@arvorco/relentless 0.3.1 → 0.4.3

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 (66) hide show
  1. package/.claude/commands/relentless.convert.md +25 -0
  2. package/.claude/skills/analyze/SKILL.md +113 -40
  3. package/.claude/skills/analyze/templates/analysis-report.md +138 -0
  4. package/.claude/skills/checklist/SKILL.md +144 -51
  5. package/.claude/skills/checklist/templates/checklist.md +43 -11
  6. package/.claude/skills/clarify/SKILL.md +70 -11
  7. package/.claude/skills/constitution/SKILL.md +61 -3
  8. package/.claude/skills/constitution/templates/constitution.md +241 -160
  9. package/.claude/skills/constitution/templates/prompt.md +150 -20
  10. package/.claude/skills/convert/SKILL.md +248 -0
  11. package/.claude/skills/implement/SKILL.md +82 -34
  12. package/.claude/skills/plan/SKILL.md +139 -27
  13. package/.claude/skills/plan/templates/plan.md +92 -9
  14. package/.claude/skills/specify/SKILL.md +112 -20
  15. package/.claude/skills/specify/templates/spec.md +40 -5
  16. package/.claude/skills/tasks/SKILL.md +76 -1
  17. package/.claude/skills/tasks/templates/tasks.md +5 -4
  18. package/CHANGELOG.md +84 -1
  19. package/MANUAL.md +40 -0
  20. package/README.md +268 -13
  21. package/bin/relentless.ts +292 -5
  22. package/package.json +2 -2
  23. package/relentless/config.json +45 -1
  24. package/relentless/constitution.md +41 -19
  25. package/relentless/prompt.md +142 -72
  26. package/src/agents/amp.ts +53 -13
  27. package/src/agents/claude.ts +70 -15
  28. package/src/agents/codex.ts +73 -14
  29. package/src/agents/droid.ts +68 -14
  30. package/src/agents/exec.ts +96 -0
  31. package/src/agents/gemini.ts +59 -16
  32. package/src/agents/opencode.ts +188 -9
  33. package/src/cli/fallback-order.ts +210 -0
  34. package/src/cli/index.ts +63 -0
  35. package/src/cli/mode-flag.ts +198 -0
  36. package/src/cli/review-flags.ts +192 -0
  37. package/src/config/loader.ts +16 -1
  38. package/src/config/schema.ts +157 -2
  39. package/src/execution/runner.ts +144 -21
  40. package/src/init/scaffolder.ts +285 -25
  41. package/src/prd/parser.ts +111 -6
  42. package/src/prd/types.ts +136 -0
  43. package/src/review/index.ts +92 -0
  44. package/src/review/prompt.ts +293 -0
  45. package/src/review/runner.ts +337 -0
  46. package/src/review/tasks/docs.ts +529 -0
  47. package/src/review/tasks/index.ts +80 -0
  48. package/src/review/tasks/lint.ts +436 -0
  49. package/src/review/tasks/quality.ts +760 -0
  50. package/src/review/tasks/security.ts +452 -0
  51. package/src/review/tasks/test.ts +456 -0
  52. package/src/review/tasks/typecheck.ts +323 -0
  53. package/src/review/types.ts +139 -0
  54. package/src/routing/cascade.ts +310 -0
  55. package/src/routing/classifier.ts +338 -0
  56. package/src/routing/estimate.ts +270 -0
  57. package/src/routing/fallback.ts +512 -0
  58. package/src/routing/index.ts +124 -0
  59. package/src/routing/registry.ts +501 -0
  60. package/src/routing/report.ts +570 -0
  61. package/src/routing/router.ts +287 -0
  62. package/src/tui/App.tsx +2 -0
  63. package/src/tui/TUIRunner.tsx +103 -8
  64. package/src/tui/components/CurrentStory.tsx +23 -1
  65. package/src/tui/hooks/useTUI.ts +1 -0
  66. package/src/tui/types.ts +9 -0
@@ -1,6 +1,8 @@
1
1
  # Implementation Plan: [FEATURE]
2
2
 
3
3
  **Branch**: `[###-feature-name]` | **Date**: [DATE] | **Spec**: [link]
4
+ **Routing Preference**: auto: good | allow free: yes
5
+ <!-- Options: auto: free|cheap|good|genius | allow free: yes|no | OR specific: harness/model -->
4
6
  **Input**: Feature specification from `/specs/[###-feature-name]/spec.md`
5
7
 
6
8
  **Note**: This template is filled in by the `/relentless.plan` command. See `.claude/skills/plan/SKILL.md` for the execution workflow.
@@ -17,21 +19,29 @@
17
19
  the iteration process.
18
20
  -->
19
21
 
20
- **Language/Version**: [e.g., Python 3.11, Swift 5.9, Rust 1.75 or NEEDS CLARIFICATION]
21
- **Primary Dependencies**: [e.g., FastAPI, UIKit, LLVM or NEEDS CLARIFICATION]
22
- **Storage**: [if applicable, e.g., PostgreSQL, CoreData, files or N/A]
23
- **Testing**: [e.g., pytest, XCTest, cargo test or NEEDS CLARIFICATION]
22
+ **Language/Version**: [e.g., Python 3.11, Swift 5.9, Rust 1.75 or NEEDS CLARIFICATION]
23
+ **Primary Dependencies**: [e.g., FastAPI, UIKit, LLVM or NEEDS CLARIFICATION]
24
+ **Storage**: [if applicable, e.g., PostgreSQL, CoreData, files or N/A]
25
+ **Testing**: [e.g., pytest, XCTest, cargo test or NEEDS CLARIFICATION]
24
26
  **Target Platform**: [e.g., Linux server, iOS 15+, WASM or NEEDS CLARIFICATION]
25
- **Project Type**: [single/web/mobile - determines source structure]
26
- **Performance Goals**: [domain-specific, e.g., 1000 req/s, 10k lines/sec, 60 fps or NEEDS CLARIFICATION]
27
- **Constraints**: [domain-specific, e.g., <200ms p95, <100MB memory, offline-capable or NEEDS CLARIFICATION]
27
+ **Project Type**: [single/web/mobile - determines source structure]
28
+ **Performance Goals**: [domain-specific, e.g., 1000 req/s, 10k lines/sec, 60 fps or NEEDS CLARIFICATION]
29
+ **Constraints**: [domain-specific, e.g., <200ms p95, <100MB memory, offline-capable or NEEDS CLARIFICATION]
28
30
  **Scale/Scope**: [domain-specific, e.g., 10k users, 1M LOC, 50 screens or NEEDS CLARIFICATION]
29
31
 
30
- ## Constitution Check
32
+ ## Constitution Compliance
31
33
 
32
34
  *GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.*
33
35
 
34
- [Gates determined based on constitution file]
36
+ **MUST Rules Checked:**
37
+ - [ ] TDD is mandatory - test specs defined in this plan
38
+ - [ ] Quality gates defined - typecheck, lint, test commands
39
+ - [ ] Routing preference carried from spec
40
+ - [ ] No `any` types planned (TypeScript)
41
+ - [ ] Error handling strategy defined
42
+ - [ ] Zero lint warnings policy enforced
43
+
44
+ **If any MUST rule cannot be satisfied, document the exception and remediation plan.**
35
45
 
36
46
  ## Project Structure
37
47
 
@@ -94,6 +104,49 @@ ios/ or android/
94
104
  **Structure Decision**: [Document the selected structure and reference the real
95
105
  directories captured above]
96
106
 
107
+ ## Test Specifications (MANDATORY)
108
+
109
+ <!--
110
+ TDD REQUIREMENT: This section is mandatory. Tests are written BEFORE implementation.
111
+ The agent must create these test files first, verify they fail, then implement.
112
+ -->
113
+
114
+ ### Test File Structure
115
+
116
+ ```text
117
+ tests/
118
+ ├── unit/
119
+ │ └── [component].test.ts
120
+ ├── integration/
121
+ │ └── [feature].test.ts
122
+ └── e2e/
123
+ └── [flow].test.ts
124
+ ```
125
+
126
+ ### Unit Tests
127
+
128
+ | Component | Test File | Functions to Test |
129
+ |-----------|-----------|-------------------|
130
+ | [Name] | `tests/unit/[name].test.ts` | [functions] |
131
+
132
+ ### Integration Tests
133
+
134
+ | Flow | Test File | Scenarios |
135
+ |------|-----------|-----------|
136
+ | [Name] | `tests/integration/[name].test.ts` | [scenarios] |
137
+
138
+ ### Mock Requirements
139
+
140
+ - [List mocks/fixtures needed]
141
+ - [Database mock approach]
142
+ - [External service mocks]
143
+
144
+ ### Coverage Targets
145
+
146
+ - **Unit**: 80% minimum
147
+ - **Integration**: Key flows covered (happy path + error paths)
148
+ - **E2E**: Happy path + critical error scenarios
149
+
97
150
  ## Complexity Tracking
98
151
 
99
152
  > **Fill ONLY if Constitution Check has violations that must be justified**
@@ -102,3 +155,33 @@ directories captured above]
102
155
  |-----------|------------|-------------------------------------|
103
156
  | [e.g., 4th project] | [current need] | [why 3 projects insufficient] |
104
157
  | [e.g., Repository pattern] | [specific problem] | [why direct DB access insufficient] |
158
+
159
+ ## Quality Gates
160
+
161
+ <!--
162
+ These commands must pass before any story is considered complete.
163
+ All three are mandatory - no exceptions.
164
+ -->
165
+
166
+ ### Required Commands
167
+
168
+ ```bash
169
+ # Type checking - 0 errors required
170
+ bun run typecheck
171
+
172
+ # Linting - 0 errors AND 0 warnings required
173
+ bun run lint
174
+
175
+ # Tests - all must pass
176
+ bun test
177
+ ```
178
+
179
+ ### Per-Story Checklist
180
+
181
+ Every story implementation must:
182
+ - [ ] Pass typecheck with 0 errors
183
+ - [ ] Pass lint with 0 errors AND 0 warnings
184
+ - [ ] Pass all existing tests
185
+ - [ ] Include new tests (written first, TDD style)
186
+ - [ ] Have no debug code (console.log, debugger)
187
+ - [ ] Have no unused imports or variables
@@ -9,14 +9,55 @@ Create structured feature specifications from natural language descriptions.
9
9
 
10
10
  ---
11
11
 
12
+ ## SpecKit Workflow
13
+
14
+ This skill is **Step 1 of 6** in the Relentless workflow:
15
+
16
+ **specify** → plan → tasks → analyze → implement (task by task) or relentless run --feature [FEATURE NAME] --tui
17
+
18
+ What flows to next step:
19
+ - User requirements → plan will create technical approach
20
+ - Routing preference → carried through all artifacts
21
+ - Acceptance criteria → basis for TDD in implementation
22
+
23
+ ---
24
+
25
+ ## TDD is MANDATORY
26
+
27
+ The specification MUST include testable acceptance criteria:
28
+ - Every user requirement should be verifiable with tests
29
+ - Test scenarios should be part of each story
30
+ - Edge cases should be documented for test coverage
31
+
32
+ **All acceptance criteria must be written in Given/When/Then format** to enable direct test implementation.
33
+
34
+ ---
35
+
12
36
  ## The Job
13
37
 
14
38
  1. Receive feature description from user
15
- 2. Generate short name and feature number
16
- 3. Create branch and feature directory in `relentless/features/NNN-feature-name/`
17
- 4. Generate specification using template
18
- 5. Validate specification quality
19
- 6. Save to `spec.md`
39
+ 2. **Confirm routing preference (Step 0)**
40
+ 3. Generate short name and feature number
41
+ 4. Create branch and feature directory in `relentless/features/NNN-feature-name/`
42
+ 5. Generate specification using template
43
+ 6. Validate specification quality (including TDD readiness)
44
+ 7. Save to `spec.md`
45
+
46
+ ---
47
+
48
+ ## Step 0: Confirm Routing Preference (BEFORE generating spec)
49
+
50
+ Ask the user these specific questions:
51
+
52
+ 1. **"Which routing mode?"** (free/cheap/good/genius) - Default: `good`
53
+ 2. **"Allow free models in fallback?"** - Default: `yes`
54
+ 3. **"Specific harness/model preference?"** - Default: `auto`
55
+
56
+ Record the answer in spec.md metadata:
57
+ ```
58
+ **Routing Preference**: auto: good | allow free: yes
59
+ <!-- Options: auto: free|cheap|good|genius | allow free: yes|no | OR specific: harness/model -->
60
+ ```
20
61
 
21
62
  ---
22
63
 
@@ -43,6 +84,7 @@ This will output JSON with:
43
84
  1. Read `relentless/constitution.md` for project governance
44
85
  2. Note any MUST/SHOULD rules that apply to specifications
45
86
  3. Keep these principles in mind while generating the spec
87
+ 4. **Pay special attention to TDD requirements** - all features must be testable
46
88
 
47
89
  ---
48
90
 
@@ -58,30 +100,38 @@ Using the template at `templates/spec.md`, create a specification with:
58
100
  - Problem being solved
59
101
 
60
102
  **2. User Scenarios & Testing**
61
- - Concrete user stories
103
+ - Concrete user stories with priorities (P1, P2, P3...)
62
104
  - Step-by-step flows
63
105
  - Expected outcomes
106
+ - **Given/When/Then acceptance scenarios (MANDATORY)**
107
+ - **Independent testability explanation for each story**
64
108
 
65
109
  **3. Functional Requirements**
66
110
  - What the system must do
67
111
  - Testable requirements (no implementation details)
68
112
  - Clear success criteria
69
113
 
70
- **4. Success Criteria**
114
+ **4. Test Strategy (MANDATORY)**
115
+ - Unit test approach
116
+ - Integration test scenarios
117
+ - Edge case tests
118
+ - Test data requirements
119
+
120
+ **5. Success Criteria**
71
121
  - Measurable, technology-agnostic outcomes
72
122
  - Quantitative metrics (time, performance, volume)
73
123
  - Qualitative measures (user satisfaction, task completion)
74
124
 
75
- **5. Key Entities (if applicable)**
125
+ **6. Key Entities (if applicable)**
76
126
  - Data models and relationships
77
127
  - Fields and types (logical, not implementation)
78
128
 
79
- **6. Dependencies & Assumptions**
129
+ **7. Dependencies & Assumptions**
80
130
  - External systems required
81
131
  - Prerequisites
82
132
  - Assumptions made
83
133
 
84
- **7. Out of Scope**
134
+ **8. Out of Scope**
85
135
  - What this feature explicitly does NOT include
86
136
  - Future considerations
87
137
 
@@ -90,11 +140,12 @@ Using the template at `templates/spec.md`, create a specification with:
90
140
  ## Step 4: Handle Ambiguities
91
141
 
92
142
  If aspects are unclear:
93
- - Make informed guesses based on context
143
+ - Interview the user first with questions to clarify any doubts, concerns or about his opinion on eventual ideas to improve the feature.
94
144
  - Only mark `[NEEDS CLARIFICATION: specific question]` if:
95
145
  - Choice significantly impacts scope or UX
96
146
  - Multiple reasonable interpretations exist
97
147
  - No reasonable default exists
148
+ - Question not already solved by interview
98
149
  - **LIMIT: Maximum 3 clarifications**
99
150
 
100
151
  If clarifications needed, present to user:
@@ -120,6 +171,7 @@ Your choice: _
120
171
 
121
172
  Check the specification against:
122
173
 
174
+ ### General Quality
123
175
  - [ ] No implementation details (languages, frameworks, APIs)
124
176
  - [ ] Focused on user value and business needs
125
177
  - [ ] All requirements are testable
@@ -129,6 +181,16 @@ Check the specification against:
129
181
  - [ ] Scope clearly bounded
130
182
  - [ ] No more than 3 `[NEEDS CLARIFICATION]` markers
131
183
 
184
+ ### TDD Readiness (MANDATORY)
185
+ - [ ] Every user story has Given/When/Then acceptance criteria
186
+ - [ ] Acceptance criteria are specific enough to write tests against
187
+ - [ ] Edge cases are documented for test coverage
188
+ - [ ] Test strategy section is complete
189
+
190
+ ### Routing Compliance
191
+ - [ ] Routing preference is recorded in metadata
192
+ - [ ] Routing choice is reasonable for feature complexity
193
+
132
194
  If validation fails, revise and re-check (max 3 iterations).
133
195
 
134
196
  ---
@@ -143,8 +205,9 @@ If validation fails, revise and re-check (max 3 iterations).
143
205
  started: DATE
144
206
  last_updated: DATE
145
207
  stories_completed: 0
208
+ routing_preference: [auto: mode | allow free: yes/no]
146
209
  ---
147
-
210
+
148
211
  # Progress Log: FEATURE_NAME
149
212
  ```
150
213
 
@@ -152,6 +215,8 @@ If validation fails, revise and re-check (max 3 iterations).
152
215
  - Branch created: `BRANCH_NAME`
153
216
  - Spec saved: `SPEC_FILE`
154
217
  - Quality validation: PASSED/FAILED
218
+ - TDD readiness: PASSED/FAILED
219
+ - Routing preference: [recorded value]
155
220
  - Next step: `/relentless.plan` or `/relentless.clarify`
156
221
 
157
222
  ---
@@ -161,20 +226,25 @@ If validation fails, revise and re-check (max 3 iterations).
161
226
  ```markdown
162
227
  # Feature: User Authentication
163
228
 
229
+ **Routing Preference**: auto: good | allow free: yes
230
+
164
231
  ## Overview
165
232
  Enable users to create accounts and log in securely using email/password.
166
233
 
167
234
  ## User Scenarios
168
235
 
169
- ### Scenario 1: New User Registration
170
- 1. User visits signup page
171
- 2. Enters email and password
172
- 3. Submits form
173
- 4. Receives confirmation email
174
- 5. Clicks confirmation link
175
- 6. Account is activated
236
+ ### User Story 1: New User Registration (Priority: P1)
237
+
238
+ User visits signup page, enters email and password, and creates an account.
176
239
 
177
- **Expected Outcome:** User has active account and can log in.
240
+ **Why this priority**: Core functionality, blocks all other auth features.
241
+
242
+ **Independent Test**: Can be fully tested by registering a new account and verifying the account exists.
243
+
244
+ **Acceptance Scenarios**:
245
+
246
+ 1. **Given** a visitor on the signup page, **When** they submit valid email and password, **Then** the account is created and confirmation email sent
247
+ 2. **Given** an email already in use, **When** visitor tries to register, **Then** error message shown without revealing account exists
178
248
 
179
249
  ## Functional Requirements
180
250
 
@@ -183,6 +253,27 @@ Enable users to create accounts and log in securely using email/password.
183
253
  **REQ-3:** System must send confirmation email within 1 minute
184
254
  **REQ-4:** System must hash passwords before storage
185
255
 
256
+ ## Test Strategy (MANDATORY)
257
+
258
+ ### Unit Test Approach
259
+ - Email validation logic
260
+ - Password strength validation
261
+ - Password hashing utility
262
+
263
+ ### Integration Test Scenarios
264
+ - Full registration flow (submit form → create account → send email)
265
+ - Duplicate email rejection
266
+
267
+ ### Edge Case Tests
268
+ - Invalid email formats (missing @, invalid domain)
269
+ - Password too short
270
+ - Unicode in email/password
271
+
272
+ ### Test Data Requirements
273
+ - Valid test email addresses
274
+ - Various invalid email formats
275
+ - Password examples at boundary conditions
276
+
186
277
  ## Success Criteria
187
278
 
188
279
  1. 95% of signups complete within 60 seconds
@@ -218,3 +309,4 @@ Enable users to create accounts and log in securely using email/password.
218
309
  - Validate before marking complete
219
310
  - Keep specification technology-agnostic
220
311
  - Focus on WHAT, not HOW
312
+ - **TDD readiness is non-negotiable** - all acceptance criteria must be testable
@@ -1,9 +1,11 @@
1
1
  # Feature Specification: [FEATURE NAME]
2
2
 
3
- **Feature Branch**: `[###-feature-name]`
4
- **Created**: [DATE]
5
- **Status**: Draft
3
+ **Feature Branch**: `[###-feature-name]`
4
+ **Created**: [DATE]
5
+ **Status**: Draft
6
6
  **Input**: User description: "$ARGUMENTS"
7
+ **Routing Preference**: auto: good | allow free: yes
8
+ <!-- Options: auto: free|cheap|good|genius | allow free: yes|no | OR specific: harness/model -->
7
9
 
8
10
  ## User Scenarios & Testing *(mandatory)*
9
11
 
@@ -11,13 +13,16 @@
11
13
  IMPORTANT: User stories should be PRIORITIZED as user journeys ordered by importance.
12
14
  Each user story/journey must be INDEPENDENTLY TESTABLE - meaning if you implement just ONE of them,
13
15
  you should still have a viable MVP (Minimum Viable Product) that delivers value.
14
-
16
+
15
17
  Assign priorities (P1, P2, P3, etc.) to each story, where P1 is the most critical.
16
18
  Think of each story as a standalone slice of functionality that can be:
17
19
  - Developed independently
18
20
  - Tested independently
19
21
  - Deployed independently
20
22
  - Demonstrated to users independently
23
+
24
+ TDD REQUIREMENT: All acceptance scenarios MUST be in Given/When/Then format
25
+ to enable direct test implementation.
21
26
  -->
22
27
 
23
28
  ### User Story 1 - [Brief Title] (Priority: P1)
@@ -70,6 +75,7 @@
70
75
  <!--
71
76
  ACTION REQUIRED: The content in this section represents placeholders.
72
77
  Fill them out with the right edge cases.
78
+ Edge cases are critical for TDD - they define boundary conditions to test.
73
79
  -->
74
80
 
75
81
  - What happens when [boundary condition]?
@@ -80,12 +86,13 @@
80
86
  <!--
81
87
  ACTION REQUIRED: The content in this section represents placeholders.
82
88
  Fill them out with the right functional requirements.
89
+ Each requirement must be TESTABLE - ask "how would I verify this?"
83
90
  -->
84
91
 
85
92
  ### Functional Requirements
86
93
 
87
94
  - **FR-001**: System MUST [specific capability, e.g., "allow users to create accounts"]
88
- - **FR-002**: System MUST [specific capability, e.g., "validate email addresses"]
95
+ - **FR-002**: System MUST [specific capability, e.g., "validate email addresses"]
89
96
  - **FR-003**: Users MUST be able to [key interaction, e.g., "reset their password"]
90
97
  - **FR-004**: System MUST [data requirement, e.g., "persist user preferences"]
91
98
  - **FR-005**: System MUST [behavior, e.g., "log all security events"]
@@ -100,6 +107,34 @@
100
107
  - **[Entity 1]**: [What it represents, key attributes without implementation]
101
108
  - **[Entity 2]**: [What it represents, relationships to other entities]
102
109
 
110
+ ## Test Strategy (MANDATORY)
111
+
112
+ <!--
113
+ TDD REQUIREMENT: This section is mandatory and must be completed before implementation.
114
+ Tests are written BEFORE implementation code in Relentless.
115
+ -->
116
+
117
+ ### Unit Test Approach
118
+
119
+ - [Business logic to test - e.g., "validation functions", "calculations", "transformations"]
120
+ - [Data processing to test - e.g., "parsers", "formatters", "serializers"]
121
+
122
+ ### Integration Test Scenarios
123
+
124
+ - [API flow to test - e.g., "full registration flow", "checkout process"]
125
+ - [Data flow to test - e.g., "database operations", "cache interactions"]
126
+
127
+ ### Edge Case Tests
128
+
129
+ - [Boundary condition - e.g., "empty input", "maximum length"]
130
+ - [Error condition - e.g., "network failure", "invalid format"]
131
+ - [Race condition - e.g., "concurrent requests", "duplicate submissions"]
132
+
133
+ ### Test Data Requirements
134
+
135
+ - [Fixtures needed - e.g., "sample users", "mock responses"]
136
+ - [Edge case data - e.g., "unicode strings", "very long inputs"]
137
+
103
138
  ## Success Criteria *(mandatory)*
104
139
 
105
140
  <!--
@@ -16,11 +16,28 @@ Generate actionable, dependency-ordered user stories from technical plans.
16
16
  3. Break down into implementation tasks
17
17
  4. Order by dependencies
18
18
  5. Create tasks.md with structured user stories
19
+ 6. **Auto-convert to prd.json** with routing classification
19
20
 
20
21
  **Important:** tasks.md contains the actual user stories that convert to prd.json!
21
22
 
22
23
  ---
23
24
 
25
+ ## SpecKit Workflow
26
+
27
+ This skill is **Step 3 of 5** in the Relentless workflow:
28
+
29
+ ```
30
+ specify → plan → tasks → analyze → implement
31
+
32
+ (optional: checklist)
33
+ ```
34
+
35
+ This skill now **auto-runs convert** at the end, generating prd.json.
36
+ Manual convert is only needed if tasks.md is edited manually.
37
+ Checklist is optional but recommended for complex features.
38
+
39
+ ---
40
+
24
41
  ## Step 1: Locate Feature Files
25
42
 
26
43
  Find the current feature directory and verify:
@@ -37,6 +54,8 @@ Read:
37
54
  2. `relentless/features/NNN-feature/spec.md` - User requirements
38
55
  3. `relentless/features/NNN-feature/plan.md` - Technical design
39
56
 
57
+ Extract **Routing Preference** from spec.md or plan.md (if present) and include it near the top of tasks.md so it can be carried into prd.json.
58
+
40
59
  ---
41
60
 
42
61
  ## Step 3: Extract User Stories
@@ -132,6 +151,7 @@ For each user story, create implementation tasks using format:
132
151
  **Phase:** Stories
133
152
  **Priority:** 3
134
153
  ```
154
+ If you have any doubts or suggestions about any specific task, interview the user about them to improve your execution.
135
155
 
136
156
  ---
137
157
 
@@ -170,7 +190,61 @@ Check that:
170
190
  - Total user stories: N
171
191
  - Dependency order: [list]
172
192
  - Parallel opportunities: N
173
- - Next step: `/relentless.checklist` or `relentless convert tasks.md`
193
+
194
+ ---
195
+
196
+ ## Step 8: Auto-Convert to prd.json
197
+
198
+ After tasks.md is saved, automatically convert to prd.json with routing:
199
+
200
+ ```bash
201
+ relentless convert relentless/features/NNN-feature/tasks.md --feature <feature-name>
202
+ ```
203
+
204
+ This will:
205
+ 1. Parse tasks.md and validate structure
206
+ 2. Classify complexity for each story
207
+ 3. Route to optimal harness/model per story
208
+ 4. Generate prd.json with routing metadata
209
+ 5. Copy to prd.md for reference
210
+
211
+ **Output Summary:**
212
+ - Show routing table (story → complexity → harness/model → cost)
213
+ - Show total estimated cost
214
+ - Confirm prd.json saved
215
+
216
+ **Optional but Recommended:** `/relentless.checklist`
217
+ - Generates validation checklist with quality gates
218
+ - Helps ensure nothing is missed during implementation
219
+ - Especially useful for complex features
220
+
221
+ **Next Step:** `/relentless.analyze` (or `/relentless.checklist` first if desired)
222
+
223
+ ---
224
+
225
+ ## TDD is MANDATORY
226
+
227
+ Every user story MUST include test acceptance criteria:
228
+
229
+ 1. **Unit Tests** - For business logic and utilities
230
+ 2. **Integration Tests** - For API endpoints and data flows
231
+ 3. **E2E Tests** - For user-facing flows (use Playwright when applicable)
232
+
233
+ ### TDD Workflow
234
+
235
+ The Relentless agent will verify:
236
+ 1. Tests are written FIRST (before implementation)
237
+ 2. Tests FAIL before implementation
238
+ 3. Implementation makes tests PASS
239
+ 4. Typecheck and lint pass
240
+
241
+ ### Required Test Criteria
242
+
243
+ Every story acceptance criteria should include:
244
+ - [ ] Unit tests pass
245
+ - [ ] Integration test passes (for API stories)
246
+ - [ ] Typecheck passes
247
+ - [ ] Lint passes
174
248
 
175
249
  ---
176
250
 
@@ -186,6 +260,7 @@ Check that:
186
260
  - No vague terms ("works well", "good UX")
187
261
  - Include quality checks (typecheck, lint, test)
188
262
  - Verifiable in browser/tests
263
+ - **MUST include test criteria**
189
264
 
190
265
  **Dependencies:**
191
266
  - Only list direct dependencies
@@ -7,8 +7,9 @@ description: "Task list template for feature implementation"
7
7
 
8
8
  **Input**: Design documents from `/specs/[###-feature-name]/`
9
9
  **Prerequisites**: plan.md (required), spec.md (required for user stories), research.md, data-model.md, contracts/
10
+ **Routing Preference**: [auto: good | allow free: yes | harness/model]
10
11
 
11
- **Tests**: The examples below include test tasks. Tests are OPTIONAL - only include them if explicitly requested in the feature specification.
12
+ **Tests**: Tests are MANDATORY. Every story MUST include test acceptance criteria. TDD is required - write tests FIRST, verify they FAIL, then implement.
12
13
 
13
14
  **Organization**: Tasks are grouped by user story to enable independent implementation and testing of each story.
14
15
 
@@ -79,7 +80,7 @@ Examples of foundational tasks (adjust based on your project):
79
80
 
80
81
  **Independent Test**: [How to verify this story works on its own]
81
82
 
82
- ### Tests for User Story 1 (OPTIONAL - only if tests requested) ⚠️
83
+ ### Tests for User Story 1 (MANDATORY - TDD Required)
83
84
 
84
85
  > **NOTE: Write these tests FIRST, ensure they FAIL before implementation**
85
86
 
@@ -105,7 +106,7 @@ Examples of foundational tasks (adjust based on your project):
105
106
 
106
107
  **Independent Test**: [How to verify this story works on its own]
107
108
 
108
- ### Tests for User Story 2 (OPTIONAL - only if tests requested) ⚠️
109
+ ### Tests for User Story 2 (MANDATORY - TDD Required)
109
110
 
110
111
  - [ ] T018 [P] [US2] Contract test for [endpoint] in tests/contract/test_[name].py
111
112
  - [ ] T019 [P] [US2] Integration test for [user journey] in tests/integration/test_[name].py
@@ -127,7 +128,7 @@ Examples of foundational tasks (adjust based on your project):
127
128
 
128
129
  **Independent Test**: [How to verify this story works on its own]
129
130
 
130
- ### Tests for User Story 3 (OPTIONAL - only if tests requested) ⚠️
131
+ ### Tests for User Story 3 (MANDATORY - TDD Required)
131
132
 
132
133
  - [ ] T024 [P] [US3] Contract test for [endpoint] in tests/contract/test_[name].py
133
134
  - [ ] T025 [P] [US3] Integration test for [user journey] in tests/integration/test_[name].py