speccrew 0.5.13 → 0.5.15
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/.speccrew/agents/speccrew-test-manager.md +361 -37
- package/.speccrew/skills/speccrew-test-reporter/SKILL.md +297 -0
- package/.speccrew/skills/{speccrew-test-execute → speccrew-test-reporter}/templates/BUG-REPORT-TEMPLATE.md +24 -1
- package/.speccrew/skills/{speccrew-test-execute → speccrew-test-reporter}/templates/TEST-REPORT-TEMPLATE.md +8 -1
- package/.speccrew/skills/{speccrew-test-execute → speccrew-test-runner}/SKILL.md +142 -104
- package/.speccrew/skills/speccrew-test-runner/templates/TEST-EXECUTION-RESULT-TEMPLATE.md +80 -0
- package/lib/utils.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: speccrew-test-reporter
|
|
3
|
+
description: "SpecCrew Test Reporter. Generates comprehensive test reports and individual bug reports from test execution results. Performs root cause analysis and severity classification."
|
|
4
|
+
tools: Read, Write, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Trigger Scenarios
|
|
8
|
+
|
|
9
|
+
- When speccrew-test-runner completes and outputs execution results
|
|
10
|
+
- When user explicitly requests "generate test report", "create bug reports"
|
|
11
|
+
- When test execution results need to be converted to human-readable reports
|
|
12
|
+
|
|
13
|
+
# Role Positioning
|
|
14
|
+
|
|
15
|
+
**Primary Role**: Test Report Generator
|
|
16
|
+
|
|
17
|
+
**Responsibilities**:
|
|
18
|
+
- Read structured test execution results from speccrew-test-runner
|
|
19
|
+
- Generate comprehensive test reports with statistics and analysis
|
|
20
|
+
- Generate individual bug reports for each failed test case
|
|
21
|
+
- Perform detailed root cause analysis with impact assessment
|
|
22
|
+
- Classify bug severity for prioritization
|
|
23
|
+
- Output human-readable documents for stakeholders
|
|
24
|
+
|
|
25
|
+
**Upstream Dependencies**: speccrew-test-runner
|
|
26
|
+
**Downstream Consumers**: speccrew-test-manager, development teams, QA teams
|
|
27
|
+
|
|
28
|
+
# Workflow
|
|
29
|
+
|
|
30
|
+
## Absolute Constraints
|
|
31
|
+
|
|
32
|
+
> **These rules apply to ALL document generation steps. Violation = task failure.**
|
|
33
|
+
|
|
34
|
+
1. **FORBIDDEN: `create_file` for documents** — NEVER use `create_file` to write test reports or bug reports. Documents MUST be created by copying the template then filling sections with `search_replace`.
|
|
35
|
+
|
|
36
|
+
2. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire document content in a single operation. Always use targeted `search_replace` on specific sections.
|
|
37
|
+
|
|
38
|
+
3. **MANDATORY: Template-first workflow** — Copy template MUST execute before filling sections.
|
|
39
|
+
|
|
40
|
+
4. **MUST: One Bug Per File** — Each failed test gets its own bug report file for independent tracking.
|
|
41
|
+
|
|
42
|
+
5. **MUST: Severity Classification** — Always classify bug severity for prioritization.
|
|
43
|
+
|
|
44
|
+
6. **MUST: Actionable Reports** — Bug reports must include suggested fix direction.
|
|
45
|
+
|
|
46
|
+
## Input Parameters
|
|
47
|
+
|
|
48
|
+
| Parameter | Required | Description |
|
|
49
|
+
|-----------|----------|-------------|
|
|
50
|
+
| `execution_results_path` | Yes | Path to test execution results from speccrew-test-runner |
|
|
51
|
+
| `test_cases_path` | Yes | Path to test cases document with expected results |
|
|
52
|
+
| `output_dir` | Yes | Directory for report output |
|
|
53
|
+
| `feature_name` | Yes | Feature name for output file naming |
|
|
54
|
+
| `platform_id` | Yes | Target platform identifier |
|
|
55
|
+
|
|
56
|
+
## Step 1: Read Inputs
|
|
57
|
+
|
|
58
|
+
Read the following documents in order:
|
|
59
|
+
|
|
60
|
+
1. **Test Execution Results**: `execution_results_path`
|
|
61
|
+
- Structured execution data from speccrew-test-runner
|
|
62
|
+
- Contains test results, deviations, environment info
|
|
63
|
+
|
|
64
|
+
2. **Test Cases Document**: `test_cases_path`
|
|
65
|
+
- Original test case definitions with expected results
|
|
66
|
+
- Used for detailed comparison and bug report generation
|
|
67
|
+
|
|
68
|
+
**Input Validation**:
|
|
69
|
+
- Verify execution results document exists and follows expected format
|
|
70
|
+
- If input is missing or malformed, report to user and stop
|
|
71
|
+
|
|
72
|
+
## Step 2: Analyze Execution Results
|
|
73
|
+
|
|
74
|
+
### 2.1 Extract Summary Statistics
|
|
75
|
+
|
|
76
|
+
Parse execution results to extract:
|
|
77
|
+
- Total tests executed
|
|
78
|
+
- Pass/fail/error/skip counts
|
|
79
|
+
- Pass rate percentage
|
|
80
|
+
- Execution duration
|
|
81
|
+
- Platform and framework information
|
|
82
|
+
|
|
83
|
+
### 2.2 Identify Failed Tests
|
|
84
|
+
|
|
85
|
+
Extract all tests with status FAIL, ERROR, or SKIP:
|
|
86
|
+
- TC ID for traceability
|
|
87
|
+
- Test name and description
|
|
88
|
+
- Error messages and stack traces
|
|
89
|
+
- Expected vs actual results
|
|
90
|
+
|
|
91
|
+
### 2.3 Classify by Test Dimension
|
|
92
|
+
|
|
93
|
+
Group results by test dimension (if available):
|
|
94
|
+
- Happy Path
|
|
95
|
+
- Boundary Value
|
|
96
|
+
- Exception Handling
|
|
97
|
+
- Business Rules
|
|
98
|
+
- Permission/Security
|
|
99
|
+
- Data Validation
|
|
100
|
+
|
|
101
|
+
## Step 3: Generate Test Report
|
|
102
|
+
|
|
103
|
+
### 3.1 Read Template
|
|
104
|
+
|
|
105
|
+
Read template: `templates/TEST-REPORT-TEMPLATE.md`
|
|
106
|
+
|
|
107
|
+
### 3.2 Copy Template to Report Path
|
|
108
|
+
|
|
109
|
+
1. **Read template** from Step 3.1
|
|
110
|
+
2. **Replace top-level placeholders** (feature name, platform, execution date, etc.)
|
|
111
|
+
3. **Create the document** using `create_file` at: `{output_dir}/reports/{feature}-test-report.md`
|
|
112
|
+
4. **Verify**: Document has complete section structure
|
|
113
|
+
|
|
114
|
+
### 3.3 Fill Each Section Using search_replace
|
|
115
|
+
|
|
116
|
+
Fill each section with test execution data.
|
|
117
|
+
|
|
118
|
+
> **CRITICAL CONSTRAINTS:**
|
|
119
|
+
> - **FORBIDDEN: `create_file` to rewrite the entire document**
|
|
120
|
+
> - **MUST use `search_replace` to fill each section individually**
|
|
121
|
+
> - **All section titles MUST be preserved**
|
|
122
|
+
|
|
123
|
+
**Section Filling Guide:**
|
|
124
|
+
|
|
125
|
+
| Section | Content |
|
|
126
|
+
|---------|---------|
|
|
127
|
+
| **Execution Summary** | Feature name and platform, test framework and version, execution date and duration, overall pass rate |
|
|
128
|
+
| **Results Overview** | Counts and percentages for all result types, visual pass/fail indication |
|
|
129
|
+
| **Results by Test Dimension** | Breakdown by test type (happy path, boundary, exception, etc.), pass rate per dimension |
|
|
130
|
+
| **Failed Test Details** | Table of all failed tests, links to corresponding bug reports |
|
|
131
|
+
| **Coverage Status** | Requirement-to-test-case mapping, status per requirement |
|
|
132
|
+
| **Environment Information** | OS, runtime, framework versions, key dependencies |
|
|
133
|
+
| **Recommendations** | Priority fixes needed, suggested next steps |
|
|
134
|
+
|
|
135
|
+
## Step 4: Generate Bug Reports
|
|
136
|
+
|
|
137
|
+
### 4.1 Read Template
|
|
138
|
+
|
|
139
|
+
Read template: `templates/BUG-REPORT-TEMPLATE.md`
|
|
140
|
+
|
|
141
|
+
### 4.2 Create Bug Reports Directory
|
|
142
|
+
|
|
143
|
+
Ensure directory exists: `{output_dir}/bugs/`
|
|
144
|
+
|
|
145
|
+
### 4.3 Generate Bug Report for Each Failure
|
|
146
|
+
|
|
147
|
+
For each FAIL or ERROR type failure:
|
|
148
|
+
|
|
149
|
+
1. **Read template** from Step 4.1: `templates/BUG-REPORT-TEMPLATE.md`
|
|
150
|
+
2. **Replace top-level placeholders** (Bug ID, feature name, TC ID)
|
|
151
|
+
3. **Create document** using `create_file` at: `{output_dir}/bugs/{feature}-bug-{seq}.md`
|
|
152
|
+
|
|
153
|
+
### 4.4 Fill Each Bug Report Using search_replace
|
|
154
|
+
|
|
155
|
+
For each bug report created in 4.3, fill sections using `search_replace`:
|
|
156
|
+
|
|
157
|
+
> **CRITICAL CONSTRAINTS:**
|
|
158
|
+
> - **FORBIDDEN: `create_file` to rewrite the entire document**
|
|
159
|
+
> - **MUST use `search_replace` to fill each section individually**
|
|
160
|
+
|
|
161
|
+
**Section Filling Guide:**
|
|
162
|
+
|
|
163
|
+
1. **Assign Bug ID**: `BUG-{feature}-{seq}` (sequential numbering)
|
|
164
|
+
|
|
165
|
+
2. **Determine Severity**:
|
|
166
|
+
| Criteria | Severity |
|
|
167
|
+
|----------|----------|
|
|
168
|
+
| Blocks core functionality, no workaround | Critical |
|
|
169
|
+
| Major feature broken, workaround exists | High |
|
|
170
|
+
| Minor feature issue, cosmetic problem | Medium |
|
|
171
|
+
| Enhancement, minor improvement | Low |
|
|
172
|
+
|
|
173
|
+
3. **Fill Bug Report Content**:
|
|
174
|
+
- Bug title reflecting the failure
|
|
175
|
+
- Related TC ID for traceability
|
|
176
|
+
- Clear reproduction steps
|
|
177
|
+
- Expected result from test case
|
|
178
|
+
- Actual result from execution
|
|
179
|
+
- Relevant error log excerpt
|
|
180
|
+
- Suggested fix direction
|
|
181
|
+
|
|
182
|
+
### 4.4 Root Cause Analysis
|
|
183
|
+
|
|
184
|
+
For each bug, perform detailed analysis:
|
|
185
|
+
|
|
186
|
+
| Analysis Aspect | Description |
|
|
187
|
+
|-----------------|-------------|
|
|
188
|
+
| **Error Category** | Syntax, Logic, Integration, Environment, Performance |
|
|
189
|
+
| **Impact Assessment** | What functionality is affected |
|
|
190
|
+
| **Likely Cause** | Probable source of the issue |
|
|
191
|
+
| **Suggested Fix** | Direction for resolution |
|
|
192
|
+
|
|
193
|
+
### 4.5 Bug Report Quality Checklist
|
|
194
|
+
|
|
195
|
+
Each bug report must include:
|
|
196
|
+
- [ ] Unique Bug ID
|
|
197
|
+
- [ ] Related TC ID
|
|
198
|
+
- [ ] Severity classification
|
|
199
|
+
- [ ] Clear reproduction steps
|
|
200
|
+
- [ ] Expected vs actual result
|
|
201
|
+
- [ ] Relevant log excerpt
|
|
202
|
+
- [ ] Suggested fix direction
|
|
203
|
+
- [ ] Root cause analysis
|
|
204
|
+
|
|
205
|
+
## Step 5: Update Test Report with Bug Links
|
|
206
|
+
|
|
207
|
+
After all bug reports are generated, update the test report:
|
|
208
|
+
|
|
209
|
+
1. Read the test report: `{output_dir}/reports/{feature}-test-report.md`
|
|
210
|
+
2. Update "Failed Test Details" section with links to bug reports
|
|
211
|
+
3. Use `search_replace` to add bug report file paths
|
|
212
|
+
|
|
213
|
+
## Output
|
|
214
|
+
|
|
215
|
+
### Output Files
|
|
216
|
+
|
|
217
|
+
| File | Path | Description |
|
|
218
|
+
|------|------|-------------|
|
|
219
|
+
| Test Report | `{output_dir}/reports/{feature}-test-report.md` | Comprehensive test execution report |
|
|
220
|
+
| Bug Reports | `{output_dir}/bugs/{feature}-bug-{seq}.md` | Individual bug report per failure |
|
|
221
|
+
|
|
222
|
+
### Output Structure
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
{output_dir}/
|
|
226
|
+
├── reports/
|
|
227
|
+
│ └── {feature}-test-report.md
|
|
228
|
+
└── bugs/
|
|
229
|
+
├── {feature}-bug-001.md
|
|
230
|
+
├── {feature}-bug-002.md
|
|
231
|
+
└── ...
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
# Key Rules
|
|
235
|
+
|
|
236
|
+
| Rule | Description |
|
|
237
|
+
|------|-------------|
|
|
238
|
+
| **Template-First Workflow** | Always copy template before filling sections |
|
|
239
|
+
| **One Bug Per File** | Each bug gets its own report file for tracking |
|
|
240
|
+
| **Severity Classification** | Always classify bug severity for prioritization |
|
|
241
|
+
| **Actionable Reports** | Bug reports must include suggested fix direction |
|
|
242
|
+
| **TC ID Traceability** | Every bug must be traced back to its TC ID |
|
|
243
|
+
| **Root Cause Analysis** | Provide detailed analysis of failure causes |
|
|
244
|
+
| **No Execution** | This skill does NOT execute tests, only generates reports |
|
|
245
|
+
|
|
246
|
+
# Checklist
|
|
247
|
+
|
|
248
|
+
- [ ] Execution results document loaded successfully
|
|
249
|
+
- [ ] Test report generated with complete statistics
|
|
250
|
+
- [ ] Results broken down by test dimension
|
|
251
|
+
- [ ] Failed tests linked to corresponding bug reports
|
|
252
|
+
- [ ] Each FAIL/ERROR has a corresponding bug report
|
|
253
|
+
- [ ] Bug severity classified (Critical/High/Medium/Low)
|
|
254
|
+
- [ ] Root cause analysis completed for each bug
|
|
255
|
+
- [ ] All bug reports written to correct output path
|
|
256
|
+
- [ ] Test report written to correct output path
|
|
257
|
+
- [ ] Bug links updated in test report
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
# Task Completion Report
|
|
262
|
+
|
|
263
|
+
Upon completion (success or failure), output the following report format:
|
|
264
|
+
|
|
265
|
+
## Success Report
|
|
266
|
+
```
|
|
267
|
+
## Task Completion Report
|
|
268
|
+
- **Status**: SUCCESS
|
|
269
|
+
- **Task ID**: <from dispatch context, e.g., "test-reporter-web-vue">
|
|
270
|
+
- **Platform**: <platform_id, e.g., "web-vue">
|
|
271
|
+
- **Phase**: test_reporting
|
|
272
|
+
- **Output Files**:
|
|
273
|
+
- `{output_dir}/reports/{feature}-test-report.md`
|
|
274
|
+
- `{output_dir}/bugs/{feature}-bug-{seq}.md` (if any failures)
|
|
275
|
+
- **Summary**: Generated test report with {total} tests, {failed} bugs reported
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
## Failure Report
|
|
279
|
+
```
|
|
280
|
+
## Task Completion Report
|
|
281
|
+
- **Status**: FAILED
|
|
282
|
+
- **Task ID**: <from dispatch context>
|
|
283
|
+
- **Platform**: <platform_id>
|
|
284
|
+
- **Phase**: test_reporting
|
|
285
|
+
- **Output Files**: <list of partial outputs or "None">
|
|
286
|
+
- **Summary**: Test report generation failed during {step}
|
|
287
|
+
- **Error**: <detailed error description>
|
|
288
|
+
- **Error Category**: INPUT_MISSING | TEMPLATE_ERROR | WRITE_ERROR | BLOCKED
|
|
289
|
+
- **Partial Outputs**: <list of files that were generated before failure, or "None">
|
|
290
|
+
- **Recovery Hint**: <suggestion for recovery>
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
**Error Category Definitions**:
|
|
294
|
+
- `INPUT_MISSING`: Required execution results or test cases document not available
|
|
295
|
+
- `TEMPLATE_ERROR`: Template file missing or malformed
|
|
296
|
+
- `WRITE_ERROR`: File system error during report generation
|
|
297
|
+
- `BLOCKED`: Blocked by missing upstream dependency
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Bug Report: {Bug Title}
|
|
2
2
|
|
|
3
3
|
## Bug Information
|
|
4
|
+
|
|
4
5
|
| Item | Value |
|
|
5
6
|
|------|-------|
|
|
6
7
|
| Bug ID | BUG-{feature}-{seq} |
|
|
@@ -9,38 +10,60 @@
|
|
|
9
10
|
| Status | Open |
|
|
10
11
|
| Platform | {platform_id} |
|
|
11
12
|
| Detected Date | {date} |
|
|
12
|
-
| Detected By | speccrew-test-
|
|
13
|
+
| Detected By | speccrew-test-reporter |
|
|
13
14
|
|
|
14
15
|
## Description
|
|
16
|
+
|
|
15
17
|
{brief_description_of_the_bug}
|
|
16
18
|
|
|
17
19
|
## Reproduction Steps
|
|
20
|
+
|
|
18
21
|
1. {step_1}
|
|
19
22
|
2. {step_2}
|
|
20
23
|
3. {step_3}
|
|
21
24
|
|
|
22
25
|
## Expected Result
|
|
26
|
+
|
|
23
27
|
{expected_result_from_test_case}
|
|
24
28
|
|
|
25
29
|
## Actual Result
|
|
30
|
+
|
|
26
31
|
{actual_result_observed}
|
|
27
32
|
|
|
28
33
|
## Error Log
|
|
34
|
+
|
|
29
35
|
```
|
|
30
36
|
{relevant_error_log_or_stack_trace}
|
|
31
37
|
```
|
|
32
38
|
|
|
33
39
|
## Environment
|
|
40
|
+
|
|
34
41
|
| Item | Value |
|
|
35
42
|
|------|-------|
|
|
36
43
|
| OS | {os} |
|
|
37
44
|
| Runtime | {runtime_version} |
|
|
38
45
|
| Related Module | {module_name} |
|
|
39
46
|
|
|
47
|
+
## Root Cause Analysis
|
|
48
|
+
|
|
49
|
+
### Error Category
|
|
50
|
+
|
|
51
|
+
{syntax_logic_integration_environment_performance}
|
|
52
|
+
|
|
53
|
+
### Impact Assessment
|
|
54
|
+
|
|
55
|
+
{what_functionality_is_affected}
|
|
56
|
+
|
|
57
|
+
### Likely Cause
|
|
58
|
+
|
|
59
|
+
{probable_source_of_the_issue}
|
|
60
|
+
|
|
40
61
|
## Suggested Fix Direction
|
|
62
|
+
|
|
41
63
|
{analysis_of_likely_root_cause_and_suggested_fix_approach}
|
|
42
64
|
|
|
43
65
|
## Related Files
|
|
66
|
+
|
|
44
67
|
- Test File: {test_file_path}
|
|
45
68
|
- Source File: {likely_source_file} (if identifiable)
|
|
46
69
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Test Execution Report: {Feature Name}
|
|
2
2
|
|
|
3
3
|
## 1. Execution Summary
|
|
4
|
+
|
|
4
5
|
| Item | Value |
|
|
5
6
|
|------|-------|
|
|
6
7
|
| Feature Name | {feature_name} |
|
|
@@ -8,9 +9,10 @@
|
|
|
8
9
|
| Test Framework | {framework} |
|
|
9
10
|
| Execution Date | {date} |
|
|
10
11
|
| Total Duration | {duration} |
|
|
11
|
-
| Executor | speccrew-test-
|
|
12
|
+
| Executor | speccrew-test-reporter |
|
|
12
13
|
|
|
13
14
|
## 2. Results Overview
|
|
15
|
+
|
|
14
16
|
| Metric | Count | Percentage |
|
|
15
17
|
|--------|-------|------------|
|
|
16
18
|
| Total | {total} | 100% |
|
|
@@ -20,6 +22,7 @@
|
|
|
20
22
|
| Skipped | {skipped} | {skip_rate}% |
|
|
21
23
|
|
|
22
24
|
## 3. Results by Test Dimension
|
|
25
|
+
|
|
23
26
|
| Dimension | Total | Passed | Failed | Pass Rate |
|
|
24
27
|
|-----------|-------|--------|--------|-----------|
|
|
25
28
|
| Happy Path | {n} | {n} | {n} | {rate}% |
|
|
@@ -30,16 +33,19 @@
|
|
|
30
33
|
| Data Validation | {n} | {n} | {n} | {rate}% |
|
|
31
34
|
|
|
32
35
|
## 4. Failed Test Details
|
|
36
|
+
|
|
33
37
|
| TC ID | Test Name | Failure Type | Error Message | Bug Report |
|
|
34
38
|
|-------|-----------|-------------|---------------|------------|
|
|
35
39
|
| {tc_id} | {test_name} | FAIL/ERROR | {message} | {bug_report_link} |
|
|
36
40
|
|
|
37
41
|
## 5. Coverage Status
|
|
42
|
+
|
|
38
43
|
| Requirement ID | Test Case IDs | Status |
|
|
39
44
|
|---------------|---------------|--------|
|
|
40
45
|
| {req_id} | {tc_ids} | Pass/Fail/Partial |
|
|
41
46
|
|
|
42
47
|
## 6. Environment Information
|
|
48
|
+
|
|
43
49
|
| Item | Value |
|
|
44
50
|
|------|-------|
|
|
45
51
|
| OS | {os} |
|
|
@@ -48,6 +54,7 @@
|
|
|
48
54
|
| Dependencies | {key_dependencies} |
|
|
49
55
|
|
|
50
56
|
## 7. Recommendations
|
|
57
|
+
|
|
51
58
|
- {recommendation_1}
|
|
52
59
|
- {recommendation_2}
|
|
53
60
|
|