with one click
ln-100-documents-pipeline
// Creates complete project documentation system (project docs, reference, tasks, tests). Use when bootstrapping docs from scratch or regenerating all.
// Creates complete project documentation system (project docs, reference, tasks, tests). Use when bootstrapping docs from scratch or regenerating all.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | ln-100-documents-pipeline |
| description | Creates complete project documentation system (project docs, reference, tasks, tests). Use when bootstrapping docs from scratch or regenerating all. |
| license | MIT |
Paths: File paths (
references/,../ln-*) are relative to this skill directory.
Type: L1 Top Orchestrator Category: 1XX Documentation Pipeline
This skill orchestrates the creation of a complete documentation system by invoking one L2 coordinator plus 3 L2 workers. The coordinator (ln-110) delegates to 5 L3 workers for project docs; other L2 workers handle reference, tasks, and test domains. Each component validates its own output, and the orchestrator owns the final docs-quality acceptance gate.
Top-level orchestrator that creates a complete project documentation system in one invocation. Chains ln-110 coordinator + ln-120/130/140 workers sequentially, then runs global cleanup (deduplication, orphan reporting, cross-link validation).
MANDATORY READ: Load references/coordinator_runtime_contract.md, references/docs_pipeline_runtime_contract.md, references/docs_generation_summary_contract.md
Runtime family: docs-pipeline-runtime
Identifier:
docs-pipelinePhases:
PHASE_0_CONFIGPHASE_1_LEGACY_SCANPHASE_2_CONFIRMATIONPHASE_3_DELEGATEPHASE_4_QUALITY_GATEPHASE_5_CLEANUPPHASE_6_SELF_CHECKComponent summary contract:
ln-110, ln-120, ln-130, ln-140 write or return docs-generation envelopesln-100 consumes those summaries plus docs-quality checkpoints as orchestration SSOTln-100-documents-pipeline (L1 Top Orchestrator - this skill)
|- ln-110-project-docs-coordinator (L2 Coordinator)
| |- ln-111-root-docs-creator (L3 Worker) -> 5 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 always + 1 conditional
|- ln-120-reference-docs-creator (L2 Worker)
|- ln-130-tasks-docs-creator (L2 Worker)
`- ln-140-test-docs-creator (L2 Worker - optional)
This skill should be used when:
AGENTS.md canonical + CLAUDE.md import stub -> docs/) in one goAlternative: If you prefer granular control, invoke workers manually:
MANDATORY READ: Load references/docs_quality_contract.md.
Note: Each worker validates its own local output in Phase 2/3. The orchestrator still owns the final docs-quality manifest, verification, and repair loop before cleanup can continue.
The skill follows a 5-phase orchestration workflow: Legacy Migration (optional) -> User confirmation -> Invoke coordinator + workers sequentially -> Global cleanup -> Summary.
Objective: Detect non-canonical documentation, normalize any useful facts, and remove duplicate documentation paths before generation.
Trigger: Runs at pipeline start when the repo already contains documentation outside the canonical layout.
Process:
0a. Non-Canonical Source Detection:
references/legacy_detection_patterns.md:
ARCHITECTURE.md, REQUIREMENTS.md, STACK.md, API.md, DATABASE.md, DEPLOYMENT.mddocumentation/, doc/, wiki/, or docs/ with wrong structure## Architecture, ## Tech Stack, ## Requirements, etc.## Development, ## Code Style, ## Coding Standardssource_manifest: list of { path, detected_type, target_doc, confidence }0b. Fact Extraction:
references/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[] }infrastructure_extractor -> { servers[], domains[], ports[], services[], artifacts{}, cicd{} }source_notes0c. User Confirmation:
Non-Canonical 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 |
Cleanup Options:
1. NORMALIZE (recommended): Extract facts -> Archive -> Remove duplicate sources
2. ARCHIVE ONLY: Backup without extraction
3. SKIP: Leave non-canonical docs as-is (may cause duplication)
Choose option (1/2/3): _
0d. Backup and Archive:
.archive/source-docs-{timestamp}/ directory.archive/
`- source-docs-YYYY-MM-DD-HHMMSS/
|- README_cleanup.md # Rollback instructions
|- original/ # Exact copies of non-canonical files
| |- README.md
| |- ARCHITECTURE.md
| `- documentation/
`- extracted/ # Extracted facts (for reference)
|- architecture_content.md
`- principles_content.md
original/extracted/README_cleanup.md with rollback instructions0e. Context Normalization:
SOURCE_DOC_NOTES from extracted facts:
{
"SOURCE_DOC_NOTES": {
"architecture_notes": { "sections": [...], "diagrams": [...] },
"requirements_notes": { "functional": [...] },
"principles_notes": { "principles": [...] },
"tech_stack_notes": { "frontend": "...", "backend": "..." },
"api_notes": { "endpoints": [...] },
"database_notes": { "tables": [...] },
"runbook_notes": { "install_steps": [...] },
"infrastructure_notes": { "servers": [...], "domains": [...], "ports": {} }
}
}
0f. Cleanup (Non-Canonical Files):
## Architecture -> replace with link: [Architecture](docs/project/architecture.md)## Tech Stack -> replace with link: [Tech Stack](docs/project/tech_stack.md)Output: cleanup_summary { normalized_count, archived_count, skipped_count, source_doc_notes }
Objective: Check existing files, explain workflow, and get user approval.
Process:
Cleanup Summary (if Phase 0 ran):
Pre-flight Check (scan existing documentation):
AGENTS.md, CLAUDE.md, docs/README.md, docs/documentation_standards.md, docs/principles.mddocs/reference/README.md, docs/reference/adrs/, docs/reference/guides/, docs/reference/manuals/, docs/reference/research/docs/tasks/README.md, docs/tasks/kanban_board.mddocs/project/requirements.md, architecture.md, tech_stack.md, api_spec.md, database_schema.md, design_guidelines.md, infrastructure.md, runbook.mddocs/reference/guides/testing-strategy.md, tests/README.mdDocumentation Status:
Found: X existing files
Missing: Y files
Pipeline will create ONLY missing files.
Existing files will be preserved (no overwrites).
Show user what will be created:
AGENTS.md canonical + CLAUDE.md import stub + docs/README.md + documentation_standards.md + principles.md + docs/project/ via ln-110-project-docs-coordinator)Ask: "Proceed with creating missing files? (yes/no)"
Ask: "Include test documentation (tests/README.md)? (yes/no)"
Output: File scan summary + user approval + test docs preference
Objective: Create complete documentation system by invoking L2 coordinator + 4 L2 workers in order.
Process (AUTOMATIC invocations with Skill tool):
2a. Create Root + Project Documentation:
Skill(skill: "ln-110-project-docs-coordinator") -> AUTOMATICAGENTS.md canonical + CLAUDE.md @AGENTS.md import stub + docs/README.md + docs/documentation_standards.md + docs/principles.md) + Project docs (docs/project/requirements.md, architecture.md, tech_stack.md, infrastructure.md + conditional: api_spec.md, database_schema.md, design_guidelines.md, runbook.md)context_store from ln-110 result (contains TECH_STACK for ln-120)2b. Create Reference Structure + Smart Documents:
Skill(skill: "ln-120-reference-docs-creator") -> AUTOMATICcontext_store from ln-110 (TECH_STACK enables smart document creation)docs/reference/README.md + adrs/, guides/, manuals/, research/ directories + justified ADRs/Guides/Manuals2c. Create Task Management Docs:
Skill(skill: "ln-130-tasks-docs-creator") -> AUTOMATICdocs/tasks/README.md + optionally kanban_board.md (if user provides Linear config)2d. Create Test Documentation (Optional):
Skill(skill: "ln-140-test-docs-creator") -> AUTOMATICtests/README.md (test documentation with Story-Level Test Task Pattern)2e. Extract Skills from Documentation (Optional):
Skill(skill: "ln-160-docs-skill-extractor") -> AUTOMATIC.claude/commands/*.md files extracted from procedural documentation sectionsOutput: Complete documentation system with coordinator + 4 workers completed and validated
Host Skill Invocation: Skill(skill: "...", args: "...") is mandatory delegation.
SKILL.md, treat args as $ARGUMENTS, execute that skill workflow, then return here with its result/artifact.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)
- Run Global Cleanup (Phase 3) (pending)
- Show Summary (Phase 4) (pending)
Mark each as in_progress when starting, completed when worker returns success.
Objective: Remove duplicates, orphaned files, consolidate knowledge across ALL documentation.
Trigger: Only after ALL workers complete Phase 2/3 validation.
Process:
3a. Build docs-quality manifest
Create one normalized manifest from worker outputs before any cleanup:
created_files, skipped_files, and quality_inputs from ln-110, ln-120, ln-130, and ln-140quality_inputs.doc_paths and quality_inputs.owners, deduplicate paths, and fail fast if any worker omitted the normalized return contractnode {skills_repo_root}/references/scripts/docs-quality/cli.mjs manifest \
--project-root . \
--files "AGENTS.md,CLAUDE.md,docs/README.md,docs/project/requirements.md" \
--output docs/project/.audit/ln-100/docs-quality-manifest.json
3b. Run centralized docs-quality verifier
Run the shared verifier against the manifest:
node {skills_repo_root}/references/scripts/docs-quality/cli.mjs verify \
--project-root . \
--manifest docs/project/.audit/ln-100/docs-quality-manifest.json \
--output docs/project/.audit/ln-100/docs-quality-report.json
Verifier checks come from the shared docs-quality contract/rules and include:
Gate: No HIGH/CRITICAL findings may remain before Phase 3 cleanup proceeds.
3c. Bounded repair loop
If verifier reports HIGH/CRITICAL findings:
## Maintenancequality_inputs.owners[path]Record the verifier summary and doc-registry output in the Phase 5 final output.
3d. Scan for duplicate content
Read all .md files in docs/
pattern: "docs/**/*.md"Identify duplicate sections:
80% content similarity (simple word overlap check)
Determine canonical version:
Remove duplicates:
Canonical source: [Development Principles](../principles.md#development-principles)
Log results:
3e. Report unexpected files (advisory)
List all .md files in docs/
pattern: "docs/**/*.md"Check against expected structure (files created by workers + user-created reference docs)
Report findings (DO NOT move/delete/archive):
3f. Consolidate knowledge
Identify scattered information:
For each scattered concept:
Update non-SSoT files:
Canonical source: [Linear Configuration](../tasks/kanban_board.md#linear-configuration)
Log results:
3g. Cross-link validation
Scan all .md files for internal links:
[text](path)Verify link targets exist:
Fix broken links:
Add missing critical links:
Log results:
3h. Final report
Global Cleanup Complete:
Structure:
- Removed {N} duplicate sections (canonical: principles.md)
- Found {N} unexpected files (listed for user review)
- 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, unexpected files reported, knowledge consolidated, cross-links validated
Objective: Provide complete overview of created system.
Process:
List all created files with sizes:
AGENTS.md (canonical project entry point)CLAUDE.md (@AGENTS.md import stub for Claude Code)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.mdtests/README.md (if created)Show documentation system features:
Recommend next steps:
Summarize the docs-quality gate:
Verifier score: X/10Repair passes used: 0-2Remaining warnings: list LOW/MEDIUM onlyOutput: Summary message with file list, verifier status, and recommendations
project_root/
|- AGENTS.md # Canonical project entry point (map-first root)
|- CLAUDE.md # Derived Anthropic entrypoint
|- 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)
| | |- infrastructure.md # Infrastructure inventory (always)
| | `- 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)
`- tests/
`- README.md # Test documentation (optional)
Recommended workflow for new projects:
Trade-offs:
When to use manual approach instead:
All documents created by this pipeline MUST follow these rules:
| Rule | Description | Enforcement |
|---|---|---|
| NO_CODE Rule | Documents describe contracts, not implementations | No code blocks >5 lines; use tables/ASCII/links |
| Stack Adaptation | Links must match project TECH_STACK | .NET -> Microsoft docs, JS -> MDN |
| Format Priority | Tables/ASCII > Lists (enumerations only) > Text | Tables for params, config, alternatives |
These standards are enforced by L3 workers (ln-111-115), ln-120/130/140, and the shared docs-quality gate.
If any invoked skill fails:
Skill Invocation:
File Verification:
Global Cleanup:
Docs-Quality Gate:
references/scripts/docs-quality/cli.mjs to build a manifest from worker outputsStandards Compliance:
Optional reference: load references/meta_analysis_protocol.md only when the user asks for post-run meta-analysis or protocol-formatted run reflection.
Skill type: planning-coordinator. When requested, run after all phases complete. Output to chat using the planning-coordinator format.
references/legacy_detection_patterns.mdln-110-project-docs-coordinator, ln-120-reference-docs-creator, ln-130-tasks-docs-creator, ln-140-test-docs-creatorreferences/docs_quality_contract.mdreferences/scripts/docs-quality/cli.mjsBefore completing work, verify ALL checkpoints:
Source Cleanup (Phase 0 - if applicable):
.archive/source-docs-{timestamp}/original/.archive/source-docs-{timestamp}/extracted/User Confirmation (Phase 1):
Coordinator + Workers Invoked Sequentially (Phase 2):
AGENTS.md + CLAUDE.md + docs/README.md + docs/documentation_standards.md + docs/principles.md) + Project docs (docs/project/requirements.md, architecture.md, tech_stack.md + conditional files)docs/reference/README.md + directories (adrs/, guides/, manuals/, research/) + justified ADRs/Guides/Manuals based on TECH_STACKdocs/tasks/README.md + optionally kanban_board.mdtests/README.mdcreated_files, skipped_files, quality_inputs, and validation_statusFile Verification Complete:
Global Cleanup Complete (Phase 3):
Summary Displayed (Phase 4):
Error Handling (if applicable):
Output: Complete documentation system (AGENTS.md canonical + CLAUDE.md @AGENTS.md import stub + docs/ with README.md, documentation_standards.md, principles.md + optionally tests/) with global cleanup (no duplicates, orphaned files reported, consolidated knowledge, validated cross-links)
Version: 8.1.0 Last Updated: 2025-01-12