ln-111-root-docs-creator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRoot Documentation Creator
根文档创建器
L3 Worker that creates 4 root documentation files using templates and Context Store from coordinator.
这是一个L3 Worker,使用模板和协调器提供的Context Store创建4个根文档文件。
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
- 创建4个根文档文件(AI Agent的入口文件)
- 接收来自ln-110-project-docs-coordinator的Context Store
- 使用项目特定数据替换占位符
- 自我验证结构与内容(22项检查问题)
- 绝不自行收集上下文;仅使用协调器提供的输入
Invocation (who/when)
调用方式(调用方/时机)
- ln-110-project-docs-coordinator: ALWAYS invoked as first worker
- Never called directly by users
- ln-110-project-docs-coordinator: 始终作为第一个Worker被调用
- 绝不直接由用户调用
Inputs
输入参数
From coordinator:
- : Key-value pairs with all placeholders
contextStore- 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):
- : { principles[], anti_patterns[], conventions[] }
legacy_principles
- : Project root directory
targetDir
LEGACY_CONTENT is used as base content when creating principles.md. Priority: Legacy > Template defaults.
来自协调器的输入:
- :包含所有占位符的键值对
contextStore- PROJECT_NAME、PROJECT_DESCRIPTION
- TECH_STACK_SUMMARY
- DEV_COMMANDS(来自package.json的脚本)
- DATE(当前日期)
- LEGACY_CONTENT(可选,来自ln-100 Phase 0迁移):
- : { principles[], anti_patterns[], conventions[] }
legacy_principles
- : 项目根目录
targetDir
LEGACY_CONTENT在创建principles.md时用作基础内容。优先级:遗留内容 > 模板默认值
Documents Created (4)
创建的文档(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 |
| 文件 | 目标章节 | 检查问题 |
|---|---|---|
| CLAUDE.md | 关键规则、文档导航、开发命令、维护 | Q1-Q6 |
| docs/README.md | 概述、标准、写作指南、快速导航、维护 | Q7-Q13 |
| docs/documentation_standards.md | 快速参考(60+项要求)、12个主要章节、维护 | Q14-Q16 |
| docs/principles.md | 核心原则(8项)、决策框架、反模式、验证、维护 | Q17-Q22 |
Workflow
工作流
Phase 1: Receive Context
阶段1:接收上下文
- Parse Context Store from coordinator
- Validate required keys present (PROJECT_NAME, PROJECT_DESCRIPTION)
- Set defaults for missing optional keys
- 解析来自协调器的Context Store
- 验证必填键是否存在(PROJECT_NAME、PROJECT_DESCRIPTION)
- 为缺失的可选键设置默认值
Phase 2: Create Documents
阶段2:创建文档
For each document (CLAUDE.md, docs/README.md, documentation_standards.md, principles.md):
- Check if file exists (idempotent)
- If exists: skip with log
- If not exists:
- Copy template from
references/templates/ - Check LEGACY_CONTENT for this document type:
- For : If
principles.mdexists:LEGACY_CONTENT.legacy_principles- Use as base for "## Core Principles" section
legacy_principles.principles[] - Use for "## Anti-Patterns" section
legacy_principles.anti_patterns[] - Use for code style rules
legacy_principles.conventions[] - Augment with template structure (add missing sections)
- Mark: at top of relevant sections
<!-- Migrated from legacy documentation -->
- Use
- For other documents: Use template as-is (no legacy content applicable)
- For
- Replace with Context Store values
{{PLACEHOLDER}} - Mark for missing data (never leave empty placeholders)
[TBD: X] - Write file
- Copy template from
针对每个文档(CLAUDE.md、docs/README.md、documentation_standards.md、principles.md):
- 检查文件是否已存在(幂等性)
- 若已存在:跳过并记录日志
- 若不存在:
- 从复制模板
references/templates/ - 检查该文档类型的LEGACY_CONTENT:
- 对于:若
principles.md存在:LEGACY_CONTENT.legacy_principles- 使用作为“## 核心原则”章节的基础内容
legacy_principles.principles[] - 使用作为“## 反模式”章节的内容
legacy_principles.anti_patterns[] - 使用作为代码风格规则
legacy_principles.conventions[] - 结合模板结构补充(添加缺失的章节)
- 在相关章节顶部标记:
<!-- Migrated from legacy documentation -->
- 使用
- 对于其他文档:直接使用模板(不适用遗留内容)
- 对于
- 将替换为Context Store中的值
{{PLACEHOLDER}} - 对缺失的数据标记为(绝不保留空占位符)
[TBD: X] - 写入文件
- 从
Phase 3: Self-Validate
阶段3:自我验证
For each created document:
- Check SCOPE tag in first 10 lines
- Check required sections (from questions_root.md)
- Check Maintenance section (Update Triggers, Verification, Last Updated)
- Check POSIX endings (single newline at end)
- Auto-fix issues where possible
针对每个已创建的文档:
- 检查前10行中是否包含SCOPE标签
- 检查是否包含必填章节(来自questions_root.md)
- 检查维护章节(更新触发条件、验证方式、最后更新时间)
- 检查POSIX结尾(文件末尾有单个换行符)
- 尽可能自动修复问题
Phase 4: Return Status
阶段4:返回状态
Return to coordinator:
json
{
"created": ["CLAUDE.md", "docs/README.md", ...],
"skipped": [],
"tbd_count": 3,
"validation": "OK"
}向协调器返回:
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 for missing data, never
[TBD: placeholder_name]{{PLACEHOLDER}} - Language: All root docs in English (universal standards)
- SCOPE tags: Required in first 10 lines of each file
- 幂等性: 绝不覆盖现有文件;跳过并记录日志
- 禁止自行收集上下文: 所有数据均来自协调器的Context Store
- TBD标记: 对缺失数据使用,绝不使用
[TBD: placeholder_name]{{PLACEHOLDER}} - 语言: 所有根文档均使用英文(通用标准)
- SCOPE标签: 每个文件的前10行必须包含SCOPE标签
NO_CODE_EXAMPLES Rule (MANDATORY)
NO_CODE_EXAMPLES规则(强制性)
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 tag - FOLLOW IT
<!-- NO_CODE_EXAMPLES: ... -->
根文档用于定义导航与标准,而非实现细节:
- 禁止: 代码块、实现片段
- 允许: 表格、链接、单行命令示例
- 模板规则: 所有模板均包含标签 —— 必须遵守
<!-- NO_CODE_EXAMPLES: ... -->
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)
- 所有外部链接必须匹配项目技术栈(从Context Store中检测)
- .NET项目 → 微软文档;Node.js → MDN、npm文档;Python → Python官方文档
- 绝不混合技术栈引用(.NET项目中不得出现Python示例)
Format Priority (MANDATORY)
格式优先级(强制性)
Tables/ASCII > Lists (enumerations only) > Text (last resort)
表格/ASCII图表 > 列表(仅用于枚举) > 文本(最后选择)
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)
- Status returned to coordinator
- 已接收并验证Context Store
- 已创建4个根文档(或因已存在而跳过)
- 所有占位符已替换(或标记为TBD)
- 自我验证通过(SCOPE、章节、维护、POSIX结尾)
- 已向协调器返回状态
Reference Files
参考文件
- Templates: ,
references/templates/claude_md_template.md,docs_root_readme_template.md,documentation_standards_template.mdprinciples_template.md - Questions: (Q1-Q22)
references/questions_root.md
Version: 2.1.0 (Added NO_CODE, Stack Adaptation, Format Priority rules to Critical Notes)
Last Updated: 2025-01-12
- 模板:、
references/templates/claude_md_template.md、docs_root_readme_template.md、documentation_standards_template.mdprinciples_template.md - 检查问题:(Q1-Q22)
references/questions_root.md
版本: 2.1.0(在重要注意事项中新增NO_CODE、技术栈适配、格式优先级规则)
最后更新: 2025-01-12