home / skills / levnikolaevich / claude-code-skills / ln-111-root-docs-creator

ln-111-root-docs-creator skill

/ln-111-root-docs-creator

This skill creates four root documentation files using coordinator data, ensuring templates, legacy content, and validation for ready AI navigation.

npx playbooks add skill levnikolaevich/claude-code-skills --skill ln-111-root-docs-creator

Review the files below or copy the command above to add this skill to your agents.

Files (6)
SKILL.md
5.3 KB
---
name: ln-111-root-docs-creator
description: Creates 4 root documentation files (CLAUDE.md, docs/README.md, documentation_standards.md, principles.md). L3 Worker invoked by ln-110-project-docs-coordinator.
---

> **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)

| File | Target Sections | Questions |
|------|-----------------|-----------|
| CLAUDE.md | Critical Rules, Documentation Navigation, Development Commands, Maintenance | Q1-Q6 |
| docs/README.md | Overview, Standards, Writing Guidelines, Quick Navigation, Maintenance | Q7-Q13 |
| docs/documentation_standards.md | Quick Reference (60+ requirements), 12 main sections, Maintenance | Q14-Q16 |
| docs/principles.md | Core Principles (8), Decision Framework, Anti-Patterns, Verification, Maintenance | Q17-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:
```json
{
  "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

Overview

This skill creates four root documentation files (CLAUDE.md, docs/README.md, documentation_standards.md, docs/principles.md) using project context supplied by the coordinator. It populates templates, migrates legacy principles when provided, self-validates structure and maintenance metadata, and returns a concise status payload. The skill is idempotent and never gathers context itself — it only uses the coordinator's Context Store.

How this skill works

On invocation by the coordinator, the skill parses the Context Store and validates required keys (PROJECT_NAME, PROJECT_DESCRIPTION). For each target file it checks existence, skips if present, otherwise copies the appropriate template, substitutes placeholders with context values, inserts [TBD: name] markers for missing data, and applies legacy principles migration when available. After writing files it runs a 22-question style self-validation (SCOPE tag, required sections, maintenance entries, POSIX endings) and auto-fixes simple issues before returning creation status.

When to use it

  • As a delegated L3 worker invoked by project-docs coordinator to initialize root docs
  • When bootstrapping new projects that need standardized AI-agent entry points
  • During migration where legacy principles should be preserved and augmented
  • When you require idempotent creation of top-level documentation files
  • When enforcement of NO_CODE_EXAMPLES and stack-specific references is needed

Best practices

  • Always run ln-110-project-docs-coordinator first; this worker expects full Context Store input
  • Provide LEGACY_CONTENT only when you want prior principles and anti-patterns migrated
  • Ensure TECH_STACK_SUMMARY accurately reflects primary stack to apply correct external link mappings
  • Keep templates under references/templates/ and update them centrally to change output patterns
  • Review and resolve all [TBD: ...] markers after creation to achieve Definition of Done

Example use cases

  • Initialize project documentation for a new Node.js service with clear navigation and dev commands
  • Migrate an older project by importing legacy principles into docs/principles.md while preserving template structure
  • Enforce documentation standards across multiple repos by running coordinator + this worker in CI
  • Create standard CLAUDE.md entrypoint for AI agents to follow repository rules and quick navigation
  • Add consistent maintenance metadata (update triggers, verification, last updated) to every new project root

FAQ

Will this skill overwrite existing files?

No. The skill is idempotent: if a target file already exists it is skipped and logged, never overwritten.

Can it gather missing project details by itself?

No. It never gathers context. All data must come from the coordinator’s Context Store; missing values become [TBD: ...] markers.