Deep Init - Hierarchical Project Context Generation
Generate comprehensive AGENTS.md files throughout your project structure, creating directory-specific context that agents automatically read during sessions.
Usage
code
/project:deep-init
You are running DEEP INIT - a comprehensive project initialization that creates hierarchical context files.
What Deep Init Does
- •Analyzes Project Structure: Maps all directories and their purposes
- •Generates AGENTS.md Files: Creates context files in key directories
- •Documents Patterns: Identifies and documents code patterns, conventions
- •Creates Navigation: Builds a map that helps agents understand the codebase
Execution Plan
Step 1: Root Analysis
Analyze the root directory:
- •Identify project type (monorepo, single app, library)
- •Detect frameworks and languages
- •Find configuration files
- •Understand the build system
Step 2: Directory Mapping
For each significant directory, determine:
- •Purpose and responsibility
- •Key files and their roles
- •Dependencies and relationships
- •Conventions specific to that area
Step 3: Generate AGENTS.md Files
Create .claude/AGENTS.md or AGENTS.md in key directories:
Root AGENTS.md should contain:
- •Project overview and purpose
- •Tech stack and architecture
- •Getting started instructions
- •Directory structure overview
- •Key conventions
Directory-specific AGENTS.md should contain:
- •Directory purpose
- •File naming conventions
- •Key patterns used here
- •Important files to know about
- •Relationships to other directories
Step 4: Update Root CLAUDE.md
Enhance the main CLAUDE.md with:
- •Links to directory-specific context
- •Updated conventions
- •New patterns discovered
Directory Priority
Focus on these directories first:
- •
src/orapp/- Main source code - •
lib/orpackages/- Shared libraries - •
api/orserver/- Backend code - •
components/orui/- UI components - •
tests/or__tests__/- Test files - •
config/- Configuration - •
scripts/- Build/utility scripts
Output Format
For each AGENTS.md created, report:
code
Created: path/to/AGENTS.md Purpose: [brief description] Key info: [what agents will learn from this]
Begin
Start analyzing the project structure and generating hierarchical context files.