Get the FREE Ultimate OpenClaw Setup Guide →

ln-111-root-docs-creator

npx machina-cli add skill levnikolaevich/claude-code-skills/ln-111-root-docs-creator --openclaw
Files (1)
SKILL.md
5.3 KB

Paths: File paths (shared/, references/, ../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.

Root Documentation Creator

L3 Worker that creates 4 root documentation files using templates and Context Store from coordinator.

Purpose & Scope

  • Creates 4 root documentation files (entry points for AI agents)
  • Receives Context Store from ln-110-project-docs-coordinator
  • Replaces placeholders with project-specific data
  • Self-validates structure and content (22 questions)
  • Never gathers context itself; uses coordinator input

Invocation (who/when)

  • ln-110-project-docs-coordinator: ALWAYS invoked as first worker
  • Never called directly by users

Inputs

From coordinator:

  • contextStore: Key-value pairs with all placeholders
    • PROJECT_NAME, PROJECT_DESCRIPTION
    • TECH_STACK_SUMMARY
    • DEV_COMMANDS (from package.json scripts)
    • DATE (current date)
    • LEGACY_CONTENT (optional, from ln-100 Phase 0 migration):
      • legacy_principles: { principles[], anti_patterns[], conventions[] }
  • targetDir: Project root directory

LEGACY_CONTENT is used as base content when creating principles.md. Priority: Legacy > Template defaults.

Documents Created (4)

FileTarget SectionsQuestions
CLAUDE.mdCritical Rules, Documentation Navigation, Development Commands, MaintenanceQ1-Q6
docs/README.mdOverview, Standards, Writing Guidelines, Quick Navigation, MaintenanceQ7-Q13
docs/documentation_standards.mdQuick Reference (60+ requirements), 12 main sections, MaintenanceQ14-Q16
docs/principles.mdCore Principles (8), Decision Framework, Anti-Patterns, Verification, MaintenanceQ17-Q22

Workflow

Phase 1: Receive Context

  1. Parse Context Store from coordinator
  2. Validate required keys present (PROJECT_NAME, PROJECT_DESCRIPTION)
  3. Set defaults for missing optional keys

Phase 2: Create Documents

For each document (CLAUDE.md, docs/README.md, documentation_standards.md, principles.md):

  1. Check if file exists (idempotent)
  2. If exists: skip with log
  3. If not exists:
    • Copy template from references/templates/
    • Check LEGACY_CONTENT for this document type:
      • For principles.md: If LEGACY_CONTENT.legacy_principles exists:
        • Use legacy_principles.principles[] as base for "## Core Principles" section
        • Use legacy_principles.anti_patterns[] for "## Anti-Patterns" section
        • Use legacy_principles.conventions[] for code style rules
        • Augment with template structure (add missing sections)
        • Mark: <!-- Migrated from legacy documentation --> at top of relevant sections
      • For other documents: Use template as-is (no legacy content applicable)
    • Replace {{PLACEHOLDER}} with Context Store values
    • Mark [TBD: X] for missing data (never leave empty placeholders)
    • Write file

Phase 3: Self-Validate

For each created document:

  1. Check SCOPE tag in first 10 lines
  2. Check required sections (from questions_root.md)
  3. Check Maintenance section (Update Triggers, Verification, Last Updated)
  4. Check POSIX endings (single newline at end)
  5. Auto-fix issues where possible

Phase 4: Return Status

Return to coordinator:

{
  "created": ["CLAUDE.md", "docs/README.md", ...],
  "skipped": [],
  "tbd_count": 3,
  "validation": "OK"
}

Critical Notes

Core Rules

  • Idempotent: Never overwrite existing files; skip and log
  • No context gathering: All data comes from coordinator's Context Store
  • TBD markers: Use [TBD: placeholder_name] for missing data, never {{PLACEHOLDER}}
  • Language: All root docs in English (universal standards)
  • SCOPE tags: Required in first 10 lines of each file

NO_CODE_EXAMPLES Rule (MANDATORY)

Root documents define navigation and standards, NOT implementations:

  • FORBIDDEN: Code blocks, implementation snippets
  • ALLOWED: Tables, links, command examples (1 line)
  • TEMPLATE RULE: All templates include <!-- NO_CODE_EXAMPLES: ... --> tag - FOLLOW IT

Stack Adaptation Rule (MANDATORY)

  • All external links must match project stack (detected in Context Store)
  • .NET project → Microsoft docs; Node.js → MDN, npm docs; Python → Python docs
  • Never mix stack references (no Python examples in .NET project)

Format Priority (MANDATORY)

Tables/ASCII > Lists (enumerations only) > Text (last resort)

Definition of Done

  • Context Store received and validated
  • 4 root documents created (or skipped if exist)
  • All placeholders replaced (or marked TBD)
  • Self-validation passed (SCOPE, sections, Maintenance, POSIX)
  • Actuality verified: all document facts match current code (paths, functions, APIs, configs exist and are accurate)
  • Status returned to coordinator

Reference Files

  • Templates: references/templates/claude_md_template.md, docs_root_readme_template.md, documentation_standards_template.md, principles_template.md
  • Questions: references/questions_root.md (Q1-Q22)

Version: 2.1.0 Last Updated: 2025-01-12

Source

git clone https://github.com/levnikolaevich/claude-code-skills/blob/master/ln-111-root-docs-creator/SKILL.mdView on GitHub

Overview

Root Documentation Creator is an L3 Worker that creates four root documentation files: CLAUDE.md, docs/README.md, docs/documentation_standards.md, and docs/principles.md, using templates and the Context Store provided by the coordinator. It validates structure, substitutes placeholders, and supports legacy content for principles when available. The workflow is initiated by ln-110-project-docs-coordinator and is idempotent to avoid overwriting existing docs.

How This Skill Works

It takes contextStore and targetDir from the coordinator, validates required keys, and then creates or skips four root docs. For missing files, it copies templates from references/templates/ and replaces placeholders with context data; for principles.md it may seed content from LEGACY_CONTENT. It then runs self-validation to ensure required sections, proper formatting, and a final newline.

When to Use It

  • When starting a new project that requires standard root docs
  • When the docs workflow is orchestrated by ln-110-project-docs-coordinator
  • When you need to seed principles.md from legacy or migrate content
  • When you want idempotent documentation creation that won't overwrite existing files
  • When project data is available via Context Store to populate placeholders

Quick Start

  1. Step 1: Ensure the coordinator provides contextStore with PROJECT_NAME, PROJECT_DESCRIPTION, TECH_STACK_SUMMARY, DEV_COMMANDS, DATE, and optional LEGACY_CONTENT, plus targetDir
  2. Step 2: Trigger the ln-111-root-docs-creator as part of the docs workflow via ln-110-project-docs-coordinator
  3. Step 3: Review created files for placeholder replacements and run self-validation

Best Practices

  • Verify required context keys are present (PROJECT_NAME, PROJECT_DESCRIPTION) before execution
  • Rely on idempotent behavior—don’t overwrite existing docs; log skips
  • Use LEGACY_CONTENT to seed principles.md only when available
  • Run the self-validation phase to verify SCOPE, sections, and end-of-file newline
  • Replace all placeholders with actual values and insert [TBD: key] where data is missing

Example Use Cases

  • Generating CLAUDE.md for a new product project
  • Creating docs/README.md with quick navigation for a new repo
  • Populating docs/documentation_standards.md from a template
  • Migrating legacy principles into docs/principles.md
  • Re-running the workflow to confirm no missing files after initial creation

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers