codemap

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Onboarding onto an unfamiliar codebase requires reading many files before understanding architecture, and keeping that documentation current as code changes is tedious. This Skill automates repository mapping by tracking file hashes and scaffolding per-folder codemap documents. ## Core Features & Use Cases - Hierarchical Codemap Generation: Creates empty codemap.md templates in every relevant folder for agents to fill with responsibility, design patterns, data flow, and integration points. - Change Detection: Tracks file and folder hashes in .slim/codemap.json so re-runs only update affected folders, with automatic migration from legacy cartography.json state. - Pattern-Based File Selection: Includes core code and config files via glob patterns while excluding tests, docs, build output, and .gitignore entries. - Use Case: When starting work on a new repository, run the init command to generate a full codemap skeleton, delegate folder documentation to fixer agents, and register the root atlas in AGENTS.md so future sessions auto-discover the map. ## Quick Start Ask the agent to map this repository and generate a hierarchical codemap with per-folder documentation and a root atlas.

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 an unfamiliar repository?▼

Run codemap.mjs init with the repository root and glob patterns for core code files, such as 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 to detect which files changed since the last codemap run?▼

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

Does the codemap script respect .gitignore files?▼

Yes, the script loads patterns from the repository's .gitignore and excludes matching files during selection. It also skips hidden directories and supports explicit include, exclude, and exception patterns.

What happens to legacy cartography.json state files?▼

The script automatically migrates .slim/cartography.json to .slim/codemap.json on the next run. If the new state file already exists, the legacy file is left untouched and no migration occurs.

When should I not run the codemap skill?▼

Avoid running it on familiar repositories or for routine edits, since full mapping is an expensive operation. It is intended only for initial repository documentation or when explicitly asked to map a codebase.