一键导入
repomap
Creates concise, hierarchical maps of repository structure showing entrypoints, modules, critical files, and their relationships.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Creates concise, hierarchical maps of repository structure showing entrypoints, modules, critical files, and their relationships.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Communicate efficiently without sacrificing clarity - natural, concise, actionable. Global skill loaded for every command and agent.
Use when reviewing or building UI components - ensures keyboard, screen-reader, and visual accessibility (WCAG 2.1 AA) so a11y is built in, not retrofitted.
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.
Manages context caching to optimize token usage and cost by creating, incrementally updating, and invalidating caches while verifying integrity before reuse.
Clean code and engineering discipline: modularity, readability, sizing, naming, duplication, separation of concerns, plus the four behavioral principles - think before coding, simplicity first, surgical changes, and goal-driven execution. Global skill applied to all coding work.
Detects and resolves drift between code, documentation, and contextual knowledge, classifying each drift and recommending concrete sync actions to keep artifacts consistent.
| name | repomap |
| description | Creates concise, hierarchical maps of repository structure showing entrypoints, modules, critical files, and their relationships. |
Generate clear, actionable maps of codebase structure to accelerate understanding and navigation.
Create concise repository maps that help agents and developers quickly understand:
This skill is automatically selected by the orchestrator when:
Build the map cheaply. Never read an entire large file just to learn what it contains.
Use ripgrep to outline a file's symbols before reading it in full:
# Outline signatures in a single file (portable, no AST needed)
rg -n "^(export\s+)?(async\s+)?(function|class|const|interface|type|def|enum)\b" path/to/file
Then open only the relevant region for the symbol you actually need.
Pick the cheapest path that answers the question. Outline first, narrow to a symbol, and read the full file only when you truly need everything.
| Approach | Tokens | Use case |
|---|---|---|
| Outline (rg signatures) | ~200–600 | "What's in this file?" |
| Read one symbol/region | ~300–1,500 | "Show me this function" |
| Read full file | ~6,000–12,000+ | "I truly need everything" |
Provide a hierarchical, scannable map:
Project Overview:
Type: Full-stack web application
Framework: Next.js 14 (App Router)
Language: TypeScript
Database: PostgreSQL via Prisma
Deployment: Vercel
Entry Points:
📍 app/layout.tsx - Root layout, auth provider
📍 app/page.tsx - Home page
📍 app/api/*/route.ts - API endpoints
📍 middleware.ts - Auth middleware
📍 scripts/seed.ts - Database seeding
Core Modules:
src/
├─ components/ - React components
│ ├─ ui/ - Shadcn/ui primitives
│ └─ features/ - Feature-specific components
├─ lib/ - Utilities and helpers
│ ├─ auth.ts - Authentication logic
│ ├─ db.ts - Database client
│ └─ api.ts - API client utilities
├─ hooks/ - Custom React hooks
├─ types/ - TypeScript type definitions
└─ actions/ - Server actions
Critical Files:
⚙️ Configuration:
- next.config.js - Next.js config
- tailwind.config.ts - Styling config
- .env.example - Required environment variables
🗄️ Database:
- prisma/schema.prisma - Database schema
- prisma/migrations/ - Migration history
🔐 Security:
- middleware.ts - Route protection
- lib/auth.ts - Auth utilities
- app/api/auth/ - Auth endpoints
🧪 Testing:
- vitest.config.ts - Test configuration
- tests/integration/ - Integration tests
- tests/unit/ - Unit tests
Key Relationships:
app/page.tsx
→ components/features/UserDashboard
→ hooks/useUser
→ lib/api.ts
→ app/api/users/route.ts
→ lib/db.ts
→ prisma/schema.prisma
Architecture Patterns:
Notes:
repomap.json)Alongside the markdown map, emit a machine-readable map at
.ai/runtime/cache/repomap.json. Its schema is canonical and matches the skeleton
shipped at that path — populate these exact keys (replace the example entries with
real data on first sync):
{
"schema_version": "1.0",
"generated_at": "<iso8601 timestamp>",
"project": {
"type": "", "framework": "", "language": "", "database": "", "deployment": ""
},
"entry_points": [ { "path": "src/index.ts", "purpose": "Application entry point" } ],
"modules": [ { "path": "src/", "purpose": "Source root", "children": [] } ],
"critical_files": [ { "path": "package.json", "category": "configuration", "purpose": "Dependencies and scripts" } ],
"relationships": [ { "from": "src/index.ts", "to": "src/app.ts", "kind": "imports" } ],
"architecture_patterns": [],
"notes": ""
}
Field meanings: entry_points, modules, and critical_files correspond to the
Entry Points, Core Modules, and Critical Files sections above;
relationships encodes the Key Relationships edges (from/to/kind); and
architecture_patterns lists the Architecture Patterns. Set generated_at on
every regeneration. This file is tracked in CACHE_MANIFEST.json under the
repomap_json key.
Clarity over Completeness:
Actionable Information:
Maintainable Documentation:
.ai/runtime/cache/repo-map.md and the
structured map as .ai/runtime/cache/repomap.json (both tracked in
.ai/runtime/cache/CACHE_MANIFEST.json under the repo_map and repomap_json
keys)For New Codebases (First Time):
For Familiar Codebases (Updates):
For Specific Tasks:
"I need to add a new API endpoint": → Shows: API route structure, existing endpoints as examples, database access patterns, auth middleware
"I want to add a new page": → Shows: App router structure, layout hierarchy, component patterns, data fetching approaches
"I need to understand the authentication system": → Shows: Auth middleware, auth utilities, session management, protected routes, auth API endpoints
"I'm refactoring the user module": → Shows: All files that import from user module, user-related components, API endpoints, database schema