What it does
Scans your project, detects the stack, and generates:
CLAUDE.mdat the root — rules specific to your stack (merges with existing rules safely)docs/overview.md— 1-page project summarydocs/architecture.md— services, request flow, layeringdocs/api.md— every route (method, path, auth, request, response)docs/components.md— reusable UI patternsdocs/database.md— models, relationships, migrationsdocs/integrations.md— external services + env varsdocs/DECISIONS.md,KNOWN-ISSUES.md,SESSIONS.md— empty + ready
Every factual claim cites a source file and line range via <!-- src: path:line-range -->. If Claude isn’t sure, it writes <!-- TODO: verify --> — never invents.
Usage
/docify # first-time generation
/docify --refresh api # regenerate just docs/api.md from current code
/docify approve api # promote docs/api.draft.md → docs/api.md
The safety model
Drafts first
Everything lands as .draft.md files. You review them, then promote with /docify approve <file>.
This prevents “Claude wrote 6 files that look good but contain fiction.”
Never overwrites
If docs/api.md already exists, /docify writes docs/api.draft.md instead and asks you to review the diff.
Citations
Every claim has a comment like:
This route validates input via Zod. <!-- src: app/api/invite/route.ts:12-38 -->
/ship later re-validates these citations — if the file is gone or the line range is out of bounds, you’ll know.
The CLAUDE.md merge
Existing CLAUDE.md? /docify doesn’t clobber it.
- Greps for
<!-- coderlap:rule:* -->markers to find rules the toolkit owns. - Identifies missing toolkit rules.
- Shows you exactly what it would add.
- On approval, appends them under
## Rules (added by /docify YYYY-MM-DD). - Your custom rules (no markers) are never touched.
TODO markers
If Claude can’t confidently document something, you’ll see:
### POST /api/webhook/stripe
Auth: <!-- TODO: verify — multiple middleware layers, unclear if auth() required -->
Request: <!-- src: app/api/webhook/stripe/route.ts:8-22 -->
Grep for TODO: verify to find weak spots.