@arvorco/relentless 0.4.2 → 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.
@@ -13,7 +13,7 @@ Generate domain-specific quality checklists to validate implementation completen
13
13
 
14
14
  This skill runs **after tasks, before analyze**:
15
15
 
16
- specify → plan → tasks → convert → **checklist** → analyze → implement
16
+ specify → plan → tasks → **checklist** → analyze → implement
17
17
 
18
18
  Purpose:
19
19
  - Generate validation checklist from spec/plan/tasks
@@ -118,6 +118,7 @@ Create 7-10 categories based on feature domain:
118
118
  - Performance & UX
119
119
  - Documentation
120
120
 
121
+ If you have any doubts or suggestions about the checklist, please, interview the user.
121
122
  ---
122
123
 
123
124
  ## Step 4: Generate Checklist Items
@@ -13,7 +13,7 @@ Create detailed technical plans that translate feature specifications into imple
13
13
 
14
14
  This skill is **Step 2 of 6** in the Relentless workflow:
15
15
 
16
- specify → **plan** → tasks → convert → analyze → implement
16
+ specify → **plan** → tasks → analyze → implement
17
17
 
18
18
  What flows from spec:
19
19
  - User requirements → technical approach
@@ -157,6 +157,8 @@ Before completing the plan, validate:
157
157
 
158
158
  If plan violates MUST rules, revise until compliant.
159
159
 
160
+ If plan generates any doubts, interview the user about them with insightful questions to improve the plan.
161
+
160
162
  ---
161
163
 
162
164
  ## Step 6: Save & Report
@@ -284,5 +286,6 @@ tests/
284
286
  - Include specific technologies and patterns
285
287
  - Must comply with constitution
286
288
  - Detailed enough for task generation
289
+ - Interview user if you have any doubts or suggestions
287
290
  - **Test specifications are mandatory** - no tests = incomplete plan
288
291
  - **Routing preference must be carried forward** from spec
@@ -13,7 +13,7 @@ Create structured feature specifications from natural language descriptions.
13
13
 
14
14
  This skill is **Step 1 of 6** in the Relentless workflow:
15
15
 
16
- **specify** → plan → tasks → convertanalyze implement
16
+ **specify** → plan → tasks → analyzeimplement (task by task) or relentless run --feature [FEATURE NAME] --tui
17
17
 
18
18
  What flows to next step:
19
19
  - User requirements → plan will create technical approach
@@ -140,11 +140,12 @@ Using the template at `templates/spec.md`, create a specification with:
140
140
  ## Step 4: Handle Ambiguities
141
141
 
142
142
  If aspects are unclear:
143
- - 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.
144
144
  - Only mark `[NEEDS CLARIFICATION: specific question]` if:
145
145
  - Choice significantly impacts scope or UX
146
146
  - Multiple reasonable interpretations exist
147
147
  - No reasonable default exists
148
+ - Question not already solved by interview
148
149
  - **LIMIT: Maximum 3 clarifications**
149
150
 
150
151
  If clarifications needed, present to user:
@@ -151,6 +151,7 @@ For each user story, create implementation tasks using format:
151
151
  **Phase:** Stories
152
152
  **Priority:** 3
153
153
  ```
154
+ If you have any doubts or suggestions about any specific task, interview the user about them to improve your execution.
154
155
 
155
156
  ---
156
157
 
package/CHANGELOG.md CHANGED
@@ -7,7 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [0.4.0] - 2026-01-20
10
+ ## [0.4.3] - 2026-01-20
11
+
12
+ ### Fixed
13
+ - **Parser**: Extract only valid story IDs (US-XXX) from dependency annotations (#4 - thanks @aruj0!)
14
+ - `"US-001 (auth must work first)"` now correctly extracts `US-001`
15
+ - `"None (foundational)"` and `"Phase 5"` no longer cause errors
16
+ - **Parser**: Section boundary fix prevents content from `## Implementation Tasks` bleeding into last story
17
+
18
+ ### Changed
19
+ - **Constitution v2.1.0**: Added SpecKit Workflow as Principle 1 (now 16 principles total)
20
+ - **SpecKit Workflow**: Added user interview/feedback step for better requirement gathering
21
+ - **Skills updated**: plan, tasks, specify, checklist - improved TDD and workflow guidance
22
+ - **README**: Revised for clarity and updated command examples
23
+ - **prompt.md**: Refreshed with template version tracking and improved structure
24
+
25
+ ### Documentation
26
+ - Constitution now includes template version header for upgrade tracking
27
+ - Added explicit 6-step workflow documentation: specify → plan → tasks → convert → analyze → implement
28
+
29
+ ## [0.4.2] - 2026-01-20
11
30
 
12
31
  ### Major Features
13
32
 
@@ -392,7 +411,9 @@ Relentless evolved from the [Ralph Wiggum Pattern](https://ghuntley.com/ralph/)
392
411
  - **License**: MIT
393
412
  - **Inspiration**: [Ralph Wiggum Pattern](https://ghuntley.com/ralph/) by Geoffrey Huntley
394
413
 
395
- [Unreleased]: https://github.com/ArvorCo/Relentless/compare/v0.4.0...HEAD
414
+ [Unreleased]: https://github.com/ArvorCo/Relentless/compare/v0.4.3...HEAD
415
+ [0.4.3]: https://github.com/ArvorCo/Relentless/compare/v0.4.2...v0.4.3
416
+ [0.4.2]: https://github.com/ArvorCo/Relentless/compare/v0.4.0...v0.4.2
396
417
  [0.4.0]: https://github.com/ArvorCo/Relentless/compare/v0.3.0...v0.4.0
397
418
  [0.3.0]: https://github.com/ArvorCo/Relentless/compare/v0.2.0...v0.3.0
398
419
  [0.2.0]: https://github.com/ArvorCo/Relentless/compare/v0.1.27...v0.2.0
package/README.md CHANGED
@@ -424,7 +424,7 @@ Relentless uses a simplified 5-step SpecKit workflow:
424
424
  ### Core Commands
425
425
 
426
426
  ```bash
427
- relentless init # Initialize project
427
+ relentless init # Initialize project; -f if upgrading to force overwrite
428
428
  relentless run --feature <name> --tui # Run orchestration
429
429
  relentless status --feature <name> # Show progress
430
430
  relentless reset <story-id> --feature <name> # Re-run a story
@@ -460,7 +460,7 @@ relentless agents list # Show installed agents
460
460
  relentless agents doctor # Health check
461
461
  ```
462
462
 
463
- ### Slash Commands (Claude/Amp/OpenCode)
463
+ ### Slash Commands (Claude/Amp/OpenCode/Codex/Droid)
464
464
 
465
465
  ```bash
466
466
  /relentless.constitution # Create project rules + prompt.md
@@ -569,11 +569,12 @@ Each iteration has access to:
569
569
  - **progress.txt** — YAML metadata + learnings
570
570
  - **prd.json** — Task completion status
571
571
  - **constitution.md** — Project rules
572
+ - **spec.md**, **plan.md** and **tasks.md** - Feature specification and task definition files
572
573
  - **checklist.md** — Quality validation (now included in prompts!)
573
574
 
574
575
  ---
575
576
 
576
- ## Writing Good PRDs
577
+ ## Writing Good Specs
577
578
 
578
579
  ### Right-Sized Stories
579
580
 
@@ -597,6 +598,8 @@ Make criteria **verifiable**:
597
598
  - `Tests pass` in every story
598
599
  - `Verify in browser` for UI stories
599
600
 
601
+ **ALWAYS REVIEW YOUR SPECS, PLANS AND PRD FILES!**
602
+
600
603
  ---
601
604
 
602
605
  ## Troubleshooting
@@ -624,7 +627,7 @@ A: Estimates include a 12% buffer for potential escalation. Actual costs may be
624
627
  A: Yes, set `autoMode.escalation.enabled: false` in config. Tasks will fail instead of escalating.
625
628
 
626
629
  **Q: Which mode should I use?**
627
- A: Start with `good` (default). Use `cheap` for well-defined tasks. Use `genius` for complex architecture. Use `free` only for experimentation.
630
+ A: Start with `good` (default). Use `cheap` for well-defined tasks. Use `genius` for complex architecture. Use `free` only for experimentation and simple tasks, like translation, documentation, change variable names etc.
628
631
 
629
632
  ---
630
633
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arvorco/relentless",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Universal AI agent orchestrator - works with Claude Code, Amp, OpenCode, Codex, Droid, and Gemini",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -36,7 +36,7 @@
36
36
  "path": "prompt.md"
37
37
  },
38
38
  "autoMode": {
39
- "enabled": true,
39
+ "enabled": false,
40
40
  "defaultMode": "good",
41
41
  "fallbackOrder": [
42
42
  "claude",
@@ -79,4 +79,4 @@
79
79
  }
80
80
  }
81
81
  }
82
- }
82
+ }
@@ -1,8 +1,11 @@
1
+ <!-- TEMPLATE_VERSION: 2.1.0 -->
2
+ <!-- LAST_UPDATED: 2026-01-20 -->
3
+
1
4
  # Relentless Project Constitution
2
5
 
3
- **Version:** 2.0.0
6
+ **Version:** 2.1.0
4
7
  **Ratified:** 2026-01-13
5
- **Last Amended:** 2026-01-13
8
+ **Last Amended:** 2026-01-20
6
9
 
7
10
  ---
8
11
 
@@ -27,7 +30,25 @@ Our mission is to build one of the best AI orchestration tools in the world - si
27
30
 
28
31
  ## Part I: Foundational Principles
29
32
 
30
- ### Principle 1: Test-Driven Development (TDD)
33
+ ### Principle 1: SpecKit Workflow
34
+
35
+ **MUST:**
36
+ - All features MUST follow the 6-step workflow: specify → plan → tasks → convert → analyze → implement
37
+ - Each step MUST produce its corresponding artifact before proceeding
38
+ - Artifacts MUST be validated with `/relentless.analyze` before implementation begins
39
+ - Implementation MUST NOT start without: spec.md, plan.md, tasks.md, checklist.md, prd.json
40
+
41
+ **SHOULD:**
42
+ - Run analysis after any manual artifact edits
43
+ - Keep artifacts in sync throughout development
44
+ - Document deviations from plan in progress.txt
45
+ - Review checklist.md before completing each story
46
+
47
+ **Rationale:** The SpecKit workflow ensures thorough planning, prevents scope creep, and provides structured guidance for AI agents. Each artifact serves a specific purpose in the autonomous execution pipeline.
48
+
49
+ ---
50
+
51
+ ### Principle 2: Test-Driven Development (TDD)
31
52
 
32
53
  **MUST:**
33
54
  - All new features MUST have tests written BEFORE implementation begins
@@ -46,7 +67,7 @@ Our mission is to build one of the best AI orchestration tools in the world - si
46
67
 
47
68
  ---
48
69
 
49
- ### Principle 2: Smart Model Routing
70
+ ### Principle 3: Smart Model Routing
50
71
 
51
72
  **MUST:**
52
73
  - Planning phase MUST evaluate task complexity before assigning models
@@ -66,7 +87,7 @@ Our mission is to build one of the best AI orchestration tools in the world - si
66
87
 
67
88
  ---
68
89
 
69
- ### Principle 3: Parallel Execution with Git Worktrees
90
+ ### Principle 4: Parallel Execution with Git Worktrees
70
91
 
71
92
  **MUST:**
72
93
  - Parallel tasks MUST use git worktrees for clean isolation
@@ -86,7 +107,7 @@ Our mission is to build one of the best AI orchestration tools in the world - si
86
107
 
87
108
  ---
88
109
 
89
- ### Principle 4: Queued Prompts (Mid-Run Input)
110
+ ### Principle 5: Queued Prompts (Mid-Run Input)
90
111
 
91
112
  **MUST:**
92
113
  - Implement file-based queue (.queue.txt) for mid-run user input
@@ -105,7 +126,7 @@ Our mission is to build one of the best AI orchestration tools in the world - si
105
126
 
106
127
  ---
107
128
 
108
- ### Principle 5: Adaptive Final Review
129
+ ### Principle 6: Adaptive Final Review
109
130
 
110
131
  **MUST:**
111
132
  - Every feature MUST have a final review phase before completion
@@ -126,7 +147,7 @@ Our mission is to build one of the best AI orchestration tools in the world - si
126
147
 
127
148
  ---
128
149
 
129
- ### Principle 6: Agent-Aware Best Practices
150
+ ### Principle 7: Agent-Aware Best Practices
130
151
 
131
152
  **MUST:**
132
153
  - Maintain up-to-date knowledge of each agent's capabilities
@@ -147,7 +168,7 @@ Our mission is to build one of the best AI orchestration tools in the world - si
147
168
 
148
169
  ## Part II: Code Quality Standards
149
170
 
150
- ### Principle 7: Zero-Lint Policy
171
+ ### Principle 8: Zero-Lint Policy
151
172
 
152
173
  **MUST:**
153
174
  - All code MUST pass lint with zero warnings (not just errors)
@@ -165,7 +186,7 @@ Our mission is to build one of the best AI orchestration tools in the world - si
165
186
 
166
187
  ---
167
188
 
168
- ### Principle 8: TypeScript Strictness
189
+ ### Principle 9: TypeScript Strictness
169
190
 
170
191
  **MUST:**
171
192
  - Use TypeScript strict mode throughout
@@ -184,7 +205,7 @@ Our mission is to build one of the best AI orchestration tools in the world - si
184
205
 
185
206
  ---
186
207
 
187
- ### Principle 9: Minimal Dependencies
208
+ ### Principle 10: Minimal Dependencies
188
209
 
189
210
  **MUST NOT:**
190
211
  - Add dependencies without clear justification
@@ -207,7 +228,7 @@ Our mission is to build one of the best AI orchestration tools in the world - si
207
228
 
208
229
  ## Part III: Architecture Principles
209
230
 
210
- ### Principle 10: Clean Architecture
231
+ ### Principle 11: Clean Architecture
211
232
 
212
233
  **MUST:**
213
234
  - Maintain clear separation of concerns
@@ -225,7 +246,7 @@ Our mission is to build one of the best AI orchestration tools in the world - si
225
246
 
226
247
  ---
227
248
 
228
- ### Principle 11: Performance First
249
+ ### Principle 12: Performance First
229
250
 
230
251
  **MUST:**
231
252
  - Maintain fast startup time (<1s)
@@ -243,7 +264,7 @@ Our mission is to build one of the best AI orchestration tools in the world - si
243
264
 
244
265
  ---
245
266
 
246
- ### Principle 12: Error Handling Excellence
267
+ ### Principle 13: Error Handling Excellence
247
268
 
248
269
  **MUST:**
249
270
  - Surface errors clearly - never hide failures
@@ -263,7 +284,7 @@ Our mission is to build one of the best AI orchestration tools in the world - si
263
284
 
264
285
  ## Part IV: Version Control & Documentation
265
286
 
266
- ### Principle 13: Git Discipline
287
+ ### Principle 14: Git Discipline
267
288
 
268
289
  **MUST:**
269
290
  - Write clear, descriptive commit messages
@@ -282,7 +303,7 @@ Our mission is to build one of the best AI orchestration tools in the world - si
282
303
 
283
304
  ---
284
305
 
285
- ### Principle 14: Documentation Standards
306
+ ### Principle 15: Documentation Standards
286
307
 
287
308
  **MUST:**
288
309
  - Document public APIs and interfaces
@@ -302,7 +323,7 @@ Our mission is to build one of the best AI orchestration tools in the world - si
302
323
 
303
324
  ## Part V: Security & Compliance
304
325
 
305
- ### Principle 15: Security First
326
+ ### Principle 16: Security First
306
327
 
307
328
  **MUST:**
308
329
  - Never commit secrets to git
@@ -371,6 +392,7 @@ The following are strategic directions that guide future development:
371
392
 
372
393
  | Version | Date | Changes |
373
394
  |---------|------|---------|
395
+ | 2.1.0 | 2026-01-20 | Added SpecKit Workflow principle, template version tracking, renumbered principles (now 16 total), improved artifact consistency requirements |
374
396
  | 2.0.0 | 2026-01-13 | Major revision: Added smart routing, parallel execution, queued prompts, adaptive review, TDD requirements, agent-aware practices |
375
397
  | 1.0.0 | Previous | Initial constitution |
376
398
 
@@ -1,21 +1,40 @@
1
+ <!-- TEMPLATE_VERSION: 2.1.0 -->
2
+ <!-- LAST_UPDATED: 2026-01-20 -->
3
+
1
4
  # Relentless Agent Instructions
2
5
 
3
- You are an autonomous coding agent working on the Relentless project - a universal AI agent orchestrator.
6
+ You are an autonomous coding agent orchestrated by Relentless - a universal AI agent orchestrator.
7
+
8
+ ---
9
+
10
+ ## Before Starting ANY Story
11
+
12
+ **CRITICAL:** Read the feature artifacts in this order:
13
+
14
+ 1. **`spec.md`** - Read FULL file to understand requirements
15
+ 2. **`plan.md`** - Read FULL file to understand technical approach
16
+ 3. **`tasks.md`** - Read ONLY the section for your current story (US-XXX)
17
+ 4. **`checklist.md`** - Review quality criteria you must satisfy
18
+ 5. **`prd.json`** - Find your story and check routing metadata
19
+
20
+ This context is essential. Do NOT skip reading these files.
4
21
 
5
22
  ---
6
23
 
7
- ## SpecKit Workflow
24
+ ## SpecKit Workflow Reference
8
25
 
9
26
  Implementation is **Step 6 of 6** in the Relentless workflow:
10
27
 
11
- specify → plan → tasks → convert → analyze → **implement**
28
+ ```
29
+ /relentless.specify → /relentless.plan → /relentless.tasks → /relentless.convert → /relentless.analyze → /relentless.implement
30
+ ```
12
31
 
13
- This prompt guides the implementation phase. Ensure all prerequisite artifacts exist:
32
+ Each step generates an artifact in `relentless/features/<feature>/`:
14
33
  - `spec.md` - Feature specification (routing preference)
15
34
  - `plan.md` - Technical implementation plan (test specifications)
16
35
  - `tasks.md` - User stories with acceptance criteria
17
- - `prd.json` - Converted PRD with routing metadata
18
36
  - `checklist.md` - Quality validation checklist
37
+ - `prd.json` - Machine-readable PRD with routing
19
38
 
20
39
  **Run `/relentless.analyze` before implementing to validate artifact consistency.**
21
40
 
@@ -45,34 +64,29 @@ bun test
45
64
 
46
65
  ---
47
66
 
48
- ## Before You Start
49
-
50
- 1. **Read the Constitution** - Review `relentless/constitution.md` for project principles
51
- 2. **Review the Codebase** - Understand current state, architecture, and patterns
52
- 3. **Read progress.txt** - Check the Codebase Patterns section for learnings from previous iterations
53
- 4. **Read the spec/plan/tasks** - `spec.md`, `plan.md`, `tasks.md` for the feature
54
- 5. **Read the PRD** - Understand what needs to be done
55
- 6. **Check the Queue** - Look for `.queue.txt` for any mid-run user input
56
- 7. **Verify Analysis Passed** - Run `/relentless.analyze` if not done
57
-
58
- ---
59
-
60
- ## Your Task
61
-
62
- 1. Read the PRD at `relentless/features/<feature>/prd.json`
63
- 2. Read the progress log at `relentless/features/<feature>/progress.txt`
64
- 3. Read `relentless/features/<feature>/spec.md`, `plan.md`, `tasks.md`, and `checklist.md` for full context
65
- 4. Check you're on the correct branch from PRD `branchName`. If not, check it out or create from main.
66
- 5. Pick the **highest priority** user story where `passes: false` and all dependencies are met
67
- 6. **Review routing metadata** - Check story complexity and model assignment
68
- 7. **Review relevant checklist items** - Find `[US-XXX]` tagged items for the story
69
- 8. **Review relevant code** before implementing - understand existing patterns
67
+ ## Your Task (Per Iteration)
68
+
69
+ 1. Check you're on the correct branch from PRD `branchName`
70
+ 2. Read feature artifacts (spec.md, plan.md, your story in tasks.md)
71
+ 3. Pick the **highest priority** story where `passes: false` and dependencies met
72
+ 4. Check story routing metadata for complexity/model guidance
73
+ 5. Review checklist items tagged `[US-XXX]` for your story
74
+ 6. Review existing code to understand patterns
75
+ 7. **Write tests FIRST** (TDD is mandatory)
76
+ 8. Verify tests FAIL before implementation
77
+ 9. Implement the story to make tests PASS
78
+ 10. Run ALL quality checks (typecheck, lint, test)
79
+ 11. If ALL checks pass, commit: `feat: [Story ID] - [Story Title]`
80
+ 12. Update tasks.md: check off `- [x]` completed acceptance criteria
81
+ 13. Update checklist.md: check off `- [x]` verified items
82
+ 14. Update PRD: set `passes: true`
83
+ 15. Append progress to `progress.txt`
70
84
 
71
85
  ---
72
86
 
73
87
  ## TDD Workflow (MANDATORY)
74
88
 
75
- Relentless follows strict Test-Driven Development. For EVERY story:
89
+ You MUST follow Test-Driven Development:
76
90
 
77
91
  ### Step 1: Write Failing Tests First (RED)
78
92
  ```bash
@@ -113,53 +127,42 @@ If the current story has `research: true` and no research file exists yet:
113
127
 
114
128
  ---
115
129
 
116
- ## Implementation Phase
117
-
118
- If research findings exist (or research is not required):
130
+ ## Routing Awareness
119
131
 
120
- 1. **Write tests first** (TDD - mandatory)
121
- 2. Implement that single user story (using research findings if available)
122
- 3. Run quality checks (typecheck, lint, test)
123
- 4. If checks pass, commit ALL changes with message: `feat: [Story ID] - [Story Title]`
124
- 5. Update `tasks.md` - check off completed acceptance criteria
125
- 6. Update `checklist.md` - check off verified checklist items
126
- 7. Update the PRD to set `passes: true` for the completed story
127
- 8. Append your progress to `relentless/features/<feature>/progress.txt`
132
+ Stories in `prd.json` may have routing metadata:
128
133
 
129
- ---
130
-
131
- ## File Update Summary
134
+ ```json
135
+ {
136
+ "routing": {
137
+ "complexity": "medium",
138
+ "harness": "claude",
139
+ "model": "sonnet-4.5",
140
+ "estimatedCost": 0.0034
141
+ }
142
+ }
143
+ ```
132
144
 
133
- After completing each story, these files MUST be updated:
145
+ **What this means:**
146
+ - **complexity**: How hard the task is (simple/medium/complex/expert)
147
+ - **harness/model**: Which AI was chosen for this task
148
+ - **estimatedCost**: Pre-execution cost estimate
134
149
 
135
- | File | Update |
136
- |------|--------|
137
- | `tasks.md` | Check off `- [x]` completed acceptance criteria |
138
- | `checklist.md` | Check off `- [x]` verified checklist items |
139
- | `prd.json` | Set `"passes": true` for the story |
140
- | `progress.txt` | Append progress entry with learnings |
150
+ After completion, execution history is saved for cost tracking.
141
151
 
142
152
  ---
143
153
 
144
- ## Implementation Phases
145
-
146
- ### Phase 0: Setup
147
- - Infrastructure, tooling, configuration
148
- - Usually US-001 type stories
154
+ ## Checklist Validation
149
155
 
150
- ### Phase 1: Foundation
151
- - Data models, types, schemas
152
- - Base utilities and helpers
153
- - Core infrastructure
156
+ Before completing a story, verify against `checklist.md`:
154
157
 
155
- ### Phase 2: User Stories
156
- - Feature implementation
157
- - Follow dependency order strictly
158
-
159
- ### Phase 3: Polish
160
- - E2E tests
161
- - Documentation
162
- - Performance optimization
158
+ - [ ] All acceptance criteria from tasks.md satisfied
159
+ - [ ] Tests written BEFORE implementation (TDD)
160
+ - [ ] Tests passing
161
+ - [ ] Typecheck passes (0 errors)
162
+ - [ ] Lint passes (0 errors AND 0 warnings)
163
+ - [ ] No debug code (console.log, debugger)
164
+ - [ ] No unused imports or variables
165
+ - [ ] Follows existing patterns
163
166
 
164
167
  ---
165
168
 
@@ -171,19 +174,20 @@ Between iterations, check `.queue.txt` for user input:
171
174
  # If .queue.txt exists, read and process it
172
175
  # Acknowledge in progress.txt
173
176
  # Process in FIFO order
177
+ # Support commands: [PAUSE], [SKIP US-XXX], [ABORT]
174
178
  ```
175
179
 
176
180
  ---
177
181
 
178
182
  ## Progress Report Format
179
183
 
180
- APPEND to progress.txt (never replace, always append):
184
+ APPEND to `progress.txt` after each story (never replace):
181
185
 
182
- ```
183
- ## [Date/Time] - [Story ID]
186
+ ```markdown
187
+ ## [Date] - [Story ID]: [Story Title]
184
188
 
185
- **Implemented:**
186
- - What was built
189
+ **Completed:**
190
+ - What was implemented
187
191
  - Key decisions made
188
192
 
189
193
  **Files Changed:**
@@ -194,7 +198,7 @@ APPEND to progress.txt (never replace, always append):
194
198
 
195
199
  **Learnings:**
196
200
  - Patterns discovered
197
- - Gotchas encountered
201
+ - Gotchas for future iterations
198
202
 
199
203
  **Constitution Compliance:**
200
204
  - [list principles followed]
@@ -204,27 +208,6 @@ APPEND to progress.txt (never replace, always append):
204
208
 
205
209
  ---
206
210
 
207
- ## Quality Requirements
208
-
209
- ### Code Quality (Zero-Lint Policy)
210
- - All commits MUST pass typecheck with 0 errors
211
- - All commits MUST pass lint with 0 warnings (not just errors)
212
- - No subterfuges to escape linting - fix issues properly
213
- - All new features MUST include appropriate tests
214
-
215
- ### Testing Requirements
216
- - Unit tests for all business logic
217
- - Integration tests for API endpoints
218
- - E2E tests for critical user workflows
219
- - Tests MUST be written BEFORE implementation (TDD)
220
-
221
- ### TypeScript Strictness
222
- - Use strict mode throughout
223
- - Avoid `any` type - use `unknown` or proper types
224
- - Use Zod for runtime validation
225
-
226
- ---
227
-
228
211
  ## Project-Specific Patterns
229
212
 
230
213
  ### Directory Structure
@@ -236,8 +219,12 @@ relentless/
236
219
  │ ├── config/ # Configuration schema and loading
237
220
  │ ├── prd/ # PRD parsing and validation
238
221
  │ ├── execution/ # Orchestration loop and routing
222
+ │ ├── routing/ # Auto mode routing module
239
223
  │ └── init/ # Project initialization scaffolder
240
- ├── templates/ # Templates copied to projects on init
224
+ ├── tests/ # Test files
225
+ │ ├── helpers/ # Shared test utilities
226
+ │ ├── routing/ # Routing module tests
227
+ │ └── integration/ # Integration tests
241
228
  ├── .claude/ # Skills and commands
242
229
  │ ├── skills/ # Skill implementations
243
230
  │ └── commands/ # Command wrappers
@@ -257,9 +244,10 @@ relentless/
257
244
  - **UI:** Ink (React for CLI)
258
245
 
259
246
  ### Test File Patterns
260
- - Unit tests: `*.test.ts` alongside source files
247
+ - Unit tests: `tests/**/*.test.ts`
261
248
  - Integration tests: `tests/integration/`
262
249
  - E2E tests: `tests/e2e/`
250
+ - Test helpers: `tests/helpers/`
263
251
 
264
252
  ---
265
253
 
@@ -283,29 +271,32 @@ relentless/
283
271
 
284
272
  ---
285
273
 
286
- ## Common Pitfalls to Avoid
274
+ ## Common Mistakes to Avoid
287
275
 
288
- 1. **Skipping TDD** - Never implement without tests first
289
- 2. **Suppressing lints** - Fix issues properly, don't disable rules
290
- 3. **Large commits** - Keep commits focused and atomic
291
- 4. **Missing typecheck** - Always run `bun run typecheck` before commit
292
- 5. **Ignoring progress.txt** - Read learnings from previous iterations
293
- 6. **Not checking queue** - Always check `.queue.txt` for user input
276
+ 1. **Skipping spec/plan reading** - You MUST read context before coding
277
+ 2. **Writing code before tests** - TDD is mandatory, tests come FIRST
278
+ 3. **Ignoring lint warnings** - Zero warnings required, not just zero errors
279
+ 4. **Marking incomplete stories done** - Only mark `passes: true` when ALL criteria met
280
+ 5. **Not updating progress.txt** - Document learnings for future iterations
281
+ 6. **Committing broken code** - All quality checks must pass before commit
294
282
  7. **Using Node.js APIs** - Use Bun APIs instead
295
283
  8. **Adding unnecessary dependencies** - Prefer built-in solutions
296
284
  9. **Skipping analysis** - Run `/relentless.analyze` before implementing
297
285
  10. **Ignoring checklist** - Update checklist.md after completing criteria
286
+ 11. **Not checking queue** - Always check `.queue.txt` for user input
298
287
 
299
288
  ---
300
289
 
301
290
  ## Stop Condition
302
291
 
303
- After completing a user story, check if ALL stories have `passes: true`.
292
+ After completing a story, check if ALL stories have `passes: true`.
304
293
 
305
- If ALL stories are complete and passing, reply with:
306
- `<promise>COMPLETE</promise>`
294
+ If ALL complete, output:
295
+ ```
296
+ <promise>COMPLETE</promise>
297
+ ```
307
298
 
308
- If there are still stories with `passes: false`, end your response normally (another iteration will pick up the next story).
299
+ Otherwise, end normally (next iteration continues with next story).
309
300
 
310
301
  ---
311
302
 
@@ -325,5 +316,5 @@ If there are still stories with `passes: false`, end your response normally (ano
325
316
  ---
326
317
 
327
318
  **Personalized for Relentless**
328
- **Generated:** 2026-01-13
319
+ **Generated:** 2026-01-20
329
320
  **Re-generate:** /relentless.constitution
package/src/prd/parser.ts CHANGED
@@ -81,7 +81,17 @@ export function parsePRDMarkdown(content: string): Partial<PRD> {
81
81
  }
82
82
 
83
83
  // Parse section headers (## Section)
84
+ // This ends the current story (if any) and starts a new section
84
85
  if (trimmed.startsWith("## ")) {
86
+ // Save current story before switching sections
87
+ if (currentStory && currentStory.id) {
88
+ if (descriptionLines.length > 0 && !currentStory.description) {
89
+ currentStory.description = descriptionLines.join(" ").trim();
90
+ }
91
+ prd.userStories!.push(currentStory as UserStory);
92
+ currentStory = null;
93
+ descriptionLines = [];
94
+ }
85
95
  currentSection = trimmed.replace("## ", "").toLowerCase();
86
96
  inAcceptanceCriteria = false;
87
97
  continue;
@@ -134,13 +144,17 @@ export function parsePRDMarkdown(content: string): Partial<PRD> {
134
144
  }
135
145
 
136
146
  // Parse dependencies (Dependencies: US-001, US-002)
147
+ // Extracts only valid story IDs (US-XXX pattern), ignoring annotations like "(foundational)"
137
148
  if (currentStory && trimmed.match(/^\*\*Dependencies:?\*\*/i)) {
138
- const deps = trimmed
139
- .replace(/^\*\*Dependencies:?\*\*/i, "")
140
- .trim()
149
+ const depsText = trimmed.replace(/^\*\*Dependencies:?\*\*/i, "").trim();
150
+ const deps = depsText
141
151
  .split(/[,;]/)
142
- .map((d) => d.trim())
143
- .filter((d) => d && !["none", "n/a", "-", "na"].includes(d.toLowerCase()));
152
+ .map((d) => {
153
+ // Extract US-XXX pattern from strings like "US-001 (authentication must work first)"
154
+ const match = d.match(/US-\d+/i);
155
+ return match ? match[0].toUpperCase() : null;
156
+ })
157
+ .filter((d): d is string => d !== null);
144
158
  if (deps.length > 0) {
145
159
  currentStory.dependencies = deps;
146
160
  }