code-map

A codebase index that records where features start, how calls move through the code, and which domain, contract, and architecture-decision documents relate to them.

In plain words
What is it for?
Use it to create and maintain Markdown maps of feature entry points and call flows, with links to related project documents.
Why use it?
It reduces the time an agent or developer spends searching an unfamiliar codebase and piecing together how parts connect. It can organize one repository or shared knowledge across multiple repositories.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/scroogy-dev/scroogy-agent-skills/code-map
Any agent
npx skills add scroogy-dev/scroogy-agent-skills --skill code-map
Clone the repo
git clone --depth 1 https://github.com/scroogy-dev/scroogy-agent-skills

Made for: Claude Code, Codex.

Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,913 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00070 $0.02913
Opus 5 $0.00035 $0.01456
Sonnet 5 $0.00014 $0.00583
Haiku 4.5 $0.00007 $0.00291

Measured yesterday against content hash d7cac1bbab02, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-map scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

code-map/SKILL.md · 203 lines

How it starts

The opening of the file, as written. The whole thing — 203 lines — stays where its author put it; the contents beside it link to each section on GitHub.

개요

소스코드를 SSoT(Single Source of Truth, 단일 진실 공급원)로 삼아, 기능별 엔트리포인트와 호출 흐름을 .ai/60_codebase/에 마크다운으로 색인합니다. AI가 구현, 테스트, 코드 리뷰 등 코드베이스의 맥락 파악이 필요할 때 60_codebase/index.md를 진입점으로 읽고, 관련된 소스코드·도메인 지식·계약·ADR 문서를 빠르게 찾을 수 있도록 합니다.

"건물·층" 비유의 2레이어 구조를 사용하며, 하나의 스킬이 두 가지 모드로 동작합니다:

  • --local (floor 모드): 개별 리포의 .ai/60_codebase/에 코드 색인을 생성·관리
  • --global (building 모드): 멀티 리포 환경에서 공통 도메인 지식을 통합·관리

관련 skill

  • ai-workspace (권장): .ai/ 디렉토리 구조를 활용합니다. 없으면 .ai/60_codebase/ 디렉토리를 직접 생성합니다. .ai/30_contract/, .ai/40_domain/, .ai/50_adr/ 경로의 문서가 있으면 교차 참조로 연결합니다.
  • context-harvest (쌍): code-map이 소스코드(How)를 색인하는 스킬이라면, context-harvest는 소스코드 바깥의 What+Why를 수집·증류하여 30_contract/, 40_domain/, 50_adr/ 문서를 생성하는 스킬입니다. context-harvest 실행 후 code-map --local sync를 실행하면 새로 생긴 문서를 교차 참조로 연결합니다.

참조 문서

  • 공통 규칙: .ai/10_rules/context-loading.md — 있으면 따르며, 이미 적재되어 있으면 재로딩하지 않습니다.
  • 스킬 고유 추가 참조:
    • .ai/30_contract/index.md, .ai/40_domain/index.md, .ai/50_adr/index.md — 교차 참조 연결용 (index 먼저 → 관련 파일만 선택적으로 추가 로드)
  • 분리 참조 파일 (references/ — 모드 결정 후 해당 모드 파일만 읽습니다):
    • local.md--local (floor 모드) 실행 절차
    • global.md--global (building 모드) 실행 절차

사용법

/code-map --local          # 현재 리포의 코드 색인 생성/갱신
/code-map --global         # 멀티 리포 공통 도메인 지식 통합·관리

옵션을 생략하면 사용자에게 선택을 요청합니다.


적용 대상

  • Java 웹 애플리케이션 (Spring Boot, Spring MVC 등)
  • Java 배치 애플리케이션 (Spring Batch, 스케줄러 등)

핵심 원칙

SSoT 원칙

  • 소스코드가 SSoT이다.
  • .ai/60_codebase/의 문서는 소스코드에서 파생된 2차 산출물이다.
  • 소스코드와 문서 사이에 불일치가 발생하면 소스코드가 우선한다.

지식 프레임워크: What / How / Why

각 코드맵 문서는 3개 레이어로 구성한다:

레이어 내용 생성 주체
What 이 코드/모듈이 무엇인가 (엔티티 정의, 데이터 모델, API 계약) 에이전트가 소스코드에서 자동 추출
How 어떻게 동작하는가 (호출 흐름, 의존성, 설정) 에이전트가 소스코드 + 설정파일에서 자동 추출
Why 왜 이렇게 설계했는가 (비즈니스 판단, 아키텍처 결정, 규제 근거) 반드시 사람이 태깅
  • 에이전트는 Why를 자의적으로 생성하지 않는다.
  • .ai/ 내 관련 문서(계약, 도메인 명세, ADR 등)가 있으면 Why에 교차 참조 링크로 연결한다.
  • 관련 문서로도 설명되지 않는 설계 근거는 [WHY-NEEDED] 태그로 표시하여 사람에게 요청한다.

Read the full file on GitHub · 203 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 203 lines · 70 tokens per session scan A d7cac1bbab02

Subscribe to this mod's changes

code-map is a skill published in the GitHub repository scroogy-dev/scroogy-agent-skills (2 stars, last pushed 9d ago), licensed Apache-2.0. It adds 70 tokens to every session and 2,913 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

agent-host-chat-contributions

Build and review cross-cutting agent-host chat behavior through lifecycle contributions. Use when adding turn lifecycle side effects, prompt or context injection, restored-history transformation, protocol-action observation, or when reviewing changes that add code to AgentSideEffects or AgentService.

microsoft/vscode · 56 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens