init-deep
Helps your agent organize project documentation. It's useful for the agent to understand your project's structure, commands, and rules.
What it does
This tool organizes your project's documentation into files called AGENTS.md. It creates a hierarchical structure, like folders within folders, so that artificial intelligence can better understand the project.
When to use it
- ✓When you start a new project and want the AI to understand its structure.
- ✓When the project grows and the documentation needs organizing.
- ✓When you want the AI to help keep the documentation up-to-date.
Example of what to ask your AI
“Organize my project's documentation into AGENTS.md files, starting from the root and creating subfolders as needed.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The tool first measures your project's size and decides how to divide it. Then, it gathers information from each part and finally writes the AGENTS.md files, ensuring the AI always has a clear and organized view of the project.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add code-yeongyu/oh-my-openagent --skill init-deepOr download just the file:
curl -L https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/dev/packages/omo-senpi/skills/init-deep/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
/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)
- Size & route (main session) - ONE eval cell measures the repo and computes the node formula.
- Map (dag) -
quickscanner nodes extract per-chunk facts into bounded file reports. - Reduce (dag) -
unspecified-highwriter nodes own disjoint subtrees: score, write AGENTS.md files, emit digests. - Root & verify (dag) - one node writes root AGENTS.md from digests only; one node verifies every file.
- Snapshot & mode (main session) - snapshot contract unchanged.
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
# Formula
CHUNK = 400 * 1024 # ~100k tokens of source; a quick worker's usable window
# is ~150k over its fallback chain - leave room for its
# prompt and report
N_quick = ceil(S / CHUNK) # bin-pack WHOLE directories into chunks; a directory
# larger than one chunk splits at its children
N_high = ceil(N_quick / 12) # one reducer absorbs ~12 reports (~60k tokens) and
# still has room to spot-check real code
Route:
- **N_quick < 4** -> inline path below; a dag costs more than it saves.
- N_quick >
task.dag.max_nodes_per_run(default 64) -> raise the knob in omo config, or run one chained dag per top-level directory (multi-run composition,mass-ulwskill). - Otherwise -> dag path: emit
CHUNKS = [{id, dirs, bytes}], assign each writer a directory SUBTREE (disjoint - no two writers own the same directory), andmkdir -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 (N_quick < 4)
Small repo - skip the dag. Fire 2-4 parallel explore agents (structure, entry points, conventions, anti-patterns), for example:
task(subagent_type="explore", run_in_background=true, prompt="Project structure: map real layout via ast-grep structural search (sg/ast_grep MCP) + rg --files -> REPORT deviations from standard patterns")
Run the LSP/ast-grep code map yourself (lsp_symbols outlines + workspace inventory, lsp_find_references on top exports, ast-grep import/call shapes; when neither resolves, mark centrality unmeasured). Then score with the matrix below and write every file per the templates yourself. Phase 5 applies unchanged.
Phase 2: Map Wave - quick Scanners (dag)
Build and start the run in one eval JS cell with the dag SDK (OMO_DAG_SDK_ROOT); wave doctrine, the node prompt contract, and the failure playbook come from the mass-ulw skill's references/planning.md. One scanner node per chunk, category: "quick", no load_skills - scanners stay lean and their prompt is a rigid numbered extraction template. Quick workers extract; they never judge and never write AGENTS.md:
TASK: Extract knowledge-base facts for chunk <id> (<dirs>) of <repo-root>.
Steps, in order:
1. Inventory each directory in scope: file count, LOC, languages, entry files.
…
FAQ
What are AGENTS.md files?
They are documentation files that help artificial intelligence understand a project's structure, commands, and conventions.
What does 'hierarchical' mean?
It means the documentation is organized in levels, like folders and subfolders, to make navigation and understanding easier.
Can I control the organization's depth?
Yes, you can set a limit for the depth of subfolders to avoid creating an overly complex structure.
Details
Original description by the author
Initializes a hierarchical AGENTS.md knowledge base for a project. Use when a repo needs its structure, commands, and conventions documented for agents.
Popularity
- GitHub stars
- 70k
- Ranking position
- #1726
- License
- NOASSERTION
- Updated
- 10/16/2026
Comments
- …
More skills from this repository
comment-checker
Helps your agent understand and respond to feedback from automatic comment checkers. It's useful when the agent needs to process information from tools that automatically review code or content.
code-yeongyu/oh-my-openagent
lcx-contribute-bug-fix
Helps your agent contribute bug fixes for LazyCodex-related projects. It creates issues or pull requests to ensure code quality.
code-yeongyu/oh-my-openagent
lcx-doctor
Lets your agent check the health of LazyCodex and Codex CLI installations. It's useful when the system behaves oddly after updates or changes.
code-yeongyu/oh-my-openagent
lcx-report-bug
Helps your agent report bugs in detail for LazyCodex projects. It creates issues with useful information for developers to fix the problem.
code-yeongyu/oh-my-openagent
Similar skills
architecture-decision-records
Has your agent record important project structure decisions. It helps to understand the reasoning behind choices and maintain a clear history of changes.
affaan-m/ECC
code-tour
Lets your agent create step-by-step code walkthroughs with exact file and line anchors. It's useful for project introductions, code explanations, or change reviews. Helps understand how a system works.
affaan-m/ECC
codebase-onboarding
Helps your agent analyze unfamiliar code and create an onboarding guide. It includes an architecture map, entry points, and conventions. Ideal for starting on a new project.
affaan-m/ECC