@arvorco/relentless 0.1.19 → 0.1.21

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.
@@ -1,15 +1,42 @@
1
1
  ---
2
- description: Execute implementation workflow phase by phase.
2
+ description: Execute implementation workflow for a feature manually, story by story.
3
3
  ---
4
4
 
5
5
  Load the implement skill and begin systematic implementation.
6
6
 
7
+ **Usage:** `/relentless.implement [story-id]`
8
+
7
9
  **Context:** $ARGUMENTS
8
10
 
9
- The implement skill will:
10
- 1. Guide you through implementing tasks in dependency order
11
- 2. Track progress per user story
12
- 3. Ensure quality gates are met
13
- 4. Update progress.txt with learnings
11
+ The implement skill will guide you through:
12
+
13
+ 1. **TDD Workflow** - Tests first, then implementation
14
+ 2. **Quality Gates** - typecheck, lint, test must all pass
15
+ 3. **File Updates** - tasks.md, checklist.md, prd.json, progress.txt
16
+ 4. **Dependency Order** - Stories implemented in correct sequence
17
+
18
+ ## Quick Start
19
+
20
+ 1. Ensure you have all artifacts: spec.md, plan.md, tasks.md, checklist.md, prd.json
21
+ 2. Run `/relentless.analyze` first (must pass with no CRITICAL issues)
22
+ 3. Run `/relentless.implement` to start with the next available story
23
+ 4. Or run `/relentless.implement US-003` to implement a specific story
24
+
25
+ ## What Gets Updated
26
+
27
+ After each story:
28
+ - `tasks.md` - Acceptance criteria checked off
29
+ - `checklist.md` - Verified items checked off
30
+ - `prd.json` - Story marked as `passes: true`
31
+ - `progress.txt` - Progress entry with learnings
32
+
33
+ ## Prerequisites
34
+
35
+ - `/relentless.analyze` must pass
36
+ - All feature artifacts must exist
37
+ - Constitution and prompt.md reviewed
38
+
39
+ ## See Also
14
40
 
15
- Prerequisites: /relentless.analyze must pass (no CRITICAL issues)
41
+ - `relentless run` - Automated orchestration (runs agents automatically)
42
+ - `/relentless.analyze` - Check artifact consistency before implementing
@@ -12,9 +12,10 @@ Create a personalized project constitution that defines your team's coding princ
12
12
  ## The Job
13
13
 
14
14
  1. Ask the user about their project's coding philosophy and standards
15
- 2. Generate a personalized constitution based on their answers
16
- 3. Save to `relentless/constitution.md`
17
- 4. Ensure consistency with project templates and documentation
15
+ 2. Analyze the project structure and documentation
16
+ 3. Generate personalized constitution based on their answers → `relentless/constitution.md`
17
+ 4. Generate personalized agent prompt based on the same analysis → `relentless/prompt.md`
18
+ 5. Ensure consistency with project templates and documentation
18
19
 
19
20
  **Important:** The constitution is the foundation for all feature work - create this before generating features.
20
21
 
@@ -67,31 +68,126 @@ Load the template from `templates/constitution-template.md` and:
67
68
 
68
69
  ---
69
70
 
70
- ## Step 3: Validate & Save
71
+ ## Step 3: Analyze Project Structure
72
+
73
+ Read and analyze project documentation:
74
+
75
+ **Core Files:**
76
+ - `README.md` - Project overview, setup instructions
77
+ - `AGENTS.md` or `CLAUDE.md` - Developer guidelines
78
+ - `package.json` - Scripts, dependencies, tech stack
79
+ - `CONTRIBUTING.md` - Contribution workflow (if exists)
80
+
81
+ **Extract:**
82
+ - Tech stack (TypeScript, React, Node, etc.)
83
+ - Testing framework (vitest, jest, playwright)
84
+ - Quality commands (`typecheck`, `lint`, `test`)
85
+ - Build system (bun, npm, turbo, vite)
86
+ - Linting setup (eslint, biome)
87
+ - File structure patterns
88
+
89
+ ---
90
+
91
+ ## Step 4: Generate Personalized Prompt
92
+
93
+ Using the generic template from relentless, create a personalized `prompt.md` with:
94
+
95
+ **Section 1: Quality Gates**
96
+ ```markdown
97
+ ## CRITICAL: Quality Gates (Non-Negotiable)
98
+
99
+ Before marking ANY story as complete:
100
+
101
+ \`\`\`bash
102
+ # TypeScript (detected from package.json)
103
+ [actual typecheck command from package.json scripts]
104
+
105
+ # Linting (detected from package.json)
106
+ [actual lint command from package.json scripts]
107
+
108
+ # Tests (detected from package.json)
109
+ [actual test command from package.json scripts]
110
+ \`\`\`
111
+
112
+ **If ANY check fails, DO NOT mark the story as complete.**
113
+ ```
114
+
115
+ **Section 2: Project-Specific Patterns** (from README/AGENTS.md)
116
+ - Monorepo structure (if applicable)
117
+ - Component locations
118
+ - Test file patterns
119
+ - Database/backend info
120
+ - Styling approach
121
+
122
+ **Section 3: TDD Workflow** (if tests exist)
123
+ - Test-first workflow
124
+ - Test location patterns
125
+ - Test commands
126
+
127
+ **Section 4: Common Pitfalls** (from AGENTS.md/docs)
128
+ - Project-specific gotchas
129
+ - Known issues
130
+ - Best practices
131
+
132
+ **Footer:**
133
+ ```markdown
134
+ ---
135
+ **Personalized for [Project Name]**
136
+ **Generated:** [date]
137
+ **Re-generate:** /relentless.constitution
138
+ ```
139
+
140
+ Save to: `relentless/prompt.md`
141
+
142
+ ---
143
+
144
+ ## Step 5: Validate & Save
71
145
 
72
146
  Before saving:
73
- - No `[PLACEHOLDER]` tokens remain (unless explicitly marked as TODO)
147
+
148
+ **Constitution:**
149
+ - No `[PLACEHOLDER]` tokens remain
74
150
  - All dates in ISO format (YYYY-MM-DD)
75
151
  - Principles are declarative and testable
76
152
  - Version format is semantic (X.Y.Z)
77
153
 
78
- Save to: `relentless/constitution.md`
154
+ **Prompt:**
155
+ - All quality commands are actual commands from package.json
156
+ - File patterns match project structure
157
+ - No generic placeholders remain
158
+
159
+ Save both files:
160
+ - `relentless/constitution.md`
161
+ - `relentless/prompt.md`
79
162
 
80
163
  ---
81
164
 
82
- ## Step 4: Report
165
+ ## Step 6: Report
83
166
 
84
167
  Output summary:
85
- - Constitution version created
86
- - Number of principles defined
87
- - Key MUST/SHOULD rules
88
- - Next steps: "Now create your first feature with `/relentless.specify`"
168
+ ```
169
+ Created constitution.md
170
+ - Version: 1.0.0
171
+ - Principles: [count]
172
+ - Key rules: [summary]
173
+
174
+ ✓ Created prompt.md
175
+ - Quality gates: [count]
176
+ - Tech stack: [detected stack]
177
+ - Test framework: [detected]
178
+
179
+ Next steps:
180
+ 1. Review both files
181
+ 2. Create your first feature: /relentless.specify "feature description"
182
+ ```
89
183
 
90
184
  ---
91
185
 
92
- ## Updating Existing Constitution
186
+ ## Updating Existing Files
187
+
188
+ If `relentless/constitution.md` or `relentless/prompt.md` exist:
93
189
 
94
- If `relentless/constitution.md` exists:
190
+ **For Constitution Updates:**
95
191
  1. Load current version
96
192
  2. Ask what needs to change
97
193
  3. Increment version appropriately:
@@ -101,6 +197,15 @@ If `relentless/constitution.md` exists:
101
197
  4. Update `LAST_AMENDED_DATE` to today
102
198
  5. Add amendment notes at top
103
199
 
200
+ **For Prompt Updates:**
201
+ 1. Re-analyze project structure (package.json, docs)
202
+ 2. Detect any new quality commands or patterns
203
+ 3. Regenerate personalized sections
204
+ 4. Preserve any manual customizations in comments
205
+ 5. Update "Generated" date
206
+
207
+ **Both files can be regenerated at any time by running `/relentless.constitution` again.**
208
+
104
209
  ---
105
210
 
106
211
  ## Example Constitution Structure
@@ -5,137 +5,238 @@ description: "Execute implementation workflow phase by phase. Use after analysis
5
5
 
6
6
  # Implementation Workflow Executor
7
7
 
8
- Guide systematic implementation of features using the task breakdown.
8
+ Guide systematic implementation of features using TDD and quality-first approach.
9
9
 
10
10
  ---
11
11
 
12
12
  ## The Job
13
13
 
14
- Guide user through implementing tasks in correct order following dependencies.
14
+ Implement user stories one at a time, following strict TDD and updating all tracking files.
15
15
 
16
16
  ---
17
17
 
18
- ## Prerequisites
18
+ ## Before You Start
19
19
 
20
- Before starting:
21
- - `/relentless.analyze` must pass (no CRITICAL issues)
22
- - All artifacts exist (spec, plan, tasks, checklist)
23
- - Constitution reviewed
20
+ 1. **Read the Constitution** - Review `relentless/constitution.md` for project principles
21
+ 2. **Read prompt.md** - Review `relentless/prompt.md` for workflow guidelines
22
+ 3. **Read progress.txt** - Check learnings from previous iterations
23
+ 4. **Review artifacts** - Ensure spec.md, plan.md, tasks.md, checklist.md exist
24
+ 5. **Run `/relentless.analyze`** - Must pass with no CRITICAL issues
24
25
 
25
26
  ---
26
27
 
27
- ## Implementation Flow
28
+ ## CRITICAL: Quality Gates (Non-Negotiable)
28
29
 
29
- ### Phase 0: Setup
30
- 1. Review `tasks.md` for setup tasks
31
- 2. Install dependencies
32
- 3. Create directory structure
33
- 4. Initialize configuration
30
+ Before marking ANY story as complete, ALL checks must pass:
34
31
 
35
- ### Phase 1: Foundation
36
- 1. Implement data models
37
- 2. Create base utilities
38
- 3. Set up infrastructure
39
- 4. Tests for foundation
32
+ ```bash
33
+ # TypeScript strict mode check
34
+ bun run typecheck
40
35
 
41
- ### Phase 2: User Stories
42
- For each story in dependency order:
43
- 1. Read story acceptance criteria
44
- 2. Implement functionality
45
- 3. Write tests
46
- 4. Run quality checks (typecheck, lint)
47
- 5. Verify against checklist
48
- 6. Commit changes
49
- 7. Mark story complete in prd.json
36
+ # ESLint with zero warnings policy
37
+ bun run lint
50
38
 
51
- ### Phase 3: Polish
52
- 1. Performance optimization
53
- 2. Error handling improvements
54
- 3. Documentation
55
- 4. Final quality checks
39
+ # All tests must pass
40
+ bun test
41
+ ```
42
+
43
+ **If ANY check fails, DO NOT mark the story as complete. Fix the issues first.**
56
44
 
57
45
  ---
58
46
 
59
- ## Per-Story Workflow
47
+ ## TDD Workflow (MANDATORY)
60
48
 
61
- ```markdown
62
- **Current:** US-001: Create User Registration Endpoint
49
+ For EVERY story, follow strict Test-Driven Development:
63
50
 
64
- **Acceptance Criteria:**
65
- - [ ] POST /api/auth/register endpoint exists
66
- - [ ] Email validation works
67
- - [ ] Password requirements enforced
68
- - [ ] Password hashed before storage
69
- - [ ] Confirmation email sent
70
- - [ ] Returns 201 with user ID
71
- - [ ] Returns 400 for invalid input
72
- - [ ] Typecheck passes
73
- - [ ] Tests pass
74
-
75
- **Checklist Items:**
76
- - CHK-001: User table created
77
- - CHK-006: Password hashing uses bcrypt
78
- - CHK-011: Returns correct status codes
79
-
80
- **Steps:**
81
- 1. Create endpoint handler
82
- 2. Implement validation
83
- 3. Add password hashing
84
- 4. Integrate email service
85
- 5. Write unit tests
86
- 6. Write integration tests
87
- 7. Run typecheck
88
- 8. Run tests
89
- 9. Verify checklist items
90
- 10. Commit with message: "feat: US-001 - Create User Registration Endpoint"
51
+ ### Step 1: Write Failing Tests First (RED)
52
+ ```bash
53
+ # Create test file if needed
54
+ # Write tests that define expected behavior
55
+ bun test # Tests MUST fail initially
91
56
  ```
92
57
 
93
- ---
58
+ ### Step 2: Implement Minimum Code (GREEN)
59
+ ```bash
60
+ # Write only enough code to pass tests
61
+ bun test # Tests MUST pass
62
+ ```
94
63
 
95
- ## Quality Gates
64
+ ### Step 3: Refactor
65
+ ```bash
66
+ # Clean up while keeping tests green
67
+ bun test # Tests MUST still pass
68
+ ```
96
69
 
97
- Before marking story complete:
98
- - [ ] All acceptance criteria checked
99
- - [ ] Typecheck passes
100
- - [ ] Linter passes
101
- - [ ] Tests pass
102
- - [ ] Relevant checklist items verified
103
- - [ ] Code committed
70
+ **Do NOT skip TDD. Tests are contracts that validate your implementation.**
104
71
 
105
72
  ---
106
73
 
107
- ## Progress Tracking
74
+ ## Per-Story Implementation Flow
75
+
76
+ For each story (in dependency order):
77
+
78
+ ### 1. Identify the Story
79
+ - Read `prd.json` to find the next story where `passes: false`
80
+ - Check dependencies are met (dependent stories have `passes: true`)
81
+ - Read the story's acceptance criteria
82
+
83
+ ### 2. Find Relevant Checklist Items
84
+ - Open `checklist.md`
85
+ - Find items tagged with `[US-XXX]` for this story
86
+ - Note constitution compliance items `[Constitution]`
108
87
 
109
- Update `progress.txt` after each story:
88
+ ### 3. Implement with TDD
89
+ Follow the TDD workflow above for each acceptance criterion.
110
90
 
91
+ ### 4. Update tasks.md
92
+ As you complete each criterion:
111
93
  ```markdown
112
- ## 2026-01-11 - US-001
113
- - Implemented user registration endpoint
114
- - Added email validation and password hashing
115
- - Email service integration working
116
- - All tests passing
94
+ # Change from:
95
+ - [ ] Criterion text
117
96
 
118
- **Learnings:**
119
- - Bcrypt cost factor 12 provides good balance
120
- - Email validation regex from validator.js works well
121
- - Nodemailer setup straightforward
97
+ # To:
98
+ - [x] Criterion text
99
+ ```
100
+
101
+ ### 5. Update checklist.md
102
+ For each verified checklist item:
103
+ ```markdown
104
+ # Change from:
105
+ - [ ] CHK-XXX [US-001] Description
106
+
107
+ # To:
108
+ - [x] CHK-XXX [US-001] Description
109
+ ```
110
+
111
+ ### 6. Run Quality Checks
112
+ ```bash
113
+ bun run typecheck # 0 errors required
114
+ bun run lint # 0 warnings required
115
+ bun test # All tests must pass
116
+ ```
117
+
118
+ ### 7. Commit Changes
119
+ ```bash
120
+ git add -A
121
+ git commit -m "feat: US-XXX - Story Title"
122
+ ```
123
+
124
+ ### 8. Update prd.json
125
+ Set the story's `passes` field to `true`:
126
+ ```json
127
+ {
128
+ "id": "US-001",
129
+ "title": "...",
130
+ "passes": true, // <- Change from false to true
131
+ ...
132
+ }
133
+ ```
134
+
135
+ ### 9. Update progress.txt
136
+ Append progress entry:
137
+ ```markdown
138
+ ## [Date] - US-XXX: Story Title
139
+
140
+ **Implemented:**
141
+ - What was built
142
+ - Key decisions made
122
143
 
123
144
  **Files Changed:**
124
- - src/api/auth/register.ts (new)
125
- - src/services/user.service.ts (new)
126
- - src/utils/password.ts (new)
127
- - tests/auth/register.test.ts (new)
145
+ - path/to/file.ts (new/modified)
146
+
147
+ **Tests Added:**
148
+ - path/to/file.test.ts
149
+
150
+ **Learnings:**
151
+ - Patterns discovered
152
+ - Gotchas encountered
153
+
154
+ **Constitution Compliance:**
155
+ - Principle N: How it was followed
156
+
157
+ ---
158
+ ```
128
159
 
129
160
  ---
161
+
162
+ ## Example Per-Story Workflow
163
+
164
+ ```markdown
165
+ **Current:** US-001: Test Infrastructure Setup
166
+
167
+ **Acceptance Criteria:**
168
+ - [ ] `bun test` command runs successfully
169
+ - [ ] Test files with pattern `*.test.ts` are auto-discovered
170
+ - [ ] `bun test --coverage` shows coverage report
171
+ - [ ] Typecheck passes
172
+ - [ ] Lint passes
173
+
174
+ **Relevant Checklist Items:**
175
+ - [ ] CHK-001 [US-001] `bun test` command executes successfully
176
+ - [ ] CHK-002 [US-001] Test files with `*.test.ts` pattern are auto-discovered
177
+ - [ ] CHK-007 [Constitution] Tests written BEFORE implementation
178
+
179
+ **Implementation Steps:**
180
+ 1. Write a simple failing test first
181
+ 2. Configure bun test runner
182
+ 3. Verify test discovery works
183
+ 4. Run `bun run typecheck` - must pass
184
+ 5. Run `bun run lint` - must pass with 0 warnings
185
+ 6. Update tasks.md - check off completed criteria
186
+ 7. Update checklist.md - mark verified items
187
+ 8. Commit: "feat: US-001 - Test Infrastructure Setup"
188
+ 9. Update prd.json: set passes: true
189
+ 10. Update progress.txt with learnings
130
190
  ```
131
191
 
132
192
  ---
133
193
 
194
+ ## File Update Summary
195
+
196
+ After completing each story, these files MUST be updated:
197
+
198
+ | File | Update |
199
+ |------|--------|
200
+ | `tasks.md` | Check off `- [x]` completed acceptance criteria |
201
+ | `checklist.md` | Check off `- [x]` verified checklist items |
202
+ | `prd.json` | Set `"passes": true` for the story |
203
+ | `progress.txt` | Append progress entry with learnings |
204
+
205
+ ---
206
+
207
+ ## Implementation Phases
208
+
209
+ ### Phase 0: Setup
210
+ - Infrastructure, tooling, configuration
211
+ - Usually US-001 type stories
212
+
213
+ ### Phase 1: Foundation
214
+ - Data models, types, schemas
215
+ - Base utilities and helpers
216
+ - Core infrastructure
217
+
218
+ ### Phase 2: User Stories
219
+ - Feature implementation
220
+ - Follow dependency order strictly
221
+
222
+ ### Phase 3: Polish
223
+ - E2E tests
224
+ - Documentation
225
+ - Performance optimization
226
+
227
+ ---
228
+
134
229
  ## Notes
135
230
 
136
231
  - Work on ONE story at a time
137
- - Follow dependency order
138
- - Don't skip quality checks
139
- - Commit frequently
140
- - Update progress after each story
141
- - This is a guided workflow, not automated
232
+ - Follow dependency order strictly
233
+ - Never skip TDD - tests come FIRST
234
+ - Never skip quality checks
235
+ - Commit after each story
236
+ - Update ALL tracking files
237
+ - This is a guided workflow for manual implementation
238
+
239
+ ---
240
+
241
+ *Reference: See `relentless/prompt.md` for additional guidelines*
242
+ *Reference: See `relentless/constitution.md` for project principles*