codemap

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Onboarding onto an unfamiliar codebase is slow and error-prone because there is no structured map of what each directory does. This Skill automates repository mapping by selecting relevant source files, tracking file and folder hashes for change detection, and scaffolding per-folder codemap.md documents that agents or humans fill in with architectural knowledge. ## Core Features & Use Cases - Hierarchical Codemap Generation: Creates empty codemap.md templates in every relevant folder and a root-level Repository Atlas aggregating each directory's responsibility. - Change Detection: Stores file and folder MD5 hashes in .slim/codemap.json so subsequent runs report added, removed, and modified files plus affected folders, enabling incremental updates instead of full remapping. - Pattern-Based File Selection: Uses include/exclude glob patterns with .gitignore support and mandatory exclusion of tests, docs, and build artifacts to focus on core code. - Use Case: When starting work on a new repository, run the init command to generate the state file and codemap templates, delegate folder documentation to fixer agents, then register the map in AGENTS.md so every future session automatically discovers the architecture. ## Quick Start Ask the agent to generate a codemap for this repository so it initializes the state file and creates codemap.md templates in each folder.

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 node codemap.mjs init with --root pointing at the repo and --include/--exclude glob patterns for core source files. This creates .slim/codemap.json with file hashes and empty codemap.md templates in each folder for agents to fill in.

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

Run node codemap.mjs changes --root ./ against an existing .slim/codemap.json state. It reports added, removed, and modified files plus the affected folders, so you only update the codemaps that actually changed.

Does codemap include test files and documentation?▼

No, the workflow mandates excluding tests, docs, and build artifacts such as **/*.test.ts, tests/**, docs/**, node_modules/**, and dist/**. It also respects .gitignore patterns automatically during file selection.

What happens to legacy cartography.json state files?▼

The script automatically migrates .slim/cartography.json to .slim/codemap.json on the next run via the migrateLegacyState function. No manual renaming is required, and existing hash state is preserved.

When should I not run the codemap skill?▼

Avoid it for quick edits on familiar code, since full mapping is an expensive operation intended for unfamiliar repositories or explicit documentation requests. Use the changes command for incremental updates instead of re-initializing.