Context Map
Build a task-focused map of the codebase before changing files.
- Leverage native parallel subagent dispatch and 200k+ context windows where available.
When to Use
Use symptom -> action triggers: when one matches, apply this skill and verify with the protocol below.
- A request spans more than one file and the impact is not obvious yet.
- You need to identify the minimum safe edit set before implementation.
- You are debugging a bug or regression and need to trace nearby code paths.
- You want a review-quality summary of likely code, test, config, and documentation touch points.
Core Workflow
- Restate the change in one sentence.
- Search for obvious entry points by feature name, route, symbol, command, or error text.
- Expand outward into direct dependencies, tests, docs, config, schemas, and scripts.
- Separate likely edit targets from read-only reference patterns.
- Call out risk multipliers such as public APIs, migrations, auth, secrets, environment variables, or generated artifacts.
- Produce a compact context map before implementation.
Search Order
1. Primary Targets
Look for the files most likely to hold the requested behavior:
- route handlers, commands, services, jobs, or pages
- components, helpers, validators, and serializers
- feature-specific configs, manifests, templates, and generated sources
2. Direct Dependencies
Trace the files that import, export, call, or configure the primary targets:
- imports and exports
- DI registration and factory wiring
- schema or model definitions
- build or deployment hooks
3. Verification Surface
Find the evidence paths that should move with the change:
- unit, integration, E2E, and snapshot tests
- fixtures, golden files, and sample payloads
- README, usage docs, changelogs, and migration notes
4. Reference Patterns
Find nearby examples that show the house style for the same kind of work:
- similar endpoints or handlers
- related UI components
- existing test patterns
- prior migrations or config changes
Output Format
Use this structure unless the user asked for a different format:
## Context Map
### Likely Edit Targets
| File | Why it matters | Expected change |
|------|----------------|-----------------|
| path/to/file | Main entry point | Update logic |
### Nearby Dependencies
| File | Relationship |
|------|--------------|
| path/to/file | Imported by the main target |
### Verification Files
| File | Coverage |
|------|----------|
| path/to/test | Existing tests for the feature |
### Reference Patterns
| File | Pattern to reuse |
|------|------------------|
| path/to/example | Similar implementation shape |
### Risks
- Public API or contract may change
- Config, env vars, or generated files may need updates
- Docs or changelog may need to move with the code
Heuristics
- Prefer the smallest edit set that can fully implement the task.
- Include tests and docs whenever the behavior or setup might move.
- Treat migrations, auth, secrets, caching, build scripts, and generated artifacts as high-risk neighbors.
- If multiple subsystems are involved, split the map by subsystem instead of producing one giant table.
- Revise the map after discovery if the real scope is materially different from the initial request.
Anti-Patterns
- Delegating or evaluating without a scoped success condition: The output becomes hard to review and easy to overbuild.
- Skipping the evidence step: A workflow that cannot be re-checked quickly is not ready for handoff.
- Bundling unrelated subtasks together: It creates noisy prompts, weaker ownership, and avoidable integration risk.
Verification Protocol
Before claiming "skill applied successfully":
- Pass/fail: The Context Map workflow names the agent boundary, delegated scope, and expected return artifact.
- Pass/fail: Context passed to helpers is minimal, task-local, and free of hidden expected answers.
- Pass/fail: Results are integrated only after evidence, diffs, or citations are checked by the controller.
- Pressure-test scenario: Run the workflow on two similar tasks that must not share assumptions or leaked context.
- Success metric: Zero context leakage; every delegated output is independently reviewable.
Scripts And References
Cross-Client Portability
This skill is written to stay usable across GitHub Copilot, Claude Code, and Codex.
- GitHub Copilot: keep the folder in a Copilot-visible skill path or wrap the
workflow in project instructions when folder discovery is unavailable.
- Claude Code: keep the folder in a local skills directory or a compatible plugin source.
- Codex: install or sync the folder into
$CODEX_HOME/skills/context-map and restart Codex after major changes.
MCP Availability And Fallback
Preferred MCP Server: None required
- Fallback prompt: "Use the Context Map skill without MCP. Rely on the local
SKILL.md, bundled references or scripts, and manual verification. Show the exact commands, evidence, and final checks you used before concluding."
- If the current host does not expose a matching server, use the bundled references, scripts, native toolchain, and manual workflow already described in this skill.
- Treat direct local verification, rendered output, logs, tests, or screenshots as the fallback evidence path before completion.
Related Skills
- agent-task-mapping: Use it when the workflow also needs task-to-agent routing decisions.
- custom-agent-usage: Use it when the workflow also needs loading and invoking custom agent definitions safely.
- subagent-delegation: Use it when the workflow also needs safe, scoped delegation to helper agents.
- subagent-driven-development: Use it when the workflow also needs plan-driven implementation with reviewer loops.
1---2name: context-map3description: Scope the real change surface before editing. Use when planning a feature, bugfix, refactor, or review and you need a concrete map of likely touch points, dependencies, tests, and nearby risks.4---5# Context Map67Build a task-focused map of the codebase before changing files.89- Leverage native parallel subagent dispatch and 200k+ context windows where available.101112## When to Use1314Use symptom -> action triggers: when one matches, apply this skill and verify with the protocol below.1516- A request spans more than one file and the impact is not obvious yet.17- You need to identify the minimum safe edit set before implementation.18- You are debugging a bug or regression and need to trace nearby code paths.19- You want a review-quality summary of likely code, test, config, and documentation touch points.2021## Core Workflow22231. Restate the change in one sentence.242. Search for obvious entry points by feature name, route, symbol, command, or error text.253. Expand outward into direct dependencies, tests, docs, config, schemas, and scripts.264. Separate likely edit targets from read-only reference patterns.275. Call out risk multipliers such as public APIs, migrations, auth, secrets, environment variables, or generated artifacts.286. Produce a compact context map before implementation.2930## Search Order3132### 1. Primary Targets3334Look for the files most likely to hold the requested behavior:3536- route handlers, commands, services, jobs, or pages37- components, helpers, validators, and serializers38- feature-specific configs, manifests, templates, and generated sources3940### 2. Direct Dependencies4142Trace the files that import, export, call, or configure the primary targets:4344- imports and exports45- DI registration and factory wiring46- schema or model definitions47- build or deployment hooks4849### 3. Verification Surface5051Find the evidence paths that should move with the change:5253- unit, integration, E2E, and snapshot tests54- fixtures, golden files, and sample payloads55- README, usage docs, changelogs, and migration notes5657### 4. Reference Patterns5859Find nearby examples that show the house style for the same kind of work:6061- similar endpoints or handlers62- related UI components63- existing test patterns64- prior migrations or config changes6566## Output Format6768Use this structure unless the user asked for a different format:6970```markdown71## Context Map7273### Likely Edit Targets74| File | Why it matters | Expected change |75|------|----------------|-----------------|76| path/to/file | Main entry point | Update logic |7778### Nearby Dependencies79| File | Relationship |80|------|--------------|81| path/to/file | Imported by the main target |8283### Verification Files84| File | Coverage |85|------|----------|86| path/to/test | Existing tests for the feature |8788### Reference Patterns89| File | Pattern to reuse |90|------|------------------|91| path/to/example | Similar implementation shape |9293### Risks94- Public API or contract may change95- Config, env vars, or generated files may need updates96- Docs or changelog may need to move with the code97```9899## Heuristics100101- Prefer the smallest edit set that can fully implement the task.102- Include tests and docs whenever the behavior or setup might move.103- Treat migrations, auth, secrets, caching, build scripts, and generated artifacts as high-risk neighbors.104- If multiple subsystems are involved, split the map by subsystem instead of producing one giant table.105- Revise the map after discovery if the real scope is materially different from the initial request.106107## Anti-Patterns108109- Delegating or evaluating without a scoped success condition: The output becomes hard to review and easy to overbuild.110- Skipping the evidence step: A workflow that cannot be re-checked quickly is not ready for handoff.111- Bundling unrelated subtasks together: It creates noisy prompts, weaker ownership, and avoidable integration risk.112113## Verification Protocol114115Before claiming "skill applied successfully":1161171. Pass/fail: The Context Map workflow names the agent boundary, delegated scope, and expected return artifact.1182. Pass/fail: Context passed to helpers is minimal, task-local, and free of hidden expected answers.1193. Pass/fail: Results are integrated only after evidence, diffs, or citations are checked by the controller.1204. Pressure-test scenario: Run the workflow on two similar tasks that must not share assumptions or leaked context.1215. Success metric: Zero context leakage; every delegated output is independently reviewable.122123## Scripts And References124125- [Context Map Template](./references/context-map-template.md)126- [Context Map Builder](./scripts/build-context-map.py)127128<!-- MCP:START -->129130<!-- PORTABILITY:START -->131## Cross-Client Portability132133This skill is written to stay usable across GitHub Copilot, Claude Code, and Codex.134135- GitHub Copilot: keep the folder in a Copilot-visible skill path or wrap the136 workflow in project instructions when folder discovery is unavailable.137- Claude Code: keep the folder in a local skills directory or a compatible plugin source.138- Codex: install or sync the folder into139 `$CODEX_HOME/skills/context-map` and restart Codex after major changes.140141<!-- PORTABILITY:END -->142143## MCP Availability And Fallback144145Preferred MCP Server: None required146147- Fallback prompt: "Use the Context Map skill without MCP. Rely on the local `SKILL.md`, bundled references or scripts, and manual verification. Show the exact commands, evidence, and final checks you used before concluding."148- If the current host does not expose a matching server, use the bundled references, scripts, native toolchain, and manual workflow already described in this skill.149- Treat direct local verification, rendered output, logs, tests, or screenshots as the fallback evidence path before completion.150151<!-- MCP:END -->152153## Related Skills154155- [agent-task-mapping](../agent-task-mapping/SKILL.md): Use it when the workflow also needs task-to-agent routing decisions.156- [custom-agent-usage](../custom-agent-usage/SKILL.md): Use it when the workflow also needs loading and invoking custom agent definitions safely.157- [subagent-delegation](../subagent-delegation/SKILL.md): Use it when the workflow also needs safe, scoped delegation to helper agents.158- [subagent-driven-development](../subagent-driven-development/SKILL.md): Use it when the workflow also needs plan-driven implementation with reviewer loops.