Skip to content
/ CoderLap
Once per project

/docify

Generate real docs from your code. Once per project. Source-cited + drafts-first.

What it does

Scans your project, detects the stack, and generates:

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.

  1. Greps for <!-- coderlap:rule:* --> markers to find rules the toolkit owns.
  2. Identifies missing toolkit rules.
  3. Shows you exactly what it would add.
  4. On approval, appends them under ## Rules (added by /docify YYYY-MM-DD).
  5. 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.