clawdocs
v1.0.0
Published
Generate AI-agent-optimized documentation for your codebase. Based on Diataxis framework + Anthropic's agent-development best practices.
Maintainers
Readme
ClawDocs
Generate AI-agent-optimized documentation for any codebase using Claude Code.
ClawDocs creates a comprehensive prompt that Claude Code executes to analyze your project and generate documentation following the Diataxis framework combined with Anthropic's agent-development best practices.
Prerequisites
- Claude Code installed and configured
Installation
npm install -g clawdocsOr use directly with npx:
npx clawdocs generateUsage
Generate Documentation Prompt
# Navigate to your project
cd your-project
# Generate the Claude Code prompt
clawdocs generate
# Run the generated prompt with Claude Code
claude ".clawdocs/generate-docs.md"Options
clawdocs generate [options]
Options:
-d, --depth <level> Documentation depth: minimal, standard, comprehensive (default: "standard")
-o, --output <path> Output path for prompt file (default: ".clawdocs/generate-docs.md")
--run Immediately run the prompt with Claude Code after generationDepth Levels
minimal - Essential files only:
- CLAUDE.md
- docs/README.md
- docs/03-reference/agent-reference/codebase-map.md
standard (default) - Balanced documentation:
- All configuration files (CLAUDE.md, AGENTS.md, CLAUDE.LOCAL.md)
- Core docs/ structure
- Codebase map and architecture
- Basic how-to guides
- Agent workflows
comprehensive - Complete documentation:
- Everything in standard
- Detailed tutorials
- Full API reference
- Architecture Decision Records (ADRs)
- Troubleshooting guides
- Security and performance docs
What Gets Generated
When you run the prompt with Claude Code, it analyzes your codebase and generates:
Root Files
- CLAUDE.md - Project configuration for Claude Code (commit this)
- CLAUDE.LOCAL.md - Personal working memory (git-ignored)
- AGENTS.md - Agent skills framework with capabilities
docs/ Structure
docs/
├── README.md # Master index
├── META-AGENT-PROTOCOLS.md # Documentation maintenance rules
├── 00-getting-started/ # Installation and setup
├── 01-tutorials/ # Step-by-step learning
├── 02-how-to-guides/ # Task-oriented recipes
├── 03-reference/ # Technical specifications
│ └── agent-reference/
│ └── codebase-map.md # Complete codebase map
├── 04-explanation/ # Architecture and concepts
├── 05-agent-workflows/ # Executable YAML workflows
├── 06-agent-guardrails/ # Restrictions and standards
├── 07-development/ # Dev environment setup
├── 08-deployment/ # Deployment procedures
├── 09-adrs/ # Architecture decisions
├── 10-conventions/ # Coding standards
└── 11-troubleshooting/ # Problem-solving guidesSupported Tech Stacks
ClawDocs auto-detects your stack to provide context to Claude:
Backend:
- Go (Gin, Echo, Fiber)
- Node.js (Express, Fastify, NestJS, Hono)
- Python (FastAPI, Django, Flask)
- Rust (Actix, Axum)
Frontend:
- React, React Native (Expo)
- Next.js, Vue, Svelte
Infrastructure:
- Docker, Docker Compose
- PostgreSQL, MySQL, MongoDB
Monorepos:
- npm/yarn workspaces
- Lerna, pnpm workspaces
Documentation Philosophy
ClawDocs follows these principles:
- Token Efficiency - Informative but concise. No emojis or decorative elements.
- Agent-Optimized - Structured for AI agent consumption with clear navigation.
- Living Documentation - Meta-protocols for keeping docs in sync with code.
- Just-in-Time Context - Progressive disclosure: indexes first, details on demand.
- Diataxis Framework - Separates tutorials, how-tos, reference, and explanation.
Example
# Generate and immediately run
clawdocs generate --depth comprehensive --run
# Or step by step
clawdocs generate --depth standard
claude ".clawdocs/generate-docs.md"Contributing
Contributions welcome. Please open an issue or PR on GitHub.
License
MIT
