From vibe-doc
This skill should be used when the user mentions "generate docs", "write my documentation", "fix my gaps", "create a runbook", "write the threat model", "generate missing docs", or wants to produce technical documentation from their project artifacts. Runs an autonomous-first workflow: reads project files, synthesizes as much as possible without asking, then interviews the user only for the sections that genuinely need human judgment.
How this skill is triggered — by the user, by Claude, or both
Slash command
/vibe-doc:generateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Autonomous-first pipeline: read the project, fill what you can, then ask the user only for the sections that need human judgment.
Autonomous-first pipeline: read the project, fill what you can, then ask the user only for the sections that need human judgment.
Shared behavior: Read skills/guide/SKILL.md for state management, CLI patterns, checkpoints, and output formatting.
The old model was agent-interviewed, user-informed: the agent asked 2-3 synthesis questions per doc type and the user answered them all. That's overkill for factual docs whose content lives in the codebase.
The new model is autonomous-first:
The CLI (vibe-doc generate <doctype>) still produces the deterministic scaffold. This skill layers intelligence on top: same scaffold, but the agent keeps going and fills it in from the codebase before handing off to the user.
if [ ! -f "<project-path>/.vibe-doc/state.json" ]; then
echo "No project profile found. Run the Scan skill first."
exit 1
fi
If state doesn't exist, redirect to the Scan skill and exit.
Read state and show gaps grouped by tier:
Documentation Gaps — <Category>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Required (ship blockers) — N missing:
□ README
□ Install Guide
□ Skill/Command Reference
Recommended (should do) — M missing:
□ ADRs
□ Test Plan
□ Changelog / Contributing
Which would you like to generate?
[required] Start with all Required docs (runs autonomous fill in parallel)
[pick] Let me choose specific docs
[<name>] Single doc by name
[all] Every missing doc, Required + Recommended + Optional
Do not default to "all" unless the user asks for it. More docs = slower, more tokens, more noise.
Follow these steps, in order, for each doc to generate.
cd <project-path> && npx vibe-doc generate <docType> --format both
This produces docs/generated/<docType>.md with deterministic-extractor fields pre-filled and NEEDS INPUT comments marking the gaps.
Read the scaffold back so you can edit it in place.
Read the files most relevant to this doc type. Use the hint table below; add files based on what the scan inventory shows.
| Doc Type | Read These Files |
|---|---|
| readme | package.json, CLAUDE.md, any existing README.md, main source entry file (e.g., src/index.ts), docs/ summaries |
| install-guide | package.json (engines, scripts, bin), any existing INSTALL.md, CI configs (.github/workflows/*.yml), install-related scripts |
| skill-command-reference | every skills/*/SKILL.md, every commands/*.md, .claude-plugin/plugin.json |
| changelog-contributing | git log --oneline -100, any existing CHANGELOG.md, any existing CONTRIBUTING.md, package.json version history |
| adr | CLAUDE.md, commit messages with "decision:" or "arch:" prefixes, any docs/adr/ or docs/decisions/ folder |
| runbook | package.json scripts, Dockerfile, .github/workflows/*.yml, any scripts/ folder, any deploy config |
| api-spec | Route/controller source files, openapi.yaml, swagger.json, any existing API docs |
| deployment-procedure | .github/workflows/*.yml, Dockerfile, deploy scripts, cloud infra configs (terraform, cdk, pulumi) |
| test-plan | Test files, test runner configs (jest.config.*, pytest.ini), CI test stages |
| data-model | Schema/migration files, ORM model files, database config |
| threat-model | Auth code, permission logic, sensitive-data handling, external API clients, secrets config |
For each file, extract what's relevant to the template's sections. Ignore irrelevant content.
Open the scaffold at docs/generated/<docType>.md. For each NEEDS INPUT comment:
{{user.*}} placeholder still sitting there) with real content. Remove the NEEDS INPUT comment to signal the section is filled.NEEDS INPUT comment in place. These will become the questions you ask the user in the next step.Rules for autonomous fills:
<!-- Source: package.json, README.md -->. This lets the user verify your work quickly.Write the filled-in doc back to docs/generated/<docType>.md.
Present a summary:
✓ Autonomous pass complete — docs/generated/<docType>.md
Filled from codebase:
• <section A> — from <source files>
• <section B> — from <source files>
• <section C> — from <source files>
Still need your input:
• <section X> — <why the agent couldn't fill it>
• <section Y> — <why the agent couldn't fill it>
I'll ask about those two now. If you'd rather fill them yourself
later, say "defer" and I'll leave the NEEDS INPUT comments.
Then ask one question at a time for each remaining gap. Each question should be specific, reference the context, and accept short answers:
Question 1 of 2: <section X>
<one-sentence explanation of what this section is for>
From what I read, you have <X, Y, Z>. What's the <specific thing>?
Capture each answer and update the doc in place. When all questions are answered, remove the NEEDS INPUT comments for those sections.
✓ <docType>.md is ready for review.
Coverage:
• Sections filled autonomously: N
• Sections filled from your answers: M
• Sections still marked NEEDS INPUT: 0 (or K if deferred)
Open: docs/generated/<docType>.md
[approve] Move to next doc (or finish if last)
[revise] Ask different questions / read more files / regenerate
[edit] I'll wait while you edit manually, then approve
[defer] Mark remaining gaps as NEEDS INPUT and move on
When the user selects multiple docs, dispatch one subagent per doc type in parallel using the Task tool. This is the recommended path — it's faster and each agent gets a focused slice of the codebase to read.
For each selected doc, build a subagent prompt that covers Section 3a-c (scaffold + read sources + fill autonomously). Do not include the conversational interview (Section 3d) in the subagent prompt — that happens in the main agent after all subagents return, so questions don't interleave.
Subagent prompt template:
You are generating documentation for a <Category> project at <project-path>.
Task: Produce a fully-filled `docs/generated/<docType>.md` from the project's
existing artifacts. Do NOT ask the user questions — fill only what you can
confidently synthesize from source files, and leave NEEDS INPUT comments for
anything you can't.
Steps:
1. Run: `cd <project-path> && npx vibe-doc generate <docType> --format both`
2. Read the generated scaffold at docs/generated/<docType>.md
3. Read these source files: <from the hint table, plus inventory-specific adds>
4. For each NEEDS INPUT section in the scaffold:
- If you can fill it confidently from what you read, replace it with real
content and add an inline <!-- Source: ... --> comment
- If you can't, leave the NEEDS INPUT comment so the main agent can ask the user
5. Write the updated doc back to docs/generated/<docType>.md
6. Report back with: (a) which sections you filled, (b) which sections still
need human input, (c) anything suspicious you noticed in the artifacts
Do not dispatch further subagents. Do not run the interview. Return findings
to the main agent.
Use the Task tool to fire all subagents in the same message. Each subagent runs independently and edits its own doc.
When all subagents return, aggregate their findings:
✓ Autonomous pass complete — <N> docs
docs/generated/readme.md
Filled: overview, install, usage, license
Needs input: configuration (no .env.example found)
docs/generated/install-guide.md
Filled: prerequisites, install steps, verification
Needs input: troubleshooting (no existing error documentation)
docs/generated/skill-command-reference.md
Filled: all sections (found 8 SKILL files and 4 command definitions)
Needs input: none — ready to ship
Total: <X> sections filled autonomously, <Y> need your input.
Now run the interview phase (Section 3d) sequentially across all docs — for each doc that has unfilled gaps, ask its questions one at a time, update the doc, move to the next. Don't interleave questions across docs; the user needs to stay focused on one doc at a time.
Generation complete ✓
Ready for review:
• docs/generated/readme.md (0 gaps remaining)
• docs/generated/install-guide.md (0 gaps remaining)
• docs/generated/skill-command-reference.md (0 gaps remaining)
Coverage improved: <before>% → <after>% (<n> Required docs satisfied)
Open each file to review. When you're ready, you can promote them to the
repo root (README.md, INSTALL.md, etc.) or keep them in docs/generated/
as a staging area.
[approve-all] Done, docs are good
[revise <name>] Re-run autonomous fill on one doc with different focus
[promote] Move files from docs/generated/ to the repo root
After any successful generation (single or parallel), update the plugins.vibe-doc namespace in ~/.claude/profiles/builder.json — but only if the file already exists.
~/.claude/profiles/builder.json. If it doesn't exist or isn't valid JSON, skip this step.plugins.vibe-doc, never touch shared or other plugin namespaces.{
"plugins": {
"vibe-doc": {
"last_generated_docs": ["<docType1>", "<docType2>"],
"preferred_tier": "<tier the user chose, if they expressed a preference>",
"default_output_format": "<format used, if not 'both'>",
"last_updated": "<today's ISO date>"
}
}
}
scans_completed, last_scan_project, etc.) — only update what changed.The autonomous-first flow works well for docs whose content lives in the codebase. It works less well for docs where the substance is judgment, intent, or future plans — specifically:
For these, default to a short autonomous pass (fill only what's obviously there) and spend most of the time in the interview phase. Lean on the synthesis questions from skills/guide/references/breadcrumb-heuristics.md.
docs/generated/ is a staging area. Moving files to the repo root (README.md, INSTALL.md, CHANGELOG.md) is always an explicit user action.The scaffold step failed: <error>
This usually means:
• The doc type isn't registered (check `vibe-doc templates list`)
• The template file is missing from the install
• A filesystem error blocked writing to docs/generated/
[retry] Try again
[skip] Skip this doc and move to the next
If reading too many source files would exceed a reasonable context budget, narrow the scope:
If a subagent couldn't fill any sections, it probably got the wrong doc type or the repo genuinely has no evidence. Options:
Read from .vibe-doc/state.json:
Write to:
docs/generated/<docType>.md — the filled-in doc (autonomous + interview results)docs/generated/<docType>.docx — DOCX version from the CLI scaffold pass.vibe-doc/state.json — generation history (file paths, timestamps)Files the agent should NOT modify:
.vibe-doc/state.json's classification or gapReport blocks — those are owned by scan/check skillsWhen the interview phase is needed, question sets per doc type live in skills/guide/references/breadcrumb-heuristics.md. Each breadcrumb's gapQuestions field is a pre-written list of targeted questions for that doc type — use them as a starting point and adapt to what you already filled in.
Last updated: 2026-04-15 | Version: 2.0 (autonomous-first)
npx claudepluginhub estevanhernandez-stack-ed/vibe-doc --plugin vibe-docGenerates documentation from code including API references, developer guides, READMEs, and architecture overviews. Matches existing styles and avoids overwriting in brownfield codebases.