@ngocsangairvds/vsaf 3.1.0 → 3.1.2
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/skills/graphify/SKILL.md +1 -1
- package/.claude/skills/vsaf-build/SKILL.md +94 -64
- package/.claude/skills/vsaf-discover/SKILL.md +56 -56
- package/.claude/skills/vsaf-doc/SKILL.md +9 -9
- package/.claude/skills/vsaf-doc-prd/SKILL.md +32 -32
- package/.claude/skills/vsaf-doc-srs/SKILL.md +88 -88
- package/.claude/skills/vsaf-docs/SKILL.md +50 -50
- package/.claude/skills/vsaf-onboard/SKILL.md +60 -25
- package/.claude/skills/vsaf-plan/SKILL.md +76 -54
- package/.claude/skills/vsaf-retro/SKILL.md +94 -0
- package/.claude/skills/vsaf-ship/SKILL.md +83 -50
- package/.claude/skills/vsaf-sprint/SKILL.md +42 -42
- package/.claude/skills/vsaf-test/SKILL.md +159 -41
- package/README.md +300 -153
- package/bin/vsaf.js +8 -9
- package/package.json +3 -3
- package/src/global.js +0 -15
- package/src/project.js +0 -9
- package/src/status.js +0 -3
- package/src/workflow.js +15 -16
- package/.claude/skills/vsaf-memory-protocol.md +0 -51
|
@@ -1,65 +1,85 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: vsaf-test
|
|
3
|
-
description:
|
|
3
|
+
description: "Two modes: (1) generate testcases from SRS — used after /vsaf-doc-srs and before /vsaf-build; (2) 'run' — execute tests, verify coverage, write results. Test cases are based on spec, not on code."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# VSAF Test
|
|
7
7
|
|
|
8
|
-
##
|
|
9
|
-
Tạo tài liệu testcase coverage đầy đủ từ SRS để làm contract cho implementation.
|
|
8
|
+
## Mode distinction
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
10
|
+
| Command | Mode | Goal |
|
|
11
|
+
|---------|------|------|
|
|
12
|
+
| `/vsaf-test <path/to/srs>` | **generate** | Generate testcase docs from SRS |
|
|
13
|
+
| `/vsaf-test run <path/to/testcases>` | **run** | Execute tests, verify coverage, write results file |
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Mode 1: Generate — Generate testcases from SRS
|
|
18
|
+
|
|
19
|
+
## Goal
|
|
20
|
+
Create comprehensive testcase coverage documentation from SRS to serve as a contract for implementation.
|
|
21
|
+
|
|
22
|
+
## Prerequisites
|
|
23
|
+
- Already ran `/vsaf-doc-prd` and `/vsaf-doc-srs`
|
|
24
|
+
- SRS file exists in `docs/project/srs/`
|
|
16
25
|
|
|
17
|
-
|
|
18
|
-
- Dùng skill `bmad-qa-generate-e2e-tests` với SRS file trong `docs/project/srs/` làm input
|
|
19
|
-
- Test cases phải cover: happy path, edge cases, error cases, NFRs
|
|
20
|
-
- Nguồn gốc: từ FRs/NFRs trong SRS — KHÔNG dựa trên implementation
|
|
26
|
+
## Steps
|
|
21
27
|
|
|
22
|
-
###
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
- Bổ sung test cases cho mọi edge case chưa cover
|
|
26
|
-
- Mục tiêu: không có unhandled edge case nào lọt qua
|
|
28
|
+
### Step 0 — Find existing test patterns (GitNexus)
|
|
29
|
+
- Use `gitnexus_query({query: "test patterns for <feature domain>"})` to see how the project currently tests
|
|
30
|
+
- Reference existing patterns to generate testcases consistent with the codebase
|
|
27
31
|
|
|
28
|
-
###
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
+
### Step 1 — Generate test cases from SRS (BMAD qa)
|
|
33
|
+
- Use skill `bmad-qa-generate-e2e-tests` with the SRS file in `docs/project/srs/` as input
|
|
34
|
+
- Test cases must cover: happy path, edge cases, error cases, NFRs
|
|
35
|
+
- Source: from FRs/NFRs in SRS — NOT based on implementation
|
|
32
36
|
|
|
33
|
-
###
|
|
34
|
-
-
|
|
35
|
-
-
|
|
37
|
+
### Step 2 — Hunt edge cases (BMAD edge case hunter)
|
|
38
|
+
- Use skill `bmad-review-edge-case-hunter` with SRS + generated testcases
|
|
39
|
+
- Look for: boundary conditions, race conditions, empty/null inputs, overflow, concurrent access
|
|
40
|
+
- Add test cases for all uncovered edge cases
|
|
41
|
+
- Goal: no unhandled edge case slips through
|
|
36
42
|
|
|
37
|
-
###
|
|
38
|
-
-
|
|
43
|
+
### Step 3 — Cross-check coverage
|
|
44
|
+
- Compare test cases against FR/NFR in SRS
|
|
45
|
+
- Each FR/NFR must have at least 1 corresponding test case
|
|
46
|
+
- Document gaps if any
|
|
47
|
+
|
|
48
|
+
### Step 4 — Export traceability matrix
|
|
49
|
+
- Create a mapping table `FR/NFR -> Testcase ID`
|
|
50
|
+
- Each testcase has: input, expected output, pass/fail criteria
|
|
51
|
+
|
|
52
|
+
### Step 5 — Save testcase document
|
|
53
|
+
- Save testcases to `docs/project/testcases/[feature].md`
|
|
39
54
|
- Format:
|
|
40
55
|
|
|
41
56
|
```markdown
|
|
42
57
|
## Testcases: [feature]
|
|
43
58
|
|
|
59
|
+
### Traceability Matrix
|
|
60
|
+
| FR/NFR ID | Testcase IDs | Coverage |
|
|
61
|
+
|-----------|-------------|----------|
|
|
62
|
+
| FR-001 | TC-001, TC-002 | ✓ |
|
|
63
|
+
|
|
44
64
|
### Unit Tests
|
|
45
|
-
| Test case | Input | Expected | Status |
|
|
46
|
-
|
|
47
|
-
|
|
|
65
|
+
| Test case | FR/NFR | Input | Expected | Status |
|
|
66
|
+
|-----------|--------|-------|----------|--------|
|
|
67
|
+
| TC-001 | FR-001 | ... | ... | [ ] |
|
|
48
68
|
|
|
49
69
|
### Integration Tests
|
|
50
|
-
| ... | ... | ... | [ ] |
|
|
70
|
+
| ... | ... | ... | ... | [ ] |
|
|
51
71
|
|
|
52
72
|
### Edge Cases
|
|
53
|
-
| ... | ... | ... | [ ] |
|
|
73
|
+
| ... | ... | ... | ... | [ ] |
|
|
54
74
|
```
|
|
55
75
|
|
|
56
|
-
###
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
76
|
+
### Step 6 — Implementation readiness gate (BMAD)
|
|
77
|
+
- Use skill `bmad-check-implementation-readiness` to validate all artifacts
|
|
78
|
+
- Check: SRS complete? Testcases cover all FRs/NFRs? Architecture aligned?
|
|
79
|
+
- If **PASS**: display `✓ Implementation ready — proceed to /vsaf-build`
|
|
80
|
+
- If **FAIL**: list gaps that need fixing before build, DO NOT proceed
|
|
61
81
|
|
|
62
|
-
###
|
|
82
|
+
### Step 7 — Output to user
|
|
63
83
|
```
|
|
64
84
|
## Testcase Summary: [feature]
|
|
65
85
|
|
|
@@ -72,10 +92,108 @@ Files:
|
|
|
72
92
|
- docs/project/testcases/[feature].md
|
|
73
93
|
|
|
74
94
|
## Next step
|
|
75
|
-
[
|
|
76
|
-
[
|
|
95
|
+
[If PASS]: Run /vsaf-build <path/to/prd> <path/to/srs> <path/to/testcases>
|
|
96
|
+
[If FAIL]: Fix gaps listed above, then re-run /vsaf-test
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
# Mode 2: Run — Execute tests + write results
|
|
102
|
+
|
|
103
|
+
## Goal
|
|
104
|
+
Execute the full test suite, verify coverage matches changed code, write a structured results file. The results file is a required input for `/vsaf-ship`.
|
|
105
|
+
|
|
106
|
+
## Prerequisites
|
|
107
|
+
- Already ran `/vsaf-build` — code implementation is complete
|
|
108
|
+
- Testcase file exists at `docs/project/testcases/[feature].md`
|
|
109
|
+
|
|
110
|
+
## Steps
|
|
111
|
+
|
|
112
|
+
### Step 1 — Re-read testcase file
|
|
113
|
+
- Re-read the testcase file, confirm all tests are present
|
|
114
|
+
- Cross-check with traceability matrix: each FR/NFR must have at least 1 test
|
|
115
|
+
|
|
116
|
+
### Step 2 — Execute test suite
|
|
117
|
+
- Run all tests: unit + integration + e2e
|
|
118
|
+
- Use the project test runner (Maven/Gradle/npm/etc.)
|
|
119
|
+
- Record output for each test case
|
|
120
|
+
|
|
121
|
+
### Step 3 — Map results back to FR/NFR
|
|
122
|
+
- Record pass/fail for each testcase
|
|
123
|
+
- Map results back to the traceability matrix: which FR/NFR passed, which have not
|
|
124
|
+
|
|
125
|
+
### Step 4 — Verify coverage matches changed code (GitNexus)
|
|
126
|
+
- Run `gitnexus_detect_changes({scope: "compare", base_ref: "main"})`
|
|
127
|
+
- Compare the list of changed files/symbols with the list of tested files/symbols
|
|
128
|
+
- Flag any changed file/symbol that does NOT have test coverage
|
|
129
|
+
|
|
130
|
+
### Step 5 — Architectural constraint check (GitNexus, optional)
|
|
131
|
+
- Run `gitnexus_shape_check` to validate no architectural constraints are violated
|
|
132
|
+
- Record constraint compliance results in the results file
|
|
133
|
+
|
|
134
|
+
### Step 6 — Write results file
|
|
135
|
+
- Save results to `docs/project/testcases/[feature]-results.md`
|
|
136
|
+
- Format:
|
|
137
|
+
|
|
138
|
+
```markdown
|
|
139
|
+
## Test Results: [feature]
|
|
140
|
+
Date: [YYYY-MM-DD]
|
|
141
|
+
|
|
142
|
+
### Summary
|
|
143
|
+
| Metric | Value |
|
|
144
|
+
|--------|-------|
|
|
145
|
+
| Total tests | [N] |
|
|
146
|
+
| Passed | [N] |
|
|
147
|
+
| Failed | [N] |
|
|
148
|
+
| Pass rate | [%] |
|
|
149
|
+
| FR/NFR coverage | [X/Y] ([%]) |
|
|
150
|
+
| Untested changes | [N files/symbols] |
|
|
151
|
+
| Shape check | [PASS / SKIP / FAIL] |
|
|
152
|
+
|
|
153
|
+
### Results by FR/NFR
|
|
154
|
+
| FR/NFR ID | Tests | Passed | Failed | Status |
|
|
155
|
+
|-----------|-------|--------|--------|--------|
|
|
156
|
+
| FR-001 | 3 | 3 | 0 | ✓ |
|
|
157
|
+
| FR-002 | 2 | 1 | 1 | ✗ |
|
|
158
|
+
|
|
159
|
+
### Failed Tests
|
|
160
|
+
| Test case | FR/NFR | Expected | Actual | Notes |
|
|
161
|
+
|-----------|--------|----------|--------|-------|
|
|
162
|
+
|
|
163
|
+
### Untested Changes (from detect_changes)
|
|
164
|
+
| File/Symbol | Change type | Test coverage |
|
|
165
|
+
|-------------|------------|---------------|
|
|
166
|
+
|
|
167
|
+
### Shape Check Results
|
|
168
|
+
[Output from gitnexus_shape_check, or "Skipped"]
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Step 7 — Ship gate
|
|
172
|
+
- **PASS** if:
|
|
173
|
+
- All FR/NFR have at least 1 test PASS
|
|
174
|
+
- No untested changes (or reason has been explained)
|
|
175
|
+
- Shape check has no violations
|
|
176
|
+
- **FAIL** if:
|
|
177
|
+
- Any FR/NFR has 0 passing tests -> **blocks ship**
|
|
178
|
+
- Untested changes detected without justification -> **blocks ship**
|
|
179
|
+
- Shape check violations -> **blocks ship**
|
|
180
|
+
- Display:
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
## Test Run Results: [feature]
|
|
184
|
+
|
|
185
|
+
- Pass rate: [X/Y] ([%])
|
|
186
|
+
- FR/NFR coverage: [X/Y] ([%])
|
|
187
|
+
- Untested changes: [N] — [CLEAR / BLOCKED]
|
|
188
|
+
- Shape check: [PASS / SKIP / FAIL]
|
|
189
|
+
- Ship gate: [PASS ✓ / FAIL ✗]
|
|
190
|
+
|
|
191
|
+
Results file: docs/project/testcases/[feature]-results.md
|
|
192
|
+
|
|
193
|
+
## Next step
|
|
194
|
+
[If PASS]: Run /vsaf-ship
|
|
195
|
+
[If FAIL]: Fix failures above, then re-run /vsaf-test run
|
|
77
196
|
```
|
|
78
197
|
|
|
79
|
-
##
|
|
80
|
-
-
|
|
81
|
-
- Nếu coverage thiếu cho FR/NFR quan trọng: quay lại cập nhật SRS trước khi build
|
|
198
|
+
## Notes
|
|
199
|
+
- Results file is a required input for `/vsaf-ship` — no results = no ship
|