From gg-senior-tools
Generate or update the living project documentation (doc.md) by synthesizing all pipeline artifacts — PRD, architecture, phase specs, recette, dep-tree. Use whenever the user asks for project docs, onboarding docs, a project overview, or wants to consolidate pipeline output into a single reference. Also trigger after a phase closes, after architecture changes, or when a stakeholder handoff doc is needed. This skill feeds from gg-skill-prd, gg-skill-architecture, gg-skill-specs, gg-skill-phase, and gg-skill-recette.
How this skill is triggered — by the user, by Claude, or both
Slash command
/gg-senior-tools:gg-skill-docThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Reads every artifact produced by the `gg-skill-*` pipeline and synthesizes them into a single, human-readable `doc.md` — the authoritative reference for onboarding, stakeholders, and cross-team handoffs.
Reads every artifact produced by the gg-skill-* pipeline and synthesizes them into a single, human-readable doc.md — the authoritative reference for onboarding, stakeholders, and cross-team handoffs.
The document is derived from sources, never invented. Every claim traces back to a file.
| Mode | Trigger | What happens |
|---|---|---|
| Full generation | No args (or -o PATH) | Collect all artifacts → synthesize doc.md |
| Update | -update | Re-read only changed files (git diff since last doc.md write) → patch affected sections |
| Section filter | -sections LIST | Generate only named sections (comma-separated, e.g. -sections api,security) |
| Phase focus | -p N | Include only phases up to N in roadmap and testing sections |
| Output | -o PATH | Custom output path (default: doc.md at project root) |
| Language | -language LANG | Default English. Code, file paths, identifiers kept as-is. |
Scan project root and standard paths. Record found vs. absent. Never block on a missing file — degrade gracefully and note the gap.
Priority: patched > original
| Artifact | Preferred | Fallback |
|---|---|---|
| PRD | PRD-patched.md | PRD.md |
| Architecture | architecture-patched.md | architecture.md |
| Phase spec N | docs/phases/phaseN.md | — |
| Phase dev N | docs/dev/phaseN.md | — |
| Phase enhancement N | docs/dev/phaseN-enhancement.md | — |
| Recette index | recette.md | — |
| Recette phase N | recette_phaseN.md | — |
| Dep-tree | dep-tree.md | — |
| PRD enhancement | PRD-enhancement.md | — |
| Arch enhancement | architecture-enhancement.md | — |
Discovery output (in chat only, not in doc.md):
## Source Discovery
PRD: ✅ PRD-patched.md
Architecture: ✅ architecture-patched.md
Dep-tree: ✅ dep-tree.md (Phase 3, 2025-03-20)
Phase specs: ✅ Phase 1 ✅ Phase 2 ⚠ Phase 3 (spec only, no enhancement)
Recette: ✅ recette.md ✅ Phase 1 ✅ Phase 2 ❌ Phase 3
Gaps noted — affected sections will show [SOURCE MISSING] markers.
Read each source silently. Extract only what the schema requires. Do NOT invent values not present in sources.
Full extraction rules per source in references/extraction-rules.md.
Key rules:
dep-tree.md: freshness header, top 5 most-used modules, high fan-in/fan-out nodesconfidence_score.global, ready_for_architecture, ready_for_senior_specs, open blocking_issuesdoc.mdOutput path: -o value, or doc.md at project root.
Every section is mandatory unless marked (if applicable) or source is absent (use [SOURCE MISSING — run /gg-skill-{command} to fill]).
Full section templates in references/doc-schema.md.
13 sections:
| # | Section | Key sources |
|---|---|---|
| 1 | Project Overview + Pipeline Health | PRD, PRD-enhancement.md, architecture-enhancement.md |
| 2 | Target Users | PRD Section 3 (personas) |
| 3 | Architecture Overview | architecture Section 1–3, 11 (ADRs) |
| 4 | Data Model | architecture Section 5 (ERD, data stores, flows) |
| 5 | API Reference | architecture Section 7 (errors, auth flow, rate limits) |
| 6 | Features & User Stories | PRD Section 4–5 (MVP scope, user stories) |
| 7 | Phase Roadmap & Status | PRD Section 11, recette_phaseN.md, phaseN-enhancement.md |
| 8 | Infrastructure & Deployment | architecture Section 8 (envs, CI/CD, observability) |
| 9 | Security | architecture Section 9, PRD Section 9 |
| 10 | AI Architecture (if applicable) | architecture Section 6 |
| 11 | Risk Register | PRD Sections 10, 12, 13, enhancement blocking_issues |
| 12 | Codebase Map (if dep-tree present) | dep-tree.md |
| 13 | Tech Stack Summary | PRD Section 6, architecture Section 5.2 |
Diagrams: Copy C4 diagrams, ERD, and data flows verbatim. Do not redraw or summarize them.
After writing doc.md, output in chat (not in the file):
## doc.md Validation
Sections written: {N}/13
[SOURCE MISSING] markers: {N}
→ {list each missing source and which section it affects}
Phases covered: Phase 1 … Phase N
Recette coverage: {N}/{N} phases have recette data
Open blocking issues: {N} (see Section 11)
doc.md written to: {path}
Word count: ~{N} words
{IF any [SOURCE MISSING]:}
Run the corresponding command to fill gaps:
- Missing PRD → /gg-skill-prd
- Missing architecture → /gg-skill-architecture {PRD path}
- Missing phase spec N → /gg-skill-specs N
- Missing recette N → /gg-skill-recette -p N
- Missing dep-tree → /gg-dep-tree
{IF all sourced:}
✅ doc.md is fully sourced.
-update)Step 1 — Find changed files:
git diff --name-only {doc.md last-modified date}
Step 2 — Map changed files to sections:
| Changed file | Sections affected |
|---|---|
| PRD-patched.md | 1, 2, 6, 7, 11, 13 |
| architecture-patched.md | 3, 4, 5, 8, 9, 10, 12, 13 |
| docs/phases/phaseN.md | 7 (phase N row) |
| docs/dev/phaseN-enhancement.md | 7 (debt), 11 (blocking) |
| recette_phaseN.md | 7 (phase N recette table) |
| dep-tree.md | 12 |
| PRD-enhancement.md | 1 (Pipeline Health), 11 (blocking) |
| architecture-enhancement.md | 1 (Pipeline Health), 11 (blocking) |
Step 3 — Patch only affected sections. Preserve unchanged sections verbatim.
Step 4 — Update footer (generation date, source list).
Output in chat:
## Autoupdate — {datetime}
Changed files detected: {N}
Sections patched: {list}
Sections unchanged: {list}
doc.md updated: {path}
-sections LIST)Accepted names (case-insensitive): overview, users, architecture, data-model, api, features, roadmap, infrastructure, security, ai, risks, codebase, stack.
Header and footer are always included regardless of filter.
DO:
*-patched.md over originals — they are the authoritative versions[SOURCE MISSING — run /gg-skill-{command} to fill]DON'T:
gg-skill-prd
↓ PRD-patched.md
gg-skill-architecture
↓ architecture-patched.md
gg-skill-specs (per phase)
↓ docs/phases/phaseN.md
gg-dep-tree
↓ dep-tree.md
gg-skill-phase (per phase)
↓ code + dep-tree updated
gg-skill-recette (per phase)
↓ recette_phaseN.md
gg-skill-doc ← you are here
↓
doc.md ← living document, re-run after each phase
Run gg-skill-doc -update after every phase close to keep doc.md current with minimal re-generation.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub schpill/gg-senior-tools --plugin gg-senior-tools