Generates and incrementally updates project docs from codebase. Trigger: "generate docs", "create documentation", "update my docs", "my docs are outdated", "document my codebase", "write docs", "devdraft", "doc my project", "sync docs". First run: full scan → writes per-app/module docs + stores git commit ID in docs/index.md. Next runs: git diff → patch only changed sections. Monorepo: folder per app/package. Monolith: folder per domain module.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
The command stays on one line. Scroll horizontally to inspect it before copying.
Prefer a local copy? Download the files currently available to SkillsMP.
File Explorer
13 files
Showing SKILL.md
SKILL.md
Source instructions · Read-only preview
name
devdraft
description
Generates and incrementally updates project docs from codebase. Trigger: "generate docs", "create documentation", "update my docs", "my docs are outdated", "document my codebase", "write docs", "devdraft", "doc my project", "sync docs". First run: full scan → writes per-app/module docs + stores git commit ID in docs/index.md. Next runs: git diff → patch only changed sections. Monorepo: folder per app/package. Monolith: folder per domain module.
{"author":"priyalraj","version":"0.0.1","platforms":["claude-code"],"triggers":["devdraft","generate docs","create documentation","update my docs","document my codebase","write docs","sync docs","my docs are outdated","doc my project"]}
devdraft
Folder-per-app doc generator. First run = full scan. Next runs = git diff → patch changed sections only.
Reference files live in references/ next to this SKILL.md. Derive absolute path at runtime — never hardcode.
S1 — Git Detection
git rev-parse HEAD
No git repo / no commits → FULL mode, skip commit tracking. Store CURRENT_HEAD.
S2 — Structure Classification
List root files. Auto-detect structure:
Workspace manifest present (go.work, Cargo.toml, pnpm-workspace.yaml, package.json, pyproject.toml, lerna.json, nx.json, turbo.json, rush.json) → read it. If it declares a workspace (members list / workspaces key / workspace section) → monorepo.
Generic layout — apps/ + packages/ both at root, OR services/ dir with 2+ subdirs each containing any manifest → monorepo.
No signals → monolith.
Monorepo → Read references/monorepo.md for workspace expansion + unit discovery per format.
Monolith → Read references/monolith.md for domain detection rules.
Print detected structure + unit list before proceeding.
S3 — Commit State
Marker location: docs/index.md only → <!-- devdraft-commit: <sha> -->
Legacy: .devdraft-state at root → migrate into docs/index.md, delete file.
Read marker → store as STORED_COMMIT. Then validate:
git cat-file -e <STORED_COMMIT>^{commit} 2>/dev/null # SHA exists?
git merge-base --is-ancestor <STORED_COMMIT> HEAD # SHA is ancestor of HEAD?
Either check fails → treat as FULL (SHA was rebased away / force-pushed / wrong branch).
If docs/ folder exists (any mode including UP_TO_DATE): ask before proceeding (AskUserQuestion, single-select):
Existing docs found. What would you like to do?
Update changed sections only — git diff → patch only what changed (recommended)
Delete all docs and regenerate fresh — wipe docs/ → full scan
Add more sections — keep existing, document additional sections only
"Delete all" → rm -rf docs/ → force FULL.
"Add more sections" → force FULL for new sections only, never overwrite existing files.
"Update changed" or no docs → proceed with detected mode.
UP_TO_DATE + "Update changed" → reply "Docs up to date." and stop.
S4 — User Config (AskUserQuestion)
Q1 multiSelect:true · Doc Sections · Which sections per app/module?
All (recommended)
Overview & Setup
Architecture
API / Routes
Components / Modules
Database & Models
Deployment
Q2 — MONOREPO ONLY multiSelect:true · Scope · Which apps/packages to document?
List all workspace entries + All (recommended).
Q3 multiSelect:false · Doc Style · Style?
Developer — concise, code-heavy (recommended)
Mixed — developer + plain English
Plain English — minimal jargon
→ SELECTED_SECTIONS, SELECTED_UNITS, DOC_STYLE
S5 — Stack Detection Per Unit
Per unit, check for manifest files in this priority order and read whichever exist:
Empty diff (no files changed) → reply "Docs up to date." and stop. Do NOT update marker.
Map each changed file to unit + section using structure rules from the reference file loaded in S2. Build CHANGE_MAP (unit → affected sections). Only dispatch agents for entries in CHANGE_MAP.
Print: Changed: N files, M units. Updating: apps/web (API, Components), packages/db (Database).