map-codebase
Map Codebase
运行环境入口约定:本仓库的
.claude/skills以 Claude Code 为源,示例默认写/tunan:*。若同一 skill 在 Codex 中运行,所有面向 sponsor 的可复制入口在输出前改写为$tunan:*;Claude Code 中保持/tunan:*。
map-codebase scans an existing repository and produces a current-state snapshot — the durable "现状" baseline that later work starts from. The snapshot is seven sections (stack, integrations, architecture, structure, conventions, testing, concerns) plus a provenance header recording the git SHA and date it was mapped at.
The snapshot is stored as one GitHub issue labeled tunan:codebase-map, never a local file. There is exactly one such issue per repository — it is a living document updated in place (like the tunan:config issue), not a per-run timeline (unlike product-pulse/retro). Re-mapping edits the same issue; significant re-maps add a short <!-- tunan:map-revision --> changelog comment so the history is visible without forking the doc.
The skill is read-only against the code. Its only writes are the single map issue (and its revision comments). It never mutates the repo, the database, or any external system.
Interaction Method
Default to the platform's blocking question tool: AskUserQuestion in Claude Code (call ToolSearch with select:AskUserQuestion first if its schema isn't loaded), request_user_input in Codex, ask_user in Gemini, ask_user in Pi (requires the pi-ask-user extension). Fall back to numbered options in chat only when no blocking tool exists in the harness or the call errors — not because a schema load is required. Never silently skip the question. In practice the only blocking question is the refresh confirmation when a map already exists (Phase 0).
Modes
#$ARGUMENTS
Interpret the argument as a mode. If empty, default to full (or refresh semantics when a map already exists — Phase 0 routes).