@haaaiawd/anws 2.2.6 → 2.4.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.
Files changed (94) hide show
  1. package/README.md +1 -1
  2. package/bin/cli.js +52 -22
  3. package/lib/diff.js +5 -2
  4. package/lib/init.js +217 -96
  5. package/lib/install-state.js +18 -3
  6. package/lib/manifest.js +510 -213
  7. package/lib/prompt.js +68 -0
  8. package/lib/resources/index.js +36 -2
  9. package/lib/update.js +12 -6
  10. package/package.json +48 -47
  11. package/templates/.agents/skills/anws-system/SKILL.md +108 -108
  12. package/templates/.agents/skills/code-reviewer/SKILL.md +170 -103
  13. package/templates/.agents/skills/concept-modeler/SKILL.md +230 -179
  14. package/templates/.agents/skills/craft-authoring/SKILL.md +112 -49
  15. package/templates/.agents/skills/craft-authoring/references/BUNDLE_POLICY.md +61 -0
  16. package/templates/.agents/skills/craft-authoring/references/PROMPT_QUALITY_RUBRIC.md +99 -0
  17. package/templates/.agents/skills/craft-authoring/references/SCORECARD_TEMPLATE.md +64 -0
  18. package/templates/.agents/skills/design-reviewer/SKILL.md +265 -190
  19. package/templates/.agents/skills/e2e-testing-guide/SKILL.md +246 -135
  20. package/templates/.agents/skills/nexus-mapper/SKILL.md +321 -321
  21. package/templates/.agents/skills/output-contract/SKILL.md +37 -0
  22. package/templates/.agents/skills/report-template/SKILL.md +92 -92
  23. package/templates/.agents/skills/sequential-thinking/SKILL.md +222 -225
  24. package/templates/.agents/skills/spec-writer/SKILL.md +75 -30
  25. package/templates/.agents/skills/system-architect/SKILL.md +538 -678
  26. package/templates/.agents/skills/system-designer/SKILL.md +601 -601
  27. package/templates/.agents/skills/task-planner/SKILL.md +1 -2
  28. package/templates/.agents/skills/task-reviewer/SKILL.md +428 -388
  29. package/templates/.agents/skills/tech-evaluator/SKILL.md +252 -144
  30. package/templates/.agents/workflows/blueprint.md +166 -43
  31. package/templates/.agents/workflows/challenge.md +331 -497
  32. package/templates/.agents/workflows/change.md +182 -339
  33. package/templates/.agents/workflows/craft.md +159 -236
  34. package/templates/.agents/workflows/design-system.md +202 -674
  35. package/templates/.agents/workflows/explore.md +187 -399
  36. package/templates/.agents/workflows/forge.md +650 -550
  37. package/templates/.agents/workflows/genesis.md +439 -351
  38. package/templates/.agents/workflows/probe.md +219 -241
  39. package/templates/.agents/workflows/quickstart.md +302 -123
  40. package/templates/.agents/workflows/upgrade.md +145 -182
  41. package/templates_en/.agents/skills/anws-system/SKILL.md +108 -0
  42. package/templates_en/.agents/skills/code-reviewer/SKILL.md +170 -0
  43. package/templates_en/.agents/skills/concept-modeler/SKILL.md +230 -0
  44. package/templates_en/.agents/skills/craft-authoring/SKILL.md +179 -0
  45. package/templates_en/.agents/skills/craft-authoring/references/BUNDLE_POLICY.md +60 -0
  46. package/templates_en/.agents/skills/craft-authoring/references/PROMPT_QUALITY_RUBRIC.md +92 -0
  47. package/templates_en/.agents/skills/craft-authoring/references/SCORECARD_TEMPLATE.md +52 -0
  48. package/templates_en/.agents/skills/design-reviewer/SKILL.md +265 -0
  49. package/templates_en/.agents/skills/e2e-testing-guide/SKILL.md +246 -0
  50. package/templates_en/.agents/skills/nexus-mapper/SKILL.md +306 -0
  51. package/templates_en/.agents/skills/nexus-mapper/references/language-customization.md +167 -0
  52. package/templates_en/.agents/skills/nexus-mapper/references/output-schema.md +311 -0
  53. package/templates_en/.agents/skills/nexus-mapper/references/probe-protocol.md +246 -0
  54. package/templates_en/.agents/skills/nexus-mapper/scripts/extract_ast.py +706 -0
  55. package/templates_en/.agents/skills/nexus-mapper/scripts/git_detective.py +194 -0
  56. package/templates_en/.agents/skills/nexus-mapper/scripts/languages.json +127 -0
  57. package/templates_en/.agents/skills/nexus-mapper/scripts/query_graph.py +556 -0
  58. package/templates_en/.agents/skills/nexus-mapper/scripts/requirements.txt +6 -0
  59. package/templates_en/.agents/skills/nexus-query/SKILL.md +114 -0
  60. package/templates_en/.agents/skills/nexus-query/scripts/extract_ast.py +706 -0
  61. package/templates_en/.agents/skills/nexus-query/scripts/git_detective.py +194 -0
  62. package/templates_en/.agents/skills/nexus-query/scripts/languages.json +127 -0
  63. package/templates_en/.agents/skills/nexus-query/scripts/query_graph.py +556 -0
  64. package/templates_en/.agents/skills/nexus-query/scripts/requirements.txt +6 -0
  65. package/templates_en/.agents/skills/output-contract/SKILL.md +37 -0
  66. package/templates_en/.agents/skills/report-template/SKILL.md +85 -0
  67. package/templates_en/.agents/skills/report-template/references/REPORT_TEMPLATE.md +100 -0
  68. package/templates_en/.agents/skills/runtime-inspector/SKILL.md +101 -0
  69. package/templates_en/.agents/skills/sequential-thinking/SKILL.md +214 -0
  70. package/templates_en/.agents/skills/spec-writer/SKILL.md +153 -0
  71. package/templates_en/.agents/skills/spec-writer/references/prd_template.md +177 -0
  72. package/templates_en/.agents/skills/system-architect/SKILL.md +538 -0
  73. package/templates_en/.agents/skills/system-architect/references/rfc_template.md +59 -0
  74. package/templates_en/.agents/skills/system-designer/SKILL.md +534 -0
  75. package/templates_en/.agents/skills/system-designer/references/system-design-detail-template.md +187 -0
  76. package/templates_en/.agents/skills/system-designer/references/system-design-template.md +605 -0
  77. package/templates_en/.agents/skills/task-planner/SKILL.md +251 -0
  78. package/templates_en/.agents/skills/task-planner/references/TASK_TEMPLATE_05A.md +109 -0
  79. package/templates_en/.agents/skills/task-planner/references/TASK_TEMPLATE_05B.md +176 -0
  80. package/templates_en/.agents/skills/task-reviewer/SKILL.md +428 -0
  81. package/templates_en/.agents/skills/tech-evaluator/SKILL.md +252 -0
  82. package/templates_en/.agents/skills/tech-evaluator/references/ADR_TEMPLATE.md +78 -0
  83. package/templates_en/.agents/workflows/blueprint.md +200 -0
  84. package/templates_en/.agents/workflows/challenge.md +331 -0
  85. package/templates_en/.agents/workflows/change.md +182 -0
  86. package/templates_en/.agents/workflows/craft.md +159 -0
  87. package/templates_en/.agents/workflows/design-system.md +202 -0
  88. package/templates_en/.agents/workflows/explore.md +187 -0
  89. package/templates_en/.agents/workflows/forge.md +651 -0
  90. package/templates_en/.agents/workflows/genesis.md +439 -0
  91. package/templates_en/.agents/workflows/probe.md +219 -0
  92. package/templates_en/.agents/workflows/quickstart.md +303 -0
  93. package/templates_en/.agents/workflows/upgrade.md +145 -0
  94. package/templates_en/AGENTS.md +149 -0
@@ -0,0 +1,251 @@
1
+ ---
2
+ name: task-planner
3
+ description: Use WBS to decompose system design into an execution list (05A_TASKS.md) and a verification plan (05B_VERIFICATION_PLAN.md), with dependency analysis, traceability, and evidence ownership.
4
+ ---
5
+
6
+ # Task Planner
7
+
8
+ You are the task decomposition and verification orchestration skill.
9
+
10
+ Outputs:
11
+ - `.anws/v{N}/05A_TASKS.md` (execution list)
12
+ - `.anws/v{N}/05B_VERIFICATION_PLAN.md` (verification plan)
13
+
14
+ ---
15
+
16
+ ## Fast Flow
17
+
18
+ 1. Read `01_PRD.md` and `02_ARCHITECTURE_OVERVIEW.md`.
19
+ 2. Read `03_ADR/` and `04_SYSTEM_DESIGN/` when available.
20
+ 3. If ADR provides testing strategy or quality gates, follow them first.
21
+ 4. Extract public contracts (HTTP API, CLI, config, format, error semantics, persistence, cross-system interfaces).
22
+ 5. Generate WBS tasks to 05A.
23
+ 6. Generate verification anchors and evidence ownership to 05B.
24
+
25
+ ---
26
+
27
+ ## Split Responsibilities
28
+
29
+ ### 05A_TASKS.md (Execution Track)
30
+
31
+ - WBS task definitions
32
+ - dependencies and estimates
33
+ - sprint roadmap
34
+ - INT milestone tasks
35
+ - progress checkboxes
36
+ - User Story Overlay
37
+
38
+ ### 05B_VERIFICATION_PLAN.md (Verification Track)
39
+
40
+ - verification layering strategy
41
+ - risk-category coverage rules
42
+ - Task-by-Task verification plan
43
+ - Contract Coverage Overlay
44
+ - Testing Coverage Overlay
45
+ - Verification Traceability Matrix
46
+
47
+ > [!IMPORTANT]
48
+ > The following three sections are mandatory in 05B and must not be removed:
49
+ > - Contract Coverage Overlay
50
+ > - Testing Coverage Overlay
51
+ > - Verification Traceability Matrix
52
+
53
+ ---
54
+
55
+ ## 05A Task Structure
56
+
57
+ ```markdown
58
+ - [ ] **T{System}.{Phase}.{Seq}** [REQ-XXX]: Task title
59
+ - **Description**: what to build (not how)
60
+ - **Input**: design references + predecessor outputs (must include at least one design document reference)
61
+ - **Output**: files/components/interfaces/artifacts
62
+ - **Contract Ownership**: public contract implemented or verified by this task, or "None"
63
+ - **Reference**: ADR/System Design section if applicable
64
+ - **Acceptance Criteria**:
65
+ - Given ...
66
+ - When ...
67
+ - Then ...
68
+ - (Clear Done When is allowed only for pure technical foundation tasks)
69
+ - **Verification Type**: Unit Test | API Interface Functional Test | Integration Test | E2E Test | Smoke Test | Regression Test | Manual Verification | Build Check | Lint Check
70
+ - **Verification Summary**: verification scope and boundary only
71
+ - **Verification Reference**: `05B_VERIFICATION_PLAN.md#t-x-y-z`
72
+ - **Evidence Output**: `tests/...`, `reports/...`, `screenshots/...`, `logs/...`
73
+ - **Estimate**: Xh
74
+ - **Dependencies**: T{A}.{B}.{C}
75
+ - **Priority**: P0 | P1 | P2
76
+ ```
77
+
78
+ ---
79
+
80
+ ## 05B Verification Structure
81
+
82
+ ### Task-by-Task Entry
83
+
84
+ ```markdown
85
+ ### T{X}.{Y}.{Z}
86
+ - Related Requirement:
87
+ - Related Contract:
88
+ - Risk Category:
89
+ - Unit Test Coverage:
90
+ - API Interface Functional Test Coverage:
91
+ - Integration/E2E/Smoke Coverage:
92
+ - Preconditions/Test Data:
93
+ - Assertions:
94
+ - Evidence:
95
+ ```
96
+
97
+ ### Traceability Matrix
98
+
99
+ ```markdown
100
+ ## Verification Traceability Matrix
101
+ | REQ/Contract | Task | Verification | Test Material | Evidence | Status |
102
+ |---|---|---|---|---|---|
103
+ ```
104
+
105
+ ---
106
+
107
+ ## Verification Type Selection Logic
108
+
109
+ Follow the "lightest sufficient proof" principle:
110
+
111
+ 1. Local logic / pure algorithm / state transition / exception handling -> Unit Test
112
+ 2. HTTP API / CLI API / permission boundary / error semantics / data-changing endpoint -> API Interface Functional Test
113
+ 3. Cross-module or cross-service collaboration -> Integration Test
114
+ 4. Critical end-user journey -> E2E Test or Manual Verification
115
+ 5. Sprint milestone gate -> Smoke Test (prefer binding to `INT-S{N}`)
116
+ 6. Changes that may impact existing critical behavior -> Regression Test
117
+ 7. Config or scaffolding tasks -> Build Check / Lint Check / Manual Verification
118
+
119
+ Selection rules:
120
+ - do not upgrade to E2E by default
121
+ - for public API changes, verification must include normal and representative invalid request paths
122
+ - data-changing endpoints must include before/after assertions
123
+ - auth/role/permission changes must include permission-denied scenarios
124
+
125
+ ### E2E Execution Boundary (Hard Rule)
126
+
127
+ - `task-planner` only records E2E trigger assumptions, coverage scope, and expected evidence in `05A_TASKS.md` / `05B_VERIFICATION_PLAN.md`
128
+ - planning phase must not call or execute `e2e-testing-guide`
129
+ - actual E2E guide generation and real-browser validation are executed by `/forge` when triggered by tasks
130
+
131
+ ---
132
+
133
+ ## Hard Testing Constraints
134
+
135
+ > [!IMPORTANT]
136
+ > Project acceptance must include both Unit Tests and API Interface Functional Tests.
137
+
138
+ ### Unit Test Responsibilities
139
+
140
+ - normal, boundary, and invalid input
141
+ - critical state transitions (create, execute, fail, retry style)
142
+ - exception handling (null, out-of-range, invalid state) with stable behavior
143
+
144
+ ### API Interface Functional Test Responsibilities
145
+
146
+ - normal request path
147
+ - missing parameter, malformed parameter, and permission-denied scenarios
148
+ - expected error code and error message semantics
149
+ - before/after assertions for data-changing interfaces
150
+
151
+ ### Anti-Bloat Policy
152
+
153
+ - close risk categories, do not maximize raw test counts
154
+ - prefer equivalence classes, boundary values, representative invalid samples, parameterized or table-driven tests
155
+ - avoid full Cartesian-product enumeration
156
+ - keep E2E focused on key user chains
157
+
158
+ ---
159
+
160
+ ## Contract Coverage Rules
161
+
162
+ > [!IMPORTANT]
163
+ > If task outputs include or modify public contracts, explicit verification ownership is mandatory.
164
+
165
+ Public contract coverage is mandatory whenever tasks create or modify externally observable behavior.
166
+
167
+ Rules:
168
+ - each public contract needs at least one implementation owner task
169
+ - each high-risk public contract needs at least one verification owner point
170
+ - implementation-only is not contract closure
171
+ - foundational low-dependency logic defaults to Unit Test ownership
172
+ - external interfaces (HTTP API / CLI API) default to explicit API Interface Functional Test evaluation
173
+ - error semantics and before/after data state are observable contract parts and cannot be skipped
174
+
175
+ ---
176
+
177
+ ## WBS Method
178
+
179
+ ### Three Levels
180
+
181
+ ```text
182
+ Level 1: System <- system list from Architecture Overview
183
+ Level 2: Phase <- Foundation / Core / Integration / Polish
184
+ Level 3: Task <- concrete tasks, typically 2h-2d granularity
185
+ ```
186
+
187
+ ### Sprint Roadmap Format
188
+
189
+ ```markdown
190
+ ## Sprint Roadmap
191
+
192
+ | Sprint | Codename | Core Work | Exit Criteria | Estimate |
193
+ |--------|----------|-----------|---------------|----------|
194
+ | S1 | Hello World | Infrastructure + core data | headless run passes + basic rendering visible | 3-4d |
195
+ ```
196
+
197
+ Exit criteria requirements:
198
+ - objectively verifiable (screenshots / recordings / logs)
199
+ - describe observable behavior for users or developers
200
+ - include cross-system integration signals
201
+
202
+ ### Integration Verification Task (`INT-S{N}`)
203
+
204
+ ```markdown
205
+ - [ ] **INT-S{N}** [MILESTONE]: S{N} integration verification — {codename}
206
+ - **Description**: verify S{N} exit criteria
207
+ - **Input**: outputs from all S{N} tasks
208
+ - **Output**: integration verification report (pass/fail + bug list)
209
+ - **Acceptance Criteria**:
210
+ - Given all S{N} tasks are completed
211
+ - When each exit criterion check is executed
212
+ - Then all pass -> sprint closes; any failure -> bug is recorded
213
+ - **Verification Notes**: execute checks item by item against exit criteria, confirm with screenshots/recordings/logs
214
+ - **Estimate**: 2-4h
215
+ - **Dependencies**: last task in S{N}
216
+ ```
217
+
218
+ `INT` is the sprint closing gate. A sprint must not be marked complete before its `INT` task passes.
219
+
220
+ ---
221
+
222
+ ## Task Quality Rules
223
+
224
+ ### Granularity
225
+
226
+ - keep single tasks in the 2h-2d range when possible; split further when over 2d
227
+ - merge tiny tasks when they are below roughly 2h
228
+
229
+ ### Input/Output Traceability
230
+
231
+ > [!IMPORTANT]
232
+ > Task inputs and outputs must align.
233
+ >
234
+ > If Task B depends on Task A, Task B input must reference concrete artifacts from Task A output (file path, interface name, or data format).
235
+
236
+ ### Acceptance Criteria
237
+
238
+ - default to Given / When / Then
239
+ - clear Done When lists are allowed only for pure technical foundation work (config / scaffolding)
240
+
241
+ ---
242
+
243
+ ## Output Quality Checklist
244
+
245
+ - both 05A and 05B generated
246
+ - every 05A task includes `Verification Reference` and `Evidence Output`
247
+ - 05B includes Task-by-Task plan and traceability matrix
248
+ - User Story Overlay is in 05A
249
+ - Contract Coverage Overlay, Testing Coverage Overlay, and Verification Traceability Matrix are in 05B
250
+ - smoke checks are centered on `INT-S{N}`
251
+ - no E2E abuse pattern
@@ -0,0 +1,109 @@
1
+ # 05A_TASKS.md Template Reference
2
+
3
+ > This file is the format reference for `05A_TASKS.md`.
4
+ > `05A` is execution-only and must not carry detailed verification design.
5
+ > Detailed verification planning belongs to `05B_VERIFICATION_PLAN.md`.
6
+
7
+ ---
8
+
9
+ ## Document Header
10
+
11
+ ```markdown
12
+ # 05A_TASKS.md - Execution Task List
13
+
14
+ > Version: v{N}
15
+ > Generated by: /blueprint
16
+ > Last updated: {Today}
17
+ >
18
+ > Verification plan: 05B_VERIFICATION_PLAN.md (every task links through Verification Reference)
19
+ ```
20
+
21
+ ---
22
+
23
+ ## Dependency Overview
24
+
25
+ ```markdown
26
+ ## Dependency Overview
27
+
28
+ \`\`\`mermaid
29
+ graph TD
30
+ T1.1.1[Project setup] --> T2.1.1[Implement core logic]
31
+ T2.1.1 --> T2.1.2[Implement API endpoint]
32
+ T3.1.1[Database schema] --> T2.1.1
33
+ T2.1.2 --> T1.2.1[Frontend integration]
34
+ \`\`\`
35
+
36
+ ```
37
+
38
+ ---
39
+
40
+ ## Sprint Roadmap
41
+
42
+ ```markdown
43
+ ## Sprint Roadmap
44
+
45
+ | Sprint | Codename | Core Tasks | Exit Criteria | Estimate |
46
+ |--------|----------|------------|---------------|----------|
47
+ | S1 | Hello World | foundation + core data | headless run succeeds + visible baseline behavior | 3-4d |
48
+ | S2 | Feature Shape | core business + APIs | complete flow is demoable | 5-6d |
49
+ ```
50
+
51
+ ---
52
+
53
+ ## Task Structure
54
+
55
+ ```markdown
56
+ - [ ] **T{System}.{Phase}.{Seq}** [REQ-XXX]: Task title
57
+ - **Description**: what to do (not how)
58
+ - **Input**: design references + predecessor outputs (must include at least one design-doc reference)
59
+ - **Output**: files/components/interfaces/artifacts
60
+ - **Contract Ownership**: contract implemented/verified by this task, or "None"
61
+ - **Reference**: ADR / System Design section (if applicable)
62
+ - **Acceptance Criteria**:
63
+ - Given ...
64
+ - When ...
65
+ - Then ...
66
+ - (Done When only for pure technical foundation tasks)
67
+ - **Verification Type**: Unit Test | API Interface Functional Test | Integration Test | E2E Test | Smoke Test | Regression Test | Manual Verification | Build Check | Lint Check
68
+ - **E2E Trigger Assumption**: if E2E is needed, define trigger conditions and key user journey (planning placeholder only; no E2E execution in blueprint/planner stage)
69
+ - **Verification Summary**: objective and boundary only
70
+ - **Verification Reference**: `05B_VERIFICATION_PLAN.md#t-x-y-z`
71
+ - **Evidence Output**: `tests/...`, `reports/...`, `logs/...`, `screenshots/...`
72
+ - **Estimate**: Xh
73
+ - **Dependencies**: T{A}.{B}.{C}
74
+ - **Priority**: P0 | P1 | P2
75
+ ```
76
+
77
+ ---
78
+
79
+ ## INT Milestone Task Format
80
+
81
+ ```markdown
82
+ - [ ] **INT-S{N}** [MILESTONE]: S{N} integration validation - {codename}
83
+ - **Description**: verify sprint exit criteria and cross-system collaboration
84
+ - **Input**: outputs of all S{N} tasks
85
+ - **Output**: integration report (pass/fail + bug list)
86
+ - **Acceptance Criteria**:
87
+ - Given all S{N} tasks are complete
88
+ - When every exit-criteria check is executed
89
+ - Then all pass -> sprint complete; failures -> bugs recorded
90
+ - **Verification Type**: Integration Test / Smoke Test
91
+ - **Verification Notes**: run checks one by one, keep logs/screenshots, add minimal regression checks if needed
92
+ - **Estimate**: 2-4h
93
+ - **Dependencies**: all S{N} tasks
94
+ ```
95
+
96
+ ---
97
+
98
+ ## User Story Overlay (append near end)
99
+
100
+ ```markdown
101
+ ## User Story Overlay
102
+
103
+ ### US-001: [Title] (P0)
104
+ **Tasks**: T1.1.1 -> T1.2.1 -> T2.1.1
105
+ **Critical Path**: T1.1.1 -> T1.2.1
106
+ **Independently Testable**: Demoable by end of S1
107
+ **Coverage Status**: Complete
108
+ ```
109
+
@@ -0,0 +1,176 @@
1
+ # 05B_VERIFICATION_PLAN.md Template Reference
2
+
3
+ > This file is the format reference for `05B_VERIFICATION_PLAN.md`.
4
+ > `05B` is verification-only and must not include execution-track task ownership.
5
+ > The execution track belongs to `05A_TASKS.md`.
6
+
7
+ ---
8
+
9
+ ## Document Header
10
+
11
+ ```markdown
12
+ # 05B_VERIFICATION_PLAN.md - Verification Plan
13
+
14
+ > Version: v{N}
15
+ > Generated by: /blueprint
16
+ > Last updated: {Today}
17
+ >
18
+ > Execution list: 05A_TASKS.md (each verification entry maps to a task ID)
19
+ ```
20
+
21
+ ---
22
+
23
+ ## Section Structure Overview
24
+
25
+ ```text
26
+ 1. Scope and Goal
27
+ 2. Verification Layering Strategy
28
+ 3. Risk Category Coverage Principles
29
+ 4. Test Material and Evidence Requirements
30
+ 5. Task-by-Task Verification Plan
31
+ 6. Contract Coverage Overlay
32
+ 7. Testing Coverage Overlay
33
+ 8. Verification Traceability Matrix
34
+ ```
35
+
36
+ > [!IMPORTANT]
37
+ > Sections 6/7/8 are mandatory and must not be deleted or merged away:
38
+ >
39
+ > - Contract Coverage Overlay (who implements and who verifies each contract)
40
+ > - Testing Coverage Overlay (which test method closes which risk category)
41
+ > - Verification Traceability Matrix (auditable chain: REQ/Contract -> Task -> Verification -> Evidence)
42
+
43
+ ---
44
+
45
+ ## Sections 1-4: Strategy Format
46
+
47
+ ```markdown
48
+ ## 1. Scope and Goal
49
+
50
+ This plan covers all P0/P1 tasks in v{N}, and ensures:
51
+ - correctness, stability, and robustness of core functionality, critical logic, and exception handling
52
+ - project acceptance includes both Unit Test and API Interface Functional Test
53
+
54
+ ## 2. Verification Layering Strategy
55
+
56
+ | Layer | Responsibility | Typical Tooling |
57
+ |------|----------------|-----------------|
58
+ | Unit Test | local logic, state transitions, exception paths | Jest / pytest / go test |
59
+ | API Interface Functional Test | HTTP API contracts, error semantics, data-changing behaviors | Postman / httpie / pytest |
60
+ | Integration Test | cross-module/cross-service collaboration | integration frameworks |
61
+ | E2E Test | key end-user journeys | Playwright / Cypress |
62
+ | Smoke Test | sprint exit gate key paths | executed with INT-S{N} |
63
+ | Regression Test | ensure changes do not break completed critical capability | reuse targeted existing suites |
64
+
65
+ ## 3. Risk Category Coverage Principles
66
+
67
+ - close risk categories, do not maximize test count
68
+ - prefer equivalence classes, boundary values, representative negative samples
69
+ - avoid Cartesian-product enumeration across all fields/parameters
70
+ - Unit Test owns fine-grained logic, API Interface Functional Test owns external contracts, E2E stays on key user journeys only
71
+
72
+ ## 4. Test Material and Evidence Requirements
73
+
74
+ | Verification Type | Test Material Location | Evidence Form |
75
+ |------------------|------------------------|---------------|
76
+ | Unit Test | `tests/unit/` | test run report / CI logs |
77
+ | API Interface Functional Test | `tests/api/` | HTTP response records / test reports |
78
+ | Integration Test | `tests/integration/` | integration reports |
79
+ | E2E Test | `tests/e2e/` | screenshots / recordings |
80
+ | Smoke Test | bound to INT-S{N} | key-path screenshots / logs |
81
+ ```
82
+
83
+ ---
84
+
85
+ ## Section 5: Task-by-Task Verification Format
86
+
87
+ Every task in 05A should map to one detailed verification entry here:
88
+
89
+ ```markdown
90
+ ## 5. Task-by-Task Verification Plan
91
+
92
+ ### T1.2.1
93
+ - **Related Requirement**: REQ-001 (User Login)
94
+ - **Related Contract**: `POST /auth/login` HTTP API contract
95
+ - **Risk Category**: API contract / auth logic / error semantics
96
+ - **Unit Test Coverage**:
97
+ - JWT signing: valid input returns valid token (normal)
98
+ - JWT signing: empty secret throws ConfigurationError (exception path)
99
+ - password compare: hash-match true, mismatch false (boundary)
100
+ - **API Interface Functional Test Coverage**:
101
+ - normal request: valid username + password -> 200 + JWT token
102
+ - missing parameter: no `password` in body -> 400 + `MISSING_PARAM`
103
+ - malformed parameter: empty `username` -> 400 + `INVALID_PARAM`
104
+ - permission denied: invalid credential -> 401 + `INVALID_CREDENTIALS`
105
+ - before/after state: N/A for login endpoint (no data mutation)
106
+ - **Integration/E2E/Smoke Coverage**: bind to INT-S1 smoke check for end-to-end login usability
107
+ - **Preconditions/Test Data**: test user `user@test.com` exists in DB with hashed password
108
+ - **Assertions**:
109
+ - 200 response body contains `token` field in valid JWT format
110
+ - 401 response body contains `error.code === "INVALID_CREDENTIALS"`
111
+ - 400 response body contains expected `error.code` for each invalid case
112
+ - **Evidence**: `tests/unit/jwt.test.ts`, `tests/api/auth.test.ts`, CI report
113
+
114
+ ### INT-S1
115
+ - **Related Requirement**: S1 exit criteria
116
+ - **Related Contract**: public contracts completed in S1
117
+ - **Risk Category**: system availability / sprint gate
118
+ - **Unit Test Coverage**: N/A (INT does not add new unit tests)
119
+ - **API Interface Functional Test Coverage**: N/A
120
+ - **Integration/E2E/Smoke Coverage**: execute sprint exit checks as smoke tests
121
+ - **Preconditions/Test Data**: all S1 tasks completed with usable outputs
122
+ - **Assertions**: each observable behavior in exit criteria passes
123
+ - **Evidence**: screenshots / recordings / integration report
124
+ ```
125
+
126
+ ---
127
+
128
+ ## Section 6: Contract Coverage Overlay Format
129
+
130
+ > Mandatory. Must not be removed.
131
+
132
+ ```markdown
133
+ ## 6. Contract Coverage Overlay
134
+
135
+ | Contract | Type | Implementation Owner | Verification Owner | Status |
136
+ |----------|------|----------------------|--------------------|:------:|
137
+ | `POST /auth/login` HTTP API | HTTP API | T1.2.1 | T1.2.1 API Interface Functional Test | ⬜ |
138
+ | JWT token signing semantics | operation contract | T1.2.1 | T1.2.1 Unit Test | ⬜ |
139
+ | `INVALID_CREDENTIALS` error semantics | error semantics | T1.2.1 | T1.2.1 API Interface Functional Test | ⬜ |
140
+ | users table persistence structure | persistence structure | T3.1.1 | T3.1.1 Integration Test | ⬜ |
141
+ ```
142
+
143
+ ---
144
+
145
+ ## Section 7: Testing Coverage Overlay Format
146
+
147
+ > Mandatory. Must not be removed.
148
+
149
+ ```markdown
150
+ ## 7. Testing Coverage Overlay
151
+
152
+ | Test Responsibility | Risk Category | Coverage Method | Task Owner | Test Material | Status |
153
+ |--------------------|---------------|-----------------|------------|---------------|:------:|
154
+ | JWT signing: normal/boundary/exception | business logic | Unit Test + parameterized cases | T1.2.1 | `tests/unit/jwt.test.ts` | ⬜ |
155
+ | `POST /auth/login` missing/malformed/permission-denied | API contract | API Interface Functional Test + representative invalid samples | T1.2.1 | `tests/api/auth.test.ts` | ⬜ |
156
+ | user state active/inactive/locked | state transition | Unit Test + table-driven state cases | T1.2.2 | `tests/unit/user.test.ts` | ⬜ |
157
+ | password change endpoint before/after consistency | data consistency | API Interface Functional Test + before/after assertions | T1.2.3 | `tests/api/password.test.ts` | ⬜ |
158
+ ```
159
+
160
+ ---
161
+
162
+ ## Section 8: Verification Traceability Matrix Format
163
+
164
+ > Mandatory. Must not be removed.
165
+
166
+ ```markdown
167
+ ## 8. Verification Traceability Matrix
168
+
169
+ | REQ/Contract | Task | Verification | Test Material | Evidence | Status |
170
+ |---|---|---|---|---|---|
171
+ | REQ-001 User Login | T1.2.1 | Unit Test + API Interface Functional Test | `tests/unit/jwt.test.ts`, `tests/api/auth.test.ts` | CI report | ⬜ |
172
+ | `POST /auth/login` contract | T1.2.1 | API Interface Functional Test | `tests/api/auth.test.ts` | HTTP response records | ⬜ |
173
+ | users table persistence structure | T3.1.1 | Integration Test | `tests/integration/db.test.ts` | integration report | ⬜ |
174
+ | S1 exit criteria | INT-S1 | Smoke Test | sprint smoke scripts | screenshots / verification report | ⬜ |
175
+ ```
176
+