skills/forge-docs-generate/SKILL.md
[writes] Generate or update project documentation on demand. Use when starting a new project without docs, after adding major features that need documentation, or to audit documentation coverage gaps. Supports README, architecture, ADRs, API docs, onboarding, runbooks, changelogs, diagrams, domain docs, user guides, migration guides.
npx skillsauth add quantumbitcz/dev-pipeline forge-docs-generateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generates project documentation independently of the pipeline. Run this skill at any time to bootstrap a full documentation suite for an undocumented codebase, update specific document types, or audit coverage gaps — without triggering a pipeline run or touching .forge/ state.
See shared/skill-contract.md for the standard exit-code table.
Before any action, verify:
git rev-parse --show-toplevel 2>/dev/null. If fails: report "Not a git repository. Navigate to a project directory." and STOP..claude/forge.local.md exists. If not: proceed with auto-detection of framework (the skill handles this in Step 1). Log INFO "No forge config found -- will auto-detect framework."Parse $ARGUMENTS for the following flags:
| Flag | Behavior |
|------|----------|
| (none) | Interactive mode — present coverage report, ask what to generate |
| --all | Generate full documentation suite (all supported types) |
| --type <type> | Generate specific type(s): readme, architecture, adr, api-spec, onboarding, runbook, changelog, domain-model, user-guide, migration-guide, diagrams |
| --export | After generation, push to configured external systems (Confluence, Notion, etc.) |
| --coverage | Report coverage only — no generation |
| --from-code <path> | Limit scope to a specific code path |
| --confirm-decisions | Interactive review of MEDIUM-confidence decisions before generation |
Multiple --type flags may be combined. --from-code applies as a scope filter to any generation step.
.claude/forge.local.md exists → read components.framework from it./forge-init):
build.gradle.kts + .kt files → springpackage.json + vite.config.* + React imports → reactpackage.json + next.config.* → nextjspackage.json + svelte.config.* + @sveltejs/kit → sveltekitpackage.json + svelte.config.* (no kit) → sveltepackage.json + angular.json → angularpackage.json + nest-cli.json → nestjspackage.json + nuxt.config.* → vueCargo.toml + axum dependency → axumgo.mod present → go-stdlibrequirements.txt or pyproject.toml + FastAPI import → fastapirequirements.txt or pyproject.toml + Django import → djangoPackage.swift + iOS/MacOS targets → swiftuiPackage.swift + Vapor dependency → vaporbuild.gradle.kts + Android imports → jetpack-compose*.csproj present → aspnetCMakeLists.txt or .c/.cpp files only → embedded*.yaml with kind: Deployment) → k8s.forge/docs-index.json exists and was last modified less than 1 hour ago → use it directly (skip re-discovery).fg-130-docs-discoverer to scan the codebase and produce a fresh docs-index.json.--coverage (report only, no generation)Present the coverage report and exit without generating anything:
## Documentation Coverage Report
Documented: <list of existing docs with type labels>
Missing: <list of doc types with no corresponding file>
Stale: <docs whose source code has changed since last generation>
External Refs: <references to external docs (Confluence, Notion, etc.)>
Coverage: {X}/{total} doc types present
--confirm-decisions (interactive review before generation)List all MEDIUM-confidence decisions and constraints identified during discovery (e.g., inferred audience, assumed scope, guessed module boundaries). For each item, show its text, source file, and basis for extraction. Prompt the user to choose:
confidence: "HIGH" in the graph/indexgeneration_history with reason: "user_dismissed" so it is not re-extracted on subsequent runsUsers may also downgrade a HIGH-confidence item to MEDIUM using the same interactive flow (present all HIGH items if --include-high is also passed).
After the review loop:
SET on DocDecision/DocConstraint nodes) or to .forge/docs-index.jsongeneration_history entry with a confidence_changes array listing every change made: { "id": "<id>", "from": "<old>", "to": "<new or null>", "reason": "<reason>" }"Confirmed {N} decisions as HIGH, dismissed {M} items"Continue to the generation step once the user has reviewed all MEDIUM items.
--all or --type <type>Use the Agent tool to dispatch fg-350-docs-generator in standalone mode with:
mode: standalone (no pipeline state, no worktree)types: the requested type(s), or all types if --allframework: detected framework (or null if unknown)scope: path from --from-code if provided, otherwise full project rootconfirm_decisions: true if --confirm-decisions was also passed--coverage).fg-350-docs-generator in standalone mode with the selected types.--from-code <path>Pass the provided path as the scope filter when dispatching fg-350-docs-generator. All other argument handling applies normally.
After generation completes, show a summary:
## Documentation Generation Complete
Created:
- {file path} ({doc type})
...
Updated:
- {file path} ({doc type})
...
Coverage delta: {before}% → {after}%
If --export was passed and external systems are configured, report export status per system. If export is not configured, log INFO "No external export targets configured; skipping --export."
state.json — this skill does not interact with pipeline run state..forge/docs-index.json for documentation discovery but does not touch state.json or checkpoint files.api-spec), skip that type and log INFO "Skipped {type}: no source content found."| Condition | Action | |-----------|--------| | Not a git repository | Report "Not a git repository. Navigate to a project directory." and STOP | | Framework detection fails | Log INFO "Framework not detected; using generic conventions only." Continue with generic doc generation | | Docs discoverer dispatch fails | Report error. Proceed with generation using available information | | Docs generator dispatch fails | Report "Documentation generator failed to start. Check plugin installation." and STOP | | No source content for a doc type | Skip that type. Log INFO "Skipped {type}: no source content found." | | Export target not configured | Log INFO "No external export targets configured; skipping --export." | | docs-index.json stale or missing | Re-run discovery by dispatching docs-discoverer |
/forge-run -- Full pipeline which includes documentation generation at the DOCUMENTING stage/forge-review -- Read-only codebase analysis (complementary to documentation generation)/forge-ask -- Query codebase knowledge including generated documentation/forge-deploy -- Deploy after documentation is generateddevelopment
[writes] Build, fix, deploy, review, or modify code in this project. Universal entry for the forge pipeline. Auto-bootstraps on first run; brainstorms before planning when given a feature description. Use when you want to take any productive action: implementing features, fixing bugs, reviewing branches, deploying, committing, running migrations.
tools
[writes] Manage forge state and configuration: recovery, abort, config edits, session handoff, automations, playbooks, output compression, knowledge graph maintenance. Use when you need to recover from broken pipeline state, edit settings, or manage long-lived state.
development
[writes] Create, list, show, resume, or search forge session handoffs. Use when context is getting heavy and you want to transfer a forge run or conversation into a fresh Claude Code session, or to resume from a prior handoff artefact. Subcommands - no args (write), list, show, resume, search.
development
[writes] Manage the Neo4j knowledge graph. Subcommands: init, rebuild (writes); status, query <cypher>, debug (read-only). Requires Docker. No default — an explicit subcommand is required. Use when setting up the graph for the first time, rebuilding after major refactors, checking graph health, or running ad-hoc Cypher diagnostics.