agent-harness-design
Designing agent harnesses and tool systems — risk taxonomy for tools, permission decisions, draft/commit pattern, structured tool…
Ranked symbol map of a codebase within a token budget — a compact "what matters in this repo" before reading files. Use when starting work in an unfamiliar/large codebase, before a refactor or deep-review fan-out, when you need JIT context instead of dumping whole files, or
$ npx -y skills add AnastasiyaW/codex-claude-code-config --skill repo-map --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/repo-mapContext preview
The summary Claude sees to decide when to auto-load this skill.
Ranked symbol map of a codebase within a token budget — a compact "what matters in this repo" before reading files. Use when starting work in an unfamiliar/large codebase, before a refactor or deep-review fan-out, when you need JIT context instead of dumping whole files, or
name: repo-map description: Ranked symbol map of a codebase within a token budget — a compact "what matters in this repo" before reading files. Use when starting work in an unfamiliar/large codebase, before a refactor or deep-review fan-out, when you need JIT context instead of dumping whole files, or asked "give me a map of this repo / where are the important functions / what's the structure". Zero-dependency (stdlib only); Aider-inspired regex extraction and PageRank ranking, not a tree-sitter parser. Do NOT use to find correctness/security defects in a change or to audit a diff; use deep-review for that (this only ranks and lists symbols, it does not evaluate code quality).
Produces a **ranked list of the structurally-important symbol definitions** in a codebase, capped to a token budget. The point: instead of dumping whole files (wasteful, blows the context window), get a cheap "skeleton" of the repo — the functions/classes everything else depends on — and read full files only where it matters.
This is our zero-dependency port of [Aider's repo-map](https://aider.chat/docs/repomap.html).
subagent the map so it knows the important entry points without re-scanning.
python scripts/repo_map.py [ROOT] [--budget-tokens N] [--top N] [--json] [--no-signature] [--max-files N]
scanned (honors `.gitignore`); otherwise a filtered directory walk is used.
(≈4 chars/token heuristic). Use 256–512 for a quick orientation, 2048+ for depth.
JSON distinguishes `symbols_extracted_total` (before `--top`), `symbols_ranked_after_top` (after that cap), and `symbols_emitted` (after the token budget). The legacy `symbols_total` key retains its post-`--top` meaning for compatibility. None is a semantic coverage guarantee: extraction is regex-based and `--max-files` can limit input. Never diagnose parser coverage from a capped map.
# Quick orientation in a new repo python scripts/repo_map.py . --budget-tokens 512 # Feed a fan-out: JSON map of the most important 40 symbols python scripts/repo_map.py /path/to/repo --top 40 --json > repo_map.json # Focus a subdirectory (a single layer/service) python scripts/repo_map.py /path/to/repo/services/auth --budget-tokens 800
1. Extract definitions (functions/classes/types) and identifier references per file via per-language regexes (py/js/ts/tsx/go/rust/java/ruby/c/cpp/csharp/php/kotlin/swift). 2. Build a directed graph: edge `F → D` when file `F` references an identifier **defined** in file `D`. Rare identifiers (defined in few files) weigh more. 3. Run **PageRank** over the file graph → structurally-central files float up (shared utilities, core models, base classes). 4. Symbol score = `pagerank(def_file) × (1 + total_refs) × rarity`. Emit highest first until the token budget is hit.
So the map surfaces the code **everything else leans on**, not just the first files alphabetically.
parser. Exotic syntax, heavy macros, or unusual formatting can miss/misattribute a def. This is a deliberate trade for zero-install + runs-anywhere. To upgrade fidelity, replace `extract()` with `tree-sitter-language-pack` tags — the graph/ PageRank stages stay identical. (Don't install tree-sitter casually: it trips the 7-day supply-chain gate; gate it like any fresh dep.)
as approximate; it errs slightly high on code with many short tokens.
expected, since each is a distinct definition. Use `--top` to trim noise.
If your build output lives somewhere unusual, it may get scanned — point ROOT at the source dir instead.
everywhere. Point ROOT at hand-written source, or filter after the fact.
| Symptom | Cause | Fix | |---|---|---| | `0 files scanned` | ROOT has no recognized source extensions, or all gitignored | Check `git ls-files`; point ROOT at the source subdir | | A key function is missing | Regex didn't match its signature style | Lower `--budget-tokens` pressure (raise budget) or accept the limitation; verify by `grep` | | `--top 12` appears to find only 12 definitions | Post-cap count confused with extraction | Inspect `symbols_extracted_total`; remove caps before investigating actual extraction misses | | Map dominated by one vendored file | A `vendor/`/generated tree got scanned (non-git mode) | Run inside the git repo, or point ROOT at hand-written source | | Wrong/old map | File moved; map is a point-in-time snapshot | Re-run — it's cheap and stateless |
`scripts/repo_map.py` is stdlib-only and was verified to run on real trees (it correctly ranks shared-utility files to the top via PageRank). Re-run on any repo to confirm; there is no state to corrupt.
A practical configuration kit for Claude Code, Codex, and other coding agents. It contains architectural principles, enforcement hooks, skills, drop-in rules, starter templates, and dynamic-workflow commands.
Designing agent harnesses and tool systems — risk taxonomy for tools, permission decisions, draft/commit pattern, structured tool…
Use when designing, auditing, refactoring, or explaining an agentic harness for any domain, especially when work must continue…
Практическая инженерия диффузионных моделей: архитектуры, обучение, инференс, оптимизация памяти. Использовать при любых задачах…
Expert prompt engineering for FLUX.2 [klein] image generation and editing model. Use this skill whenever the user wants to create…
Plan or review LoRA and edit-training work specifically for FLUX.2 Klein or Qwen-Image-Edit, including paired datasets,…
Forensic image-to-prompt compiler for image generation models. Use this skill whenever the user wants to: convert/describe an…