@mrciphersmith/keryx 0.2.72 → 0.2.74

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 (144) hide show
  1. package/dist/cli.js +33409 -32626
  2. package/package.json +2 -2
  3. package/src/gdskills/bundled/rules/core/gproject-contracts.mdc +1 -1
  4. package/src/gdskills/bundled/rules/core/jobs-documentation.mdc +1 -1
  5. package/src/gdskills/bundled/rules/core/subagent-context-construction.md +1 -1
  6. package/src/gdskills/bundled/skills/core/reviewer-skill-creator/SKILL.md +214 -0
  7. package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.codex.md +326 -20
  8. package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.cursor.md +320 -22
  9. package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.opencode.md +326 -12
  10. package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.zed.md +333 -9
  11. package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.codex.md +92 -4
  12. package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.cursor.md +92 -4
  13. package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.opencode.md +92 -4
  14. package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.zed.md +92 -4
  15. package/src/gdskills/bundled/skills/orchestration/context-collector/orchestrator-prompt.md +1 -1
  16. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.codex.md +154 -1098
  17. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.cursor.md +154 -1098
  18. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.opencode.md +154 -1098
  19. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.zed.md +154 -1098
  20. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/orchestrator-prompt.md +1 -1
  21. package/src/gdskills/bundled/skills/orchestration/feature-dev/SKILL.codex.md +101 -41
  22. package/src/gdskills/bundled/skills/orchestration/feature-dev/SKILL.cursor.md +101 -41
  23. package/src/gdskills/bundled/skills/orchestration/flow-orchestrator/SKILL.md +48 -1
  24. package/src/gdskills/bundled/skills/orchestration/flow-orchestrator/input-contract.schema.json +70 -4
  25. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.codex.md +115 -49
  26. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.cursor.md +115 -49
  27. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.opencode.md +115 -49
  28. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.zed.md +115 -49
  29. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/orchestrator-prompt.md +1 -1
  30. package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.codex.md +15 -6
  31. package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.cursor.md +15 -6
  32. package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.opencode.md +15 -6
  33. package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.zed.md +15 -6
  34. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.codex.md +1 -1
  35. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.cursor.md +1 -1
  36. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.md +1 -1
  37. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.opencode.md +1 -1
  38. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.zed.md +1 -1
  39. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.codex.md +300 -55
  40. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.cursor.md +300 -55
  41. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.md +120 -37
  42. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.opencode.md +300 -55
  43. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.zed.md +300 -55
  44. package/src/gdskills/bundled/skills/orchestration/task-implementer/input-contract.schema.json +56 -14
  45. package/src/gdskills/bundled/skills/orchestration/task-implementer/orchestrator-prompt.md +50 -23
  46. package/src/gdskills/bundled/skills/orchestration/task-implementer/output-contract.schema.json +6 -2
  47. package/src/gdskills/bundled/skills/orchestration/task-implementer/task-request.template.md +18 -12
  48. package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.codex.md +1 -1
  49. package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.cursor.md +1 -1
  50. package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.codex.md +169 -10
  51. package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.cursor.md +169 -10
  52. package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.md +1 -1
  53. package/src/gdskills/bundled/skills/planning/interview/SKILL.codex.md +7 -1
  54. package/src/gdskills/bundled/skills/planning/interview/SKILL.cursor.md +7 -1
  55. package/src/gdskills/bundled/skills/planning/interviewer/SKILL.codex.md +7 -1
  56. package/src/gdskills/bundled/skills/planning/interviewer/SKILL.cursor.md +7 -1
  57. package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.codex.md +216 -10
  58. package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.cursor.md +216 -10
  59. package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.md +1 -1
  60. package/src/gdskills/bundled/skills/planning/planner/SKILL.codex.md +169 -10
  61. package/src/gdskills/bundled/skills/planning/planner/SKILL.cursor.md +169 -10
  62. package/src/gdskills/bundled/skills/planning/planner/SKILL.md +1 -1
  63. package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.codex.md +2 -2
  64. package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.cursor.md +2 -2
  65. package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.opencode.md +2 -2
  66. package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.zed.md +2 -2
  67. package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.codex.md +134 -10
  68. package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.cursor.md +134 -10
  69. package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.md +1 -1
  70. package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.codex.md +146 -10
  71. package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.cursor.md +146 -10
  72. package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.md +1 -1
  73. package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.codex.md +211 -10
  74. package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.cursor.md +211 -10
  75. package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.md +1 -1
  76. package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.codex.md +162 -10
  77. package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.cursor.md +162 -10
  78. package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.md +1 -1
  79. package/src/gdskills/bundled/skills/platform/claude-md-management/SKILL.codex.md +1 -1
  80. package/src/gdskills/bundled/skills/platform/claude-md-management/SKILL.cursor.md +1 -1
  81. package/src/gdskills/bundled/skills/platform/hookify/SKILL.codex.md +1 -1
  82. package/src/gdskills/bundled/skills/platform/hookify/SKILL.cursor.md +1 -1
  83. package/src/gdskills/bundled/skills/quality/changelog/SKILL.codex.md +1 -1
  84. package/src/gdskills/bundled/skills/quality/changelog/SKILL.cursor.md +1 -1
  85. package/src/gdskills/bundled/skills/quality/commit/SKILL.codex.md +1 -1
  86. package/src/gdskills/bundled/skills/quality/commit/SKILL.cursor.md +1 -1
  87. package/src/gdskills/bundled/skills/quality/db-migrate/SKILL.codex.md +1 -1
  88. package/src/gdskills/bundled/skills/quality/db-migrate/SKILL.cursor.md +1 -1
  89. package/src/gdskills/bundled/skills/quality/dependency-update/SKILL.codex.md +1 -1
  90. package/src/gdskills/bundled/skills/quality/dependency-update/SKILL.cursor.md +1 -1
  91. package/src/gdskills/bundled/skills/quality/deploy/SKILL.codex.md +1 -1
  92. package/src/gdskills/bundled/skills/quality/deploy/SKILL.cursor.md +1 -1
  93. package/src/gdskills/bundled/skills/quality/perf-check/SKILL.codex.md +1 -1
  94. package/src/gdskills/bundled/skills/quality/perf-check/SKILL.cursor.md +1 -1
  95. package/src/gdskills/bundled/skills/quality/pr/SKILL.codex.md +1 -1
  96. package/src/gdskills/bundled/skills/quality/pr/SKILL.cursor.md +1 -1
  97. package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.codex.md +15 -1
  98. package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.cursor.md +248 -165
  99. package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.opencode.md +15 -1
  100. package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.zed.md +359 -19
  101. package/src/gdskills/bundled/skills/quality/push/SKILL.codex.md +1 -1
  102. package/src/gdskills/bundled/skills/quality/push/SKILL.cursor.md +1 -1
  103. package/src/gdskills/bundled/skills/quality/security-audit/SKILL.codex.md +1 -1
  104. package/src/gdskills/bundled/skills/quality/security-audit/SKILL.cursor.md +1 -1
  105. package/src/gdskills/bundled/skills/quality/test-gen/SKILL.codex.md +1 -1
  106. package/src/gdskills/bundled/skills/quality/test-gen/SKILL.cursor.md +1 -1
  107. package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.codex.md +299 -24
  108. package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.cursor.md +296 -31
  109. package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.opencode.md +309 -18
  110. package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.zed.md +312 -17
  111. package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.codex.md +29 -30
  112. package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.cursor.md +29 -30
  113. package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.opencode.md +29 -30
  114. package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.zed.md +29 -30
  115. package/src/gdskills/bundled/skills/review/code-learned-review/SKILL.codex.md +21 -30
  116. package/src/gdskills/bundled/skills/review/code-learned-review/SKILL.cursor.md +21 -30
  117. package/src/gdskills/bundled/skills/review/code-learned-review/SKILL.opencode.md +21 -30
  118. package/src/gdskills/bundled/skills/review/code-learned-review/SKILL.zed.md +21 -30
  119. package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.codex.md +19 -23
  120. package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.cursor.md +19 -23
  121. package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.opencode.md +19 -23
  122. package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.zed.md +19 -23
  123. package/src/gdskills/bundled/skills/review/code-style-review/SKILL.codex.md +17 -24
  124. package/src/gdskills/bundled/skills/review/code-style-review/SKILL.cursor.md +17 -24
  125. package/src/gdskills/bundled/skills/review/code-style-review/SKILL.opencode.md +17 -24
  126. package/src/gdskills/bundled/skills/review/code-style-review/SKILL.zed.md +17 -24
  127. package/src/gdskills/bundled/skills/review/review-clean-code/SKILL.md +33 -1
  128. package/src/gdskills/bundled/skills/review/review-layout/SKILL.md +217 -0
  129. package/src/gdskills/bundled/skills/review/review-logic/SKILL.md +26 -0
  130. package/src/gdskills/bundled/skills/review/review-orchestrator/SKILL.md +320 -5
  131. package/src/gdskills/bundled/skills/review/review-pr-feedback/SKILL.md +644 -113
  132. package/src/gdskills/bundled/skills/review/review-pr-feedback/input-contract.schema.json +79 -0
  133. package/src/gdskills/bundled/skills/review/review-pr-feedback/output-contract.schema.json +375 -0
  134. package/src/gdskills/bundled/skills/review/review-testing-practices/SKILL.md +111 -1
  135. package/src/gdskills/bundled/skills/review/review-verifier/SKILL.md +25 -1
  136. package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.claude.md +0 -46
  137. package/src/gdskills/bundled/skills/planning/interviewer/SKILL.claude.md +0 -94
  138. package/src/gdskills/bundled/skills/quality/changelog/SKILL.claude.md +0 -45
  139. package/src/gdskills/bundled/skills/quality/db-migrate/SKILL.claude.md +0 -40
  140. package/src/gdskills/bundled/skills/quality/dependency-update/SKILL.claude.md +0 -45
  141. package/src/gdskills/bundled/skills/quality/deploy/SKILL.claude.md +0 -42
  142. package/src/gdskills/bundled/skills/quality/perf-check/SKILL.claude.md +0 -48
  143. package/src/gdskills/bundled/skills/quality/security-audit/SKILL.claude.md +0 -40
  144. package/src/gdskills/bundled/skills/quality/test-gen/SKILL.claude.md +0 -30
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: tests-creator
3
- description: "Converts acceptance criteria into failing test stubs (RED phase of TDD) before any implementation. Autonomous sub-agent — runs between issue-analyzer and task-implementer. Use when: generating test specs from acceptance criteria, enforcing TDD in the implementation pipeline."
3
+ description: "Use when writing test cases BEFORE implementation — converts acceptance criteria into failing test stubs that task-implementer will make pass. Mandatory step in the TDD pipeline between issue-analyzer and task-implementer."
4
4
  triggers:
5
5
  - "Create tests"
6
6
  - "Write tests first"
@@ -12,6 +12,7 @@ metadata:
12
12
  author: "MrCipherSmith"
13
13
  version: "1.0.0"
14
14
  category: "testing"
15
+ agent_worthy: true
15
16
  compatible_harnesses: "cursor,codex,zed,opencode"
16
17
  license: "MIT"
17
18
  ---
@@ -20,55 +21,319 @@ license: "MIT"
20
21
 
21
22
  ## Purpose
22
23
 
23
- Converts acceptance criteria into concrete, failing test stubs **before any implementation code is written**. Enforces the RED phase of TDD.
24
+ Converts acceptance criteria (from `issue-analyzer` or manual input) into concrete, failing test stubs **before any implementation code is written**. Enforces the RED phase of TDD.
24
25
 
25
- **Input:** Task object with `acceptance_criteria` + codebase path
26
- **Output:** Committed test files (RED) + `test_case_specs` block for `task-implementer`
26
+ **Input:** Task object with `acceptance_criteria` + codebase path + test framework info
27
+ **Output:** Ready-to-run test files with failing test stubs + `test_case_specs` block for `task-implementer`
27
28
 
28
29
  ## When to Use
29
30
 
30
31
  - Between `issue-analyzer` and `task-implementer` in the TDD pipeline
31
- - Before writing any implementation code for a task
32
+ - Orchestrator needs test specs before dispatching implementation
33
+ - User wants to review test expectations before code is written
34
+ - Acceptance criteria need to be translated into executable specifications
32
35
 
33
- ## Quick Reference
36
+ ## Architecture: 4 Phases
34
37
 
35
- ### Phase Summary
36
- 1. **DETECT** — find test framework, read existing tests for conventions
37
- 2. **ANALYZE** — map each acceptance criterion to happy path + edge + error scenarios
38
- 3. **GENERATE** — write failing test stubs using forward-declared API
39
- 4. **REPORT** — emit `TEST_CASE_SPECS` block
38
+ ```
39
+ Phase 1: DETECT → Identify test framework, conventions, fixture patterns
40
+ Phase 2: ANALYZE → Map acceptance criteria to test scenarios
41
+ Phase 3: GENERATE → Write failing test stubs with correct framework syntax
42
+ Phase 4: REPORT → Emit test_case_specs for task-implementer consumption
43
+ ```
44
+
45
+ ---
40
46
 
41
- ### Key Rule
42
- Tests MUST FAIL before implementation. Run `<test command>` to verify RED state.
47
+ ## Workflow
48
+
49
+ ```
50
+ Tests Creator Progress:
51
+ - [ ] Phase 1: Detect test framework and conventions
52
+ - [ ] Phase 2: Map acceptance criteria to test scenarios
53
+ - [ ] Phase 3: Generate failing test stubs
54
+ - [ ] Phase 4: Report test_case_specs
55
+ ```
56
+
57
+ ---
58
+
59
+ ### Phase 1: DETECT
60
+
61
+ Identify the test framework and conventions used in the project.
62
+
63
+ **1.1 Detect framework:**
64
+
65
+ ```bash
66
+ # Check package.json for test dependencies
67
+ cat <codebase_path>/package.json | grep -E '"(jest|vitest|mocha|jasmine|bun:test|pytest|go test)"'
68
+
69
+ # Check for config files
70
+ ls <codebase_path>/{vitest.config.*,jest.config.*,pytest.ini,setup.cfg}
71
+
72
+ # Check existing test files for imports
73
+ find <codebase_path>/src -name "*.test.*" -o -name "*.spec.*" | head -5
74
+ ```
75
+
76
+ **1.2 Read 2-3 existing test files** to understand:
77
+ - Import style (`import { describe, it, expect } from 'vitest'` vs global)
78
+ - Test file location (co-located `*.test.ts` vs `__tests__/` directory)
79
+ - Describe/it/test nesting patterns
80
+ - Common assertion patterns (`expect(x).toBe(y)` vs `assert.equal(x, y)`)
81
+ - Mock patterns (`vi.fn()` vs `jest.fn()` vs manual mocks)
82
+ - Fixture/factory patterns (how test data is created)
83
+ - Before/after hook usage
84
+
85
+ **1.3 Identify test file naming:**
86
+ - Pattern: `<component>.test.ts`, `<service>.spec.ts`, `test_<module>.py`, etc.
87
+ - Location: co-located with source or in `__tests__`/`tests/` directory
88
+
89
+ **Output of Phase 1:**
90
+ ```
91
+ TEST_ENV:
92
+ framework: vitest | jest | bun:test | mocha | pytest | go_test
93
+ import_style: esm | cjs | global
94
+ file_pattern: "*.test.ts" | "*.spec.ts" | "test_*.py"
95
+ file_location: co-located | __tests__ | tests/
96
+ assertion_style: expect | assert | chai
97
+ mock_library: vi | jest | sinon | unittest.mock
98
+ fixture_pattern: <description of how test data is created>
99
+ ```
100
+
101
+ ---
102
+
103
+ ### Phase 2: ANALYZE
104
+
105
+ Map each acceptance criterion to one or more test scenarios.
106
+
107
+ **2.1 Parse acceptance criteria:**
108
+
109
+ For each criterion, determine:
110
+ - **Happy path**: when everything works correctly
111
+ - **Edge cases**: boundary values, empty inputs, maximum values
112
+ - **Error paths**: invalid input, missing data, permission denied, external failure
113
+
114
+ **2.2 Criterion-to-scenario mapping:**
115
+
116
+ | Criterion Type | Test Scenarios to Generate |
117
+ |---|---|
118
+ | "User can X" | happy path: user can X; error: user cannot X when [condition] |
119
+ | "System returns Y when Z" | given Z → returns Y; given not-Z → does not return Y |
120
+ | "Field is required" | valid data passes; missing field fails with error |
121
+ | "Value must be between A and B" | A passes; B passes; A-1 fails; B+1 fails |
122
+ | "X must not happen" | verify X does not happen under [conditions] |
123
+ | "Async operation completes" | resolves with expected value; rejects on failure |
124
+
125
+ **2.3 Group scenarios by test file:**
126
+
127
+ Group related scenarios into test files matching the target_files from the task:
128
+ - Service test → test the service class methods
129
+ - Component test → test component rendering and interactions
130
+ - Integration test → test the full flow
131
+
132
+ **Output of Phase 2:**
133
+ ```
134
+ TEST_PLAN:
135
+ - test_file: <path>
136
+ target_module: <source file being tested>
137
+ scenarios:
138
+ - id: test-1
139
+ criterion: <which acceptance criterion>
140
+ description: <what to test>
141
+ type: happy_path | edge_case | error_path
142
+ setup: <what to arrange>
143
+ action: <what to call/render/trigger>
144
+ assertion: <what to expect>
145
+ ```
146
+
147
+ ---
148
+
149
+ ### Phase 3: GENERATE
150
+
151
+ Write the actual test files with failing stubs.
152
+
153
+ **3.1 Test file structure:**
154
+
155
+ ```typescript
156
+ // Template for TypeScript (vitest/jest)
157
+ import { describe, it, expect, vi, beforeEach } from 'vitest';
158
+ // import the module under test — may not exist yet, that is expected
159
+ import { <ModuleUnderTest> } from '<relative path>';
160
+
161
+ describe('<ModuleUnderTest>', () => {
162
+ // Acceptance criterion: <criterion text>
163
+ describe('<group name>', () => {
164
+ it('<should do X when Y>', async () => {
165
+ // Arrange
166
+ const <fixture> = <test data>;
167
+
168
+ // Act
169
+ const result = await <action>;
170
+
171
+ // Assert
172
+ expect(result).<assertion>;
173
+ });
174
+
175
+ it('<should fail when Z>', async () => {
176
+ // Arrange
177
+ const <invalid fixture> = <invalid data>;
178
+
179
+ // Act & Assert
180
+ await expect(<action with invalid data>).rejects.toThrow(<error type>);
181
+ });
182
+ });
183
+ });
184
+ ```
185
+
186
+ **3.2 Failing stubs (RED phase):**
187
+
188
+ The generated tests MUST:
189
+ - Import the module under test (file may not exist yet — that is fine)
190
+ - Have meaningful test descriptions
191
+ - Have placeholder assertions that will FAIL until implementation:
192
+ ```typescript
193
+ // Use todo() for unimplemented tests
194
+ it.todo('<test description>');
195
+
196
+ // OR use a stub assertion that fails
197
+ it('<test description>', () => {
198
+ expect(true).toBe(false); // RED: remove this when implementing
199
+ });
200
+ ```
201
+ - OR use proper assertions calling the future API (will fail with "module not found" or "function is not a function")
202
+
203
+ **3.3 Preferred approach — forward-declared tests:**
204
+
205
+ Write tests that call the actual future API with real assertions. They will fail because the module doesn't exist yet:
206
+
207
+ ```typescript
208
+ // This file will fail to compile/run until task-implementer creates:
209
+ // src/services/UserValidator.ts with a validate() method
210
+ import { UserValidator } from '../services/UserValidator';
211
+
212
+ describe('UserValidator', () => {
213
+ it('should accept valid email address', () => {
214
+ const validator = new UserValidator();
215
+ expect(validator.validate({ email: 'user@example.com' })).toEqual({ valid: true });
216
+ });
217
+
218
+ it('should reject email without @ symbol', () => {
219
+ const validator = new UserValidator();
220
+ expect(validator.validate({ email: 'not-an-email' })).toEqual({
221
+ valid: false,
222
+ errors: [{ field: 'email', message: 'Invalid email format' }],
223
+ });
224
+ });
225
+ });
226
+ ```
227
+
228
+ **3.4 Commit the test files:**
229
+
230
+ ```bash
231
+ git add <test files>
232
+ git commit -m "test(<scope>): add failing test stubs for <task description>
233
+
234
+ RED phase — tests will pass after implementation
235
+ refs #<issue_number>"
236
+ ```
237
+
238
+ ---
239
+
240
+ ### Phase 4: REPORT
241
+
242
+ Emit the `test_case_specs` block for consumption by `task-implementer`.
243
+
244
+ **Output structure:**
43
245
 
44
- ### Output Format
45
246
  ```
46
247
  TEST_CASE_SPECS:
47
- framework: vitest
248
+ framework: <vitest|jest|pytest|...>
48
249
  test_files:
49
- - path: src/__tests__/UserValidator.test.ts
50
- target_module: src/services/UserValidator.ts
51
- test_count: 4
250
+ - path: <test file path>
251
+ target_module: <source file to implement>
252
+ test_count: <N>
52
253
  tests:
53
254
  - id: test-1
54
- description: "should accept valid email address"
55
- criterion: "User can register with valid email"
56
- type: happy_path
57
- status: written
58
- run_command: "bun test src/__tests__/UserValidator.test.ts"
255
+ description: <it description>
256
+ criterion: <which acceptance criterion>
257
+ type: happy_path | edge_case | error_path
258
+ status: written # test file exists, test is RED
259
+
260
+ run_command: "<command to run just these tests>"
59
261
  expected_result: "all failing (RED phase)"
262
+ notes: "<any test design decisions or assumptions>"
263
+ ```
60
264
 
265
+ **STATUS reporting:**
266
+
267
+ ```
61
268
  STATUS: DONE
62
- tests_written: 4
63
- all_criteria_covered: true
269
+ tests_written: <N>
270
+ test_files: [<list of paths>]
271
+ all_criteria_covered: true | false (with explanation)
64
272
  ```
65
273
 
66
- ### Status Protocol
274
+ ---
275
+
276
+ ## Integration with Task Implementer
277
+
278
+ When `task-implementer` receives a task that includes `test_case_specs`:
279
+
280
+ 1. Read the test files (already committed as RED)
281
+ 2. Run the tests — confirm they FAIL
282
+ 3. Implement code until all tests are GREEN
283
+ 4. Commit the implementation
284
+ 5. Re-run tests — confirm GREEN
285
+ 6. Report SUCCESS
286
+
287
+ This ensures the TDD cycle is maintained end-to-end.
288
+
289
+ ---
290
+
291
+ ## Automation Settings
292
+
293
+ | Setting | Default | Options | Description |
294
+ |---------|---------|---------|-------------|
295
+ | `commit_test_stubs` | `true` | true/false | Commit the test files after generation |
296
+ | `verify_red` | `true` | true/false | Run tests to confirm they fail before reporting |
297
+ | `stub_style` | `forward_declared` | `forward_declared` / `todo` | How to write failing stubs |
298
+ | `include_edge_cases` | `true` | true/false | Generate edge case tests in addition to happy path |
299
+ | `max_tests_per_criterion` | `3` | 1-5 | Max test cases per acceptance criterion |
300
+
301
+ ---
302
+
303
+ ## Error Handling
304
+
305
+ | Error | Action |
306
+ |-------|--------|
307
+ | No acceptance criteria provided | Derive from task description — log warning |
308
+ | Test framework not detected | Ask via output, default to vitest for TypeScript |
309
+ | Test file already exists | Read existing tests, add new stubs without overwriting |
310
+ | Module path unknown | Use placeholder path, note in test_case_specs |
311
+ | Verify-red fails (tests pass before implementation) | This means the test is wrong — fix the assertion or report as concern |
312
+
313
+ ---
314
+
315
+ ## Rules of Engagement
316
+
317
+ 1. **DO NOT** write any implementation code. This skill only writes test files.
318
+ 2. **DO NOT** write tests that pass without implementation — RED means failing.
319
+ 3. **DO** write tests that describe WHAT the code should do, not HOW.
320
+ 4. **DO** cover every acceptance criterion with at least one test.
321
+ 5. **DO** follow the project's existing test conventions (discovered in Phase 1).
322
+ 6. **DO** commit the test files before reporting.
323
+ 7. Return `TEST_CASE_SPECS` as the final message to the orchestrator/caller.
324
+
325
+ ---
326
+
327
+ ## Job Context Awareness
328
+
329
+ When dispatched by `job-orchestrator`:
330
+
67
331
  ```
68
- STATUS: DONE — all criteria covered, tests committed, RED verified
69
- STATUS: DONE_WITH_CONCERNS — some criteria ambiguous, tests written with assumptions
70
- STATUS: BLOCKED — cannot determine test framework or API shape
71
- STATUS: NEEDS_CONTEXT — acceptance criteria missing, need task description
332
+ JOB_NAME: <job-name>
333
+ CONTEXT_PATH: <JOBS_ROOT>/<job-name>/ai/context.md
72
334
  ```
73
335
 
74
- See full workflow in `.metaproject/skills/gdskills/quality/tests-creator/SKILL.md`
336
+ If provided, read the context document to understand:
337
+ - Which test frameworks are in use
338
+ - Testing conventions and patterns from the codebase
339
+ - Mock/stub strategies documented in the project