
deepinit
Deep codebase initialization with hierarchical AGENTS.md documentation
- Installs
- 1K
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/yeachan-heo/oh-my-claudecode --skill deepinit- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads deepinit automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Deep Init Skill
Creates comprehensive, hierarchical AGENTS.md documentation across the entire codebase.
Core Concept
AGENTS.md files serve as AI-readable documentation that helps agents understand:
- What each directory contains
- How components relate to each other
- Special instructions for working in that area
- Dependencies and relationships
Hierarchical Tagging System
Every AGENTS.md (except root) includes a parent reference line:
**Parent context:** `../AGENTS.md`
This MUST be visible prose, never an HTML comment. Claude Code strips HTML
comments before a memory file reaches the model, so <!-- Parent: ... -->,
<!-- Generated: ... --> and a commented MANUAL boundary are invisible to the
agent that is supposed to act on them.
This creates a navigable hierarchy:
/AGENTS.md ← Root (no parent line)
├── src/AGENTS.md ← **Parent context:** `../AGENTS.md`
│ ├── src/components/AGENTS.md ← **Parent context:** `../AGENTS.md`
│ └── src/utils/AGENTS.md ← **Parent context:** `../AGENTS.md`
└── docs/AGENTS.md ← **Parent context:** `../AGENTS.md`
Loading Model
Stock Claude Code discovers nested CLAUDE.md by basename and never loads a
nested AGENTS.md; a root @AGENTS.md import does not reach subdirectories
either. The nested files generated here are delivered by OMC's PostToolUse
directory-context injector, which walks up from each accessed file and injects
the nearest AGENTS.md/README.md once per session.
That means the hierarchy requires OMC's hooks to be active. When OMC hooks are
disabled (DISABLE_OMC=1, OMC_SKIP_HOOKS=post-tool-use) or the plugin is not
registered, add a root-level CLAUDE.md symlink or @AGENTS.md import for the
root file and expect nested files to stay unread.
AGENTS.md Template
# {Directory Name}
**Parent context:** `{relative_path_to_parent}/AGENTS.md`
**Generated:** {timestamp} · **Updated:** {timestamp}
## Purpose
{One-paragraph description of what this directory contains and its role}
## Key Files
{List each significant file with a one-line description}
| File | Description |
|------|-------------|
| `file.ts` | Brief description of purpose |
## Subdirectories
{List each subdirectory with brief purpose}
| Directory | Purpose |
|-----------|---------|
| `subdir/` | What it contains (see `subdir/AGENTS.md`) |
## For AI Agents
### Working In This Directory
{Special instructions for AI agents modifying files here}
### Testing Requirements
{How to test changes in this directory}
### Common Patterns
{Code patterns or conventions used here}
## Dependencies
### Internal
{References to other parts of the codebase this depends on}
### External
{Key external packages/libraries used}
## Manual Notes
Notes under this heading are written by humans and preserved on regeneration.
Execution Workflow
Step 1: Map Directory Structure
Task(subagent_type="explore", model="haiku",
prompt="List all directories recursively. Exclude: node_modules, .git, dist, build, __pycache__, .venv, coverage, .next, .nuxt")
Step 2: Create Work Plan
Generate todo items for each directory, organized by depth level:
Level 0: / (root)
Level 1: /src, /docs, /tests
Level 2: /src/components, /src/utils, /docs/api
...
Step 3: Generate Level by Level
IMPORTANT: Generate parent levels before child levels to ensure parent references are valid.
For each directory:
- Read all files in the directory
- Analyze purpose and relationships
- Generate AGENTS.md content
- Write file with proper parent reference
Step 4: Compare and Update (if exists)
When AGENTS.md already exists:
- Read existing content
- Identify sections:
- Auto-generated sections (can be updated)
- Manual sections (the
## Manual Notesheading and everything under it are preserved)
- Compare:
- New files added?
- Files removed?
- Structure changed?
- Merge:
- Update auto-generated content
- Preserve manual annotations
- Update timestamp
Step 5: Validate Hierarchy
After generation, run validation checks:
| Check | How to Verify | Corrective Action |
|---|---|---|
| Parent references resolve | Read each AGENTS.md, check the **Parent context:** path exists | Fix path or remove orphan |
| No orphaned AGENTS.md | Compare AGENTS.md locations to directory structure | Delete orphaned files |
| Completeness | List all directories, check for AGENTS.md | Generate missing files |
| Timestamps current | Check the **Generated:** / **Updated:** dates | Regenerate outdated files |
Validation script pattern:
# Find all AGENTS.md files
find . -name "AGENTS.md" -type f
# Check parent references
grep -r "\*\*Parent context:\*\*" --include="AGENTS.md" .
Smart Delegation
| Task | Agent |
|---|---|
| Directory mapping | explore |
| File analysis | architect |
| Content generation | writer |
| AGENTS.md writes | writer |
Empty Directory Handling
When encountering empty or near-empty directories:
| Condition | Action |
|---|---|
| No files, no subdirectories | Skip - do not create AGENTS.md |
| No files, has subdirectories | Create minimal AGENTS.md with subdirectory listing only |
| Has only generated files (*.min.js, *.map) | Skip or minimal AGENTS.md |
| Has only config files | Create AGENTS.md describing configuration purpose |
Example minimal AGENTS.md for directory-only containers:
# {Directory Name}
**Parent context:** `../AGENTS.md`
## Purpose
Container directory for organizing related modules.
## Subdirectories
| Directory | Purpose |
|-----------|---------|
| `subdir/` | Description (see `subdir/AGENTS.md`) |
Parallelization Rules
- Same-level directories: Process in parallel
- Different levels: Sequential (parent first)
- Large directories: Spawn dedicated agent per directory
- Small directories: Batch multiple into one agent
Quality Standards
Must Include
- Accurate file descriptions
- Correct parent references
- Subdirectory links
- AI agent instructions
Must Avoid
- Generic boilerplate
- Incorrect file names
- Broken parent references
- Missing important files
Example Output
Root AGENTS.md
# my-project
**Generated:** 2024-01-15 · **Updated:** 2024-01-15
## Purpose
A web application for managing user tasks with real-time collaboration features.
## Key Files
| File | Description |
|------|-------------|
| `package.json` | Project dependencies and scripts |
| `tsconfig.json` | TypeScript configuration |
| `.env.example` | Environment variable template |
## Subdirectories
| Directory | Purpose |
|-----------|---------|
| `src/` | Application source code (see `src/AGENTS.md`) |
| `docs/` | Documentation (see `docs/AGENTS.md`) |
| `tests/` | Test suites (see `tests/AGENTS.md`) |
## For AI Agents
### Working In This Directory
- Always install dependencies after modifying the project manifest
- Use TypeScript strict mode
- Follow ESLint rules
### Testing Requirements
- Run tests before committing
- Ensure >80% coverage
### Common Patterns
- Use barrel exports (index.ts)
- Prefer functional components
## Dependencies
### External
- React 18.x - UI framework
- TypeScript 5.x - Type safety
- Vite - Build tool
## Manual Notes
Custom project notes can be added under this heading.
Nested AGENTS.md
# components
**Parent context:** `../AGENTS.md`
**Generated:** 2024-01-15 · **Updated:** 2024-01-15
## Purpose
Reusable React components organized by feature and complexity.
## Key Files
| File | Description |
|------|-------------|
| `index.ts` | Barrel export for all components |
| `Button.tsx` | Primary button component |
| `Modal.tsx` | Modal dialog component |
## Subdirectories
| Directory | Purpose |
|-----------|---------|
| `forms/` | Form-related components (see `forms/AGENTS.md`) |
| `layout/` | Layout components (see `layout/AGENTS.md`) |
## For AI Agents
### Working In This Directory
- Each component has its own file
- Use CSS modules for styling
- Export via index.ts
### Testing Requirements
- Unit tests in `__tests__/` subdirectory
- Use React Testing Library
### Common Patterns
- Props interfaces defined above component
- Use forwardRef for DOM-exposing components
## Dependencies
### Internal
- `src/hooks/` - Custom hooks used by components
- `src/utils/` - Utility functions
### External
- `clsx` - Conditional class names
- `lucide-react` - Icons
## Manual Notes
Triggering Update Mode
When running on an existing codebase with AGENTS.md files:
- Detect existing files first
- Read and parse existing content
- Analyze current directory state
- Generate diff between existing and current
- Apply updates while preserving manual sections
Performance Considerations
- Cache directory listings - Don't re-scan same directories
- Batch small directories - Process multiple at once
- Skip unchanged - If directory hasn't changed, skip regeneration
- Parallel writes - Multiple agents writing different files simultaneously
FAQ
What does the deepinit skill do?
Deep codebase initialization with hierarchical AGENTS.md documentation
How do I install deepinit?
Run npx skills add https://github.com/yeachan-heo/oh-my-claudecode --skill deepinit in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/deepinit/ (personal) or .claude/skills/deepinit/ (project).
Which AI agents can use deepinit?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is deepinit safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains deepinit?
It is published by yeachan-heo in yeachan-heo/oh-my-claudecode. It has 1,034 recorded installs.
More from yeachan-heo/oh-my-claudecode
ai-slop-cleaner
yeachan-heo/oh-my-claudecode
Clean AI-generated code slop with a regression-safe, deletion-first workflow and optional reviewer-only mode
ralplan
yeachan-heo/oh-my-claudecode
Consensus planning entrypoint that auto-gates vague ralph/autopilot/team requests before execution
hud
yeachan-heo/oh-my-claudecode
Configure HUD display options (layout, presets, display elements)
deep-interview
yeachan-heo/oh-my-claudecode
Socratic deep interview with mathematical ambiguity gating before explicit execution approval
omc-setup
yeachan-heo/oh-my-claudecode
Install or refresh oh-my-claudecode for plugin, npm, and local-dev setups from the canonical setup flow
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.