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 |
references/code-archaeology.md
View on GitHub# Code and Artifact Archaeology
Use this route for repositories, modules, APIs, incidents, and local compiled artifacts.
## Establish the Exact Target
1. Resolve the repository root, worktree, branch or revision, and nearest instruction file.
2. Record dirty state before changing anything. X-Ray investigation is read-only unless the user separately asks for implementation.
3. Identify the user-visible entry point or externally observable symptom.
4. Search for exact route names, symbols, configuration keys, error strings, and persisted fields.
## Trace the Hot Path
Follow reachable code in this order:
1. Input and parsing.
2. Validation and authorization boundaries.
3. Routing or dispatch decision.
4. State reads and writes.
5. External calls and side-effect boundary.
6. Output transformation and presentation.
7. Error propagation, recovery, and terminal failure.
Inspect configuration, schemas, registries, persistence, startup wiring, and tests that can change this path. A matching filename or symbol is a lead, not proof that code is reachable.
For an application feature, continue across process and network boundaries when they are part of the behavior:
```text
user action -> client state -> request construction -> transport -> server handler -> persistence or job -> response or later result
```
Check platform-specific implementations when mobile, desktop, extension, or background execution can differ. Prefer source-defined endpoints and schemas first. Use runtime traffic capture only when it is authorized, does not expose unrelated secrets, and answers something the source cannot establish cheaply.
Use Git history, issues, and pull requests only when the question includes “why,” a tradeoff, or behavioral change. Current code remains the source of truth for current behavior.
## Code Evidence Notes
For central or disputed steps, retain enough context to relocate the evidence:
```text
path: exact/relative/path.ext
symbol: function, type, route, or field
revision: branch or commit when relevant
observation: what the code actually does
confidence: observed | corroborated | inferred | unknown
```
This note shape is optional. Render short exact snippets only when syntax itself teaches the mechanism. Prefer a diagram plus clickable anchors over a wall of code.
## Incident Trace
Order evidence by the actual event sequence:
```text
request -> validation -> routing -> state transition -> side effect -> response
```
Place logs and persisted records beside the step they prove. Separate the initiating defect, propagation mechanism, user-visible symptom, and recovery boundary.
## Compiled Artifact Route
When the user asks how a clearly identified local app, CLI, or compiled artifact works, safe read-only static inspection is part of the default investigation. Do not stall solely because the target lacks source code.
1. Resolve the exact installed path and version, then record its cryptographic hash, architecture, file format, signature, and entitlements where available.
2. Inspect load commands, linked libraries, imports, recoverable symbols, strings, embedded assets, manifests, and packaging metadata with tools already present on the machine.
3. Treat the container format as an entry point, not the answer. When an official or independently verifiable format description makes safe extraction possible, recover the embedded module table or implementation payload and trace at least one reachable hot path from its real entry point. Do not headline file size, packer name, or section layout when recoverable code can answer the teaching question.
4. Group clues by the teaching question. A long string dump is not an explanation; retain only evidence that changes the causal model.
5. Corroborate important clues against public source, official documentation, runtime-owned state, or multiple independent static observations before presenting them as behavior.
6. Mark unreachable code, dormant feature names, endpoint literals, and decompiled fragments as clues or inference unless reachability is established.
Ask separately before installing tooling, executing an unknown artifact, attaching a debugger, intercepting or decrypting traffic, patching the binary, bypassing protection, or accessing credentials. For a native binary, use `$claude-code-reverse` and its tested `extract.sh` as the canonical safe static baseline. When authorized specialist evidence is still necessary, read [reverse-core.md](reverse-core.md), load only the matching adapter, and return its findings to this causal trace rather than expanding X-Ray into a general security suite.
Refuse credential theft, access-control bypass, persistence, stealth, exploitation of third-party targets, or other harmful goals. A legitimate explanatory goal does not expand authorization.
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 |