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에이전트가 예시를 그대로 베끼지 않고 배우도록 돕습니다. 예시 뒤에 있는 공통 원칙을 찾아, 그 원칙을 따르는 새로운 글을 씁니다.