본문으로 건너뛰기
Skillpedia
일반 코딩10k · #12012

codemap

하는 일

이 스킬은 낯선 코드 저장소의 계층형 지도를 만들어, 핵심 파일과 구조를 다룹니다. 모르는 코드베이스 작업을 시작하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓잘 모르는 코드베이스에서 작업을 시작해 개요가 필요할 때.
  • ✓누군가 저장소 구조의 문서나 지도를 요청할 때.
  • ✓테스트, 문서, 생성된 파일을 빼고 핵심 코드를 찾고 싶을 때.

스킬 링크

https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/src/skills/codemap/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/src/skills/codemap/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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)

  1. Analyze the repository structure - List files, understand directories
  2. 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 root README.md if needed), LICENSE
      • Build/Deps: node_modules/**, dist/**, build/**, *.min.js
    • Respect .gitignore automatically
  3. Run codemap.mjs init (scripts/codemap.mjs is relative to this skill's base directory — the host prints it as Base 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.md files in all relevant subdirectories
  1. Delegate codemap writing to Fixer agents - Spawn one fixer per folder to read code and create or update its specific codemap.md file.

Step 3: Detect Changes (If state already exists)

  1. Run codemap.mjs changes to see what changed:
node scripts/codemap.mjs changes \
  --root ./
  1. Review the output - It shows:

    • Added files
    • Removed files
    • Modified files
    • Affected folders
  2. Only update affected codemaps - Spawn one fixer per affected folder to update its codemap.md.

  3. 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.

  1. Map Root Assets: Document the root-level files (e.g., package.json, index.ts, plugin.json) and the project's overall purpose.
  2. 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.
  3. 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:

  1. If AGENTS.md already exists and already contains a ## Repository Map section, skip this step - the reference is already set up.
  2. If AGENTS.md exists but has no ## Repository Map section, append the section below.
  3. If AGENTS.md doesn'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

repo: alvinunreal/oh-my-opencode-slim

인기도

GitHub 스타
10k
순위
#12012
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬