ln-100-documents-pipeline

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Documentation Pipeline (Orchestrator)

文档流水线(编排器)

This skill orchestrates the creation of a complete documentation system by invoking L2 coordinator + 4 L2 workers. The coordinator (ln-110) delegates to 5 L3 workers for project docs; other L2 workers handle reference/tasks/test/presentation domains. Each component validates its own output.
本技能通过调用L2协调器+4个L2工作者,编排完整文档系统的创建流程。协调器(ln-110)会委托5个L3工作者生成项目文档;其他L2工作者则负责参考文档/任务文档/测试文档/演示文档领域的内容。每个组件都会自行验证输出结果。

Architecture

架构

ln-100-documents-pipeline (L1 Top Orchestrator - this skill)
├── ln-110-project-docs-coordinator (L2 Coordinator)
│   ├── ln-111-root-docs-creator (L3 Worker) → 4 docs
│   ├── ln-112-project-core-creator (L3 Worker) → 3 docs
│   ├── ln-113-backend-docs-creator (L3 Worker) → 2 conditional
│   ├── ln-114-frontend-docs-creator (L3 Worker) → 1 conditional
│   └── ln-115-devops-docs-creator (L3 Worker) → 1 conditional
├── ln-120-reference-docs-creator (L2 Worker)
├── ln-130-tasks-docs-creator (L2 Worker)
├── ln-140-test-docs-creator (L2 Worker - optional)
├── ln-150-presentation-creator (L2 Worker)
├── ln-600-docs-auditor (L2 Worker - optional)
└── ln-610-code-comments-auditor (L2 Worker - optional)
ln-100-documents-pipeline (L1 顶级编排器 - 本技能)
├── ln-110-project-docs-coordinator (L2 协调器)
│   ├── ln-111-root-docs-creator (L3 工作者) → 4份文档
│   ├── ln-112-project-core-creator (L3 工作者) → 3份文档
│   ├── ln-113-backend-docs-creator (L3 工作者) → 2份条件文档
│   ├── ln-114-frontend-docs-creator (L3 工作者) → 1份条件文档
│   └── ln-115-devops-docs-creator (L3 工作者) → 1份条件文档
├── ln-120-reference-docs-creator (L2 工作者)
├── ln-130-tasks-docs-creator (L2 工作者)
├── ln-140-test-docs-creator (L2 工作者 - 可选)
├── ln-150-presentation-creator (L2 工作者)
├── ln-600-docs-auditor (L2 工作者 - 可选)
└── ln-610-code-comments-auditor (L2 工作者 - 可选)

When to Use This Skill

何时使用本技能

This skill should be used when:
  • Start a new IT project and need complete documentation system at once
  • Use automated workflow instead of manually invoking multiple workers
  • Create entire documentation structure (CLAUDE.md → docs/ → presentation/) in one go
  • Prefer orchestrated CREATE path over manual skill chaining
  • Need automatic global cleanup (deduplication, orphaned files, consolidation)
Alternative: If you prefer granular control, invoke workers manually:
  1. ln-110-project-docs-coordinator - Root + Project docs (coordinates 5 L3 workers)
  2. ln-120-reference-docs-creator - reference/ structure
  3. ln-130-tasks-docs-creator - tasks/README.md + kanban
  4. ln-140-test-docs-creator - tests/README.md (optional)
  5. ln-150-presentation-creator - HTML presentation
Note: Each worker now validates its own output in Phase 2/3. Orchestrator handles global operations only.
在以下场景中应使用本技能:
  • 启动新的IT项目,需要一次性搭建完整的文档系统
  • 希望使用自动化工作流,而非手动调用多个工作者
  • 一键创建完整的文档结构(从CLAUDE.md到docs/再到presentation/)
  • 偏好编排式的创建路径,而非手动串联技能
  • 需要自动执行全局清理(去重、清理孤立文件、整合内容)
替代方案:如果需要更精细的控制,可以手动调用工作者:
  1. ln-110-project-docs-coordinator - 根文档+项目文档(协调5个L3工作者)
  2. ln-120-reference-docs-creator - reference/结构
  3. ln-130-tasks-docs-creator - tasks/README.md + 看板
  4. ln-140-test-docs-creator - tests/README.md(可选)
  5. ln-150-presentation-creator - HTML演示文档
注意:现在每个组件都会在阶段2/3自行验证输出结果。编排器仅负责全局操作。

How It Works

工作原理

The skill follows a 7-phase orchestration workflow: Legacy Migration (optional) → User confirmation → Invoke coordinator + 4 workers sequentially → Global cleanup → Documentation Audit (optional) → Summary. Phase 3 (validation) is intentionally skipped - each component validates its own output.

本技能遵循7阶段编排工作流:遗留文档迁移(可选) → 用户确认 → 依次调用协调器+4个工作者 → 全局清理 → 文档审计(可选) → 总结。阶段3(验证)被有意跳过——每个组件会自行验证输出结果。

Phase 0: Legacy Migration (OPTIONAL)

阶段0:遗留文档迁移(可选)

Objective: Detect existing documentation in non-standard formats, extract valuable content, and prepare for migration.
Trigger: Always runs at pipeline start. User can skip if no legacy docs or wants to keep existing structure.
Process:
0.1 Legacy Detection:
  • Scan project for non-standard documentation using patterns from
    references/legacy_detection_patterns.md
    :
    • Root .md files:
      ARCHITECTURE.md
      ,
      REQUIREMENTS.md
      ,
      STACK.md
      ,
      API.md
      ,
      DATABASE.md
      ,
      DEPLOYMENT.md
    • Legacy folders:
      documentation/
      ,
      doc/
      ,
      wiki/
      ,
      docs/
      with wrong structure
    • README.md sections:
      ## Architecture
      ,
      ## Tech Stack
      ,
      ## Requirements
      , etc.
    • CONTRIBUTING.md sections:
      ## Development
      ,
      ## Code Style
      ,
      ## Coding Standards
  • Build
    legacy_manifest
    : list of { path, detected_type, target_doc, confidence }
  • If no legacy docs found → skip to Phase 1
0.2 Content Extraction:
  • For each detected legacy file:
    • Parse markdown structure (headers, lists, code blocks)
    • Apply type-specific extractor (see
      legacy_detection_patterns.md
      ):
      • architecture_extractor
        → { layers[], components[], diagrams[] }
      • requirements_extractor
        → { functional[], non_functional[] }
      • tech_stack_extractor
        → { frontend, backend, database, versions }
      • principles_extractor
        → { principles[], anti_patterns[] }
      • api_spec_extractor
        → { endpoints[], authentication }
      • database_schema_extractor
        → { tables[], relationships[] }
      • runbook_extractor
        → { prerequisites[], install_steps[], env_vars[] }
    • Score content quality (0.0-1.0)
  • Store in
    extracted_content
    object
0.3 User Confirmation:
  • Display detected legacy files:
    📂 Legacy Documentation Detected:
    
    | File | Type | Confidence | Target |
    |------|------|------------|--------|
    | README.md (## Architecture) | architecture | HIGH | docs/project/architecture.md |
    | docs/ARCHITECTURE.md | architecture | HIGH | docs/project/architecture.md |
    | CONTRIBUTING.md (## Development) | principles | MEDIUM | docs/principles.md |
    
    🔄 Migration Options:
    1. MIGRATE (recommended): Extract → Inject → Archive → Delete
    2. ARCHIVE ONLY: Backup without extraction
    3. SKIP: Leave legacy as-is (may cause duplication)
    
    Choose option (1/2/3): _
  • If user selects "1" (MIGRATE):
    • Optional: "Review extracted content before injection? (yes/no)"
    • Confirm: "Proceed with migration and archive legacy files?"
  • If user selects "2" (ARCHIVE ONLY):
    • Confirm: "Archive legacy files to .archive/? Content will NOT be extracted."
  • If user selects "3" (SKIP):
    • Warn: "Legacy files will remain. This may cause duplication issues."
    • Proceed to Phase 1
0.4 Backup and Archive:
  • Create
    .archive/legacy-{timestamp}/
    directory
  • Structure:
    .archive/
    └── legacy-YYYY-MM-DD-HHMMSS/
        ├── README_migration.md        # Rollback instructions
        ├── original/                  # Exact copies of legacy files
        │   ├── README.md
        │   ├── ARCHITECTURE.md
        │   └── documentation/
        └── extracted/                 # Extracted content (for reference)
            ├── architecture_content.md
            └── principles_content.md
  • Copy all legacy files to
    original/
  • Save extracted content to
    extracted/
  • Generate
    README_migration.md
    with rollback instructions
0.5 Content Injection:
  • Build
    migration_context
    from extracted content:
    json
    {
      "LEGACY_CONTENT": {
        "legacy_architecture": { "sections": [...], "diagrams": [...] },
        "legacy_requirements": { "functional": [...] },
        "legacy_principles": { "principles": [...] },
        "legacy_tech_stack": { "frontend": "...", "backend": "..." },
        "legacy_api": { "endpoints": [...] },
        "legacy_database": { "tables": [...] },
        "legacy_runbook": { "install_steps": [...] }
      }
    }
  • Merge into Context Store for ln-110:
    • contextStore.LEGACY_CONTENT = migration_context
    • Workers use LEGACY_CONTENT as base content (priority over template defaults)
  • Priority order: Legacy content > Auto-discovery > Template defaults
0.6 Cleanup (Legacy Files):
  • For root-level files (README.md, CONTRIBUTING.md):
    • Do NOT delete
    • Remove migrated sections using Edit tool
    • Add links to new locations:
      • ## Architecture
        See [Architecture](docs/project/architecture.md)
      • ## Tech Stack
        See [Tech Stack](docs/project/tech_stack.md)
  • For standalone legacy files (ARCHITECTURE.md, documentation/):
    • Delete files (already backed up)
    • Log: "Deleted: ARCHITECTURE.md (migrated to docs/project/architecture.md)"
  • Clean empty legacy directories
Output:
migration_summary
{ migrated_count, archived_count, skipped_count, legacy_content }
目标:检测非标准格式的现有文档,提取有价值的内容,并为迁移做准备。
触发条件:在流水线启动时自动运行。如果没有遗留文档,或者用户希望保留现有结构,可以跳过此阶段。
流程
0.1 遗留文档检测
  • 使用
    references/legacy_detection_patterns.md
    中的规则扫描项目中的非标准文档:
    • 根目录.md文件
      ARCHITECTURE.md
      REQUIREMENTS.md
      STACK.md
      API.md
      DATABASE.md
      DEPLOYMENT.md
    • 遗留文件夹
      documentation/
      doc/
      wiki/
      docs/
      (结构不符合规范)
    • README.md章节
      ## Architecture
      ## Tech Stack
      ## Requirements
    • CONTRIBUTING.md章节
      ## Development
      ## Code Style
      ## Coding Standards
  • 构建
    legacy_manifest
    :包含{ path, detected_type, target_doc, confidence }的列表
  • 如果未检测到遗留文档 → 跳至阶段1
0.2 内容提取
  • 对每个检测到的遗留文件:
    • 解析Markdown结构(标题、列表、代码块)
    • 应用特定类型的提取器(详见
      legacy_detection_patterns.md
      ):
      • architecture_extractor
        → { layers[], components[], diagrams[] }
      • requirements_extractor
        → { functional[], non_functional[] }
      • tech_stack_extractor
        → { frontend, backend, database, versions }
      • principles_extractor
        → { principles[], anti_patterns[] }
      • api_spec_extractor
        → { endpoints[], authentication }
      • database_schema_extractor
        → { tables[], relationships[] }
      • runbook_extractor
        → { prerequisites[], install_steps[], env_vars[] }
    • 对内容质量打分(0.0-1.0)
  • 将提取结果存储在
    extracted_content
    对象中
0.3 用户确认
  • 展示检测到的遗留文件:
    📂 检测到遗留文档:
    
    | 文件 | 类型 | 置信度 | 目标位置 |
    |------|------|------------|--------|
    | README.md (## Architecture) | 架构文档 | 高 | docs/project/architecture.md |
    | docs/ARCHITECTURE.md | 架构文档 | 高 | docs/project/architecture.md |
    | CONTRIBUTING.md (## Development) | 开发原则 | 中 | docs/principles.md |
    
    🔄 迁移选项:
    1. 迁移(推荐):提取 → 注入 → 归档 → 删除
    2. 仅归档:仅备份,不提取内容
    3. 跳过:保留遗留文档(可能导致重复内容)
    
    选择选项(1/2/3):_
  • 如果用户选择“1”(迁移):
    • 可选:“是否在注入前查看提取的内容?(是/否)”
    • 确认:“是否继续执行迁移并归档遗留文档?”
  • 如果用户选择“2”(仅归档):
    • 确认:“是否将遗留文档归档至.archive/?内容不会被提取。”
  • 如果用户选择“3”(跳过):
    • 警告:“遗留文档将被保留,这可能导致内容重复问题。”
    • 跳至阶段1
0.4 备份与归档
  • 创建
    .archive/legacy-{timestamp}/
    目录
  • 目录结构:
    .archive/
    └── legacy-YYYY-MM-DD-HHMMSS/
        ├── README_migration.md        # 回滚说明
        ├── original/                  # 遗留文件的精确副本
        │   ├── README.md
        │   ├── ARCHITECTURE.md
        │   └── documentation/
        └── extracted/                 # 提取的内容(供参考)
            ├── architecture_content.md
            └── principles_content.md
  • 将所有遗留文件复制到
    original/
    目录
  • 将提取的内容保存到
    extracted/
    目录
  • 生成包含回滚说明的
    README_migration.md
0.5 内容注入
  • 从提取的内容构建
    migration_context
    json
    {
      "LEGACY_CONTENT": {
        "legacy_architecture": { "sections": [...], "diagrams": [...] },
        "legacy_requirements": { "functional": [...] },
        "legacy_principles": { "principles": [...] },
        "legacy_tech_stack": { "frontend": "...", "backend": "..." },
        "legacy_api": { "endpoints": [...] },
        "legacy_database": { "tables": [...] },
        "legacy_runbook": { "install_steps": [...] }
      }
    }
  • 将其合并到ln-110的上下文存储中:
    • contextStore.LEGACY_CONTENT = migration_context
    • 工作者会将LEGACY_CONTENT作为基础内容(优先级高于模板默认值)
  • 优先级顺序:遗留内容 > 自动发现内容 > 模板默认值
0.6 清理(遗留文件)
  • 对于根目录文件(README.md、CONTRIBUTING.md):
    • 不删除文件
    • 使用Edit工具移除已迁移的章节
    • 添加指向新位置的链接:
      • ## Architecture
        详见[架构文档](docs/project/architecture.md)
      • ## Tech Stack
        详见[技术栈](docs/project/tech_stack.md)
  • 对于独立的遗留文件(ARCHITECTURE.md、documentation/):
    • 删除文件(已备份)
    • 日志:“已删除:ARCHITECTURE.md(已迁移至docs/project/architecture.md)”
  • 清理空的遗留目录
输出
migration_summary
{ migrated_count, archived_count, skipped_count, legacy_content }

Phase 1: User Confirmation

阶段1:用户确认

Objective: Check existing files, explain workflow, and get user approval.
Process:
  1. Migration Summary (if Phase 0 ran):
    • Show: "✓ Migrated {N} legacy documents"
    • Show: "✓ Archived to .archive/legacy-{date}/"
    • Show: "✓ LEGACY_CONTENT prepared for workers"
  2. Pre-flight Check (scan existing documentation):
    • Use Glob tool to check all potential files:
      • Root docs (4 files):
        CLAUDE.md
        ,
        docs/README.md
        ,
        docs/documentation_standards.md
        ,
        docs/principles.md
      • Reference structure (5 items):
        docs/reference/README.md
        ,
        docs/reference/adrs/
        ,
        docs/reference/guides/
        ,
        docs/reference/manuals/
        ,
        docs/reference/research/
      • Tasks docs (2 files):
        docs/tasks/README.md
        ,
        docs/tasks/kanban_board.md
      • Project docs (up to 7 files):
        docs/project/requirements.md
        ,
        architecture.md
        ,
        tech_stack.md
        ,
        api_spec.md
        ,
        database_schema.md
        ,
        design_guidelines.md
        ,
        runbook.md
      • Presentation (3 items):
        docs/presentation/README.md
        ,
        presentation_final.html
        ,
        assets/
        directory
      • Test docs (2 files):
        docs/reference/guides/testing-strategy.md
        ,
        tests/README.md
    • Count existing vs missing files
    • Show user summary:
      📊 Documentation Status:
      ✓ Found: X existing files
      ✗ Missing: Y files
      
      ⚠️ Pipeline will create ONLY missing files.
      ✅ Existing files will be preserved (no overwrites).
  3. Show user what will be created:
    • Root + Project documentation (CLAUDE.md + docs/README.md + documentation_standards.md + principles.md + docs/project/ via ln-110-project-docs-coordinator)
    • Reference structure (docs/reference/ via ln-120-reference-docs-creator)
    • Task management docs (docs/tasks/ via ln-130-tasks-docs-creator)
    • Test documentation (tests/ via ln-140-test-docs-creator - optional)
    • HTML presentation (docs/presentation/ via ln-150-presentation-creator)
    • Estimated time: 15-20 minutes with interactive dialog
  4. Ask: "Proceed with creating missing files? (yes/no)"
  5. Ask: "Include test documentation (tests/README.md)? (yes/no)"
Output: File scan summary + user approval + test docs preference

目标:检查现有文件,说明工作流,并获得用户批准。
流程
  1. 迁移总结(如果执行了阶段0):
    • 展示:“✓ 已迁移{N}份遗留文档”
    • 展示:“✓ 已归档至.archive/legacy-{date}/”
    • 展示:“✓ 已为工作者准备好LEGACY_CONTENT”
  2. 预检检查(扫描现有文档):
    • 使用Glob工具检查所有潜在文件:
      • 根文档(4个文件):
        CLAUDE.md
        docs/README.md
        docs/documentation_standards.md
        docs/principles.md
      • 参考结构(5项):
        docs/reference/README.md
        docs/reference/adrs/
        docs/reference/guides/
        docs/reference/manuals/
        docs/reference/research/
      • 任务文档(2个文件):
        docs/tasks/README.md
        docs/tasks/kanban_board.md
      • 项目文档(最多7个文件):
        docs/project/requirements.md
        architecture.md
        tech_stack.md
        api_spec.md
        database_schema.md
        design_guidelines.md
        runbook.md
      • 演示文档(3项):
        docs/presentation/README.md
        presentation_final.html
        assets/
        目录
      • 测试文档(2个文件):
        docs/reference/guides/testing-strategy.md
        tests/README.md
    • 统计现有文件与缺失文件的数量
    • 向用户展示总结:
      📊 文档状态:
      ✓ 已找到:X个现有文件
      ✗ 缺失:Y个文件
      
      ⚠️ 流水线将仅创建缺失的文件。
      ✅ 现有文件将被保留(不会覆盖)。
  3. 向用户展示将创建的内容:
    • 根文档+项目文档(CLAUDE.md + docs/README.md + documentation_standards.md + principles.md + 通过ln-110-project-docs-coordinator生成的docs/project/内容)
    • 参考结构(通过ln-120-reference-docs-creator生成的docs/reference/内容)
    • 任务管理文档(通过ln-130-tasks-docs-creator生成的docs/tasks/内容)
    • 测试文档(通过ln-140-test-docs-creator生成的tests/内容 - 可选)
    • HTML演示文档(通过ln-150-presentation-creator生成的docs/presentation/内容)
    • 预计耗时:15-20分钟(包含交互式对话)
  4. 询问:“是否继续创建缺失的文件?(是/否)”
  5. 询问:“是否包含测试文档(tests/README.md)?(是/否)”
输出:文件扫描总结 + 用户批准 + 测试文档偏好设置

Phase 2: Invoke Coordinator + Workers Sequentially

阶段2:依次调用协调器+工作者

Objective: Create complete documentation system by invoking L2 coordinator + 4 L2 workers in order.
Process (AUTOMATIC invocations with Skill tool):
2.1 Create Root + Project Documentation:
  • Invocation:
    Skill(skill: "ln-110-project-docs-coordinator")
    → AUTOMATIC
  • Input: Pass
    LEGACY_CONTENT
    from Phase 0 (if migration was performed)
  • Behavior: Coordinator gathers context ONCE, then delegates to 5 L3 workers:
    • ln-111-root-docs-creator → 4 root docs (uses LEGACY_CONTENT.legacy_principles if available)
    • ln-112-project-core-creator → 3 core docs (uses LEGACY_CONTENT.legacy_architecture, legacy_requirements, legacy_tech_stack)
    • ln-113-backend-docs-creator → 2 conditional (uses LEGACY_CONTENT.legacy_api, legacy_database)
    • ln-114-frontend-docs-creator → 1 conditional (if hasFrontend)
    • ln-115-devops-docs-creator → 1 conditional (uses LEGACY_CONTENT.legacy_runbook)
  • Output: Root docs (
    CLAUDE.md
    +
    docs/README.md
    +
    docs/documentation_standards.md
    +
    docs/principles.md
    ) + Project docs (
    docs/project/requirements.md
    ,
    architecture.md
    ,
    tech_stack.md
    + conditional:
    api_spec.md
    ,
    database_schema.md
    ,
    design_guidelines.md
    ,
    runbook.md
    )
  • Store: Save
    context_store
    from ln-110 result (contains TECH_STACK for ln-120)
  • Validation: Each L3 worker validates output (SCOPE tags, Maintenance sections)
  • Verify: All documents exist before continuing
2.2 Create Reference Structure + Smart Documents:
  • Invocation:
    Skill(skill: "ln-120-reference-docs-creator")
    → AUTOMATIC
  • Input: Pass
    context_store
    from ln-110 (TECH_STACK enables smart document creation)
  • Output:
    docs/reference/README.md
    +
    adrs/
    ,
    guides/
    ,
    manuals/
    ,
    research/
    directories + justified ADRs/Guides/Manuals
  • Smart Creation: Creates documents only for nontrivial technology choices (see ln-120 justification rules)
  • Validation: ln-120 validates output in Phase 2/3
  • Verify: Reference hub exists before continuing
2.3 Create Task Management Docs:
  • Invocation:
    Skill(skill: "ln-130-tasks-docs-creator")
    → AUTOMATIC
  • Output:
    docs/tasks/README.md
    + optionally
    kanban_board.md
    (if user provides Linear config)
  • Validation: ln-130 validates output in Phase 2/3
  • Verify: Tasks README exists before continuing
2.4 Create Test Documentation (Optional):
  • Condition: If user approved test docs in Phase 1
  • Invocation:
    Skill(skill: "ln-140-test-docs-creator")
    → AUTOMATIC
  • Output:
    tests/README.md
    (test documentation with Story-Level Test Task Pattern)
  • Validation: ln-140 validates output in Phase 2/3
  • Skip: If "no" → can run ln-140-test-docs-creator later manually
2.5 Create HTML Presentation:
  • Invocation:
    Skill(skill: "ln-150-presentation-creator")
    → AUTOMATIC
  • Output:
    docs/presentation/README.md
    +
    presentation_final.html
    +
    assets/
  • Validation: ln-150 validates output in Phase 2/3
  • Verify: Presentation files exist before continuing
Output: Complete documentation system with coordinator + 4 workers completed and validated
TodoWrite format (mandatory): Add ALL invocations to todos before starting:
- Invoke ln-110-project-docs-coordinator (pending)
- Invoke ln-120-reference-docs-creator (pending)
- Invoke ln-130-tasks-docs-creator (pending)
- Invoke ln-140-test-docs-creator (pending)
- Invoke ln-150-presentation-creator (pending)
- Run Global Cleanup (Phase 4) (pending)
- Run Documentation Audit (Phase 5 - optional) (pending)
Mark each as in_progress when starting, completed when worker returns success.

目标:通过依次调用L2协调器+4个L2工作者,创建完整的文档系统。
流程(使用Skill工具自动调用):
2.1 创建根文档+项目文档
  • 调用方式
    Skill(skill: "ln-110-project-docs-coordinator")
    → 自动调用
  • 输入:传递阶段0中的
    LEGACY_CONTENT
    (如果执行了迁移)
  • 行为:协调器一次性收集上下文,然后委托给5个L3工作者:
    • ln-111-root-docs-creator → 4份根文档(如果有LEGACY_CONTENT.legacy_principles则使用该内容)
    • ln-112-project-core-creator → 3份核心文档(使用LEGACY_CONTENT.legacy_architecture、legacy_requirements、legacy_tech_stack)
    • ln-113-backend-docs-creator → 2份条件文档(使用LEGACY_CONTENT.legacy_api、legacy_database)
    • ln-114-frontend-docs-creator → 1份条件文档(如果存在前端内容)
    • ln-115-devops-docs-creator → 1份条件文档(使用LEGACY_CONTENT.legacy_runbook)
  • 输出:根文档(
    CLAUDE.md
    +
    docs/README.md
    +
    docs/documentation_standards.md
    +
    docs/principles.md
    ) + 项目文档(
    docs/project/requirements.md
    architecture.md
    tech_stack.md
    + 条件文档:
    api_spec.md
    database_schema.md
    design_guidelines.md
    runbook.md
  • 存储:保存ln-110结果中的
    context_store
    (包含供ln-120使用的TECH_STACK)
  • 验证:每个L3工作者都会验证输出结果(SCOPE标签、维护章节)
  • 确认:在继续之前,确保所有文档都已存在
2.2 创建参考结构+智能文档
  • 调用方式
    Skill(skill: "ln-120-reference-docs-creator")
    → 自动调用
  • 输入:传递ln-110的
    context_store
    (TECH_STACK用于智能文档创建)
  • 输出
    docs/reference/README.md
    +
    adrs/
    guides/
    manuals/
    research/
    目录 + 经过合理性验证的ADRs/指南/手册
  • 智能创建:仅为重要的技术选型创建文档(详见ln-120的合理性规则)
  • 验证:ln-120会在阶段2/3验证输出结果
  • 确认:在继续之前,确保参考中心已存在
2.3 创建任务管理文档
  • 调用方式
    Skill(skill: "ln-130-tasks-docs-creator")
    → 自动调用
  • 输出
    docs/tasks/README.md
    + 可选的
    kanban_board.md
    (如果用户提供了Linear配置)
  • 验证:ln-130会在阶段2/3验证输出结果
  • 确认:在继续之前,确保任务README已存在
2.4 创建测试文档(可选)
  • 条件:如果用户在阶段1批准了测试文档
  • 调用方式
    Skill(skill: "ln-140-test-docs-creator")
    → 自动调用
  • 输出
    tests/README.md
    (采用Story-Level Test Task Pattern的测试文档)
  • 验证:ln-140会在阶段2/3验证输出结果
  • 跳过:如果用户选择“否”→ 之后可以手动调用ln-140-test-docs-creator
2.5 创建HTML演示文档
  • 调用方式
    Skill(skill: "ln-150-presentation-creator")
    → 自动调用
  • 输出
    docs/presentation/README.md
    +
    presentation_final.html
    +
    assets/
  • 验证:ln-150会在阶段2/3验证输出结果
  • 确认:在继续之前,确保演示文档文件已存在
输出:完整的文档系统,协调器+4个工作者已完成并验证
TodoWrite格式(必填): 在开始前,将所有调用添加到待办事项中:
- Invoke ln-110-project-docs-coordinator (pending)
- Invoke ln-120-reference-docs-creator (pending)
- Invoke ln-130-tasks-docs-creator (pending)
- Invoke ln-140-test-docs-creator (pending)
- Invoke ln-150-presentation-creator (pending)
- Run Global Cleanup (Phase 4) (pending)
- Run Documentation Audit (Phase 5 - optional) (pending)
开始执行时标记为in_progress,工作者返回成功后标记为completed。

Phase 4: Global Cleanup and Consolidation

阶段4:全局清理与整合

Objective: Remove duplicates, orphaned files, consolidate knowledge across ALL documentation.
Trigger: Only after ALL workers complete Phase 2/3 validation.
Process:
4.1 Scan for duplicate content
  1. Read all .md files in docs/
    • Use Glob tool:
      pattern: "docs/**/*.md"
    • Store list of all documentation files
  2. Identify duplicate sections:
    • For each file:
      • Read file content
      • Extract section headers (##, ###)
      • Extract section content (text between headers)
    • Compare sections across files:
      • If 2+ sections have:
        • Same heading (case-insensitive)
        • 80% content similarity (simple word overlap check)
      • Mark as duplicate
  3. Determine canonical version:
    • Rules for canonical location:
      • "Development Principles" → principles.md (always canonical)
      • "Testing Strategy" → testing-strategy.md (always canonical)
      • "Linear Configuration" → tasks/kanban_board.md (always canonical)
      • For other duplicates: Keep in FIRST file encountered (alphabetical order)
  4. Remove duplicates:
    • For each duplicate section:
      • Use Edit tool to delete from non-canonical files
      • Use Edit tool to add link to canonical location:
        markdown
        See [Development Principles](../principles.md#development-principles) for details.
    • Track count of removed duplicates
  5. Log results:
    • "✓ Removed {count} duplicate sections"
    • List: "{section_name} removed from {file} (canonical: {canonical_file})"
4.2 Scan for orphaned files
  1. List all .md files in docs/
    • Use Glob tool:
      pattern: "docs/**/*.md"
  2. Check against expected structure:
    • Expected files (created by workers):
      • docs/CLAUDE.md
      • docs/README.md
      • docs/documentation_standards.md
      • docs/principles.md
      • docs/project/requirements.md
      • docs/project/architecture.md
      • docs/project/tech_stack.md
      • docs/project/api_spec.md (conditional)
      • docs/project/database_schema.md (conditional)
      • docs/project/design_guidelines.md (conditional)
      • docs/project/runbook.md (conditional)
      • docs/reference/README.md
      • docs/reference/adrs/*.md (user-created)
      • docs/reference/guides/*.md (user-created)
      • docs/reference/manuals/*.md (user-created)
      • docs/tasks/README.md
      • docs/tasks/kanban_board.md
      • docs/testing-strategy.md
      • tests/README.md
    • Any file NOT in this list = orphaned
  3. Move orphaned files to archive:
    • Create
      .archive/YYYY-MM-DD/
      directory (current date)
    • For each orphaned file:
      • Use Bash tool:
        mv {file_path} .archive/YYYY-MM-DD/
      • Log: "Archived {file_name} (not in expected structure)"
    • Track count
  4. Log results:
    • "✓ Archived {count} orphaned files to .archive/{date}/"
    • List archived files
4.3 Consolidate knowledge
  1. Identify scattered information:
    • Known patterns:
      • Linear config scattered: kanban_board.md + tasks/README.md
      • Development principles scattered: principles.md + architecture.md + CLAUDE.md
      • Testing info scattered: testing-strategy.md + tests/README.md + architecture.md
  2. For each scattered concept:
    • Determine Single Source of Truth (SSoT):
      • Linear config → kanban_board.md
      • Development principles → principles.md
      • Testing strategy → testing-strategy.md
  3. Update non-SSoT files:
    • Use Edit tool to replace duplicate content with link:
      markdown
      See [Linear Configuration](../tasks/kanban_board.md#linear-configuration) for team ID and settings.
    • Track consolidation count
  4. Log results:
    • "✓ Consolidated {count} scattered concepts"
    • List: "{concept} consolidated to {SSoT_file}"
4.4 Cross-link validation
  1. Scan all .md files for internal links:
    • For each file:
      • Read content
      • Extract all markdown links:
        [text](path)
      • Filter internal links (relative paths, not http://)
  2. Verify link targets exist:
    • For each link:
      • Resolve relative path
      • Check if target file exists (Glob tool)
      • If missing: Mark as broken
  3. Fix broken links:
    • For each broken link:
      • If target was archived: Update link to archive path
      • If target never existed: Remove link (convert to plain text)
    • Track fix count
  4. Add missing critical links:
    • CLAUDE.md → docs/README.md:
      • Read CLAUDE.md
      • Check for link to docs/README.md
      • If missing: Add in "Documentation Hub" section
    • docs/README.md → section READMEs:
      • Check for links to project/, reference/, tasks/, tests/ READMEs
      • If missing: Add
    • Track added links count
  5. Log results:
    • "✓ Fixed {count} broken links"
    • "✓ Added {count} missing critical links"
    • List changes
4.5 Final report
✅ Global Cleanup Complete:

Structure:
- Removed {N} duplicate sections (canonical: principles.md)
- Archived {N} orphaned files to .archive/YYYY-MM-DD/
  - list of archived files
- Consolidated {N} scattered concepts

Links:
- Fixed {N} broken links
- Added {N} missing critical links:
  - list of added links
Output: All documentation cleaned up, duplicates removed, orphaned files archived, knowledge consolidated, cross-links validated

目标:移除重复内容、孤立文件,整合所有文档中的知识。
触发条件:仅在所有工作者完成阶段2/3验证后执行。
流程
4.1 扫描重复内容
  1. 读取docs/中的所有.md文件
    • 使用Glob工具:
      pattern: "docs/**/*.md"
    • 存储所有文档文件的列表
  2. 识别重复章节
    • 对每个文件:
      • 读取文件内容
      • 提取章节标题(##、###)
      • 提取章节内容(标题之间的文本)
    • 跨文件比较章节:
      • 如果2个及以上章节满足:
        • 标题相同(不区分大小写)
        • 内容相似度>80%(简单的词汇重叠检查)
      • 标记为重复
  3. 确定标准版本
    • 标准位置规则:
      • “开发原则” → principles.md(始终为标准版本)
      • “测试策略” → testing-strategy.md(始终为标准版本)
      • “Linear配置” → tasks/kanban_board.md(始终为标准版本)
      • 其他重复内容:保留在按字母顺序第一个出现的文件中
  4. 移除重复内容
    • 对每个重复章节:
      • 使用Edit工具从非标准文件中删除该章节
      • 使用Edit工具添加指向标准位置的链接:
        markdown
        详情请参阅[开发原则](../principles.md#development-principles)
    • 统计已移除的重复内容数量
  5. 记录结果
    • “✓ 已移除{count}个重复章节”
    • 列表:“{section_name}已从{file}中移除(标准位置:{canonical_file})”
4.2 扫描孤立文件
  1. 列出docs/中的所有.md文件
    • 使用Glob工具:
      pattern: "docs/**/*.md"
  2. 与预期结构对比
    • 预期文件(由工作者创建):
      • docs/CLAUDE.md
      • docs/README.md
      • docs/documentation_standards.md
      • docs/principles.md
      • docs/project/requirements.md
      • docs/project/architecture.md
      • docs/project/tech_stack.md
      • docs/project/api_spec.md(条件文件)
      • docs/project/database_schema.md(条件文件)
      • docs/project/design_guidelines.md(条件文件)
      • docs/project/runbook.md(条件文件)
      • docs/reference/README.md
      • docs/reference/adrs/*.md(用户创建)
      • docs/reference/guides/*.md(用户创建)
      • docs/reference/manuals/*.md(用户创建)
      • docs/tasks/README.md
      • docs/tasks/kanban_board.md
      • docs/testing-strategy.md
      • tests/README.md
    • 不在此列表中的文件 = 孤立文件
  3. 将孤立文件归档
    • 创建
      .archive/YYYY-MM-DD/
      目录(当前日期)
    • 对每个孤立文件:
      • 使用Bash工具:
        mv {file_path} .archive/YYYY-MM-DD/
      • 日志:“已归档{file_name}(不在预期结构中)”
    • 统计数量
  4. 记录结果
    • “✓ 已将{count}个孤立文件归档至.archive/{date}/”
    • 列出已归档的文件
4.3 知识整合
  1. 识别分散的信息
    • 已知模式:
      • Linear配置分散在:kanban_board.md + tasks/README.md
      • 开发原则分散在:principles.md + architecture.md + CLAUDE.md
      • 测试信息分散在:testing-strategy.md + tests/README.md + architecture.md
  2. 对每个分散的概念
    • 确定单一可信源(SSoT):
      • Linear配置 → kanban_board.md
      • 开发原则 → principles.md
      • 测试策略 → testing-strategy.md
  3. 更新非SSoT文件
    • 使用Edit工具将重复内容替换为链接:
      markdown
      团队ID和设置详情请参阅[Linear配置](../tasks/kanban_board.md#linear-configuration)
    • 统计整合的数量
  4. 记录结果
    • “✓ 已整合{count}个分散的概念”
    • 列表:“{concept}已整合至{SSoT_file}”
4.4 交叉链接验证
  1. 扫描所有.md文件中的内部链接
    • 对每个文件:
      • 读取内容
      • 提取所有Markdown链接:
        [text](path)
      • 过滤内部链接(相对路径,非http://)
  2. 验证链接目标是否存在
    • 对每个链接:
      • 解析相对路径
      • 检查目标文件是否存在(使用Glob工具)
      • 如果不存在:标记为损坏链接
  3. 修复损坏链接
    • 对每个损坏链接:
      • 如果目标已归档:更新链接至归档路径
      • 如果目标从未存在:移除链接(转换为纯文本)
    • 统计修复的数量
  4. 添加缺失的关键链接
    • CLAUDE.md → docs/README.md
      • 读取CLAUDE.md
      • 检查是否有指向docs/README.md的链接
      • 如果缺失:在“文档中心”章节添加链接
    • docs/README.md → 各章节README
      • 检查是否有指向project/、reference/、tasks/、tests/ README的链接
      • 如果缺失:添加链接
    • 统计添加的链接数量
  5. 记录结果
    • “✓ 已修复{count}个损坏链接”
    • “✓ 已添加{count}个缺失的关键链接”
    • 列出更改内容
4.5 最终报告
✅ 全局清理完成:

结构:
- 已移除{N}个重复章节(标准位置:principles.md)
- 已将{N}个孤立文件归档至.archive/YYYY-MM-DD/
  - 已归档文件列表
- 已整合{N}个分散的概念

链接:
- 已修复{N}个损坏链接
- 已添加{N}个缺失的关键链接:
  - 已添加链接列表
输出:所有文档已清理,重复内容已移除,孤立文件已归档,知识已整合,交叉链接已验证

Phase 5: Documentation Audit (OPTIONAL)

阶段5:文档审计(可选)

Objective: Audit documentation and code comments quality.
Trigger: Only if user requests audit OR pipeline invoked with audit flags.
Process:
5.1 Ask User:
📊 Documentation Audit Options:
1. AUDIT DOCS: Run ln-600-docs-auditor (6 categories)
2. AUDIT COMMENTS: Run ln-610-code-comments-auditor (6 categories)
3. BOTH: Run both auditors
4. SKIP: Continue to summary

Choose option (1/2/3/4): _
5.2 Run Selected Auditors:
  • If AUDIT DOCS selected:
    • Invocation:
      Skill(skill: "ln-600-docs-auditor")
      → AUTOMATIC
    • Output: Compliance Score X/10 per category + Findings
  • If AUDIT COMMENTS selected:
    • Invocation:
      Skill(skill: "ln-610-code-comments-auditor")
      → AUTOMATIC
    • Output: Compliance Score X/10 per category + Findings
5.3 Show Audit Summary:
📊 Audit Results:
- Documentation Quality: X/10 overall
  - Hierarchy & Links: X/10
  - Single Source of Truth: X/10
  - ...
- Code Comments Quality: X/10 overall
  - WHY not WHAT: X/10
  - Density (15-20%): X/10
  - ...

See full reports above for detailed findings.
Output: Audit reports with compliance scores and findings

目标:审计文档和代码注释的质量。
触发条件:仅在用户请求审计,或流水线通过审计标志调用时执行。
流程
5.1 询问用户
📊 文档审计选项:
1. 审计文档:运行ln-600-docs-auditor(6个类别)
2. 审计注释:运行ln-610-code-comments-auditor(6个类别)
3. 两者都审计:运行两个审计器
4. 跳过:继续到总结

选择选项(1/2/3/4):_
5.2 运行选定的审计器
  • 如果选择“审计文档”:
    • 调用方式
      Skill(skill: "ln-600-docs-auditor")
      → 自动调用
    • 输出:每个类别的合规分数X/10 + 审计发现
  • 如果选择“审计注释”:
    • 调用方式
      Skill(skill: "ln-610-code-comments-auditor")
      → 自动调用
    • 输出:每个类别的合规分数X/10 + 审计发现
5.3 展示审计总结
📊 审计结果:
- 文档质量:总体X/10
  - 层级与链接:X/10
  - 单一可信源:X/10
  - ...
- 代码注释质量:总体X/10
  - 说明原因而非内容:X/10
  - 密度(15-20%):X/10
  - ...

详细审计发现请参阅上方完整报告。
输出:包含合规分数和审计发现的审计报告

Phase 6: Summary and Next Steps

阶段6:总结与下一步建议

Objective: Provide complete overview of created system.
Process:
  1. List all created files with sizes:
    • CLAUDE.md
      (project entry point)
    • docs/README.md
      (root documentation hub)
    • docs/documentation_standards.md
      (60 universal requirements)
    • docs/principles.md
      (11 development principles)
    • docs/project/requirements.md
      ,
      architecture.md
      ,
      tech_stack.md
      + conditional documents (3-7 total)
    • docs/reference/README.md
      (reference hub with empty adrs/, guides/, manuals/, research/ directories)
    • docs/tasks/README.md
      + optionally
      kanban_board.md
    • docs/presentation/README.md
      +
      presentation_final.html
    • tests/README.md
      (if created)
  2. Show documentation system features:
    • ✅ SCOPE tags (document boundaries defined)
    • ✅ Maintenance sections (update triggers + verification)
    • ✅ README hub (central navigation)
    • ✅ DAG structure (Directed Acyclic Graph navigation)
    • ✅ Living documentation ready
    • ✅ Deduplicated content (canonical sources only)
    • ✅ Validated cross-links (no broken links)
  3. Recommend next steps:
    • "Review generated documentation (CLAUDE.md → docs/)"
    • "Open docs/presentation/presentation_final.html in browser"
    • "Run ln-210-epic-coordinator to decompose scope into Epics"
    • "Share documentation with technical stakeholders"
Output: Summary message with file list and recommendations

目标:提供已创建系统的完整概述。
流程
  1. 列出所有已创建的文件及大小:
    • CLAUDE.md
      (项目入口)
    • docs/README.md
      (根文档中心)
    • docs/documentation_standards.md
      (60项通用要求)
    • docs/principles.md
      (11项开发原则)
    • docs/project/requirements.md
      architecture.md
      tech_stack.md
      + 条件文档(总计3-7个)
    • docs/reference/README.md
      (参考中心,包含空的adrs/、guides/、manuals/、research/目录)
    • docs/tasks/README.md
      + 可选的
      kanban_board.md
    • docs/presentation/README.md
      +
      presentation_final.html
    • tests/README.md
      (如果已创建)
  2. 展示文档系统的特性:
    • ✅ SCOPE标签(已定义文档边界)
    • ✅ 维护章节(更新触发条件+验证方式)
    • ✅ README中心(集中导航)
    • ✅ DAG结构(有向无环图导航)
    • ✅ 就绪的活文档
    • ✅ 去重后的内容(仅保留标准源)
    • ✅ 已验证的交叉链接(无损坏链接)
  3. 建议下一步操作:
    • “查看生成的文档(从CLAUDE.md到docs/)”
    • “在浏览器中打开docs/presentation/presentation_final.html”
    • “运行ln-210-epic-coordinator将范围分解为Epic”
    • “与技术利益相关者共享文档”
输出:包含文件列表和建议的总结消息

Complete Output Structure

完整输出结构

project_root/
├── CLAUDE.md                         # ← Project entry point (link to docs/)
├── docs/
│   ├── README.md                     # ← Root documentation hub (general standards)
│   ├── documentation_standards.md    # ← 60 universal requirements (Claude Code + industry standards)
│   ├── principles.md                 # ← 11 development principles (Standards First, YAGNI, KISS, DRY, etc.)
│   ├── project/
│   │   ├── requirements.md           # ← Functional Requirements (NO NFR per project policy)
│   │   ├── architecture.md           # ← arc42-based architecture with C4 Model
│   │   ├── tech_stack.md             # ← Technology versions, Docker config
│   │   ├── api_spec.md               # ← API endpoints (conditional)
│   │   ├── database_schema.md        # ← Database schema (conditional)
│   │   ├── design_guidelines.md      # ← UI/UX system (conditional)
│   │   └── runbook.md                # ← Operations guide (conditional)
│   ├── reference/
│   │   ├── README.md                 # ← Reference documentation hub (registries)
│   │   ├── adrs/                     # ← Empty, ready for ADRs
│   │   ├── guides/                   # ← Empty, ready for guides
│   │   ├── manuals/                  # ← Empty, ready for manuals
│   │   └── research/                 # ← Empty, ready for research
│   ├── tasks/
│   │   ├── README.md                 # ← Task management system rules
│   │   └── kanban_board.md           # ← Linear integration (optional)
│   └── presentation/
│       ├── README.md                 # ← Navigation hub for presentation
│       ├── presentation_final.html   # ← Final standalone HTML (~130-180 KB)
│       └── assets/                   # ← Modular HTML structure
└── tests/
    └── README.md                     # ← Test documentation (optional)

project_root/
├── CLAUDE.md                         # ← 项目入口(指向docs/的链接)
├── docs/
│   ├── README.md                     # ← 根文档中心(通用标准)
│   ├── documentation_standards.md    # ← 60项通用要求(Claude Code + 行业标准)
│   ├── principles.md                 # ← 11项开发原则(标准优先、YAGNI、KISS、DRY等)
│   ├── project/
│   │   ├── requirements.md           # ← 功能需求(根据项目政策,不包含非功能需求)
│   │   ├── architecture.md           # ← 基于arc42和C4模型的架构文档
│   │   ├── tech_stack.md             # ← 技术版本、Docker配置
│   │   ├── api_spec.md               # ← API端点(条件文档)
│   │   ├── database_schema.md        # ← 数据库 schema(条件文档)
│   │   ├── design_guidelines.md      # ← UI/UX系统(条件文档)
│   │   └── runbook.md                # ← 操作指南(条件文档)
│   ├── reference/
│   │   ├── README.md                 # ← 参考文档中心(注册表)
│   │   ├── adrs/                     # ← 空目录,用于存放ADR
│   │   ├── guides/                   # ← 空目录,用于存放指南
│   │   ├── manuals/                  # ← 空目录,用于存放手册
│   │   └── research/                 # ← 空目录,用于存放研究文档
│   ├── tasks/
│   │   ├── README.md                 # ← 任务管理系统规则
│   │   └── kanban_board.md           # ← Linear集成(可选)
│   └── presentation/
│       ├── README.md                 # ← 演示文档导航中心
│       ├── presentation_final.html   # ← 最终独立HTML文档(约130-180 KB)
│       └── assets/                   # ← 模块化HTML结构
└── tests/
    └── README.md                     # ← 测试文档(可选)

Integration with Project Workflow

与项目工作流的集成

Recommended workflow for new projects:
  1. ln-100-documents-pipeline (this skill) - Create complete documentation system
  2. ln-210-epic-coordinator - Decompose scope into Epics (Linear Projects)
  3. ln-220-story-coordinator - Create User Stories for each Epic (automatic decomposition + replan)
  4. ln-300-task-coordinator - Break down Stories into implementation tasks (automatic decomposition + replan)
  5. ln-310-story-validator - Verify Stories before development
  6. ln-400-story-executor - Orchestrate Story implementation
  7. ln-500-story-quality-gate - Review completed Stories

新项目推荐工作流
  1. ln-100-documents-pipeline(本技能)- 创建完整的文档系统
  2. ln-210-epic-coordinator - 将范围分解为Epic(Linear项目)
  3. ln-220-story-coordinator - 为每个Epic创建用户故事(自动分解+重新规划)
  4. ln-300-task-coordinator - 将用户故事拆分为实现任务(自动分解+重新规划)
  5. ln-310-story-validator - 在开发前验证用户故事
  6. ln-400-story-executor - 编排用户故事的实现
  7. ln-500-story-quality-gate - 审核已完成的用户故事

Advantages of Orchestrator Approach

编排器方式的优势

Benefits:
  • ✅ Single command creates complete system
  • ✅ No need to remember skill sequence
  • ✅ Automated skill chaining
  • ✅ Consistent output every time
  • ✅ Time-saving (one invocation vs 2-3 manual invocations)
  • Idempotent: Safe to run multiple times - preserves existing files, creates only missing ones
  • Pre-flight check: Shows file scan summary before execution
  • Global cleanup: Automatic deduplication, orphaned files archival, knowledge consolidation
  • Validated cross-links: No broken links in documentation
Trade-offs:
  • ⚠️ Less granular control (can't skip coordinator phases)
  • ⚠️ Longer execution time (15-20 minutes)
  • ⚠️ Global cleanup runs even if only one file was created
When to use manual approach instead:
  • Need only HTML rebuild → use ln-150-presentation-creator
  • Need one specific ADR/guide/manual → use ln-002-best-practices-researcher

优点
  • ✅ 单一命令创建完整系统
  • ✅ 无需记忆技能调用顺序
  • ✅ 自动化技能串联
  • ✅ 每次输出一致
  • ✅ 节省时间(一次调用 vs 2-3次手动调用)
  • 幂等性:可安全多次运行 - 保留现有文件,仅创建缺失的文件
  • 预检检查:执行前展示文件扫描总结
  • 全局清理:自动去重、归档孤立文件、整合知识
  • 已验证的交叉链接:文档中无损坏链接
权衡
  • ⚠️ 控制粒度较低(无法跳过协调器阶段)
  • ⚠️ 执行时间较长(15-20分钟)
  • ⚠️ 即使仅创建了一个文件,也会执行全局清理
何时改用手动方式
  • 仅需重建HTML文档 → 使用ln-150-presentation-creator
  • 仅需创建一个特定的ADR/指南/手册 → 使用ln-002-best-practices-researcher

Documentation Standards

文档标准

All documents created by this pipeline MUST follow these rules:
RuleDescriptionEnforcement
NO_CODE RuleDocuments describe contracts, not implementationsNo code blocks >5 lines; use tables/ASCII/links
Stack AdaptationLinks must match project TECH_STACK.NET → Microsoft docs, JS → MDN
Format PriorityTables/ASCII > Lists (enumerations only) > TextTables for params, config, alternatives
These standards are enforced by L3 workers (ln-111-115) and audited by ln-600-docs-auditor.

本流水线创建的所有文档必须遵循以下规则:
规则描述执行方式
NO_CODE规则文档描述契约,而非实现细节代码块不得超过5行;使用表格/ASCII图/链接
技术栈适配链接必须匹配项目的TECH_STACK.NET → Microsoft文档,JS → MDN
格式优先级表格/ASCII图 > 列表(仅用于枚举) > 纯文本参数、配置、替代方案使用表格
这些标准由L3工作者(ln-111-115)执行,并由ln-600-docs-auditor进行审计。

Error Handling

错误处理

If any invoked skill fails:
  1. Notify user which skill failed
  2. Show error message from failed skill
  3. Recommend manual invocation for debugging
  4. List already completed steps (partial progress)

如果任何被调用的技能失败:
  1. 通知用户哪个技能失败
  2. 展示失败技能的错误消息
  3. 建议手动调用以进行调试
  4. 列出已完成的步骤(部分进度)

Technical Implementation Notes

技术实现说明

Skill Invocation:
  • Uses Skill tool with command parameter
  • Waits for each skill to complete before proceeding
  • Verifies output files exist before moving to next phase
File Verification:
  • Uses Glob tool to check docs/project/ structure
  • Lists file sizes for user confirmation
  • Warns if expected files missing
Global Cleanup:
  • Uses Glob tool to find all .md files
  • Uses Read tool to analyze content
  • Uses Edit tool to remove duplicates and add links
  • Uses Bash tool to archive orphaned files
Standards Compliance:
  • All output follows same standards as underlying skills
  • ISO/IEC/IEEE 29148:2018 (Requirements)
  • ISO/IEC/IEEE 42010:2022 (Architecture)
  • arc42 + C4 Model + Michael Nygard's ADR Format

技能调用
  • 使用Skill工具并传入命令参数
  • 等待每个技能完成后再继续
  • 在进入下一阶段前,验证输出文件是否存在
文件验证
  • 使用Glob工具检查docs/project/结构
  • 列出文件大小供用户确认
  • 如果预期文件缺失,发出警告
全局清理
  • 使用Glob工具查找所有.md文件
  • 使用Read工具分析内容
  • 使用Edit工具移除重复内容并添加链接
  • 使用Bash工具归档孤立文件
标准合规性
  • 所有输出遵循与底层技能相同的标准
  • 符合ISO/IEC/IEEE 29148:2018(需求)
  • 符合ISO/IEC/IEEE 42010:2022(架构)
  • 符合arc42 + C4模型 + Michael Nygard的ADR格式

Definition of Done

完成定义

Before completing work, verify ALL checkpoints:
✅ Legacy Migration (Phase 0 - if applicable):
  • Legacy detection patterns applied (Glob + Grep)
  • Legacy manifest built: { path, type, confidence, target }
  • User selected migration option (MIGRATE / ARCHIVE / SKIP)
  • If MIGRATE: Content extracted using type-specific extractors
  • Backup created:
    .archive/legacy-{timestamp}/original/
  • Extracted content saved:
    .archive/legacy-{timestamp}/extracted/
  • README_migration.md generated with rollback instructions
  • LEGACY_CONTENT prepared for Context Store
  • Legacy files cleaned up (sections removed from README.md, standalone files deleted)
✅ User Confirmation (Phase 1):
  • Migration summary shown (if Phase 0 ran)
  • Workflow explained to user (coordinator + 4 workers: ln-110 → ln-120 → ln-130 → ln-140 → ln-150)
  • User approved: "Proceed with complete documentation system creation? (yes/no)"
  • Test docs preference captured: "Include test documentation? (yes/no)"
✅ Coordinator + Workers Invoked Sequentially (Phase 2):
  • ln-110-project-docs-coordinator invoked → Output verified: Root docs (
    CLAUDE.md
    +
    docs/README.md
    +
    docs/documentation_standards.md
    +
    docs/principles.md
    ) + Project docs (
    docs/project/requirements.md
    ,
    architecture.md
    ,
    tech_stack.md
    + conditional 3-7 files)
  • ln-120-reference-docs-creator invoked → Output verified:
    docs/reference/README.md
    + directories (adrs/, guides/, manuals/, research/) + justified ADRs/Guides/Manuals based on TECH_STACK
  • ln-130-tasks-docs-creator invoked → Output verified:
    docs/tasks/README.md
    + optionally
    kanban_board.md
  • ln-140-test-docs-creator invoked (if enabled) → Output verified:
    tests/README.md
  • ln-150-presentation-creator invoked → Output verified:
    docs/presentation/README.md
    +
    presentation_final.html
    +
    assets/
  • Each component validated its own output (SCOPE tags, Maintenance sections, POSIX compliance)
✅ File Verification Complete:
  • All expected files exist (Glob tool used to verify structure)
  • File sizes listed for user confirmation
  • Warning displayed if expected files missing
✅ Global Cleanup Complete (Phase 4):
  • 4.1: Duplicate sections identified and removed (>80% similarity)
  • 4.1: Links added to canonical locations (principles.md, testing-strategy.md, kanban_board.md)
  • 4.2: Orphaned files archived to
    .archive/YYYY-MM-DD/
  • 4.3: Scattered concepts consolidated to Single Source of Truth (SSoT)
  • 4.4: Internal links validated (broken links fixed, critical links added)
  • 4.5: Final report generated (counts, lists, actions)
✅ Documentation Audit (Phase 5 - if selected):
  • User selected audit option (AUDIT DOCS / AUDIT COMMENTS / BOTH / SKIP)
  • If AUDIT DOCS: ln-600-docs-auditor invoked, compliance score displayed
  • If AUDIT COMMENTS: ln-610-code-comments-auditor invoked, compliance score displayed
  • Audit summary shown with scores per category
✅ Summary Displayed (Phase 6):
  • All created files listed with sizes
  • Documentation system features highlighted (SCOPE tags, Maintenance sections, README hubs, DAG structure, deduplicated content, validated links)
  • Next steps recommended (ln-210-epic-coordinator)
✅ Error Handling (if applicable):
  • If any worker failed: User notified which worker failed, error message shown, manual invocation recommended, partial progress listed
Output: Complete documentation system (CLAUDE.md + docs/ with README.md, documentation_standards.md, principles.md + presentation/ + optionally tests/) with global cleanup (no duplicates, no orphaned files, consolidated knowledge, validated cross-links)

Version: 8.1.0 (Added Documentation Standards section with NO_CODE, Stack Adaptation, Format Priority rules) Last Updated: 2025-01-12
在完成工作前,验证所有检查点:
✅ 遗留文档迁移(阶段0 - 如适用)
  • 已应用遗留文档检测规则(Glob + Grep)
  • 已构建legacy manifest:{ path, type, confidence, target }
  • 用户已选择迁移选项(迁移/仅归档/跳过)
  • 如果是迁移:已使用特定类型的提取器提取内容
  • 已创建备份:
    .archive/legacy-{timestamp}/original/
  • 已保存提取的内容:
    .archive/legacy-{timestamp}/extracted/
  • 已生成包含回滚说明的README_migration.md
  • 已为上下文存储准备好LEGACY_CONTENT
  • 已清理遗留文件(从README.md中移除章节,删除独立文件)
✅ 用户确认(阶段1)
  • 已展示迁移总结(如果执行了阶段0)
  • 已向用户说明工作流(协调器+4个工作者:ln-110 → ln-120 → ln-130 → ln-140 → ln-150)
  • 用户已批准:“是否继续创建完整的文档系统?(是/否)”
  • 已捕获测试文档偏好:“是否包含测试文档?(是/否)”
✅ 协调器+工作者已依次调用(阶段2)
  • 已调用ln-110-project-docs-coordinator → 输出已验证:根文档(
    CLAUDE.md
    +
    docs/README.md
    +
    docs/documentation_standards.md
    +
    docs/principles.md
    ) + 项目文档(
    docs/project/requirements.md
    architecture.md
    tech_stack.md
    + 3-7个条件文件)
  • 已调用ln-120-reference-docs-creator → 输出已验证:
    docs/reference/README.md
    + 目录(adrs/、guides/、manuals/、research/) + 基于TECH_STACK的合理性ADRs/指南/手册
  • 已调用ln-130-tasks-docs-creator → 输出已验证:
    docs/tasks/README.md
    + 可选的
    kanban_board.md
  • 已调用ln-140-test-docs-creator(如果启用)→ 输出已验证:
    tests/README.md
  • 已调用ln-150-presentation-creator → 输出已验证:
    docs/presentation/README.md
    +
    presentation_final.html
    +
    assets/
  • 每个组件已自行验证输出结果(SCOPE标签、维护章节、POSIX合规性)
✅ 文件验证完成
  • 所有预期文件都已存在(使用Glob工具验证结构)
  • 已列出文件大小供用户确认
  • 如果预期文件缺失,已显示警告
✅ 全局清理完成(阶段4)
  • 4.1:已识别并移除重复章节(相似度>80%)
  • 4.1:已添加指向标准位置的链接(principles.md、testing-strategy.md、kanban_board.md)
  • 4.2:已将孤立文件归档至
    .archive/YYYY-MM-DD/
  • 4.3:已将分散的概念整合至单一可信源(SSoT)
  • 4.4:已验证内部链接修复损坏链接,添加关键链接)
  • 4.5:已生成最终报告(数量、列表、操作)
✅ 文档审计完成(阶段5 - 如选择)
  • 用户已选择审计选项(审计文档/审计注释/两者都审计/跳过)
  • 如果是审计文档:已调用ln-600-docs-auditor,已展示合规分数
  • 如果是审计注释:已调用ln-610-code-comments-auditor,已展示合规分数
  • 已展示包含各类别分数的审计总结
✅ 总结已展示(阶段6)
  • 已列出所有已创建的文件及大小
  • 已突出显示文档系统的特性(SCOPE标签、维护章节、README中心、DAG结构、去重内容、已验证链接)
  • 已推荐下一步操作(ln-210-epic-coordinator)
✅ 错误处理(如适用)
  • 如果任何工作者失败:已通知用户哪个工作者失败,已展示错误消息,已建议手动调用,已列出已完成的步骤
输出:完整的文档系统(CLAUDE.md + 包含README.md、documentation_standards.md、principles.md的docs/ + presentation/ + 可选的tests/),并已完成全局清理(无重复内容、无孤立文件、知识已整合、交叉链接已验证)

版本:8.1.0(新增文档标准章节,包含NO_CODE、技术栈适配、格式优先级规则) 最后更新:2025-01-12