codemap

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Understanding an unfamiliar codebase is slow and error-prone. This Skill automates repository mapping by selecting relevant source files, tracking file and folder hashes for change detection, and scaffolding per-directory codemap.md documentation that agents and developers can fill in and maintain incrementally. ## Core Features & Use Cases - Repository Initialization: Scans a repo with include/exclude glob patterns, respects .gitignore, and creates .slim/codemap.json plus empty codemap.md templates in every relevant folder. - Incremental Change Detection: Compares current file hashes against saved state to report added, removed, and modified files along with affected folders, so only impacted codemaps need updates. - Legacy Migration & Agent Integration: Automatically migrates .slim/cartography.json to the new state format and registers the codemap in AGENTS.md so agents discover it on every session. - Use Case: When starting work on a new TypeScript project, run the init command to map src/**/*.ts files, then delegate codemap writing to fixer agents per folder and keep maps current with the changes and update commands. ## Quick Start Ask the agent to generate a codemap for this repository so it initializes the state file and scaffolds documentation for each directory.

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 glob patterns like --include "src/**/*.ts" and --exclude "node_modules/**". This creates .slim/codemap.json with file hashes and empty codemap.md templates in each folder.

How to detect which files changed since the last codemap?▼

Run node codemap.mjs changes --root ./ to compare current file hashes against saved state. It lists added, removed, and modified files plus affected folders, then run the update command to persist the new state.

Does codemap respect .gitignore and exclude test files?▼

Yes, the script loads .gitignore patterns automatically and applies them during file selection. The workflow also mandates excluding tests, docs, and build output such as **/*.test.ts, dist/**, and node_modules/**.

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 continues with normal change detection, so no manual conversion is needed.

When should I not run the codemap skill?▼

Avoid running it on familiar repositories or for routine edits, since it is an expensive operation intended for initial mapping or explicit documentation requests. Use the changes command for lightweight incremental updates instead of re-initializing.