specweave 0.6.8 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/README.md +1 -1
- package/CLAUDE.md +903 -99
- package/README.md +143 -207
- package/bin/specweave.js +67 -0
- package/dist/cli/commands/abandon.d.ts +13 -0
- package/dist/cli/commands/abandon.d.ts.map +1 -0
- package/dist/cli/commands/abandon.js +15 -0
- package/dist/cli/commands/abandon.js.map +1 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +90 -18
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/pause.d.ts +13 -0
- package/dist/cli/commands/pause.d.ts.map +1 -0
- package/dist/cli/commands/pause.js +15 -0
- package/dist/cli/commands/pause.js.map +1 -0
- package/dist/cli/commands/qa.d.ts +54 -0
- package/dist/cli/commands/qa.d.ts.map +1 -0
- package/dist/cli/commands/qa.js +98 -0
- package/dist/cli/commands/qa.js.map +1 -0
- package/dist/cli/commands/resume.d.ts +12 -0
- package/dist/cli/commands/resume.d.ts.map +1 -0
- package/dist/cli/commands/resume.js +14 -0
- package/dist/cli/commands/resume.js.map +1 -0
- package/dist/cli/commands/status.d.ts +12 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +23 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/helpers/issue-tracker/ado.d.ts +57 -0
- package/dist/cli/helpers/issue-tracker/ado.d.ts.map +1 -0
- package/dist/cli/helpers/issue-tracker/ado.js +223 -0
- package/dist/cli/helpers/issue-tracker/ado.js.map +1 -0
- package/dist/cli/helpers/issue-tracker/github.d.ts +65 -0
- package/dist/cli/helpers/issue-tracker/github.d.ts.map +1 -0
- package/dist/cli/helpers/issue-tracker/github.js +284 -0
- package/dist/cli/helpers/issue-tracker/github.js.map +1 -0
- package/dist/cli/helpers/issue-tracker/index.d.ts +22 -0
- package/dist/cli/helpers/issue-tracker/index.d.ts.map +1 -0
- package/dist/cli/helpers/issue-tracker/index.js +270 -0
- package/dist/cli/helpers/issue-tracker/index.js.map +1 -0
- package/dist/cli/helpers/issue-tracker/jira.d.ts +61 -0
- package/dist/cli/helpers/issue-tracker/jira.d.ts.map +1 -0
- package/dist/cli/helpers/issue-tracker/jira.js +265 -0
- package/dist/cli/helpers/issue-tracker/jira.js.map +1 -0
- package/dist/cli/helpers/issue-tracker/types.d.ts +86 -0
- package/dist/cli/helpers/issue-tracker/types.d.ts.map +1 -0
- package/dist/cli/helpers/issue-tracker/types.js +16 -0
- package/dist/cli/helpers/issue-tracker/types.js.map +1 -0
- package/dist/cli/helpers/issue-tracker/utils.d.ts +103 -0
- package/dist/cli/helpers/issue-tracker/utils.d.ts.map +1 -0
- package/dist/cli/helpers/issue-tracker/utils.js +240 -0
- package/dist/cli/helpers/issue-tracker/utils.js.map +1 -0
- package/dist/core/increment/limits.d.ts +68 -0
- package/dist/core/increment/limits.d.ts.map +1 -0
- package/dist/core/increment/limits.js +224 -0
- package/dist/core/increment/limits.js.map +1 -0
- package/dist/core/increment/metadata-manager.d.ts +114 -0
- package/dist/core/increment/metadata-manager.d.ts.map +1 -0
- package/dist/core/increment/metadata-manager.js +320 -0
- package/dist/core/increment/metadata-manager.js.map +1 -0
- package/dist/core/increment/status-commands.d.ts +43 -0
- package/dist/core/increment/status-commands.d.ts.map +1 -0
- package/dist/core/increment/status-commands.js +277 -0
- package/dist/core/increment/status-commands.js.map +1 -0
- package/dist/core/plugin-detector.d.ts +1 -0
- package/dist/core/plugin-detector.d.ts.map +1 -1
- package/dist/core/plugin-detector.js +25 -0
- package/dist/core/plugin-detector.js.map +1 -1
- package/dist/core/qa/qa-runner.d.ts +16 -0
- package/dist/core/qa/qa-runner.d.ts.map +1 -0
- package/dist/core/qa/qa-runner.js +404 -0
- package/dist/core/qa/qa-runner.js.map +1 -0
- package/dist/core/qa/quality-gate-decider.d.ts +53 -0
- package/dist/core/qa/quality-gate-decider.d.ts.map +1 -0
- package/dist/core/qa/quality-gate-decider.js +268 -0
- package/dist/core/qa/quality-gate-decider.js.map +1 -0
- package/dist/core/qa/risk-calculator.d.ts +126 -0
- package/dist/core/qa/risk-calculator.d.ts.map +1 -0
- package/dist/core/qa/risk-calculator.js +247 -0
- package/dist/core/qa/risk-calculator.js.map +1 -0
- package/dist/core/qa/types.d.ts +315 -0
- package/dist/core/qa/types.d.ts.map +1 -0
- package/dist/core/qa/types.js +8 -0
- package/dist/core/qa/types.js.map +1 -0
- package/dist/core/types/config.d.ts +35 -0
- package/dist/core/types/config.d.ts.map +1 -1
- package/dist/core/types/config.js +16 -0
- package/dist/core/types/config.js.map +1 -1
- package/dist/core/types/increment-metadata.d.ts +120 -0
- package/dist/core/types/increment-metadata.d.ts.map +1 -0
- package/dist/core/types/increment-metadata.js +138 -0
- package/dist/core/types/increment-metadata.js.map +1 -0
- package/dist/hooks/lib/invoke-translator-skill.d.ts +60 -0
- package/dist/hooks/lib/invoke-translator-skill.d.ts.map +1 -0
- package/dist/hooks/lib/invoke-translator-skill.js +201 -0
- package/dist/hooks/lib/invoke-translator-skill.js.map +1 -0
- package/dist/hooks/lib/translate-file.d.ts +59 -0
- package/dist/hooks/lib/translate-file.d.ts.map +1 -0
- package/dist/hooks/lib/translate-file.js +350 -0
- package/dist/hooks/lib/translate-file.js.map +1 -0
- package/dist/locales/en/cli.json +3 -1
- package/dist/metrics/calculators/change-failure-rate.d.ts +22 -0
- package/dist/metrics/calculators/change-failure-rate.d.ts.map +1 -0
- package/dist/metrics/calculators/change-failure-rate.js +70 -0
- package/dist/metrics/calculators/change-failure-rate.js.map +1 -0
- package/dist/metrics/calculators/deployment-frequency.d.ts +20 -0
- package/dist/metrics/calculators/deployment-frequency.d.ts.map +1 -0
- package/dist/metrics/calculators/deployment-frequency.js +61 -0
- package/dist/metrics/calculators/deployment-frequency.js.map +1 -0
- package/dist/metrics/calculators/lead-time.d.ts +22 -0
- package/dist/metrics/calculators/lead-time.d.ts.map +1 -0
- package/dist/metrics/calculators/lead-time.js +82 -0
- package/dist/metrics/calculators/lead-time.js.map +1 -0
- package/dist/metrics/calculators/mttr.d.ts +21 -0
- package/dist/metrics/calculators/mttr.d.ts.map +1 -0
- package/dist/metrics/calculators/mttr.js +60 -0
- package/dist/metrics/calculators/mttr.js.map +1 -0
- package/dist/metrics/dora-calculator.d.ts +24 -0
- package/dist/metrics/dora-calculator.d.ts.map +1 -0
- package/dist/metrics/dora-calculator.js +104 -0
- package/dist/metrics/dora-calculator.js.map +1 -0
- package/dist/metrics/github-client.d.ts +51 -0
- package/dist/metrics/github-client.d.ts.map +1 -0
- package/dist/metrics/github-client.js +133 -0
- package/dist/metrics/github-client.js.map +1 -0
- package/dist/metrics/types.d.ts +112 -0
- package/dist/metrics/types.d.ts.map +1 -0
- package/dist/metrics/types.js +10 -0
- package/dist/metrics/types.js.map +1 -0
- package/dist/metrics/utils/percentile.d.ts +25 -0
- package/dist/metrics/utils/percentile.d.ts.map +1 -0
- package/dist/metrics/utils/percentile.js +46 -0
- package/dist/metrics/utils/percentile.js.map +1 -0
- package/dist/metrics/utils/tier-classifier.d.ts +61 -0
- package/dist/metrics/utils/tier-classifier.d.ts.map +1 -0
- package/dist/metrics/utils/tier-classifier.js +100 -0
- package/dist/metrics/utils/tier-classifier.js.map +1 -0
- package/dist/utils/auth-helpers.d.ts +58 -0
- package/dist/utils/auth-helpers.d.ts.map +1 -0
- package/dist/utils/auth-helpers.js +108 -0
- package/dist/utils/auth-helpers.js.map +1 -0
- package/dist/utils/env-file.d.ts +88 -0
- package/dist/utils/env-file.d.ts.map +1 -0
- package/dist/utils/env-file.js +180 -0
- package/dist/utils/env-file.js.map +1 -0
- package/dist/utils/plugin-detection.d.ts +50 -0
- package/dist/utils/plugin-detection.d.ts.map +1 -0
- package/dist/utils/plugin-detection.js +229 -0
- package/dist/utils/plugin-detection.js.map +1 -0
- package/dist/utils/secrets-loader.d.ts +88 -0
- package/dist/utils/secrets-loader.d.ts.map +1 -0
- package/dist/utils/secrets-loader.js +271 -0
- package/dist/utils/secrets-loader.js.map +1 -0
- package/dist/utils/translation.d.ts +187 -0
- package/dist/utils/translation.d.ts.map +1 -0
- package/dist/utils/translation.js +414 -0
- package/dist/utils/translation.js.map +1 -0
- package/package.json +28 -44
- package/plugins/specweave/.claude-plugin/plugin.json +3 -3
- package/plugins/specweave/agents/pm/AGENT.md +330 -54
- package/plugins/specweave/agents/test-aware-planner/AGENT.md +1035 -0
- package/plugins/specweave/agents/test-aware-planner/templates/README.md +118 -0
- package/plugins/specweave/agents/test-aware-planner/templates/task-non-testable.md.template +24 -0
- package/plugins/specweave/agents/test-aware-planner/templates/task-testable.md.template +53 -0
- package/plugins/specweave/agents/test-aware-planner/templates/tasks-frontmatter.md.template +11 -0
- package/plugins/specweave/commands/README.md +88 -163
- package/plugins/specweave/commands/specweave-abandon.md +314 -0
- package/plugins/specweave/commands/specweave-check-tests.md +546 -0
- package/plugins/specweave/commands/{do.md → specweave-do.md} +5 -7
- package/plugins/specweave/commands/{increment.md → specweave-increment.md} +231 -4
- package/plugins/specweave/commands/specweave-pause.md +189 -0
- package/plugins/specweave/commands/specweave-qa.md +245 -0
- package/plugins/specweave/commands/specweave-resume.md +216 -0
- package/plugins/specweave/commands/specweave-status.md +397 -0
- package/plugins/specweave/commands/specweave-sync-tasks.md +256 -0
- package/plugins/specweave/commands/{translate.md → specweave-translate.md} +3 -3
- package/plugins/specweave/commands/specweave-update-scope.md +351 -0
- package/plugins/specweave/commands/specweave.md +21 -21
- package/plugins/specweave/hooks/post-increment-planning.sh +335 -0
- package/plugins/specweave/hooks/post-task-completion.sh +141 -0
- package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
- package/plugins/specweave/skills/brownfield-analyzer/SKILL.md +9 -9
- package/plugins/specweave/skills/increment-planner/SKILL.md +400 -212
- package/plugins/specweave/skills/increment-quality-judge-v2/SKILL.md +499 -0
- package/plugins/specweave/skills/plugin-detector/SKILL.md +114 -1
- package/plugins/specweave/skills/project-kickstarter/SKILL.md +74 -1
- package/plugins/specweave/skills/{rfc-generator → spec-generator}/SKILL.md +22 -29
- package/plugins/specweave/skills/specweave-detector/SKILL.md +3 -3
- package/plugins/specweave/skills/specweave-framework/SKILL.md +2 -2
- package/plugins/specweave-ado/.claude-plugin/plugin.json +18 -4
- package/plugins/specweave-ado/agents/ado-manager/AGENT.md +426 -0
- package/plugins/specweave-ado/commands/close-workitem.md +52 -0
- package/plugins/specweave-ado/commands/create-workitem.md +53 -0
- package/plugins/specweave-ado/commands/status.md +53 -0
- package/plugins/specweave-ado/commands/sync.md +55 -0
- package/plugins/specweave-ado/lib/ado-client.ts +361 -0
- package/plugins/specweave-ado/reference/ado-specweave-mapping.md +552 -0
- package/plugins/specweave-ado/skills/ado-sync/SKILL.md +344 -193
- package/plugins/specweave-docs/skills/docusaurus/SKILL.md +73 -0
- package/plugins/specweave-github/agents/github-manager/AGENT.md +49 -0
- package/plugins/specweave-github/commands/{github-close-issue.md → close-issue.md} +1 -1
- package/plugins/specweave-github/commands/{github-create-issue.md → create-issue.md} +1 -1
- package/plugins/specweave-github/commands/{github-status.md → status.md} +1 -1
- package/plugins/specweave-github/commands/{github-sync-tasks.md → sync-tasks.md} +1 -1
- package/plugins/specweave-github/commands/{github-sync.md → sync.md} +1 -1
- package/plugins/specweave-github/reference/github-specweave-mapping.md +377 -0
- package/plugins/specweave-github/skills/github-sync/SKILL.md +11 -3
- package/plugins/specweave-infrastructure/commands/{specweave.monitor-setup.md → monitor-setup.md} +5 -0
- package/plugins/specweave-infrastructure/commands/{specweave.slo-implement.md → slo-implement.md} +5 -0
- package/plugins/specweave-jira/agents/jira-manager/AGENT.md +380 -0
- package/plugins/specweave-jira/commands/{specweave.sync-jira.md → sync.md} +1 -1
- package/plugins/specweave-jira/reference/jira-specweave-mapping.md +508 -0
- package/plugins/specweave-ml/commands/ml-deploy.md +1 -1
- package/plugins/specweave-ml/commands/ml-evaluate.md +1 -1
- package/plugins/specweave-ml/commands/ml-explain.md +1 -1
- package/plugins/specweave-ml/commands/{specweave.ml-pipeline.md → ml-pipeline.md} +5 -0
- package/src/templates/AGENTS.md.template +331 -31
- package/src/templates/CLAUDE.md.template +36 -21
- package/src/templates/COMPLETION-REPORT.template.md +128 -0
- package/src/templates/README.md.template +17 -16
- package/src/templates/docs/README.md +11 -9
- package/src/templates/docs/spec-template.md +229 -0
- package/plugins/specweave/commands/inc.md +0 -85
- package/plugins/specweave/commands/list-increments.md +0 -180
- package/src/adapters/README.md +0 -275
- package/src/adapters/adapter-base.ts +0 -182
- package/src/adapters/adapter-interface.ts +0 -166
- package/src/adapters/adapter-loader.ts +0 -256
- package/src/adapters/agents-md-generator.ts +0 -228
- package/src/adapters/claude/README.md +0 -233
- package/src/adapters/claude/adapter.ts +0 -468
- package/src/adapters/claude-md-generator.ts +0 -377
- package/src/adapters/codex/README.md +0 -105
- package/src/adapters/codex/adapter.ts +0 -333
- package/src/adapters/cursor/.cursor/context/docs-context.md +0 -62
- package/src/adapters/cursor/.cursor/context/increments-context.md +0 -71
- package/src/adapters/cursor/.cursor/context/strategy-context.md +0 -73
- package/src/adapters/cursor/.cursor/context/tests-context.md +0 -89
- package/src/adapters/cursor/README.md +0 -283
- package/src/adapters/cursor/adapter.ts +0 -451
- package/src/adapters/doc-generator.ts +0 -331
- package/src/adapters/gemini/README.md +0 -97
- package/src/adapters/gemini/adapter.ts +0 -298
- package/src/adapters/generic/README.md +0 -277
- package/src/adapters/generic/adapter.ts +0 -378
- package/src/adapters/registry.yaml +0 -187
- /package/plugins/specweave/commands/{costs.md → specweave-costs.md} +0 -0
- /package/plugins/specweave/commands/{done.md → specweave-done.md} +0 -0
- /package/plugins/specweave/commands/{next.md → specweave-next.md} +0 -0
- /package/plugins/specweave/commands/{progress.md → specweave-progress.md} +0 -0
- /package/plugins/specweave/commands/{sync-docs.md → specweave-sync-docs.md} +0 -0
- /package/plugins/specweave/commands/{tdd-cycle.md → specweave-tdd-cycle.md} +0 -0
- /package/plugins/specweave/commands/{tdd-green.md → specweave-tdd-green.md} +0 -0
- /package/plugins/specweave/commands/{tdd-red.md → specweave-tdd-red.md} +0 -0
- /package/plugins/specweave/commands/{tdd-refactor.md → specweave-tdd-refactor.md} +0 -0
- /package/plugins/specweave/commands/{validate.md → specweave-validate.md} +0 -0
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: check-tests
|
|
3
|
+
description: Validate test coverage for increment tasks, check AC-ID coverage, report test status, and verify coverage targets (NEW format with embedded tests in tasks.md)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Check Tests - Test Coverage Validation
|
|
7
|
+
|
|
8
|
+
**Purpose**: Validate test coverage from tasks.md (NEW format with embedded tests)
|
|
9
|
+
|
|
10
|
+
**Replaces**: `validate-coverage` (old command for tests.md format)
|
|
11
|
+
|
|
12
|
+
Shows:
|
|
13
|
+
- Task test coverage status (which tasks have tests)
|
|
14
|
+
- Test pass/fail status (if tests implemented)
|
|
15
|
+
- Coverage targets vs actual coverage
|
|
16
|
+
- AC-ID coverage (which acceptance criteria are tested)
|
|
17
|
+
- Missing tests or gaps in coverage
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Check tests for current increment
|
|
25
|
+
/check-tests
|
|
26
|
+
|
|
27
|
+
# Check tests for specific increment
|
|
28
|
+
/check-tests 0007
|
|
29
|
+
|
|
30
|
+
# Detailed report with test case breakdown
|
|
31
|
+
/check-tests 0007 --detailed
|
|
32
|
+
|
|
33
|
+
# AC-ID coverage report only
|
|
34
|
+
/check-tests 0007 --ac-coverage
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## What It Does
|
|
40
|
+
|
|
41
|
+
### Architecture Change (v0.7.0)
|
|
42
|
+
|
|
43
|
+
**OLD Format** (pre-v0.7.0):
|
|
44
|
+
- Separate tests.md file with TC-IDs
|
|
45
|
+
- validate-coverage command parsed tests.md
|
|
46
|
+
|
|
47
|
+
**NEW Format** (v0.7.0+):
|
|
48
|
+
- Embedded tests in tasks.md
|
|
49
|
+
- check-tests command parses tasks.md for test plans
|
|
50
|
+
|
|
51
|
+
**Why the change?**
|
|
52
|
+
- Single source of truth (no sync issues)
|
|
53
|
+
- Simpler architecture
|
|
54
|
+
- Industry-aligned (BDD, Agile patterns)
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Output Example (NEW Format)
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
/check-tests 0007
|
|
62
|
+
|
|
63
|
+
📊 Test Status Report: 0007-smart-increment-discipline
|
|
64
|
+
|
|
65
|
+
═══════════════════════════════════════════════════════════════
|
|
66
|
+
|
|
67
|
+
Task Coverage Analysis:
|
|
68
|
+
|
|
69
|
+
✅ T-001: Update plan.md (N/A - documentation)
|
|
70
|
+
Validation: Manual review complete
|
|
71
|
+
|
|
72
|
+
✅ T-003: Create test-aware-planner structure (2 test cases, 85% coverage)
|
|
73
|
+
- Manual: Directory structure verified ✅
|
|
74
|
+
- Integration: tests/integration/test-aware-planner/agent-invocation.test.ts
|
|
75
|
+
• testAgentCanBeInvoked() ✅ (passed)
|
|
76
|
+
• testAgentReadsSpecPlan() ✅ (passed)
|
|
77
|
+
Coverage: 87% (target: 85%) ✅
|
|
78
|
+
|
|
79
|
+
⚠️ T-007: Create check-tests command (0 test cases, 0% coverage)
|
|
80
|
+
WARNING: No test plan defined!
|
|
81
|
+
Action: Add test cases to T-007 or mark as non-testable
|
|
82
|
+
|
|
83
|
+
❌ T-008: Implement check-tests logic (3 test cases, 45% coverage)
|
|
84
|
+
- Unit: tests/unit/check-tests.test.ts
|
|
85
|
+
• testParseTasksMd() ❌ (failing: Expected 3 tasks, got 2)
|
|
86
|
+
• testExtractTestCases() ✅ (passed)
|
|
87
|
+
• testCalculateCoverage() ⏸️ (not implemented)
|
|
88
|
+
Coverage: 45% ❌ (target: 85%, below threshold!)
|
|
89
|
+
Action: Fix failing test, implement missing test
|
|
90
|
+
|
|
91
|
+
═══════════════════════════════════════════════════════════════
|
|
92
|
+
|
|
93
|
+
Overall Coverage: 72% ⚠️ (target: 80-90%)
|
|
94
|
+
|
|
95
|
+
Breakdown:
|
|
96
|
+
- Testable tasks: 15/24 (62%)
|
|
97
|
+
- Non-testable tasks: 9/24 (38%) ✅
|
|
98
|
+
- Average coverage (testable): 78% ⚠️
|
|
99
|
+
- Tests passing: 12/18 (67%) ⚠️
|
|
100
|
+
- Tests failing: 3/18 (17%) ❌
|
|
101
|
+
- Tests not implemented: 3/18 (17%) ⏸️
|
|
102
|
+
|
|
103
|
+
═══════════════════════════════════════════════════════════════
|
|
104
|
+
|
|
105
|
+
Acceptance Criteria Coverage:
|
|
106
|
+
|
|
107
|
+
✅ AC-US1-01: Covered by T-001, T-003 (6 tests, 88% coverage)
|
|
108
|
+
✅ AC-US1-02: Covered by T-002, T-004 (4 tests, 92% coverage)
|
|
109
|
+
⚠️ AC-US2-01: Partially covered by T-007 (0 tests)
|
|
110
|
+
Missing: Unit tests for command logic
|
|
111
|
+
❌ AC-US3-05: Not covered by any task
|
|
112
|
+
Action: Add task for AC-US3-05 or mark as won't-do
|
|
113
|
+
|
|
114
|
+
═══════════════════════════════════════════════════════════════
|
|
115
|
+
|
|
116
|
+
🎯 Recommendations:
|
|
117
|
+
|
|
118
|
+
Priority: P1 (blocking issues)
|
|
119
|
+
1. Fix failing test in T-008: testParseTasksMd()
|
|
120
|
+
2. Implement missing test in T-008: testCalculateCoverage()
|
|
121
|
+
3. Add test plan to T-007 or mark as non-testable
|
|
122
|
+
|
|
123
|
+
Priority: P2 (coverage gaps)
|
|
124
|
+
4. Increase coverage in T-008 to ≥85%
|
|
125
|
+
5. Add unit tests for AC-US2-01
|
|
126
|
+
6. Create task for uncovered AC-US3-05
|
|
127
|
+
|
|
128
|
+
═══════════════════════════════════════════════════════════════
|
|
129
|
+
|
|
130
|
+
Summary:
|
|
131
|
+
- Status: ⚠️ NEEDS WORK (coverage below 80%, failing tests)
|
|
132
|
+
- Next: Fix failing tests, implement missing tests
|
|
133
|
+
- Run: npm test (to re-run all tests)
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Detailed Report (--detailed flag)
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
/check-tests 0007 --detailed
|
|
142
|
+
|
|
143
|
+
[Shows expanded report with:]
|
|
144
|
+
- Full test case breakdown per task
|
|
145
|
+
- Code coverage metrics per file
|
|
146
|
+
- Test execution times
|
|
147
|
+
- Test file paths and line numbers
|
|
148
|
+
- Suggestions for improving coverage
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## AC Coverage Report (--ac-coverage flag)
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
/check-tests 0007 --ac-coverage
|
|
157
|
+
|
|
158
|
+
═══════════════════════════════════════════════════════════════
|
|
159
|
+
|
|
160
|
+
Acceptance Criteria Coverage Report: 0007
|
|
161
|
+
|
|
162
|
+
✅ AC-US1-01: User can login with email/password
|
|
163
|
+
Covered by: T-001, T-003
|
|
164
|
+
Test cases: 6 (unit: 3, integration: 2, E2E: 1)
|
|
165
|
+
Coverage: 88%
|
|
166
|
+
Status: ✅ PASSING
|
|
167
|
+
|
|
168
|
+
✅ AC-US1-02: User can logout
|
|
169
|
+
Covered by: T-002, T-004
|
|
170
|
+
Test cases: 4 (unit: 2, integration: 2)
|
|
171
|
+
Coverage: 92%
|
|
172
|
+
Status: ✅ PASSING
|
|
173
|
+
|
|
174
|
+
⚠️ AC-US2-01: Command validates test coverage
|
|
175
|
+
Covered by: T-007, T-008
|
|
176
|
+
Test cases: 3 (unit: 3)
|
|
177
|
+
Coverage: 45% ⚠️
|
|
178
|
+
Status: ⚠️ PARTIAL (1 failing, 1 not implemented)
|
|
179
|
+
|
|
180
|
+
❌ AC-US3-05: Documentation is complete
|
|
181
|
+
Covered by: NONE
|
|
182
|
+
Test cases: 0
|
|
183
|
+
Coverage: 0%
|
|
184
|
+
Status: ❌ NOT COVERED
|
|
185
|
+
|
|
186
|
+
═══════════════════════════════════════════════════════════════
|
|
187
|
+
|
|
188
|
+
Summary:
|
|
189
|
+
- Total AC-IDs: 4
|
|
190
|
+
- Fully covered: 2 (50%)
|
|
191
|
+
- Partially covered: 1 (25%)
|
|
192
|
+
- Not covered: 1 (25%)
|
|
193
|
+
- Overall AC coverage: 75% ⚠️
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## What It Checks
|
|
199
|
+
|
|
200
|
+
### 1. Task Test Coverage
|
|
201
|
+
|
|
202
|
+
For each task in tasks.md:
|
|
203
|
+
|
|
204
|
+
**Testable tasks**:
|
|
205
|
+
- Parses "Test Plan" section (Given/When/Then)
|
|
206
|
+
- Extracts "Test Cases" (unit/integration/E2E)
|
|
207
|
+
- Checks if test files exist
|
|
208
|
+
- Runs tests (if implemented)
|
|
209
|
+
- Compares actual vs target coverage
|
|
210
|
+
|
|
211
|
+
**Non-testable tasks**:
|
|
212
|
+
- Verifies "Test Plan: N/A" is set
|
|
213
|
+
- Checks "Validation" section exists
|
|
214
|
+
- Reports validation methods
|
|
215
|
+
|
|
216
|
+
### 2. Test Execution Status
|
|
217
|
+
|
|
218
|
+
- ✅ Passing tests (green)
|
|
219
|
+
- ❌ Failing tests (red, shows error)
|
|
220
|
+
- ⏸️ Not implemented (gray, needs implementation)
|
|
221
|
+
- 🚫 Test file missing (needs creation)
|
|
222
|
+
|
|
223
|
+
### 3. Coverage Metrics
|
|
224
|
+
|
|
225
|
+
- Per-task coverage (from task definition)
|
|
226
|
+
- Per-test-level coverage (unit/int/E2E)
|
|
227
|
+
- Overall increment coverage
|
|
228
|
+
- Comparison to target (80-90%)
|
|
229
|
+
|
|
230
|
+
### 4. AC-ID Coverage
|
|
231
|
+
|
|
232
|
+
- Maps AC-IDs from spec.md → tasks in tasks.md
|
|
233
|
+
- Checks which AC-IDs have test coverage
|
|
234
|
+
- Identifies untested acceptance criteria
|
|
235
|
+
- Reports partial vs full coverage
|
|
236
|
+
|
|
237
|
+
### 5. Recommendations
|
|
238
|
+
|
|
239
|
+
Priority-based action items:
|
|
240
|
+
- **P1 (blocking)**: Failing tests, missing critical tests
|
|
241
|
+
- **P2 (important)**: Coverage gaps, untested AC-IDs
|
|
242
|
+
- **P3 (nice-to-have)**: Minor coverage improvements
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## How It Works (NEW Format)
|
|
247
|
+
|
|
248
|
+
### Step 1: Parse tasks.md
|
|
249
|
+
|
|
250
|
+
```typescript
|
|
251
|
+
// Pseudo-code for check-tests logic
|
|
252
|
+
|
|
253
|
+
const tasks = parseTasksMd('.specweave/increments/0007/tasks.md');
|
|
254
|
+
|
|
255
|
+
for (const task of tasks) {
|
|
256
|
+
if (task.testPlan === 'N/A') {
|
|
257
|
+
// Non-testable task
|
|
258
|
+
reportValidation(task);
|
|
259
|
+
} else {
|
|
260
|
+
// Testable task
|
|
261
|
+
const testCases = extractTestCases(task);
|
|
262
|
+
const results = runTests(testCases);
|
|
263
|
+
const coverage = calculateCoverage(results);
|
|
264
|
+
|
|
265
|
+
reportTestStatus(task, testCases, results, coverage);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### Step 2: Extract Test Cases
|
|
271
|
+
|
|
272
|
+
From each task's "Test Cases" section:
|
|
273
|
+
|
|
274
|
+
```markdown
|
|
275
|
+
**Test Cases**:
|
|
276
|
+
1. **Unit**: `tests/unit/auth.test.ts`
|
|
277
|
+
- testValidLogin(): ...
|
|
278
|
+
- testInvalidLogin(): ...
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
Extracts:
|
|
282
|
+
- Test level (Unit, Integration, E2E)
|
|
283
|
+
- Test file path
|
|
284
|
+
- Test function names
|
|
285
|
+
- Coverage target
|
|
286
|
+
|
|
287
|
+
### Step 3: Run Tests (if implemented)
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
# For each test file, run:
|
|
291
|
+
npm test tests/unit/auth.test.ts
|
|
292
|
+
|
|
293
|
+
# Capture:
|
|
294
|
+
# - Pass/fail status
|
|
295
|
+
# - Error messages
|
|
296
|
+
# - Code coverage %
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### Step 4: Compare Coverage
|
|
300
|
+
|
|
301
|
+
```
|
|
302
|
+
Actual coverage: 87%
|
|
303
|
+
Target coverage: 85%
|
|
304
|
+
Status: ✅ PASSING (actual ≥ target)
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### Step 5: Check AC-ID Coverage
|
|
308
|
+
|
|
309
|
+
```markdown
|
|
310
|
+
# From spec.md:
|
|
311
|
+
AC-US1-01: User can login
|
|
312
|
+
|
|
313
|
+
# From tasks.md:
|
|
314
|
+
T-001: Implement login
|
|
315
|
+
Acceptance Criteria: AC-US1-01
|
|
316
|
+
|
|
317
|
+
# Result:
|
|
318
|
+
AC-US1-01 → Covered by T-001 ✅
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
## Backward Compatibility (OLD Format)
|
|
324
|
+
|
|
325
|
+
**If increment has tests.md** (pre-v0.7.0):
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
/check-tests 0003 # Old format increment
|
|
329
|
+
|
|
330
|
+
⚠️ OLD FORMAT DETECTED: tests.md exists
|
|
331
|
+
|
|
332
|
+
This increment uses the old format (separate tests.md).
|
|
333
|
+
The check-tests command supports both formats.
|
|
334
|
+
|
|
335
|
+
[Parses tests.md with TC-IDs instead of tasks.md]
|
|
336
|
+
|
|
337
|
+
📊 Test Status Report: 0003 (OLD FORMAT)
|
|
338
|
+
|
|
339
|
+
Test Case Coverage:
|
|
340
|
+
✅ TC-001: User can login (3 tests, 90% coverage)
|
|
341
|
+
...
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
**Detection logic**:
|
|
345
|
+
|
|
346
|
+
```typescript
|
|
347
|
+
const hasTestsMd = fs.existsSync('.specweave/increments/0003/tests.md');
|
|
348
|
+
|
|
349
|
+
if (hasTestsMd) {
|
|
350
|
+
// OLD FORMAT: Parse tests.md for TC-IDs
|
|
351
|
+
return checkTestsOldFormat(incrementId);
|
|
352
|
+
} else {
|
|
353
|
+
// NEW FORMAT: Parse tasks.md for embedded tests
|
|
354
|
+
return checkTestsNewFormat(incrementId);
|
|
355
|
+
}
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## Integration with Workflow
|
|
361
|
+
|
|
362
|
+
**When to run check-tests**:
|
|
363
|
+
|
|
364
|
+
1. **During development**: After implementing tasks
|
|
365
|
+
```bash
|
|
366
|
+
# Implement T-001
|
|
367
|
+
# Write tests
|
|
368
|
+
/check-tests # Verify tests pass
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
2. **Before PR**: Ensure coverage meets targets
|
|
372
|
+
```bash
|
|
373
|
+
/check-tests 0007
|
|
374
|
+
# Fix any failing tests
|
|
375
|
+
# Commit and push
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
3. **In CI/CD**: Automated test validation
|
|
379
|
+
```bash
|
|
380
|
+
# In .github/workflows/test.yml
|
|
381
|
+
- name: Check test coverage
|
|
382
|
+
run: npx specweave check-tests $INCREMENT_ID
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
4. **PM Gate 2**: Part of increment closure
|
|
386
|
+
```bash
|
|
387
|
+
/done 0007
|
|
388
|
+
# PM Agent runs /check-tests automatically
|
|
389
|
+
# Verifies >80% coverage before closure
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
---
|
|
393
|
+
|
|
394
|
+
## Exit Codes
|
|
395
|
+
|
|
396
|
+
For CI/CD integration:
|
|
397
|
+
|
|
398
|
+
```bash
|
|
399
|
+
/check-tests 0007
|
|
400
|
+
echo $? # Exit code
|
|
401
|
+
|
|
402
|
+
# Exit codes:
|
|
403
|
+
# 0 = All tests passing, coverage ≥80%
|
|
404
|
+
# 1 = Tests failing
|
|
405
|
+
# 2 = Coverage <80%
|
|
406
|
+
# 3 = AC-IDs not covered
|
|
407
|
+
# 4 = Command error (invalid increment, etc.)
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
## Files Read
|
|
413
|
+
|
|
414
|
+
The command reads:
|
|
415
|
+
- `.specweave/increments/{id}/tasks.md` (NEW format)
|
|
416
|
+
- `.specweave/increments/{id}/tests.md` (OLD format, if exists)
|
|
417
|
+
- `.specweave/increments/{id}/spec.md` (for AC-IDs)
|
|
418
|
+
- Test files (to check existence)
|
|
419
|
+
- Coverage reports (if generated)
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
## Related Commands
|
|
424
|
+
|
|
425
|
+
- `/validate 0007` - Full increment validation (tasks, tests, docs)
|
|
426
|
+
- `/progress` - Current increment progress with test status
|
|
427
|
+
- `/done 0007` - Close increment (runs check-tests automatically)
|
|
428
|
+
|
|
429
|
+
---
|
|
430
|
+
|
|
431
|
+
## Comparison: OLD vs NEW Command
|
|
432
|
+
|
|
433
|
+
| Aspect | OLD (validate-coverage) | NEW (check-tests) |
|
|
434
|
+
|--------|------------------------|-------------------|
|
|
435
|
+
| **Reads** | tests.md | tasks.md |
|
|
436
|
+
| **Test IDs** | TC-001, TC-002 | Function names |
|
|
437
|
+
| **Format** | Separate file | Embedded in tasks |
|
|
438
|
+
| **BDD** | No | Yes (Given/When/Then) |
|
|
439
|
+
| **AC Traceability** | Manual | Automatic (AC-IDs) |
|
|
440
|
+
| **Sync Issues** | tasks ↔ tests | None (single file) |
|
|
441
|
+
| **Coverage Target** | Per test case | Per task + overall |
|
|
442
|
+
| **Status** | Deprecated (v0.7+) | Current |
|
|
443
|
+
|
|
444
|
+
---
|
|
445
|
+
|
|
446
|
+
## Technical Implementation Notes
|
|
447
|
+
|
|
448
|
+
For developers working on check-tests logic (T-008):
|
|
449
|
+
|
|
450
|
+
### Input: tasks.md (NEW format)
|
|
451
|
+
|
|
452
|
+
```markdown
|
|
453
|
+
### T-001: Implement Feature
|
|
454
|
+
|
|
455
|
+
**Test Plan**:
|
|
456
|
+
- **Given** precondition
|
|
457
|
+
- **When** action
|
|
458
|
+
- **Then** outcome
|
|
459
|
+
|
|
460
|
+
**Test Cases**:
|
|
461
|
+
1. **Unit**: `tests/unit/feature.test.ts`
|
|
462
|
+
- testFeatureSuccess(): ...
|
|
463
|
+
- **Coverage Target**: 90%
|
|
464
|
+
**Overall Coverage Target**: 85%
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
### Parsing Logic
|
|
468
|
+
|
|
469
|
+
```typescript
|
|
470
|
+
interface TaskTest {
|
|
471
|
+
taskId: string;
|
|
472
|
+
testPlan: TestPlan | 'N/A';
|
|
473
|
+
testCases: TestCase[];
|
|
474
|
+
overallTarget: number;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
interface TestPlan {
|
|
478
|
+
given: string;
|
|
479
|
+
when: string;
|
|
480
|
+
then: string;
|
|
481
|
+
and?: string;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
interface TestCase {
|
|
485
|
+
level: 'Unit' | 'Integration' | 'E2E';
|
|
486
|
+
filePath: string;
|
|
487
|
+
functions: string[];
|
|
488
|
+
target: number;
|
|
489
|
+
}
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
### Test Execution
|
|
493
|
+
|
|
494
|
+
```typescript
|
|
495
|
+
async function runTest(testCase: TestCase): Promise<TestResult> {
|
|
496
|
+
// Run: npm test {filePath}
|
|
497
|
+
// Parse output for pass/fail
|
|
498
|
+
// Extract coverage %
|
|
499
|
+
return {
|
|
500
|
+
passed: boolean,
|
|
501
|
+
coverage: number,
|
|
502
|
+
errors: string[]
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
### Report Generation
|
|
508
|
+
|
|
509
|
+
```typescript
|
|
510
|
+
function generateReport(results: TaskTest[]): Report {
|
|
511
|
+
return {
|
|
512
|
+
taskCoverage: calculateTaskCoverage(results),
|
|
513
|
+
acCoverage: calculateACCoverage(results, specMd),
|
|
514
|
+
recommendations: generateRecommendations(results),
|
|
515
|
+
overallStatus: determineStatus(results)
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
---
|
|
521
|
+
|
|
522
|
+
## Future Enhancements (Post-v0.7.0)
|
|
523
|
+
|
|
524
|
+
- **Visual coverage reports**: HTML report generation
|
|
525
|
+
- **Trend tracking**: Coverage over time (per increment)
|
|
526
|
+
- **Auto-fix suggestions**: "Run this command to fix coverage"
|
|
527
|
+
- **Integration with IDEs**: VS Code extension
|
|
528
|
+
- **Parallel test execution**: Speed up large test suites
|
|
529
|
+
|
|
530
|
+
---
|
|
531
|
+
|
|
532
|
+
## Summary
|
|
533
|
+
|
|
534
|
+
**check-tests** is the NEW command (v0.7.0+) for validating test coverage from tasks.md with embedded test plans.
|
|
535
|
+
|
|
536
|
+
**Key Features**:
|
|
537
|
+
- ✅ Parses tasks.md (NEW format)
|
|
538
|
+
- ✅ Checks AC-ID coverage
|
|
539
|
+
- ✅ Reports test pass/fail status
|
|
540
|
+
- ✅ Validates coverage targets (80-90%)
|
|
541
|
+
- ✅ Backward compatible (supports old tests.md format)
|
|
542
|
+
- ✅ Generates actionable recommendations
|
|
543
|
+
|
|
544
|
+
**Replaces**: validate-coverage (deprecated)
|
|
545
|
+
|
|
546
|
+
**See also**: ARCHITECTURE-PIVOT.md (rationale for NEW format)
|
|
@@ -5,8 +5,6 @@ description: Execute increment implementation following spec and plan - hooks ru
|
|
|
5
5
|
|
|
6
6
|
# Do Increment
|
|
7
7
|
|
|
8
|
-
**⚡ Convenient Short Form**: Use `/do` for quick access, or `/specweave:do` for explicit namespace.
|
|
9
|
-
|
|
10
8
|
**Implementation Execution**: Following spec.md and plan.md to execute the increment work.
|
|
11
9
|
|
|
12
10
|
You are helping the user implement a SpecWeave increment by executing tasks from tasks.md with automatic documentation updates after EVERY task completion.
|
|
@@ -15,15 +13,15 @@ You are helping the user implement a SpecWeave increment by executing tasks from
|
|
|
15
13
|
|
|
16
14
|
```bash
|
|
17
15
|
# Auto-resumes from last incomplete task
|
|
18
|
-
/do <increment-id>
|
|
16
|
+
/specweave:do <increment-id>
|
|
19
17
|
|
|
20
18
|
# Or let it find active increment automatically
|
|
21
|
-
/do
|
|
19
|
+
/specweave:do
|
|
22
20
|
|
|
23
21
|
# Override model selection for all tasks (advanced)
|
|
24
|
-
/do <increment-id> --model haiku
|
|
25
|
-
/do <increment-id> --model sonnet
|
|
26
|
-
/do <increment-id> --model opus
|
|
22
|
+
/specweave:do <increment-id> --model haiku
|
|
23
|
+
/specweave:do <increment-id> --model sonnet
|
|
24
|
+
/specweave:do <increment-id> --model opus
|
|
27
25
|
```
|
|
28
26
|
|
|
29
27
|
## Arguments
|