codemap
できること
このスキルは、なじみのないコードリポジトリの階層的な地図を作り、その主要なファイルと構造を扱います。自分が知らないコードベースでの作業を始める開発者向けです。
使う場面
- ✓自分が知らないコードベースで作業を始め、概要が必要なとき。
- ✓リポジトリの構造のドキュメントや地図を頼まれたとき。
- ✓テスト、ドキュメント、生成されたファイルを飛ばして、主要なコードを見つけたいとき。
スキルのリンク
https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/src/skills/codemap/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“変更を加える前に主要なコードがどこにあるかわかるように、このリポジトリの地図を作ってください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルは、フォルダの構成を見て、主要なコードと設定のファイルを選び、地図のファイルに記録します。以降の実行では、変わったものだけを確認します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Codemap Skill
You help users understand and map repositories by creating hierarchical codemaps.
When to Use
- User asks to understand/map a repository
- User wants codebase documentation
- Starting work on an unfamiliar codebase
Workflow
Step 1: Check for Existing State
First, check if .slim/codemap.json exists in the repo root.
If it does not exist, check for legacy state at .slim/cartography.json.
If legacy state exists: move .slim/cartography.json to .slim/codemap.json, then continue with change detection.
If .slim/codemap.json exists: Skip to Step 3 (Detect Changes) - no need to re-initialize.
If neither file exists: Continue to Step 2 (Initialize).
Step 2: Initialize (Only if no state exists)
- Analyze the repository structure - List files, understand directories
- Infer patterns for core code/config files ONLY to include:
- Include:
src/**/*.ts,package.json, etc. - Exclude (MANDATORY): Do NOT include tests, documentation, or translations.
- Tests:
**/*.test.ts,**/*.spec.ts,tests/**,__tests__/** - Docs:
docs/**,*.md(except rootREADME.mdif needed),LICENSE - Build/Deps:
node_modules/**,dist/**,build/**,*.min.js
- Tests:
- Respect
.gitignoreautomatically
- Include:
- Run codemap.mjs init (
scripts/codemap.mjsis relative to this skill's base directory — the host prints it asBase directory for this skill):
node scripts/codemap.mjs init \
--root ./ \
--include "src/**/*.ts" \
--exclude "**/*.test.ts" --exclude "dist/**" --exclude "node_modules/**"
This creates:
.slim/codemap.json- File and folder hashes for change detection- Empty
codemap.mdfiles in all relevant subdirectories
- Delegate codemap writing to Fixer agents - Spawn one fixer per folder to read code and create or update its specific
codemap.mdfile.
Step 3: Detect Changes (If state already exists)
- Run codemap.mjs changes to see what changed:
node scripts/codemap.mjs changes \
--root ./
Review the output - It shows:
- Added files
- Removed files
- Modified files
- Affected folders
Only update affected codemaps - Spawn one fixer per affected folder to update its
codemap.md.Run update to save new state:
node scripts/codemap.mjs update \
--root ./
Step 4: Finalize Repository Atlas (Root Codemap)
Once all specific directories are mapped, the Orchestrator must create or update the root codemap.md. This file serves as the Master Entry Point for any agent or human entering the repository.
- Map Root Assets: Document the root-level files (e.g.,
package.json,index.ts,plugin.json) and the project's overall purpose. - Aggregate Sub-Maps: Create a "Repository Directory Map" section. For every folder that has a
codemap.md, extract its Responsibility summary and include it in a table or list in the root map. - Cross-Reference: Ensure that the root map contains the absolute or relative paths to the sub-maps so agents can jump directly to the relevant details.
Step 5: Register Codemap in AGENTS.md
OpenCode auto-loads AGENTS.md into agent context on every session. To ensure agents automatically discover and use the codemap, update (or create) AGENTS.md at the repo root:
- If
AGENTS.mdalready exists and already contains a## Repository Mapsection, skip this step - the reference is already set up. - If
AGENTS.mdexists but has no## Repository Mapsection, append the section below. - If
AGENTS.mddoesn't exist, create it with the section below.
## Repository Map
A full codemap is available at `codemap.md` in the project root.
Before working on any task, read `codemap.md` to understand:
- Project architecture and entry points
- Directory responsibilities and design patterns
- Data flow and integration points between modules
For deep work on a specific folder, also read that folder's `codemap.md`.
This is idempotent - repeated codemap runs will detect the existing section and skip. No duplication.
Codemap Content
Fixers are responsible for writing codemap.md files during this workflow. Use precise technical terminology to document the implementation:
- Responsibility - Define the specific role of this directory using standard software engineering terms (e.g., "Service Layer", "Data Access Object", "Middleware").
- **Design Pat
よくある質問
地図にテストやドキュメントは含まれますか?
いいえ。このスキルは、テスト、ドキュメント、ビルドの出力を主要な地図から外すよう設定されています。
すぐに終わる作業ですか?
いいえ。このスキルは、コストの高い操作だと説明しているため、リポジトリの最初の地図作成のためのものです。
地図はどこに保存されますか?
プロジェクトの.slimフォルダの中のcodemapのファイルに保存されます。
詳細
作者による元の説明
Generate comprehensive hierarchical codemaps for UNFAMILIAR repositories. Expensive operation - only use when explicitly asked for codebase documentation or initial repository mapping
人気
- GitHubのスター
- 10k
- ランキング
- #12012
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
cli-review
10kエージェントが、プルリクエストを開く前に、現在のブランチでGreptileのコードレビューを実行し、結果を平易な言葉でまとめられるよう支援します。
ai-estimates
10kエージェントが、人がAIと一緒に作業するときに、作業にどのくらい時間がかかるかを見積もり、速いAIの作業と、人や外部による遅れを分けられるよう支援します。
clonedeps
10kエージェントが、プロジェクトの主要な依存関係のソースコードをローカルのフォルダにコピーし、それらのライブラリの内部の仕組みを読めるよう支援します。
deanchor
10kエージェントが、例を複製せずに学べるよう支援します。例の背後にある共通の原則を見つけ、それに従って新しいものを書きます。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。