ln-140-test-docs-creator by levnikolaevich/claude-code-skills
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-140-test-docs-creator路径说明: 文件路径(
shared/、references/、../ln-*)是相对于技能仓库根目录的。如果在当前工作目录未找到,请定位此 SKILL.md 文件所在目录并向上返回一级以找到仓库根目录。如果缺少shared/目录,请通过 WebFetch 从https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}获取文件。
此技能用于创建和验证测试文档:testing-strategy.md(通用测试理念)和 tests/README.md(测试组织结构与故事级测试任务模式)。
创建并验证测试文档(testing-strategy.md + tests/README.md),为任何项目建立通用测试理念、基于风险的测试策略和故事级测试任务模式。
此技能是 L2 WORKER,由 ln-100-documents-pipeline 编排器调用。
在以下情况下应直接使用此技能:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
该技能遵循 3 阶段工作流程:创建 → 验证结构 → 验证内容。每个阶段都建立在前一阶段的基础上,确保完成结构和语义验证。
目标:建立测试理念和文档结构。
流程:
1.1 检查并创建目录:
docs/reference/guides/ 是否存在 → 若缺失则创建tests/ 是否存在 → 若缺失则创建tests/manual/ 是否存在 → 若缺失则创建tests/manual/results/ 是否存在 → 若缺失则创建tests/manual/results/ 添加到项目 .gitignore 中1.2 检查并创建文档文件:
docs/reference/guides/testing-strategy.md 是否存在ln-114-test-docs-creator/references/testing_strategy_template.md → docs/reference/guides/testing-strategy.md[CURRENT_DATE] — 当前日期(YYYY-MM-DD)tests/README.md 是否存在ln-114-test-docs-creator/references/tests_readme_template.md → tests/README.md{{DATE}} — 当前日期(YYYY-MM-DD)1.3 输出:
docs/reference/guides/
└── testing-strategy.md # 已创建或已存在
tests/
├── README.md # 已创建或已存在
└── manual/
└── results/ # 已创建,已添加到 .gitignore
目标:确保测试文档文件符合结构要求,并自动修复违规项。
流程:
2.1 检查 SCOPE 标签:
<!-- SCOPE: ... --> 标签<!-- SCOPE: Universal testing philosophy (Risk-Based Testing, test pyramid, isolation patterns) --><!-- SCOPE: Test organization structure (directory layout, Story-Level Test Task Pattern) -->scope_tags_added += 12.2 检查必需章节:
references/questions.md 加载预期的章节## [Section Name] 标题是否存在missing_sections += 12.3 检查维护章节:
## Maintenance 标题使用 Edit 工具在文件末尾添加:
## Maintenance
**Last Updated:** [current date]
**Update Triggers:**
- Test framework changes
- Test organization changes
- New test patterns introduced
**Verification:**
- [ ] All test examples follow current framework syntax
- [ ] Directory structure matches actual tests/
- [ ] Test runner commands are current
跟踪违规:maintenance_added += 1
2.4 检查 POSIX 文件结尾:
posix_fixed += 12.5 报告验证结果:
记录摘要:
✅ 结构验证完成:
如果发现违规项:"⚠️ 已自动修复 [总计] 个结构违规项"
目标:确保每个章节都使用有意义的内容回答其问题,并根据自动发现的结果填充测试特定章节。
流程:
3.1 加载验证规范:
references/questions.md3.2 验证 testing-strategy.md 章节:
对于此文件,使用标准模板内容(无需自动发现):
注意:testing-strategy.md 是通用理念,无需项目特定的自动发现。
3.3 使用自动发现验证 tests/README.md 章节:
章节:Test Organization
package.json → "devDependencies" 和 "dependencies":
requirements.txt(如果是 Python 项目):
go.mod(如果是 Go 项目):
framework_detected = "[framework]"framework_detected = None"tests/e2e/**/*.{js,ts,py,go}""tests/integration/**/*.{js,ts,py,go}""tests/unit/**/*.{js,ts,py,go}"e2e_count = len(e2e_files)integration_count = len(integration_files)unit_count = len(unit_files)创建占位符结构:
tests/
e2e/ (empty, ready for E2E tests)
integration/ (empty, ready for Integration tests)
unit/ (empty, ready for Unit tests)
记录:"✓ 已创建测试目录结构(将在故事测试任务执行期间填充)"
*.test.js → "*.test.js" 约定*.spec.ts → "*.spec.ts" 约定test_*.py → "test_*.py" 约定*_test.go → "*_test.go" 约定章节:Running Tests
package.json → "scripts" → "test""jest" → 测试运行器:"npm test"(运行 jest)"vitest" → 测试运行器:"npm test"(运行 vitest)"mocha" → 测试运行器:"npm test"(运行 mocha)package.json → "scripts" 中是否存在:
3.4 报告内容验证结果:
记录摘要:
✅ 内容验证完成:
docs/reference/guides/
└── testing-strategy.md # 通用测试理念(465 行)
tests/
└── README.md # 测试组织 + 故事级模式(112 行)
注意:实际的测试目录(e2e/, integration/, unit/)在故事测试任务执行期间或在阶段 3(如果缺失)创建。
<!-- SCOPE: ... --> 标签shared/references/risk_based_testing_guide.md测试策略模板:
references/testing_strategy_template.md - 包含以下内容的通用测试理念:
测试 README 模板:
references/tests_readme_template.md - 包含以下内容的测试组织:
验证规范:
references/questions.md (v1.0.0) - 基于问题的验证:
调用者:ln-110-documents-pipeline 编排器
要求:
docs/reference/guides/ 目录(由 ln-112-reference-docs-creator 创建,或在阶段 1 缺失时创建)创建:
docs/reference/guides/testing-strategy.md(通用测试理念)tests/README.md(测试组织结构)在完成工作之前,请验证所有检查点:
✅ 结构已创建(阶段 1):
docs/reference/guides/ 目录存在tests/ 目录存在tests/manual/ 目录存在tests/manual/results/ 目录存在tests/manual/results/ 已添加到 .gitignoretesting-strategy.md 存在(已创建或已存在)tests/README.md 存在(已创建或已存在)✅ 结构已验证(阶段 2):
✅ 内容已验证(阶段 3):
✅ 报告:
标准:
语言:仅限英文
自动发现支持:
版本: 7.2.0 最后更新: 2026-01-15
每周安装数
161
仓库
GitHub 星标数
245
首次出现
Jan 24, 2026
安全审计
安装于
claude-code145
gemini-cli144
opencode144
cursor143
codex142
github-copilot138
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 and validates test documentation: testing-strategy.md (universal testing philosophy) + tests/README.md (test organization structure and Story-Level Test Task Pattern).
Creates and validates test documentation (testing-strategy.md + tests/README.md) establishing universal testing philosophy, Risk-Based Testing strategy, and Story-Level Test Task Pattern for any project.
This skill is a L2 WORKER invoked by ln-100-documents-pipeline orchestrator.
This skill should be used directly when:
The skill follows a 3-phase workflow: CREATE → VALIDATE STRUCTURE → VALIDATE CONTENT. Each phase builds on the previous, ensuring complete structure and semantic validation.
Objective : Establish test philosophy and documentation structure.
Process :
1.1 Check & create directories:
docs/reference/guides/ exists → create if missingtests/ exists → create if missingtests/manual/ exists → create if missingtests/manual/results/ exists → create if missingtests/manual/results/ to project .gitignore if not present1.2 Check & create documentation files:
Check if docs/reference/guides/testing-strategy.md exists
If exists:
If NOT exists:
ln-114-test-docs-creator/references/testing_strategy_template.md → docs/reference/guides/testing-strategy.md[CURRENT_DATE] — current date (YYYY-MM-DD)Check if tests/README.md exists
If exists:
If NOT exists:
1.3 Output :
docs/reference/guides/
└── testing-strategy.md # Created or existing
tests/
├── README.md # Created or existing
└── manual/
└── results/ # Created, added to .gitignore
Objective : Ensure test documentation files comply with structural requirements and auto-fix violations.
Process :
2.1 Check SCOPE tags :
<!-- SCOPE: ... --> tag in each<!-- SCOPE: Universal testing philosophy (Risk-Based Testing, test pyramid, isolation patterns) --><!-- SCOPE: Test organization structure (directory layout, Story-Level Test Task Pattern) -->scope_tags_added += 12.2 Check required sections :
references/questions.md## [Section Name] header existsmissing_sections += 12.3 Check Maintenance section :
## Maintenance headerUse Edit tool to add at end of file:
## Maintenance
**Last Updated:** [current date]
**Update Triggers:**
- Test framework changes
- Test organization changes
- New test patterns introduced
**Verification:**
- [ ] All test examples follow current framework syntax
- [ ] Directory structure matches actual tests/
- [ ] Test runner commands are current
Track violation: maintenance_added += 1
2.4 Check POSIX file endings :
posix_fixed += 12.5 Report validation :
Log summary:
✅ Structure validation complete:
If violations found: "⚠️ Auto-fixed [total] structural violations"
Objective : Ensure each section answers its questions with meaningful content and populate test-specific sections from auto-discovery.
Process :
3.1 Load validation spec :
references/questions.md3.2 Validate testing-strategy.md sections :
For this file, use standard template content (no auto-discovery needed):
Testing Philosophy section :
Test Levels section :
Note : testing-strategy.md is universal philosophy - no project-specific auto-discovery needed.
3.3 Validate tests/README.md sections with auto-discovery :
Section: Test Organization
Auto-discover test framework :
package.json → "devDependencies" and "dependencies":
requirements.txt (if Python project):
go.mod (if Go project):
framework_detected = "[framework]"framework_detected = NoneSection: Running Tests
Auto-discover test runner command :
package.json → "scripts" → "test""jest" → Test runner: "npm test" (runs jest)"vitest" → Test runner: "npm test" (runs vitest)"mocha" → Test runner: "npm test" (runs mocha)Auto-discover coverage command (optional):
3.4 Report content validation :
Log summary:
✅ Content validation complete:
docs/reference/guides/
└── testing-strategy.md # Universal testing philosophy (465 lines)
tests/
└── README.md # Test organization + Story-Level Pattern (112 lines)
Note : Actual test directories (e2e/, integration/, unit/) created during Story test task execution or Phase 3 if missing.
<!-- SCOPE: ... --> tag in first 5 linesshared/references/risk_based_testing_guide.mdTesting Strategy Template :
references/testing_strategy_template.md - Universal testing philosophy with:
Tests README Template :
references/tests_readme_template.md - Test organization with:
Validation Specification :
references/questions.md (v1.0.0) - Question-driven validation:
Invoked by : ln-110-documents-pipeline orchestrator
Requires :
docs/reference/guides/ directory (created by ln-112-reference-docs-creator or Phase 1 if missing)Creates :
docs/reference/guides/testing-strategy.md (universal testing philosophy)tests/README.md (test organization structure)Before completing work, verify ALL checkpoints:
✅ Structure Created (Phase 1):
docs/reference/guides/ directory existstests/ directory existstests/manual/ directory existstests/manual/results/ directory existstests/manual/results/ added to .gitignoretesting-strategy.md exists (created or existing)tests/README.md exists (created or existing)✅ Structure Validated (Phase 2):
✅ Content Validated (Phase 3):
✅ Reporting:
Standards :
Language : English only
Auto-Discovery Support :
Version: 7.2.0 Last Updated: 2026-01-15
Weekly Installs
161
Repository
GitHub Stars
245
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code145
gemini-cli144
opencode144
cursor143
codex142
github-copilot138
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
33,600 周安装
ln-114-test-docs-creator/references/tests_readme_template.md → tests/README.md{{DATE}} — current date (YYYY-MM-DD)Auto-discover test directory structure :
"tests/e2e/**/*.{js,ts,py,go}""tests/integration/**/*.{js,ts,py,go}""tests/unit/**/*.{js,ts,py,go}"e2e_count = len(e2e_files)integration_count = len(integration_files)unit_count = len(unit_files)Create placeholder structure:
tests/
e2e/ (empty, ready for E2E tests)
integration/ (empty, ready for Integration tests)
unit/ (empty, ready for Unit tests)
Log: "✓ Created test directory structure (will be populated during Story test task execution)"
Auto-discover naming conventions :
*.test.js → "*.test.js" convention*.spec.ts → "*.spec.ts" conventiontest_*.py → "test_*.py" convention*_test.go → "*_test.go" conventionCheck Test Organization section content :
package.json → "scripts" for:
Check Running Tests section content :