repo-mapping
Repo Mapping Skill
Build and maintain a cached AST-based map of repository symbols and imports using ast-grep.
Parse Arguments
const args = '$ARGUMENTS'.split(' ').filter(Boolean);
const action = args.find(a => !a.startsWith('--')) || 'status';
const force = args.includes('--force');
Primary Responsibilities
- Generate map on demand (
/repo-map init) - Update map incrementally (
/repo-map update) - Check status and staleness (
/repo-map status) - Validate output with the map-validator agent
Core Data Contract
Repo map is stored in the platform state directory:
- Claude Code:
.claude/repo-map.json - OpenCode:
.opencode/repo-map.json - Codex CLI:
.codex/repo-map.json
Minimal structure:
{
"version": "1.0.0",
"generated": "2026-01-25T12:00:00Z",
"updated": "2026-01-25T12:05:00Z",
"git": { "commit": "abc123", "branch": "main" },
"project": { "languages": ["typescript", "python"] },
"stats": { "totalFiles": 142, "totalSymbols": 847 },
"files": {
"src/auth/login.ts": {
"hash": "deadbeef1234abcd",
"language": "typescript",
"symbols": { "exports": [], "functions": [], "classes": [] },
"imports": [ { "source": "./utils", "kind": "named" } ]
}
}
}
Behavior Rules
- Never run ast-grep without user approval if it is not installed
- Never install dependencies without explicit user consent
- Always validate map output with
map-validatorafter init/update - Prefer incremental update unless map is stale or history rewritten
When to Suggest Repo Map
If a user asks for drift detection, documentation alignment, or repo analysis and repo-map is missing:
Repo map not found. For better analysis, run:
/repo-map init
Staleness Signals
- Map commit not found (rebased)
- Branch changed
- Git hooks marked stale
- Commits behind HEAD
Output Expectations
Keep outputs concise:
- init/update: file count, symbol count, commit, warnings
- status: staleness, commits behind, last updated
More from agent-sh/agentsys
debate
Structured AI debate templates and synthesis. Use when orchestrating multi-round debates between AI tools, 'debate topic', 'argue about', 'stress test idea', 'devil advocate'.
10discover-tasks
Use when user asks to \"discover tasks\", \"find next task\", \"prioritize issues\", \"what should I work on\", or \"list open issues\". Discovers and ranks tasks from GitHub, GitLab, local files, and custom sources.
9learn
Research any topic online and create learning guides. Use when user asks to 'learn about', 'research topic', 'create learning guide', 'build knowledge base', or 'study subject'.
9perf-benchmarker
Use when running performance benchmarks, establishing baselines, or validating regressions with sequential runs. Enforces 60s minimum runs (30s only for binary search) and no parallel benchmarks.
9web-browse
Browse and interact with web pages headlessly. Use when agent needs to navigate websites, click elements, fill forms, read content, or take screenshots.
9deslop
Use when user wants to clean AI slop from code. Use for cleanup, remove debug statements, find ghost code, repo hygiene.
8