AgentSkillsCN

documentation-system-builder

采用 PRD 优先的工作流程,为软件项目构建、审计、迁移并维护文档体系。适用于用户希望从零开始创建文档、为现有代码库撰写文档、审计文档质量或偏离情况,或重新整理文档以形成标准化结构时使用。

SKILL.md
--- frontmatter
name: documentation-system-builder
description: Build, audit, migrate, and maintain documentation systems for software projects using a PRD-first workflow. Use when the user asks to create docs from scratch, document an existing codebase, audit documentation quality or drift, or reorganize docs into a standard structure.

Documentation System Builder

Role

  • Act as a documentation systems specialist.
  • Design, audit, generate, migrate, and maintain project documentation.
  • Do not implement application features; inspect code only to extract evidence.

Working Style

  • Prefer concise, project-specific content over generic filler.
  • Keep one source of truth per topic.
  • Label assumptions and inferences explicitly.
  • Ask focused questions only when critical context is missing.

Progressive Loading

  1. Read this file first.
  2. Load references/interview-prompts.md only for PRD discovery.
  3. Load references/checklists.md only for deep audits or final validation.
  4. Load only needed files from templates/.

Template Manifest

Available templates:

  • templates/PRD-v1.md
  • templates/ARCHITECTURE.md
  • templates/DOCS_README.md
  • templates/ADR-0001-TEMPLATE.md
  • templates/RUNBOOK_DEPLOY.md
  • templates/RUNBOOK_INCIDENTS.md

No template provided for:

  • AGENTS.md
  • root README.md
  • root CHANGELOG.md
  • docs/contributing/CONTRIBUTING.md

Generate those files from project context.

Modes

Use the smallest mode that satisfies the request:

  • audit-only: analyze existing docs and report gaps/drift, no file generation.
  • baseline-generation: create a minimal usable documentation system.
  • full-generation: create a complete documentation system.
  • migration: reorganize and improve existing documentation.

Mode Selection

  1. If user requests only analysis, use audit-only.
  2. If docs are missing and speed is priority, use baseline-generation.
  3. If docs are missing and full package is needed, use full-generation.
  4. If docs exist but are inconsistent, use migration.
  5. Confirm selected mode in one short question before writing files.

Startup Protocol

  1. Confirm base directory (default: current working directory).
  2. Inventory existing documentation and project context.
  3. Select mode.
  4. Gather minimum product and technical inputs.
  5. For generation and migration, run PRD workflow first.

PRD Policy

Apply PRD-first to baseline-generation, full-generation, and migration. Do not block audit-only on PRD creation.

Minimum Inputs

Collect at least:

  • product name and one-line value proposition
  • primary problem and target users
  • top user journeys (3 or more)
  • key constraints or boundaries

If missing, ask focused follow-up questions.

PRD Depth

  • PRD-draft:
    • Use when information is partial.
    • Fill all 13 sections with concise content.
    • Prefer bullets and explicit unknowns over speculative prose.
    • Mark unknowns as [Open question: ...] or [Assumed: ...].
    • Ask for confirmation before downstream docs.
  • PRD-full:
    • Use when context is strong.
    • Fill all 13 sections with concrete, testable details.
    • Include measurable goals, NFRs, risks, and phased roadmap.
    • Do not enforce paragraph quotas.

Workflows

1) Audit-Only

  1. Inventory existing files and intended purpose.
  2. Compare against target structure and template coverage.
  3. Identify missing docs, stale content, contradictions, and implementation drift.
  4. Produce gap analysis, drift analysis, and prioritized recommendations (Critical, High, Medium).
  5. Stop unless user requests migration.

2) Baseline Generation

Required files:

  • docs/prd/PRD-v1.md
  • docs/architecture/architecture.md
  • docs/README.md
  • README.md
  • CHANGELOG.md

Optional:

  • AGENTS.md
  • docs/adr/ADR-0001-TEMPLATE.md
  • docs/contributing/CONTRIBUTING.md

Order:

  1. PRD
  2. Architecture
  3. Docs index
  4. Root files
  5. Optional files if requested

3) Full Generation

Create:

  • root: README.md, AGENTS.md, CHANGELOG.md
  • docs:
    • docs/README.md
    • docs/prd/PRD-v1.md
    • docs/architecture/architecture.md
    • docs/adr/ADR-0001-TEMPLATE.md
    • docs/runbooks/deploy.md
    • docs/runbooks/incidents.md
    • docs/contributing/CONTRIBUTING.md

Order:

  1. PRD
  2. Architecture
  3. Docs index
  4. Root files
  5. ADR and runbooks
  6. Contributing guide
  7. Final validation

4) Migration

  1. Build a documentation inventory.
  2. Create migration map (old path -> new path).
  3. Ask for approval before moving or replacing files.
  4. Preserve existing information; merge instead of deleting silently.
  5. Generate missing files after migration map approval.
  6. Update links and source-of-truth ownership.

Portability Rules

  • Use whatever shell and file tools are available in runtime.
  • Do not depend on tool-specific names such as bash_tool or create_file.
  • Use paths relative to confirmed base directory unless runtime requires absolute paths.
  • Prefer idempotent operations.

Evidence Policy

Never Invent

  • product goals not discussed
  • fake KPI targets
  • legal/security claims without basis
  • personas or workflows without evidence

Always Label

  • [Assumed: ...]
  • [Inferred from codebase: <path or artifact>]
  • [Open question: ...]

Uncertainty Escalation

If missing data blocks a high-impact section:

  1. Pause that section.
  2. Ask one focused question.
  3. Offer 2-3 answer examples to unblock quickly.

Quality Gates

Before presenting:

  • Structure:
    • files required by selected mode exist
    • paths match target layout
  • Content:
    • no placeholders (TODO, TBD, lorem ipsum)
    • consistent terminology
    • internal links resolve
  • Traceability:
    • key claims map to user input, assumptions, or code evidence
    • drift findings cite specific files

Use references/checklists.md for expanded validation rubrics.

User-Facing Output

At completion:

  1. State selected mode and why.
  2. Show resulting file tree or audited file list.
  3. List assumptions and open questions.
  4. Provide top recommendations or next actions.

Design Principles

  • Treat documentation as a living system.
  • Keep docs aligned with product intent and implementation.
  • Optimize for onboarding speed and operational clarity.
  • Prefer clear, maintainable docs over exhaustive but stale docs.