From grimoire
Identifies overlapping cartography files in grimoire/cartography/, detects duplicates, proposes and executes merges, cleans stale references, and updates index.
npx claudepluginhub joranhonig/grimoireThis skill uses the workspace's default tool permissions.
Identify overlapping or duplicated cartography files, merge them where appropriate, and clean
Verifies and refines cartography files documenting code flows against the actual codebase, filling gaps, fixing inaccuracies, adding cross-references, and introducing conditional sections.
Generate GitHub-renderable Mermaid flowcharts from PRDs, docs, codebases, or combinations with evidence maps tracing nodes to sources, confidence scoring, and unknowns lists. Use for user flow diagrams.
Maintains persistent codebase maps (map.md, conventions.md, modules/) to record exploration learnings, consult structure before tasks, and load module context for subagents.
Share bugs, ideas, or general feedback.
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.