majiayu000/spellbook / skills/xray
xray
VerifiedInvestigate how a concept, code path, application, network flow, system, incident, document, or local artifact actually works, then deliver a two-depth visual HTML explainer with a dead-simple big-picture first layer and source-backed technical depth behind it. Use when the user invokes $xray, asks how something works under the hood, wants a module or app behavior traced across boundaries, requests web, code, network, or safe static artifact research before explanation, or asks for an evidence-backed explainer. Do not use for answer-only definitions, general web design, full codebase audits, or invasive binary reverse engineering without explicit authorization.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 13.2 KB |
| agents/openai.yaml | config | 379 B |
| assets/concept-explainer.html | other | 9.0 KB |
| assets/feature-explainer.html | other | 7.9 KB |
| evals/evals.json | config | 7.9 KB |
| references/chinese-writing.md | markdown | 3.8 KB |
| references/code-archaeology.md | markdown | 4.7 KB |
| references/evidence-contract.md | markdown | 3.2 KB |
| references/research-routing.md | markdown | 2.8 KB |
| references/reverse-core.md | markdown | 8.2 KB |
| references/visual-explanation.md | markdown | 5.1 KB |
| scripts/render-check.shexecutable | script | 1.9 KB |
scripts/render-check.sh
View on GitHub#!/bin/sh
# Render an X-Ray explainer at desktop and mobile widths with Playwright.
# Usage: scripts/render-check.sh <page.html> [new-output-directory]
set -eu
if [ $# -lt 1 ] || [ $# -gt 2 ]; then
echo "usage: render-check.sh <page.html> [new-output-directory]" >&2
exit 64
fi
PAGE=$(cd "$(dirname -- "$1")" && pwd)/$(basename -- "$1")
if [ ! -f "$PAGE" ]; then
echo "not a file: $PAGE" >&2
exit 66
fi
if [ $# -eq 2 ] && { [ -e "$2" ] || [ -L "$2" ]; }; then
echo "output directory already exists: $2" >&2
exit 73
fi
PLAYWRIGHT_MODE=
if command -v playwright >/dev/null 2>&1 && playwright --version >/dev/null 2>&1; then
PLAYWRIGHT_MODE=direct
elif command -v npm >/dev/null 2>&1 && npm exec --offline --no -- playwright --version >/dev/null 2>&1; then
PLAYWRIGHT_MODE=npm
else
echo "Playwright CLI is unavailable; install Playwright before rendering" >&2
exit 69
fi
run_playwright() {
if [ "$PLAYWRIGHT_MODE" = direct ]; then
playwright "$@"
else
npm exec --offline --no -- playwright "$@"
fi
}
CREATED_OUT=
cleanup_failed_render() {
status=$?
trap - 0
if [ "$status" -ne 0 ] && [ -n "$CREATED_OUT" ] && [ -d "$CREATED_OUT" ]; then
if ! rm -r -- "$CREATED_OUT"; then
echo "failed to remove incomplete output directory: $CREATED_OUT" >&2
fi
fi
exit "$status"
}
trap cleanup_failed_render 0
if [ $# -eq 2 ]; then
OUT=$2
mkdir "$OUT"
else
OUT=$(mktemp -d "${TMPDIR:-/tmp}/xray-render.XXXXXX")
fi
CREATED_OUT=$OUT
OUT=$(cd "$OUT" && pwd)
CREATED_OUT=$OUT
PAGE_URL=$(python3 - "$PAGE" <<'PY'
from pathlib import Path
import sys
print(Path(sys.argv[1]).as_uri())
PY
)
run_playwright screenshot --browser chromium --full-page \
--viewport-size "1280, 720" "$PAGE_URL" "$OUT/render-wide.png"
run_playwright screenshot --browser chromium --full-page \
--viewport-size "390, 844" "$PAGE_URL" "$OUT/render-narrow.png"
CREATED_OUT=
echo "wrote $OUT"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |