ln-120-reference-docs-creator by levnikolaevich/claude-code-skills
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-120-reference-docs-creatorPaths: 文件路径(
shared/、references/、../ln-*)是相对于技能仓库根目录的。如果在当前工作目录未找到,请定位此 SKILL.md 文件所在目录,然后向上返回一级以找到仓库根目录。如果缺少shared/目录,请通过 WebFetch 从https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}获取文件。
此技能基于项目的 TECH_STACK 创建参考文档结构(docs/reference/)和智能文档(ADRs、指南、手册)。文档仅在理由充分时创建(指具有替代方案的非平凡技术选择)。
创建参考文档目录结构(docs/reference/)及其 README 中心页,然后仅根据上下文存储中的 TECH_STACK,为理由充分的(非平凡的)技术选择生成 ADRs、指南和手册。
此技能是一个 L2 WORKER,由 ln-100-documents-pipeline 编排器调用。
在以下情况下应直接使用此技能:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
来自 ln-100(通过 ln-110 上下文存储):
{
"context_store": {
"PROJECT_NAME": "my-project",
"TECH_STACK": {
"frontend": "React 18",
"backend": "Express 4.18",
"database": "PostgreSQL 15",
"orm": "Prisma 5.0",
"auth": "JWT",
"cache": "Redis 7"
},
"DEPENDENCIES": [...],
"flags": { "hasBackend": true, "hasDatabase": true, "hasFrontend": true }
}
}
TECH_STACK 用于第 2 阶段的智能文档创建。
此技能遵循 4 阶段工作流程:创建结构 → 智能文档创建 → 验证结构 → 验证内容。第 2 阶段仅为理由充分的技术选择创建文档。
目标:建立参考文档目录和 README 中心页。
流程:
1.1 检查并创建目录:
docs/reference/adrs/ 是否存在 → 若缺失则创建docs/reference/guides/ 是否存在 → 若缺失则创建docs/reference/manuals/ 是否存在 → 若缺失则创建docs/reference/research/ 是否存在 → 若缺失则创建1.2 检查并创建 README:
docs/reference/README.md 是否存在ln-112-reference-docs-creator/references/reference_readme_template.md → docs/reference/README.md{{VERSION}} — "1.0.0"{{DATE}} — 当前日期(YYYY-MM-DD){{ADR_LIST}} — 保留为占位符(在第 4 阶段填充){{GUIDE_LIST}} — 保留为占位符(在第 4 阶段填充){{MANUAL_LIST}} — 保留为占位符(在第 4 阶段填充)1.3 输出:
docs/reference/
├── README.md # 已创建或已存在
├── adrs/ # 空,准备存放 ADRs
├── guides/ # 空,准备存放指南
├── manuals/ # 空,准备存放手册
└── research/ # 空,准备存放研究文档
目标:为理由充分的技术选择创建 ADRs、指南和手册。跳过平凡/显而易见的选择。
2.1 检查上下文存储:
context_store → 跳过阶段 2,进入阶段 3TECH_STACK → 跳过阶段 2,进入阶段 32.2 加载合理性规则:
references/tech_justification_rules.md2.3 为 ADRs 分析 TECH_STACK:
对于 TECH_STACK 中的每个类别(frontend、backend、database、orm、auth、cache):
检查是否理由充分(来自合理性规则):
frontend:如果选择 React/Vue/Angular/Svelte(存在多个选项)则理由充分backend:如果选择 Express/Fastify/NestJS/Koa(存在多个选项)则理由充分database:如果选择 PostgreSQL/MySQL/MongoDB(存在多个选项)则理由充分auth:如果选择 JWT/OAuth/Session(需要决策)则理由充分orm:如果选择 Prisma/TypeORM/Sequelize(存在多个选项)则理由充分cache:如果选择 Redis/Memcached(需要决策)则理由充分如果平凡则跳过:
如果理由充分则创建 ADR:
adr-NNN-{category}.mdshared/templates/adr_template.mdmcp__context7__resolve-library-id(technology)docs/reference/adrs/adr-NNN-{category}.md如果理由不充分则跳过:
2.4 为指南分析 TECH_STACK:
对于每个具有复杂配置的技术:
检查是否理由充分:
如果理由充分则创建指南:
NN-{technology-slug}-patterns.mdshared/templates/guide_template.mdmcp__Ref__ref_search_documentation("{technology} patterns {current_year}")docs/reference/guides/NN-{technology}-patterns.md如果是标准用法则跳过:
2.5 为手册分析 TECH_STACK:
对于每个具有复杂 API 的包:
检查是否理由充分:
如果理由充分则创建手册:
shared/templates/manual_template.mdmcp__context7__get-library-docs(topic: "API")docs/reference/manuals/{package}-{version}.md如果是平凡 API 则跳过:
2.6 报告智能创建:
✅ 智能文档创建完成:
- 创建的 ADRs:[数量](理由充分:frontend、backend、database)
- 跳过的 ADRs:[数量](平凡:cache=in-memory)
- 创建的指南:[数量]
- 跳过的指南:[数量]
- 创建的手册:[数量]
- 跳过的手册:[数量]
目标:确保 reference/README.md 符合结构要求,并自动修复违规项。
流程:
2.1 检查 SCOPE 标签:
docs/reference/README.md(前 5 行)<!-- SCOPE: ... --> 标签<!-- SCOPE: Reference documentation hub (ADRs, Guides, Manuals) with links to subdirectories -->scope_tag_added = True2.2 检查必需部分:
references/questions.md 加载预期部分## [Section Name] 标题使用编辑工具添加带占位符的部分:
## [Section Name]
{{PLACEHOLDER}}
跟踪违规:missing_sections += 1
2.3 检查维护部分:
## Maintenance 标题使用编辑工具在文件末尾添加:
## Maintenance
**Last Updated:** [current date]
**Update Triggers:**
- New ADRs added to adrs/ directory
- New guides added to guides/ directory
- New manuals added to manuals/ directory
**Verification:**
- [ ] All ADR links in registry are valid
- [ ] All guide links in registry are valid
- [ ] All manual links in registry are valid
- [ ] Placeholders {{ADR_LIST}}, {{GUIDE_LIST}}, {{MANUAL_LIST}} synced with files
跟踪违规:maintenance_added = True
2.4 检查 POSIX 文件结尾:
posix_fixed = True2.5 报告验证:
记录摘要:
✅ 结构验证完成:
- SCOPE 标签:[已添加/已存在]
- 缺失部分:[数量] 个部分已添加
- 维护部分:[已添加/已存在]
- POSIX 结尾:[已修复/合规]
如果发现违规项:"⚠️ 自动修复了 [总计] 个结构违规项"
目标:确保每个部分都使用有意义的内容回答其问题,并通过自动发现(包括阶段 2 创建的文档)填充注册表。
流程:
4.1 加载验证规范:
references/questions.md4.2 验证部分(参数化循环):
定义部分参数:
sections = [
{
"name": "Architecture Decision Records (ADRs)",
"question": "Where are architecture decisions documented?",
"directory": "docs/reference/adrs/",
"placeholder": "{{ADR_LIST}}",
"glob_pattern": "docs/reference/adrs/*.md",
"heuristics": [
"Contains link: [ADRs](adrs/) or [adrs](adrs/)",
"Mentions 'Architecture Decision Record' or 'ADR'",
"Has placeholder {{ADR_LIST}} or actual list",
"Length > 30 words"
]
},
{
"name": "Project Guides",
"question": "Where are reusable project patterns documented?",
"directory": "docs/reference/guides/",
"placeholder": "{{GUIDE_LIST}}",
"glob_pattern": "docs/reference/guides/*.md",
"heuristics": [
"Contains link: [Guides](guides/) or [guides](guides/)",
"Has placeholder {{GUIDE_LIST}} or actual list",
"Length > 20 words"
]
},
{
"name": "Package Manuals",
"question": "Where are third-party package references documented?",
"directory": "docs/reference/manuals/",
"placeholder": "{{MANUAL_LIST}}",
"glob_pattern": "docs/reference/manuals/*.md",
"heuristics": [
"Contains link: [Manuals](manuals/) or [manuals](manuals/)",
"Has placeholder {{MANUAL_LIST}} or actual list",
"Length > 20 words"
]
},
{
"name": "Research",
"question": "Where are research/investigation documents stored?",
"directory": "docs/reference/research/",
"placeholder": "{{RESEARCH_LIST}}",
"glob_pattern": "docs/reference/research/*.md",
"heuristics": [
"Contains link: [Research](research/) or [research](research/)",
"Has placeholder {{RESEARCH_LIST}} or actual list",
"Length > 20 words"
]
}
]
对于 sections 中的每个部分:
读取部分内容:
检查内容是否回答了问题:
自动发现(如果内容无效或存在占位符):
提取文件名
生成动态列表:
- [ADR-001: Frontend Framework](adrs/adr-001-frontend-framework.md)
- [02-Repository Pattern](guides/02-repository-pattern.md)
- [Axios 1.6](manuals/axios-1.6.md)
使用编辑工具将占位符替换为生成的列表
跟踪更改:sections_populated += 1
placeholders_kept += 1跳过外部 API 调用:
4.3 报告内容验证:
记录摘要:
✅ 内容验证完成:
- 已检查部分:4
- 通过自动发现填充:[数量]
- 保留占位符(无文件):[数量]
- 已有效:[数量]
docs/
└── reference/
├── README.md # 带有注册表的参考中心页
├── adrs/ # 空或包含 ADR 文件
├── guides/ # 空或包含指南文件
├── manuals/ # 空或包含手册文件
└── research/ # 空或包含研究文件
参考 README 模板:
references/reference_readme_template.md (v2.0.0) - 参考中心页,包含:
文档模板(用于阶段 2 智能创建):
shared/templates/adr_template.md - Nygard ADR 格式(7 个部分)shared/templates/guide_template.md - 模式文档(做/不做/何时)shared/templates/manual_template.md - API 参考格式shared/templates/research_template.md - 研究/探索文档合理性规则:
references/tech_justification_rules.md - 映射:类别 → 创建/跳过条件验证规范:
references/questions.md (v2.0) - 问题驱动的验证:
强制阅读: shared/references/research_tool_fallback.md
指南记录模式,而非实现:
<!-- NO_CODE_EXAMPLES: ... --> 标签 - 请遵守表格(做/不做/何时) > ASCII 图表 > 列表 > 文本
调用者:ln-110-documents-pipeline 编排器
要求:
docs/ 目录(由 ln-111-project-docs-creator 创建)创建:
docs/reference/ 目录结构及其 README 中心页在完成工作之前,验证所有检查点:
✅ 阶段 1 - 结构已创建:
docs/reference/ 目录存在docs/reference/adrs/ 目录存在docs/reference/guides/ 目录存在docs/reference/manuals/ 目录存在docs/reference/research/ 目录存在docs/reference/README.md 存在(已创建或已存在)✅ 阶段 2 - 智能文档已创建(如果提供了上下文存储):
✅ 阶段 3 - 结构已验证:
✅ 阶段 4 - 内容已验证:
✅ 报告:
强制阅读: 加载 shared/references/meta_analysis_protocol.md
技能类型:documentation-creator。在所有阶段完成后运行。使用 documentation-creator 格式输出到聊天。
标准:
语言:仅限英语
版本: 8.2.0 最后更新: 2025-01-12
每周安装次数
161
仓库
GitHub 星标数
253
首次出现
Jan 24, 2026
安全审计
安装于
claude-code146
cursor142
opencode141
gemini-cli141
codex141
github-copilot136
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. Ifshared/is missing, fetch files via WebFetch fromhttps://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}.
This skill creates the reference documentation structure (docs/reference/) and smart documents (ADRs, Guides, Manuals) based on project's TECH_STACK. Documents are created only when justified (nontrivial technology choices with alternatives).
Create the reference documentation directory structure (docs/reference/) with README hub, then generate ADRs, Guides, and Manuals only for justified (nontrivial) technology choices based on TECH_STACK from Context Store.
This skill is a L2 WORKER invoked by ln-100-documents-pipeline orchestrator.
This skill should be used directly when:
From ln-100 (via ln-110 Context Store):
{
"context_store": {
"PROJECT_NAME": "my-project",
"TECH_STACK": {
"frontend": "React 18",
"backend": "Express 4.18",
"database": "PostgreSQL 15",
"orm": "Prisma 5.0",
"auth": "JWT",
"cache": "Redis 7"
},
"DEPENDENCIES": [...],
"flags": { "hasBackend": true, "hasDatabase": true, "hasFrontend": true }
}
}
TECH_STACK is used for smart document creation in Phase 2.
The skill follows a 4-phase workflow: CREATE STRUCTURE → SMART DOCUMENT CREATION → VALIDATE STRUCTURE → VALIDATE CONTENT. Phase 2 creates documents only for justified technology choices.
Objective : Establish reference documentation directories and README hub.
Process :
1.1 Check & create directories:
docs/reference/adrs/ exists → create if missingdocs/reference/guides/ exists → create if missingdocs/reference/manuals/ exists → create if missingdocs/reference/research/ exists → create if missing1.2 Check & create README:
docs/reference/README.md existsln-112-reference-docs-creator/references/reference_readme_template.md → docs/reference/README.md{{VERSION}} — "1.0.0"{{DATE}} — current date (YYYY-MM-DD){{ADR_LIST}} — kept as placeholder (filled in Phase 4){{GUIDE_LIST}} — kept as placeholder (filled in Phase 4){{MANUAL_LIST}} — kept as placeholder (filled in Phase 4)1.3 Output :
docs/reference/
├── README.md # Created or existing
├── adrs/ # Empty, ready for ADRs
├── guides/ # Empty, ready for guides
├── manuals/ # Empty, ready for manuals
└── research/ # Empty, ready for research documents
Objective : Create ADRs, Guides, and Manuals for justified technology choices. Skip trivial/obvious selections.
2.1 Check Context Store :
context_store provided → skip Phase 2, proceed to Phase 3TECH_STACK in context_store → skip Phase 2, proceed to Phase 32.2 Load Justification Rules :
references/tech_justification_rules.md2.3 Analyze TECH_STACK for ADRs :
For each category in TECH_STACK (frontend, backend, database, orm, auth, cache):
Check if justified (from justification rules):
frontend: Justified if React/Vue/Angular/Svelte (multiple options exist)backend: Justified if Express/Fastify/NestJS/Koa (multiple options exist)database: Justified if PostgreSQL/MySQL/MongoDB (multiple options exist)auth: Justified if JWT/OAuth/Session (decision required)orm: Justified if Prisma/TypeORM/Sequelize (multiple options exist)cache: Justified if Redis/Memcached (decision required)Skip if trivial :
2.4 Analyze TECH_STACK for Guides :
For each technology with complex configuration:
Check if justified :
Create Guide if justified :
NN-{technology-slug}-patterns.mdshared/templates/guide_template.mdmcp__Ref__ref_search_documentation("{technology} patterns {current_year}")docs/reference/guides/NN-{technology}-patterns.mdSkip if standard usage :
2.5 Analyze TECH_STACK for Manuals :
For each package with complex API:
Check if justified :
Create Manual if justified :
shared/templates/manual_template.mdmcp__context7__get-library-docs(topic: "API")docs/reference/manuals/{package}-{version}.mdSkip if trivial API :
2.6 Report Smart Creation :
✅ Smart Document Creation complete:
- ADRs created: [count] (justified: frontend, backend, database)
- ADRs skipped: [count] (trivial: cache=in-memory)
- Guides created: [count]
- Guides skipped: [count]
- Manuals created: [count]
- Manuals skipped: [count]
Objective : Ensure reference/README.md complies with structural requirements and auto-fix violations.
Process :
2.1 Check SCOPE tag :
docs/reference/README.md (first 5 lines)<!-- SCOPE: ... --> tag<!-- SCOPE: Reference documentation hub (ADRs, Guides, Manuals) with links to subdirectories -->scope_tag_added = True2.2 Check required sections :
references/questions.md## [Section Name] header existsUse Edit tool to add section with placeholder:
## [Section Name]
{{PLACEHOLDER}}
Track violation: missing_sections += 1
2.3 Check Maintenance section :
## Maintenance headerUse Edit tool to add at end of file:
## Maintenance
**Last Updated:** [current date]
**Update Triggers:**
- New ADRs added to adrs/ directory
- New guides added to guides/ directory
- New manuals added to manuals/ directory
**Verification:**
- [ ] All ADR links in registry are valid
- [ ] All guide links in registry are valid
- [ ] All manual links in registry are valid
- [ ] Placeholders {{ADR_LIST}}, {{GUIDE_LIST}}, {{MANUAL_LIST}} synced with files
Track violation: maintenance_added = True
2.4 Check POSIX file endings :
posix_fixed = True2.5 Report validation :
Log summary:
✅ Structure validation complete:
- SCOPE tag: [added/present]
- Missing sections: [count] sections added
- Maintenance section: [added/present]
- POSIX endings: [fixed/compliant]
If violations found: "⚠️ Auto-fixed [total] structural violations"
Objective : Ensure each section answers its questions with meaningful content and populate registries from auto-discovery (including documents created in Phase 2).
Process :
4.1 Load validation spec :
references/questions.md4.2 Validate sections (parametric loop) :
Define section parameters:
sections = [
{
"name": "Architecture Decision Records (ADRs)",
"question": "Where are architecture decisions documented?",
"directory": "docs/reference/adrs/",
"placeholder": "{{ADR_LIST}}",
"glob_pattern": "docs/reference/adrs/*.md",
"heuristics": [
"Contains link: [ADRs](adrs/) or [adrs](adrs/)",
"Mentions 'Architecture Decision Record' or 'ADR'",
"Has placeholder {{ADR_LIST}} or actual list",
"Length > 30 words"
]
},
{
"name": "Project Guides",
"question": "Where are reusable project patterns documented?",
"directory": "docs/reference/guides/",
"placeholder": "{{GUIDE_LIST}}",
"glob_pattern": "docs/reference/guides/*.md",
"heuristics": [
"Contains link: [Guides](guides/) or [guides](guides/)",
"Has placeholder {{GUIDE_LIST}} or actual list",
"Length > 20 words"
]
},
{
"name": "Package Manuals",
"question": "Where are third-party package references documented?",
"directory": "docs/reference/manuals/",
"placeholder": "{{MANUAL_LIST}}",
"glob_pattern": "docs/reference/manuals/*.md",
"heuristics": [
"Contains link: [Manuals](manuals/) or [manuals](manuals/)",
"Has placeholder {{MANUAL_LIST}} or actual list",
"Length > 20 words"
]
},
{
"name": "Research",
"question": "Where are research/investigation documents stored?",
"directory": "docs/reference/research/",
"placeholder": "{{RESEARCH_LIST}}",
"glob_pattern": "docs/reference/research/*.md",
"heuristics": [
"Contains link: [Research](research/) or [research](research/)",
"Has placeholder {{RESEARCH_LIST}} or actual list",
"Length > 20 words"
]
}
]
For each section in sections:
Read section content :
Check if content answers question :
Auto-discovery (if content invalid or placeholder present):
Extract filenames
Generate dynamic list:
- [ADR-001: Frontend Framework](adrs/adr-001-frontend-framework.md)
- [02-Repository Pattern](guides/02-repository-pattern.md)
- [Axios 1.6](manuals/axios-1.6.md)
Use Edit tool to replace placeholder with generated list
Track change: sections_populated += 1
placeholders_kept += 14.3 Report content validation :
Log summary:
✅ Content validation complete:
- Sections checked: 4
- Populated from auto-discovery: [count]
- Placeholders kept (no files): [count]
- Already valid: [count]
docs/
└── reference/
├── README.md # Reference hub with registries
├── adrs/ # Empty or with ADR files
├── guides/ # Empty or with guide files
├── manuals/ # Empty or with manual files
└── research/ # Empty or with research files
Reference README Template :
references/reference_readme_template.md (v2.0.0) - Reference hub with:
Document Templates (for Phase 2 Smart Creation):
shared/templates/adr_template.md - Nygard ADR format (7 sections)shared/templates/guide_template.md - Pattern documentation (Do/Don't/When)shared/templates/manual_template.md - API reference formatshared/templates/research_template.md - Research/Spike documentationJustification Rules :
references/tech_justification_rules.md - Mapping: category → create/skip conditionsValidation Specification :
references/questions.md (v2.0) - Question-driven validation:
MANDATORY READ: shared/references/research_tool_fallback.md
Guides document patterns , NOT implementations:
<!-- NO_CODE_EXAMPLES: ... --> tag - FOLLOW ITTables (Do/Don't/When) > ASCII diagrams > Lists > Text
Invoked by : ln-110-documents-pipeline orchestrator
Requires :
docs/ directory (created by ln-111-project-docs-creator)Creates :
docs/reference/ directory structure with README hubBefore completing work, verify ALL checkpoints:
✅ Phase 1 - Structure Created:
docs/reference/ directory existsdocs/reference/adrs/ directory existsdocs/reference/guides/ directory existsdocs/reference/manuals/ directory existsdocs/reference/research/ directory existsdocs/reference/README.md exists (created or existing)✅ Phase 2 - Smart Documents Created (if Context Store provided):
✅ Phase 3 - Structure Validated:
✅ Phase 4 - Content Validated:
✅ Reporting:
MANDATORY READ: Load shared/references/meta_analysis_protocol.md
Skill type: documentation-creator. Run after all phases complete. Output to chat using the documentation-creator format.
Standards :
Language : English only
Version: 8.2.0 Last Updated: 2025-01-12
Weekly Installs
161
Repository
GitHub Stars
253
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code146
cursor142
opencode141
gemini-cli141
codex141
github-copilot136
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
33,600 周安装
loop 自主实验循环工具 - 自动化定时运行 AI 实验与性能测试
159 周安装
列表布局设计指南:何时使用、结构、变体与最佳实践 | UX/UI设计
159 周安装
依赖项与复用审计器 - 代码安全漏洞扫描、依赖管理优化工具
159 周安装
GCP开发最佳实践指南:Terraform、Cloud Functions、Cloud Run、Firestore与BigQuery
159 周安装
从AI工作流中移除技能指南 - 清理未使用或弃用技能完整教程
159 周安装
Hyvä Playwright 测试指南:解决 Alpine.js 冲突,编写可靠电商自动化测试
159 周安装
Create ADR if justified :
adr-NNN-{category}.mdshared/templates/adr_template.mdmcp__context7__resolve-library-id(technology)docs/reference/adrs/adr-NNN-{category}.mdSkip if not justified :
Skip external API calls :