Init deep
Generate hierarchical AGENTS.md files for a codebase (root + scored subdirectories).From its SKILL.md
npx -y skills add UtsavBalar1231/oh-my-claudeagent --skill init-deepAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
5.8 KB, as published. Nobody here has run it
/init-deep
Generate hierarchical AGENTS.md files. Root + complexity-scored subdirectories.
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
- Discovery + Analysis (concurrent): explore agents, bash structure, codemap, existing AGENTS.md
- Score & Decide — AGENTS.md locations from merged findings
- Generate — root first, subdirs in parallel
- Review — deduplicate, trim, validate
Use TaskCreate for ALL phases. Mark in_progress → completed in real-time.
Precondition: TodoWrite and TaskCreate/TaskGet/TaskUpdate/TaskList are withheld on Opus 5 and Fable 5 era models unless CLAUDE_CODE_ENABLE_TODO_TOOLS=1 is set. When they are absent the mandate still stands, carried in your own response text instead of a task list.
Phase 1: Discovery + Analysis (Concurrent)
Background Explore Agents (launch immediately)
Agent(subagent_type="oh-my-claudeagent:explore", prompt="Project structure: PREDICT standard patterns for detected language → REPORT deviations only")
Agent(subagent_type="oh-my-claudeagent:explore", prompt="Entry points: FIND main files → REPORT non-standard organization")
Agent(subagent_type="oh-my-claudeagent:explore", prompt="Conventions: FIND config files (.eslintrc, pyproject.toml, .editorconfig) → REPORT project-specific rules")
Agent(subagent_type="oh-my-claudeagent:explore", prompt="Anti-patterns: FIND 'DO NOT', 'NEVER', 'ALWAYS', 'DEPRECATED' comments → LIST forbidden patterns")
Agent(subagent_type="oh-my-claudeagent:explore", prompt="Build/CI: FIND .github/workflows, Makefile → REPORT non-standard patterns")
Agent(subagent_type="oh-my-claudeagent:explore", prompt="Test patterns: FIND test configs, test structure → REPORT unique conventions")
Background Agent Barrier
Agent completes but others running → acknowledge briefly, END response. Do NOT merge or proceed until ALL reported.
Main Session (concurrent with agents)
1. Bash Structural Analysis
find . -type d -not -path '*/\.*' -not -path '*/node_modules/*' -not -path '*/venv/*' -not -path '*/dist/*' -not -path '*/build/*' | awk -F/ '{print NF-1}' | sort -n | uniq -c
find . -type f -not -path '*/\.*' -not -path '*/node_modules/*' | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn | head -30
find . -type f \( -name "*.py" -o -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.go" -o -name "*.rs" \) -not -path '*/node_modules/*' | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn | head -20
find . -type f \( -name "AGENTS.md" -o -name "CLAUDE.md" \) -not -path '*/node_modules/*' 2>/dev/null
2. Read Existing AGENTS.md
Extract key insights, conventions, anti-patterns. --create-new: read first (preserve context) → delete → regenerate.
3. LSP Codemap (if available)
Optional Claude-native/plugin LSP tools for entry points: lsp_servers(), lsp_document_symbols(), lsp_workspace_symbols(). If unavailable, rely on explore agents and bash only.
4. Dynamic Agent Spawning
Additional explore agents based on project scale (max 5 total):
| Factor | Threshold | Additional Agents |
|---|---|---|
| Total files | >100 | +1 per 100 files |
| Total lines | >10k | +1 per 10k lines |
| Directory depth | ≥4 | +2 for deep exploration |
| Large files (>500 lines) | >10 files | +1 for complexity hotspots |
| Multiple languages | >1 | +1 per language |
total_files=$(find . -type f -not -path '*/node_modules/*' -not -path '*/.git/*' | wc -l)
Phase 2: Scoring & Location Decision
Scoring Matrix
| Factor | Weight | High Threshold | Source |
|---|---|---|---|
| File count | 3x | >20 | bash |
| Subdir count | 2x | >5 | bash |
| Code ratio | 2x | >70% | bash |
| Unique patterns | 1x | Has own config | explore |
| Module boundary | 2x | Has index.ts/init.py | bash |
| Symbol density | 2x | >30 symbols | lsp_workspace_symbols count |
| Reference centrality | 3x | >20 refs | lsp_find_references count |
Decision Rules
| Score | Action |
|---|---|
| Root (.) | ALWAYS create |
| >15 | Create AGENTS.md |
| 8-15 | Create if distinct domain |
| <8 | Skip (parent covers) |
Phase 3: Generate AGENTS.md
Root AGENTS.md
# PROJECT KNOWLEDGE BASE
**Generated:** {TIMESTAMP}
**Commit:** {SHORT_SHA}
## OVERVIEW
{1-2 sentences: what + core stack}
## STRUCTURE
{Tree with non-obvious purposes only}
## WHERE TO LOOK
| Task | Location | Notes |
## CONVENTIONS
{ONLY deviations from standard}
## ANTI-PATTERNS (THIS PROJECT)
{Explicitly forbidden here}
## COMMANDS
{dev/test/build}
Quality gates: 50-150 lines, no generic advice, no obvious info.
Subdirectory AGENTS.md (Parallel)
30-80 lines max per location.
Phase 4: Review & Deduplicate
Remove: generic advice, parent duplicates. Trim to limits. Verify telegraphic style.
Anti-Patterns
- Sequential execution → MUST parallel
- Ignoring existing → ALWAYS read first, even with --create-new
- Over-documenting → not every dir needs AGENTS.md
- Redundancy → child never repeats parent
- Generic content → remove anything applying to ALL projects
- Static agent count → vary by project size/depth