一键导入
test-plan
Use when creating test plans from implementation and design documents. Provides test plan structure, test case tracking, and coverage guidelines.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when creating test plans from implementation and design documents. Provides test plan structure, test case tracking, and coverage guidelines.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when implementation work in this repository changes behavior, adds functionality, or fixes bugs and the user has not explicitly asked to avoid workflows. Routes the work through the project-local divedra workflow `divedra-workflows/design-and-implement-review-loop`, including design/plan alignment, implementation, review, user-facing documentation refresh, and final handoff.
Use when creating or organizing design documents. Provides directory structure, file naming, and content guidelines for design specs and references.
Use when a divedra workflow, CLI command, GraphQL control plane, event listener, or submodule integration appears to fail because of an upstream divedra bug. Requires reproducing with the local submodule, filing an issue in tacogips/divedra when the bug is real, fixing the submodule, validating it, and committing the divedra change.
Use when helping an end user run, inspect, monitor, resume, continue, rerun, or troubleshoot existing divedra workflows. Applies to workflow list/status/validate/inspect/run, session progress/status/resume/continue/rerun, GraphQL inspection, mock scenarios, workflow roots, runtime artifacts, local serve, GraphQL endpoint execution, and event-triggered workflow usage.
Use when creating, modifying, reviewing, or validating divedra workflow bundles. Applies to step-addressed workflow.json authoring, node payload files, prompt files, built-in node add-ons, cross-workflow transitions, manager/worker routing, and portable workflows under a workflow root.
Use when testing or verifying divedra workflow bundles. Applies to deterministic mock-scenario runs, workflow validate/inspect/run checks, EXPECTED_RESULTS.md updates, regression assertions, session output verification, and CI-style workflow fixture validation.
| name | test-plan |
| description | Use when creating test plans from implementation and design documents. Provides test plan structure, test case tracking, and coverage guidelines. |
| allowed-tools | Read, Write, Glob, Grep |
This skill provides guidelines for creating and managing test plans from implementation and design documents.
Apply this skill when:
Test plans bridge the gap between implementation (what was built) and verification (does it work correctly). They provide:
CRITICAL: Due to context limitations, test plans MUST use a divide-and-conquer approach.
IMPORTANT: Test plans and impl-plans do NOT need 1:1 mapping.
| Mapping | When to Use |
|---|---|
| 1:N (one impl -> multiple test plans) | Large implementations need focused test plans |
| N:1 (multiple impls -> one test plan) | Related modules can share integration tests |
| 1:1 (one impl -> one test plan) | Well-bounded features with clear test scope |
Recommended granularity:
CRITICAL: Large test plan files cause Claude Code OOM errors.
| Metric | Limit | Reason |
|---|---|---|
| Line count | MAX 400 lines | Prevents memory issues |
| Test cases per plan | MAX 15 | Keeps plans focused |
| Modules per plan | MAX 5 | Enables focused testing |
Split a test plan into multiple files when:
BEFORE: session-groups-tests.md (too large)
AFTER:
- session-groups-unit-tests.md (~200 lines)
- session-groups-integration-tests.md (~200 lines)
- session-groups-e2e-tests.md (~150 lines)
IMPORTANT: All test plans MUST be stored under test-plans/.
test-plans/
├── README.md # Index of all test plans
├── PROGRESS.json # Test status tracking (single source of truth)
├── <feature>-unit.md # Unit test plans
├── <feature>-integration.md # Integration test plans
└── <feature>-e2e.md # End-to-end test plans
Each test plan file MUST include:
# <Feature Name> Test Plan
**Status**: Planning | Ready | In Progress | Completed
**Implementation Reference**: impl-plans/<file>.md
**Source Files**: src/<path>/*.ts
**Test Type**: Unit | Integration | E2E
**Created**: YYYY-MM-DD
**Last Updated**: YYYY-MM-DD
## Test Environment
**Runtime**: Bun test
**Mocks Required**: List of mock implementations needed
**Fixtures**: List of test fixtures needed
**Setup/Teardown**: Special requirements
Each test case MUST have:
### TEST-001: <Test Case Name>
**Status**: Not Started | In Progress | Passing | Failing | Skipped
**Priority**: Critical | High | Medium | Low
**Parallelizable**: Yes | No
**Dependencies**: None | TEST-XXX | other-plan:TEST-XXX
**Target**: `src/path/file.ts:functionName`
**Description**:
Brief description of what this test verifies.
**Scenarios**:
1. Happy path: <expected behavior>
2. Edge case: <expected behavior>
3. Error case: <expected behavior>
**Assertions**:
- [ ] Assertion 1
- [ ] Assertion 2
**Test Code Location**: `src/path/file.test.ts`
## Test Status
| Test ID | Name | Status | Priority | Dependencies |
|---------|------|--------|----------|--------------|
| TEST-001 | Basic parsing | Not Started | High | None |
| TEST-002 | Error handling | Not Started | High | TEST-001 |
| TEST-003 | Edge cases | Not Started | Medium | TEST-001 |
## Coverage Targets
| Module | Current | Target | Status |
|--------|---------|--------|--------|
| src/sdk/queue/types.ts | 0% | 90% | Not Started |
| src/sdk/queue/manager.ts | 0% | 85% | Not Started |
## Completion Criteria
- [ ] All test cases implemented
- [ ] All tests passing
- [ ] Coverage targets met
- [ ] No flaky tests
- [ ] Documentation updated
## Progress Log
### Session: YYYY-MM-DD HH:MM
**Tests Completed**: TEST-001, TEST-002
**Tests In Progress**: TEST-003
**Blockers**: None
**Notes**: Discovered edge case requiring additional test
TEST-XXX where XXX is zero-padded (001, 002, etc.)<plan-name>:TEST-XXXSame-plan dependency:
**Dependencies**: TEST-001
**Dependencies**: TEST-001, TEST-002
Cross-plan dependency:
**Dependencies**: session-groups-unit:TEST-001
No dependencies:
**Dependencies**: None
Tests can be parallelized when:
Parallelizable: Yes - Test can run independently Parallelizable: No - Test depends on other tests or shared state
CRITICAL: After creating a test plan, update test-plans/PROGRESS.json.
{
"lastUpdated": "2026-01-09T16:00:00Z",
"summary": {
"totalPlans": 10,
"totalTests": 150,
"passing": 0,
"failing": 0,
"notStarted": 150
},
"plans": {
"feature-unit": {
"status": "Ready",
"testType": "Unit",
"implRef": "impl-plans/feature.md",
"tests": {
"TEST-001": { "status": "Not Started", "priority": "High", "parallelizable": true, "deps": [] },
"TEST-002": { "status": "Not Started", "priority": "High", "parallelizable": false, "deps": ["TEST-001"] }
}
}
}
}
| Status | Meaning |
|---|---|
Not Started | Test not yet implemented |
In Progress | Test being written |
Passing | Test implemented and passing |
Failing | Test implemented but failing |
Skipped | Test intentionally skipped |
| Priority | Meaning |
|---|---|
Critical | Must pass for release |
High | Should pass for release |
Medium | Important but not blocking |
Low | Nice to have |
*.test.ts adjacent to sourcetest-plans/<feature>-<type>.md| Section | Required | Format |
|---|---|---|
| Header | Yes | Markdown metadata |
| Implementation Reference | Yes | Link + summary |
| Test Environment | Yes | Requirements list |
| Test Cases | Yes | Structured format with scenarios |
| Status Table | Yes | Simple table |
| Coverage Targets | Yes | Target percentages |
| Completion Criteria | Yes | Checklist |
| Progress Log | Yes | Session entries |