From grimoire
Identifies overlapping or duplicated cartography files, merges them, and cleans up stale cross-references. Useful when flow files accumulate and need deduplication.
How this skill is triggered — by the user, by Claude, or both
Slash command
/grimoire:gc-cartographyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Identify overlapping or duplicated cartography files, merge them where appropriate, and clean
Identify overlapping or duplicated cartography files, merge them where appropriate, and clean up stale cross-references. Garbage collection for your flow maps.
Cartography files accumulate. As a security engagement progresses, researchers map flows independently. Over time this creates overlap — two files documenting slightly different views of the same flow, or three files that share most of their components. This bloat degrades agent performance by splitting context across multiple files. GC consolidates without losing signal.
When this skill is activated, create a todo list from the following steps. Mark each task in_progress before starting it and completed when done.
- [ ] 1. Inventory all flows — run index, read all files, track referenced paths per flow
- [ ] 2. Detect overlap — compare component sets, flag pairs with significant overlap
- [ ] 3. Propose merge plan — present candidates to user with rationale
- [ ] 4. Execute merges — combine files, deduplicate, create conditional sections
- [ ] 5. Clean up cross-references — fix stale links in all files
- [ ] 6. Update index — re-run script, present before/after summary
Run the indexing script:
bash skills/cartography/scripts/index-cartography.sh grimoire/cartography/
Read every cartography file in grimoire/cartography/. For each file, extract:
name and description from frontmatterrelated and tags fields from frontmatterBuild an in-memory map of flow → referenced file paths.
Run scripts/gc-cartography/scripts/detect-overlaps.sh or compare manually. Consult
references/overlap-metrics.md for the overlap formula and tier thresholds.
Flag pairs that meet any of these criteria:
For each flagged pair, note:
Consult references/merge-decisions.md for the merge-vs-keep decision framework.
Present merge candidates to the user. For each candidate pair:
Never auto-merge. Always present the plan and wait for user approval. The user may have reasons to keep flows separate that aren't apparent from the file contents alone.
If no overlaps are detected, report a clean bill of health and skip to step 6.
For each approved merge:
Combine frontmatter — keep the primary flow's name. Merge tags (union). Merge
related (union, removing references to the absorbed flow). Update description if the
merged flow's scope has broadened. Set updated to today's date.
Merge Entry Points — union of both flows' entry points, deduplicated.
Merge Key Components — union of both flows' components. Where both flows list the same file, keep the more descriptive role annotation.
Merge Flow Sequence — this is the hardest part. If both flows describe the same sequence with minor variations, unify into one sequence. If they describe genuinely different paths through shared components, keep the primary flow's sequence as the main body and move the absorbed flow's sequence into a conditional section.
Merge Security Notes — union of all security notes. Preserve every note from both files. Deduplicate only when two notes say exactly the same thing.
Unique content becomes conditional — any content from the absorbed flow that doesn't fit naturally into the primary flow's main body should become a conditional section.
Delete the absorbed flow's file after confirming the merge is correct.
Consult skills/cartography/references/cartography-format.md for format details.
After merges, scan all remaining cartography files for stale references:
[[cartography/...]] links that point to deleted filesrelated fields in frontmatter for deleted slugs and update themrelated references are reciprocalAlso check GRIMOIRE.md and files in grimoire/tomes/ for stale cartography links.
Re-run the indexing script:
bash skills/cartography/scripts/index-cartography.sh grimoire/cartography/
Present to the user:
Suggest [[review-cartography]] to verify the merged flows are accurate and complete.
[[cartography/...]] links can appear in GRIMOIRE.md,
tomes, and other documents. Clean them all up.npx claudepluginhub joranhonig/grimoireValidates and improves cartography flow documentation by cross-referencing it against the actual codebase. Fixes stale paths, fills gaps, and adds conditionals.
Generates GitHub-renderable Mermaid flowcharts from PRDs, docs, or codebases with evidence maps tracing nodes to sources. Useful for creating user flow diagrams.
Generates or updates a feature-organized CODEMAP.md for any codebase, detecting frameworks and tracing end-to-end flows. Supports create, inventory, update, and section modes.