map-module
Skill19 starsChanged 3 months agoMITView on GitHub
Create, fully refresh, or incrementally maintain a source-verified subsystem architecture map under `.claude/maps/`. Use when the user says "/map-module", "map this module", "map the <subsystem> architecture", asks to document how a subsystem works today, or when project instructions (the Knowledge Loop Conventions in CLAUDE.md) require a targeted refresh after implementation changes invalidate mapped facts. Do not use for ad hoc code explanation, a single-file question, or changes that leave the existing map accurate. Authorizes bounded, read-only Explore subagents for research and verification.
In this repository18 other files it gives its agents.
- base-breakout-scanSkill
- commit-contextSkill
- conviction-funnelSkill
- distill-memorySkill
- distill-moduleSkill
- fable-mindSkill
- hackernewsSkill
- mcd-orderSkill
- mean-reversion-scanSkill
- momentum-scanSkill
- premarket-briefSkill
- regime-scanSkill
- review-iterateSkill
- snapback-scanSkill
- sparse-checkoutSkill
- statusline-vocabSkill
- wallstreetbetsSkill
- yfinanceSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
31 rules. About 0 are common, 23 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈23
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Read references/report-contracts.md before dispatching research or verification tasks.
- Distinctive: line 23
Use full mapping for a new map, an explicitly requested full refresh, broad architectural changes, an unverified existing map, or a change …
- Distinctive: line 25
Use targeted refresh when an existing verified map is being maintained after a bounded code change and only a limited set of mapped claims …
- Distinctive: line 27
If a targeted assessment proves that all mapped claims remain accurate, leave the map unchanged and report that no refresh was needed.
- Distinctive: line 32
Start with repository and module inventories, heading outlines, symbol searches, and file sizes to establish the likely boundary before …
- Distinctive: line 34
Read the selected module's current map and paired decision file separately and to completion, chunking large files when needed.
- Distinctive: line 40
If tool output is truncated, do not treat the file or result as covered.
- Distinctive: line 42
Stop loading when the subsystem boundary and required claims have enough first-hand evidence for the selected mode.
- Distinctive: line 47
Keep synthesis, verdict judgment, file edits, module registration, and the final response in the root agent.
- Very specific: line 49
Use read-only Explore subagents (the Agent tool with subagent_type: Explore) only for code research and verification.
- Very specific: line 53
Run explorers in bounded waves: launch one wave's agents in a single message so they run concurrently, wait for the wave to report, then …
- Distinctive: line 58
Before mapping multiple modules or a very large subsystem, state the expected concern and verification counts so the cost is visible.
- Very specific: line 65
Read .claude/MODULES.md, the paired decision file if present, and the current map if refreshing.
- Distinctive: line 66
Read a related map only when an identified boundary or unresolved question crosses into it.
- Distinctive: line 89
Use the current task and its staged and unstaged diff to identify the implementation change boundary.
- Distinctive: line 97
Do not infer that a claim is unchanged solely because its named file was untouched.
- Distinctive: line 101
If no documented claim changed, do not edit the map.
- Distinctive: line 117
Keep evidence out of the map, run the validation steps below, and report which mapped claims changed.
- Very specific: line 130
Write or update .claude/maps/<module-id>.md with the Write tool (new file) or the Edit tool (existing file).
- Distinctive: line 140
Use 8–10 claims for a small subsystem, 12–15 for a medium subsystem, and at least 15 for a large subsystem.
- Very specific: line 156
Add or replace > Verified: YYYY-MM-DD (verification summary) only after the full verification pass, and remove a stale > Maintained: line …
- Very specific: line 161
Use the Edit tool for patches.
- Very specific: line 167
If the module is new, add it to the matching section of .claude/MODULES.md only after the map is verified.
- Distinctive: line 169
Check whether the root CLAUDE.md tells Claude Code to resolve affected module IDs, read the matching map and decision files before editing, …
- Distinctive: line 180
Run git diff --check and inspect the focused diff for the map and registry.
- Distinctive: line 181
Do not commit or push unless the user explicitly asks.
- Distinctive: line 186
If all readers fail, stop before writing a map and report the research blocker.
- Distinctive: line 187
If one reader fails, recover through local inspection or extra verifier coverage and disclose any remaining gap.
- Distinctive: line 189
If dependency source cannot be found, record what source is missing.
- Distinctive: line 191
If the requested root exists only in history, stop after identifying the likely successor and ask whether to map the historical snapshot or …
- Distinctive: line 193
If code and an existing map disagree, trust current source, update the map, and retain historical rationale only in the decision file.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Map Module
Produce a "how it works today" snapshot. Keep decision history in the paired
.claude/decisions/<module-id>.md; do not turn the map into a design proposal or changelog.
Read references/report-contracts.md before dispatching research or verification tasks. Use its
report contracts and final map template.
Choose the mode
- Use full mapping for a new map, an explicitly requested full refresh, broad architectural changes, an unverified existing map, or a change whose impact cannot be bounded confidently.
- Use targeted refresh when an existing verified map is being maintained after a bounded code change and only a limited set of mapped claims may have changed.
- If a targeted assessment proves that all mapped claims remain accurate, leave the map unchanged and report that no refresh was needed.
Load context progressively
- Start with repository and module inventories, heading outlines, symbol searches, and file sizes to establish the likely boundary before opening broad source files.
- Read the selected module's current map and paired decision file separately and to completion, chunking large files when needed. Do not concatenate them with large source files in one command.
- Inspect exact definitions, registration points, direct callers, direct callees, and relevant tests before opening adjacent files or related maps.
- Expand context only to answer a named unresolved question about a boundary, contract, lifecycle edge, dependency, invariant, or mapped claim. Record the question before expanding.
- If tool output is truncated, do not treat the file or result as covered; repeat with focused ranges until the required content is read.
- Stop loading when the subsystem boundary and required claims have enough first-hand evidence for the selected mode. More context is not itself verification.
Ownership and collaboration
- Keep synthesis, verdict judgment, file edits, module registration, and the final response in the root agent.
- Use read-only
Exploresubagents (the Agent tool withsubagent_type: Explore) only for code research and verification. Full mapping uses the research and verification waves below. A bounded targeted refresh may be verified locally; use explorers when the affected flow crosses concerns or repositories. Tell every explorer not to edit files. - Run explorers in bounded waves: launch one wave's agents in a single message so they run
concurrently, wait for the wave to report, then dispatch the next. Reuse an explorer through
SendMessageonly for a related concern. - Make verification independent: do not let an explorer verify its own research concern. Prefer fresh explorers; if capacity is constrained, cross-assign unrelated claims.
- Before mapping multiple modules or a very large subsystem, state the expected concern and verification counts so the cost is visible.
Phase 0: Scope and mode
- Resolve
<module-id>and the subsystem root. Derive them from the request and repository when safe; ask only if different interpretations would materially change the map. - Read
.claude/MODULES.md, the paired decision file if present, and the current map if refreshing. Read a related map only when an identified boundary or unresolved question crosses into it. - Confirm that the root exists at the current
HEAD. If it is missing, inspect Git history and symbol moves to distinguish a deleted historical subsystem from a renamed successor. Do not map a historical commit or switch module ids without user confirmation. - Inventory the root with the Glob tool (or
rg --files), then inspect class declarations, constructors or registration points, public entry points, core state fields, and file sizes. Skim key files to confirm boundaries. - Choose full mapping or targeted refresh using the criteria above. If the current task's change boundary cannot be separated from unrelated working-tree changes, do not guess; use full mapping or report the unresolved boundary.
- For full mapping, split by concern, not by file. Name specific classes, methods, states, and
flows in each focus:
- small subsystem (up to about 5 files): 3 research concerns;
- medium subsystem: 4 concerns;
- large subsystem or god-files: 5–6 concerns.
- Build a short shared context containing the module purpose, root, core files, known related maps, and any external dependency source supplied through the task or environment.
Targeted refresh
Skip the full research and adversarial-verification phases only when the targeted-refresh criteria are met.
- Use the current task and its staged and unstaged diff to identify the implementation change boundary. Preserve unrelated user changes.
- Compare that boundary with the current map and list every potentially affected claim about responsibilities, key types, public entry points, lifecycle or data flow, inbound or outbound dependencies, invariants, bugs, open questions, and verification residuals.
- Reopen the relevant source and verify every affected claim plus its immediately adjacent edges.
Inspect dependency source supplied through the task or shared context when required. If required
external source is unavailable, retain a concise residual under
To verifyinstead of guessing. Do not infer that a claim is unchanged solely because its named file was untouched. - Escalate to full mapping if the affected claims span most sections, reveal an undocumented subsystem boundary, depend on an unverified baseline, or the internal impact cannot be checked from available project source. Missing external source alone is not a reason to escalate.
- If no documented claim changed, do not edit the map.
Otherwise, patch only the affected statements and sections. Preserve the previous full
Verifiedline and keep exactly oneMaintainedline after it, separated by a bare>line:> Verified: YYYY-MM-DD (verification summary) > > Maintained: YYYY-MM-DD (targeted verification only since the full mapping: <areas changed since then, this change last>)Rewrite the whole line on each refresh; never append to it. Keep it to one sentence of about 250 characters at most, naming the areas changed since
Verifiedas they stand now, not each step that led there, and leaving out changes that later ones undid: the commits and the decision file hold the history. If the areas no longer fit in that sentence, the map rests on an unverified baseline; escalate to full mapping (step 4).- Keep evidence out of the map, run the validation steps below, and report which mapped claims changed. Do not commit or push unless the user explicitly asks.
Phase 1: Full research
- Dispatch one explorer per concern, in bounded waves, using the reader task contract.
- Require first-hand source inspection and evidence as repository-relative
path:linein the research report. Evidence is for synthesis confidence and must not enter the final map. - Collect every report. If a reader fails, cover the gap locally or mark the concern for extra first-hand verification; never synthesize a failed concern as established fact.
- Synthesize a baseline map using the final map template. Merge overlaps, distinguish public
names from class or package names, and place uncertainty only under
Open questionsorTo verify. - Write or update
.claude/maps/<module-id>.mdwith theWritetool (new file) or theEdittool (existing file).
Phase 2: Full adversarial verification
- Select checkable claims from the baseline:
- state transitions and lifecycle edges;
- public contracts and entry points;
- routing, error codes, defaults, feature gates, and implementation differences;
- invariants, suspected bugs, and all inferred or unverified assertions.
- Use 8–10 claims for a small subsystem, 12–15 for a medium subsystem, and at least 15 for a large subsystem. Weight failed-reader and state-machine concerns more heavily.
- Group claims into independent verifier assignments by concern and dispatch bounded explorer waves using the verifier task contract. Require one verdict per claim and fresh source reads.
- Judge the returned evidence yourself. Treat low-confidence or unsupported verdicts as unresolved even if an explorer labels them confirmed.
Phase 3: Full patch
Apply verdicts as follows:
confirmed: promote important facts into the body and remove matchingTo verifyitems.refutedorpartial: correct the body withcorrectedStatement.external_unverifiable: retain a concise residual underTo verify.isBug: true: add one impact-oriented item underConfirmed bugs / technical debt.
Add or replace > Verified: YYYY-MM-DD (verification summary) only after the full verification
pass, and remove a stale > Maintained: line together with the bare > line above it. Keep
genuinely open design or intent questions under Open questions. Do not claim full verification if
assignments failed; state the residual explicitly.
Use the Edit tool for patches. Match the existing text exactly, punctuation included, when
replacing it. For large section rewrites, anchor on unique headings; if a match is ambiguous, widen
the anchor rather than guessing.
Phase 4: Register, connect, and validate
- If the module is new, add it to the matching section of
.claude/MODULES.mdonly after the map is verified. Keep the registry near its documented size and describe the verified boundary. - Check whether the root
CLAUDE.mdtells Claude Code to resolve affected module IDs, read the matching map and decision files before editing, and conditionally run a targeted map refresh when implementation changes invalidate mapped facts. If those rules are missing or only mention decisions, do not editCLAUDE.md. Tell the user that/commit-contextwill propose the canonical Knowledge Loop Conventions upgrade when the map is staged for commit. If/commit-contextis unavailable, warn that the map will not be consumed automatically. - Confirm that the final map:
- follows the reference template;
- contains no source
path:linecitations; - separates facts, confirmed bugs, open questions, and external residuals;
- pairs to the same module id under
.claude/decisions/.
- Run
git diff --checkand inspect the focused diff for the map and registry. - Do not commit or push unless the user explicitly asks. Mention confirmed risks that belong in a future Decision block.
Failure handling
- If all readers fail, stop before writing a map and report the research blocker.
- If one reader fails, recover through local inspection or extra verifier coverage and disclose any remaining gap.
- If dependency source cannot be found, record what source is missing; do not guess or mark it confirmed.
- If the requested root exists only in history, stop after identifying the likely successor and ask whether to map the historical snapshot or the current subsystem.
- If code and an existing map disagree, trust current source, update the map, and retain historical rationale only in the decision file.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

