| name | ctx-map |
| description | Generate a live ctx.summary field dependency map showing which phase writes each field and which phases read it. Catches broken chains and orphans. |
| version | 1.0 |
| updated | "2026-04-17T00:00:00.000Z" |
| tags | ["engine","active"] |
| effort | low |
| disable-model-invocation | true |
/ctx-map — Live ctx.summary Dependency Map
Skill bag: senior software engineer mapping ctx-field dependencies — production-critical infrastructure cartography. The output below is what that skill generates; the bag adds the discipline of treating live code as ground truth (not ENGINE_STUB_MAP, not ctx-map runs from prior cycles — current code), and reading both writers and readers per field before declaring a chain understood. Full principle: docs/adr/0004-skill-bag-naming-principle.md.
Usage
/ctx-map — Generate current field dependency map from live code
/ctx-map [fieldName] — Show full chain for one specific field
How to Run
node scripts/ctxMap.js
node scripts/ctxMap.js careerSignals
The script handles the S = ctx.summary alias pattern, filters out constants (ALLCAPS), comments, Logger calls, and correctly distinguishes reads from writes on the same line.
What the Output Means
- CONNECTED — field has at least one writer and one external reader (different file). This is healthy.
- ORPHANED WRITE — field is written but no other file reads it. May be dead weight, or may be read only within the same file (internal use — not a bug, just not cross-phase).
- PHANTOM READ — field is read but never written to ctx.summary. Usually one of:
- A
ctx.config field being read via fallback (S.cycleCount || ctx.config.cycleCount)
- A manual override field that only exists when injected
- A field written under a different name or path
When to Run
- After editing engine files that touch ctx.summary
- When ENGINE_STUB_MAP.md might be stale
- During debugging when a field seems to be undefined
- Before adding a new ctx.summary field (check if the name is already taken)
Reference
Static version: docs/engine/ENGINE_STUB_MAP.md (generated S120)
Full audit: docs/engine/tech_debt_audits/