Install
openclaw skills install doc-system-generatorAnalyze any software project and generate a complete, well-structured documentation system with three-track philosophy (Intent/Contract/Constraint), intelligent grouping, template derivation, and 18-dimension completeness self-check. Use when: (1) Creating documentation system for a new project, (2) Redesigning existing documentation, (3) User says "generate docs", "文档系统", "document system", "setup docs", "文档生成", "创建文档体系". Trigger: "doc system", "document system", "generate docs", "文档系统", "文档生成", "setup documentation", "doc structure"
openclaw skills install doc-system-generatorAnalyze any project → derive optimal grouping → generate complete Markdown documentation system → self-check completeness.
docs/, doc/, documentation/, or any .md files at project rootAGENTS.md, CLAUDE.md, GEMINI.md, README.mdscripts/md-sections.sh to project's scripts/ directory (create if needed)
→ Output: Project Profile (JSON) containing: techStack, modules, architecture, concerns. Show Phase 1 reasoning to user before proceeding.
For detailed signal tables and detection methods, see grouping-detection.md.
Key principle: Three-track system is the foundation. Read three-track-philosophy.md for full philosophy.
Classify each document group into tracks:
Determine template flexibility for each group:
Documents answer same class of questions?
├── No → Flexibility 1: Fully Independent
└── Yes → Reader expectations identical?
├── Yes → Flexibility 3: Fully Unified
└── No → Shared core but unique needs?
├── Yes → Flexibility 4: Mixed (unified shell + free core)
└── No → Flexibility 2: Shell Unified
Generate fixed shell (three tiers):
Derive core chapters:
Present templates to user: Show derived templates per group. User confirms or adjusts.
For detailed template derivation methods, see template-derivation.md.
Generate entry file (AGENTS.md or equivalent):
Generate meta-system doc (docs/README.md):
Generate group README for each group directory:
Generate all documents per derived templates:
Write layered disclosure rule into entry file:
## ⛔ Documentation Loading Rules (Highest Priority)
For documents exceeding 200 lines:
Step 1: Run `scripts/md-sections.sh <file>` for JSON structure
Step 2: Run `scripts/md-sections.sh <file> "Section Name"` to extract specific content
PROHIBITED: Reading full document content in one operation
| Level | Marker | Trigger | Example |
|---|---|---|---|
| 🤖 Deterministic | Direct fix | 1:1 mappable from code | API signature change → update API reference |
| 🤖👤 Semi-deterministic | [pending confirmation] | Requires intent understanding | Business logic change → update description |
| 👤 Creative | Skip, report | Requires original thinking | New module → create new document |
→ 1. Phase 0: No existing docs → proceed directly
→ 2. Phase 1: Detect Maven modules (common, client-cache, client-oss, app), identify layered architecture, find concerns (auth, caching, storage, testing)
→ 3. Phase 2: Derive 3 groups: architecture/ (by question), conventions/ (by concern), modules/ (by module)
→ 4. Phase 3: architecture=Flexibility 1, conventions=Flexibility 2, modules=Flexibility 3. Intent track in openspec/specs/, Contract in docs/modules/+docs/architecture/, Constraint in docs/conventions/+AGENTS.md
→ 5. Phase 4: Generate 22 documents + AGENTS.md + docs/README.md + group READMEs
→ 6. Phase 5: S1-S7 all pass. C2-C5 use Java-specific detection (annotations, pom.xml). H5: compare against Spring Boot doc conventions
→ 7. Phase 6: User confirms
→ 1. Phase 0: Existing docs/ with disorganized files → present two options → user chooses "Full redesign"
→ 2. Phase 1: Detect npm workspaces, identify component structure, find concerns (styling, accessibility, testing, i18n)
→ 3. Phase 2: Derive groups: components/ (by component), guides/ (by concern), architecture/ (by question)
→ 4. Phase 3: components=Flexibility 3 (all need Overview/Props/Events/Examples), guides=Flexibility 2, architecture=Flexibility 4
→ 5. Phase 4: Generate documents. Field research reveals Storybook conventions → incorporate Props/Events/Accessibility chapters
→ 6. Phase 5: S4 finds entry file missing 3 new docs → fix. H5: accessibility docs missing → flag
→ 7. Phase 6: User adds accessibility concern → regenerate
→ 1. Phase 0: No existing docs
→ 2. Phase 1: Detect CMake/workspace modules, identify ECS + Game Loop pattern, find concerns (performance, memory, scripting, asset pipeline)
→ 3. Phase 2: Derive 4 groups: systems/ (AI, rendering, physics, audio), pipelines/ (asset, build, CI), guides/ (scripting, performance, debugging), architecture/ (overview, patterns, memory model)
→ 4. Phase 3: systems=Flexibility 4 (unified shell: Overview/Integration/Performance, but unique chapters: AI has Behavior Tree, Rendering has Shader Pipeline)
→ 5. Phase 4: Generate. Field research: Unreal docs commonly cover Blueprints, C++ API, Performance budgets → incorporate
→ 6. Phase 5: H1 finds 2 subsystems without docs → flag for user
→ 7. Phase 6: User confirms
After completing the workflow:
ls -la docs/ recursively)scripts/md-sections.sh <each-file> → verify TOC sections existIf any check fails → diagnose, fix, re-verify. If user disagrees with grouping/templates → iterate from corresponding Phase.
| File | When to Read |
|---|---|
| three-track-philosophy.md | Phase 3 — Need to explain track classification or writing philosophy to user |
| grouping-detection.md | Phase 1-2 — Need detailed signal tables, architecture patterns, or quality criteria |
| template-derivation.md | Phase 3 — Need detailed flexibility judgment, fixed shell definition, or chapter derivation methods |
| completeness-checklist.md | Phase 5-6 — Need 18-dimension checklist details, dependency order, or report template |
| Script | Purpose |
|---|---|
scripts/md-sections.sh | Markdown chapter parser with three operations: (1) md-sections.sh <file> → JSON structure tree, (2) md-sections.sh <file> "Section" → extract section content, (3) md-sections.sh <file> --line <N> → locate section by line number. Deploy to project's scripts/ in Phase 0 |
| Skill | Relationship |
|---|---|
contract-doc-sync | Maintenance partner: This skill = architect (one-time generation), contract-doc-sync = property manager (ongoing drift detection + sync). This skill's generated detection configs can be reused by contract-doc-sync |