Agent skill · software engineering · code-yeongyu
init-deep
Initializes a hierarchical AGENTS.md knowledge base for a project. Use when a repo needs its structure, commands, and conventions documented for agents.
Why this skill is useful
Adds executable scripts for generating and managing hierarchical AGENTS.md files with complex project structures.
What it needs
Requires ast-grep, bash, lsp installed locally. About 9k tokens when loaded. Last updated 2026-08-07. 67,387 stars on the source repository.
What this skill does
/init-deep Generate hierarchical AGENTS.md files: root + complexity-scored subdirectories, produced by a size-formula-driven dag map-reduce (quick scanners -> unspecified-high writers) so the main session's context stays flat at any repo size. Usage --- Workflow (High-Level) 1. Size & route (main session) - ONE eval cell measures the repo and computes the node formula. 2. Map (dag) - quick scanner nodes extract per-chunk facts into bounded file reports. 3. Reduce (dag) - unspecified-high writer nodes own disjoint subtrees: score, write AGENTS.md files, emit digests. 4. Root & verify (dag) - one node writes root AGENTS.md from digests only; one node verifies every file. 5. Snapshot & mode (main session) - snapshot contract unchanged. <critical> THE ALWAYS-REDUCE RULE. The main session NEVER reads chunk reports or raw node outputs - only the verify node's verdict and, when a repair needs it, one digest. Context protection is structural (bounded fan-in at every stage), never a runtime "how much context is left" guess. todo init the five phases; start/done each transition in real time. </critical> --- Phase 1: Size & Route Measure and compute in ONE eval cell - code, not mental arithmetic: Route: Nquick < 4 -> inline path below; a dag costs more than it saves. Nquick + Nhigh + 2 > task.dag.maxnodesperrun (default 64) -> the cap counts every node in the run (scanners, writers, root-writer and verify), so raise the knob in omo config, or run one chained dag per top-level directory (multi-run composition, mass-ulw skill). Otherwise -> dag path: emit CHUNKS = [{id, dirs, bytes}], assign each writer a directory SUBTREE (disjoint - no two writers own the same directory), and mkdir -p .omo/init-deep/reports .omo/init-deep/digests. --create-new: read every existing AGENTS.md FIRST (still-true facts survive as scanner input), then delete all, then regenerate. Inline path (Nquick < 4) Small repo - skip the dag. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills code-yeongyu/init-deep--7a2e26