codemap

Generate hierarchical codemaps and change-aware state files for unfamiliar repositories.

Updated Feb 25, 2026
One-click install
npx skills add https://github.com/voiddreamz/dotfiles --skill codemap-voiddreamz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: codemap
Source: https://github.com/voiddreamz/dotfiles/tree/main/.config/opencode/skills/codemap
Command: npx skills add https://github.com/voiddreamz/dotfiles --skill codemap-voiddreamz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Understanding an unfamiliar codebase requires manually reading every directory, which is slow and error-prone. This Skill automates repository mapping by tracking file hashes, detecting changes, and scaffolding per-folder codemap documentation that agents and humans can read before working on code. ## Core Features & Use Cases - Repository Initialization: Scans a repo with include/exclude glob patterns, respects .gitignore, and creates .slim/codemap.json state plus empty codemap.md templates in every relevant folder. - Incremental Change Detection: Compares current file and folder hashes against saved state to report added, removed, and modified files, so only affected codemaps get updated. - Legacy Migration: Automatically migrates .slim/cartography.json state to the new .slim/codemap.json format. - Use Case: When starting work on a new repository, run the codemap workflow to produce a root Repository Atlas and per-directory maps, then register them in AGENTS.md so every agent session automatically loads the architecture context. ## Quick Start Ask the AI to generate a codemap for this repository so it can document the architecture and track future changes.

Frequently Asked Questions about codemap

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a codemap for a repository?▼

Run codemap.mjs init with a root path and glob patterns, for example node codemap.mjs init --root ./ --include "src/**/*.ts" --exclude "node_modules/**". This creates .slim/codemap.json state and empty codemap.md templates in each folder.

How do I detect which files changed since the last codemap?▼

Run codemap.mjs changes --root ./ to compare current file hashes against saved state. It lists added, removed, and modified files plus the affected folders, so you only update the codemaps that changed.

Does codemap respect .gitignore and exclude patterns?▼

Yes, the script loads .gitignore patterns automatically and applies them alongside user-supplied exclude globs. Tests, docs, build output, and dependencies like node_modules are excluded by convention, with an --exception flag for overrides.

What happens to legacy cartography.json state files?▼

The script automatically migrates .slim/cartography.json to .slim/codemap.json on the next run. The migration renames the file in place and preserves all existing metadata and hashes.

When should I not run the codemap skill?▼

Avoid running it on repositories you already understand, since it is an expensive operation intended for unfamiliar codebases. It is designed for explicit documentation or initial mapping requests, not routine edits.