codemap

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Understanding an unfamiliar codebase requires reading every file manually, and keeping that documentation current as code changes is even harder. This Skill automates repository mapping by tracking file hashes and generating per-folder codemap documentation. ## Core Features & Use Cases - Hierarchical Codemap Generation: Creates empty codemap.md templates in every relevant folder, then delegates to fixer agents to document responsibility, design patterns, data flow, and integration points. - Change Detection: Tracks file and folder hashes in .slim/codemap.json so subsequent runs only update codemaps for folders whose files were added, removed, or modified. - Legacy Migration & AGENTS.md Registration: Automatically migrates .slim/cartography.json state and registers the codemap in AGENTS.md so agents discover it on every session. - Use Case: When joining a new project, run the codemap workflow once to produce a root Repository Atlas plus per-directory maps that any agent or developer can read before making changes. ## Quick Start Ask the agent to generate a codemap for this repository so it initializes state, scaffolds per-folder codemap.md files, and builds a root repository 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 --root pointing at the repo and --include/--exclude glob patterns for core code files. This creates .slim/codemap.json state plus empty codemap.md templates in each folder, which fixer agents then fill in with architectural documentation.

How do I 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 you only regenerate codemaps for directories that actually changed.

Does codemap exclude tests and documentation files automatically?▼

The workflow instructs you to exclude tests, docs, and build output via --exclude patterns such as **/*.test.ts, docs/**, and node_modules/**. The script also respects .gitignore patterns automatically when selecting files.

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 hash state, so no re-initialization is needed.

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 initial repository mapping or explicit documentation requests, not routine edits.