Skills

Init Deep

Initializes a hierarchical AGENTS.md knowledge base for a project.

Install

npx skills add code-yeongyu/oh-my-openagent --skill init-deep -g -a claude-code -y
Category
AI and agents
Updated
3d ago
License
See repository
Context cost
Mediumabout 3,000 tokens
Runs scripts
No, instructions only

What it does

Initializes a hierarchical AGENTS.md knowledge base for a project. Use when a repo needs its structure, commands, and conventions documented for agents.

/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

/init-deep                      # Update mode: modify existing + create new where warranted
/init-deep --create-new         # Read existing → remove all → regenerate from scratch
/init-deep --max-depth=2        # Limit directory depth (default: 3)

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:

# Measure (tracked files minus vendored/generated: node_modules, .git, dist,
# build, out, vendor, target, coverage, lockfiles, minified and binary files)
S        = total source bytes after exclusions
per_dir  = source bytes per directory            # bin-packing input
depth    = max directory depth                   # respect --max-depth (default 3)
existing = every AGENTS.md / CLAUDE.md path      # read the ROOT one now
Read the whole SKILL.md on GitHub

More in AI and agents