@arvorco/relentless 0.3.0 → 0.4.2
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.
- package/.claude/commands/relentless.constitution.md +1 -1
- package/.claude/commands/relentless.convert.md +25 -0
- package/.claude/commands/relentless.specify.md +1 -1
- package/.claude/skills/analyze/SKILL.md +113 -40
- package/.claude/skills/analyze/templates/analysis-report.md +138 -0
- package/.claude/skills/checklist/SKILL.md +143 -51
- package/.claude/skills/checklist/templates/checklist.md +43 -11
- package/.claude/skills/clarify/SKILL.md +70 -11
- package/.claude/skills/constitution/SKILL.md +61 -3
- package/.claude/skills/constitution/templates/constitution.md +241 -160
- package/.claude/skills/constitution/templates/prompt.md +150 -20
- package/.claude/skills/convert/SKILL.md +248 -0
- package/.claude/skills/implement/SKILL.md +82 -34
- package/.claude/skills/plan/SKILL.md +136 -27
- package/.claude/skills/plan/templates/plan.md +92 -9
- package/.claude/skills/specify/SKILL.md +110 -19
- package/.claude/skills/specify/scripts/bash/create-new-feature.sh +2 -2
- package/.claude/skills/specify/scripts/bash/setup-plan.sh +1 -1
- package/.claude/skills/specify/templates/spec.md +40 -5
- package/.claude/skills/tasks/SKILL.md +75 -1
- package/.claude/skills/tasks/templates/tasks.md +5 -4
- package/CHANGELOG.md +63 -1
- package/MANUAL.md +40 -0
- package/README.md +263 -11
- package/bin/relentless.ts +292 -5
- package/package.json +2 -2
- package/relentless/config.json +46 -2
- package/relentless/constitution.md +2 -2
- package/relentless/prompt.md +97 -18
- package/src/agents/amp.ts +53 -13
- package/src/agents/claude.ts +70 -15
- package/src/agents/codex.ts +73 -14
- package/src/agents/droid.ts +68 -14
- package/src/agents/exec.ts +96 -0
- package/src/agents/gemini.ts +59 -16
- package/src/agents/opencode.ts +188 -9
- package/src/cli/fallback-order.ts +210 -0
- package/src/cli/index.ts +63 -0
- package/src/cli/mode-flag.ts +198 -0
- package/src/cli/review-flags.ts +192 -0
- package/src/config/loader.ts +16 -1
- package/src/config/schema.ts +157 -2
- package/src/execution/runner.ts +144 -21
- package/src/init/scaffolder.ts +285 -25
- package/src/prd/parser.ts +92 -1
- package/src/prd/types.ts +136 -0
- package/src/review/index.ts +92 -0
- package/src/review/prompt.ts +293 -0
- package/src/review/runner.ts +337 -0
- package/src/review/tasks/docs.ts +529 -0
- package/src/review/tasks/index.ts +80 -0
- package/src/review/tasks/lint.ts +436 -0
- package/src/review/tasks/quality.ts +760 -0
- package/src/review/tasks/security.ts +452 -0
- package/src/review/tasks/test.ts +456 -0
- package/src/review/tasks/typecheck.ts +323 -0
- package/src/review/types.ts +139 -0
- package/src/routing/cascade.ts +310 -0
- package/src/routing/classifier.ts +338 -0
- package/src/routing/estimate.ts +270 -0
- package/src/routing/fallback.ts +512 -0
- package/src/routing/index.ts +124 -0
- package/src/routing/registry.ts +501 -0
- package/src/routing/report.ts +570 -0
- package/src/routing/router.ts +287 -0
- package/src/tui/App.tsx +2 -0
- package/src/tui/TUIRunner.tsx +103 -8
- package/src/tui/components/CurrentStory.tsx +23 -1
- package/src/tui/hooks/useTUI.ts +1 -0
- package/src/tui/types.ts +9 -0
- package/.claude/skills/specify/scripts/bash/update-agent-context.sh +0 -799
|
@@ -1,228 +1,309 @@
|
|
|
1
|
+
<!-- TEMPLATE_VERSION: 2.1.0 -->
|
|
2
|
+
<!-- LAST_UPDATED: 2026-01-20 -->
|
|
3
|
+
|
|
1
4
|
# Project Constitution
|
|
2
5
|
|
|
6
|
+
**Version:** 1.0.0
|
|
7
|
+
**Ratified:** [DATE]
|
|
8
|
+
**Last Amended:** [DATE]
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
3
12
|
## Overview
|
|
4
13
|
|
|
5
|
-
This document defines the governing principles, patterns, and constraints for this project. All agents and developers MUST follow these guidelines when working on the codebase.
|
|
14
|
+
This document defines the governing principles, patterns, and constraints for this project. All AI agents and developers MUST follow these guidelines when working on the codebase.
|
|
15
|
+
|
|
16
|
+
**This is a generic template.** Customize it for your project using `/relentless.constitution`.
|
|
17
|
+
|
|
18
|
+
---
|
|
6
19
|
|
|
7
20
|
## Core Principles
|
|
8
21
|
|
|
9
|
-
###
|
|
22
|
+
### 1. Test-Driven Development (TDD)
|
|
23
|
+
|
|
24
|
+
**MUST:**
|
|
25
|
+
- Write tests BEFORE implementation code
|
|
26
|
+
- Verify tests FAIL before writing implementation
|
|
27
|
+
- All new features MUST have test coverage
|
|
28
|
+
- All bug fixes MUST include regression tests
|
|
29
|
+
- Tests MUST be part of acceptance criteria
|
|
30
|
+
|
|
31
|
+
**SHOULD:**
|
|
32
|
+
- Aim for >80% code coverage on critical paths
|
|
33
|
+
- Write integration tests for API endpoints
|
|
34
|
+
- Write E2E tests for user-facing flows
|
|
35
|
+
- Use descriptive test names that document behavior
|
|
36
|
+
|
|
37
|
+
**Rationale:** TDD ensures code correctness, documents behavior, and prevents regressions. Tests written first force clear thinking about requirements.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
### 2. Quality Gates
|
|
42
|
+
|
|
43
|
+
**MUST:**
|
|
44
|
+
- All commits MUST pass typecheck with 0 errors
|
|
45
|
+
- All commits MUST pass lint with 0 errors AND 0 warnings
|
|
46
|
+
- All commits MUST pass tests
|
|
47
|
+
- No debug code in production (console.log, debugger)
|
|
48
|
+
- No unused imports or variables
|
|
49
|
+
|
|
50
|
+
**SHOULD:**
|
|
51
|
+
- Run quality checks locally before pushing
|
|
52
|
+
- Fix lint warnings immediately, don't accumulate debt
|
|
53
|
+
- Keep build times under reasonable limits
|
|
54
|
+
|
|
55
|
+
**Rationale:** Quality gates catch issues early and maintain codebase health over time.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
### 3. Code Architecture
|
|
10
60
|
|
|
11
|
-
**MUST
|
|
61
|
+
**MUST:**
|
|
12
62
|
- Follow existing code structure and organization patterns
|
|
13
63
|
- Keep modules focused and single-purpose
|
|
14
|
-
-
|
|
64
|
+
- Avoid circular dependencies
|
|
65
|
+
- Export types alongside implementations
|
|
15
66
|
|
|
16
|
-
**SHOULD
|
|
67
|
+
**SHOULD:**
|
|
17
68
|
- Prefer composition over inheritance
|
|
18
|
-
- Keep functions small and focused
|
|
69
|
+
- Keep functions small and focused (<50 lines)
|
|
19
70
|
- Write self-documenting code
|
|
71
|
+
- Use meaningful names (no abbreviations)
|
|
20
72
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
**MUST** maintain these quality standards:
|
|
24
|
-
- All commits MUST pass typecheck with 0 errors
|
|
25
|
-
- All commits MUST pass lint with 0 warnings
|
|
26
|
-
- All new features MUST include appropriate tests
|
|
27
|
-
- All code MUST be formatted consistently
|
|
73
|
+
**Rationale:** Consistent architecture makes code predictable and maintainable.
|
|
28
74
|
|
|
29
|
-
|
|
30
|
-
- High test coverage (aim for >80%)
|
|
31
|
-
- Clear, descriptive variable and function names
|
|
32
|
-
- Comprehensive error handling
|
|
75
|
+
---
|
|
33
76
|
|
|
34
|
-
###
|
|
77
|
+
### 4. Type Safety
|
|
35
78
|
|
|
36
|
-
**MUST
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
79
|
+
**MUST:**
|
|
80
|
+
- Use strict TypeScript mode
|
|
81
|
+
- No `any` type except in documented exceptional cases
|
|
82
|
+
- Validate external input at system boundaries
|
|
83
|
+
- Export type definitions for public APIs
|
|
41
84
|
|
|
42
|
-
**SHOULD
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
85
|
+
**SHOULD:**
|
|
86
|
+
- Use Zod or similar for runtime validation
|
|
87
|
+
- Prefer type inference over explicit annotations
|
|
88
|
+
- Use discriminated unions for state machines
|
|
89
|
+
- Document complex type constraints
|
|
46
90
|
|
|
47
|
-
|
|
91
|
+
**Rationale:** Type safety prevents runtime errors and improves developer experience.
|
|
48
92
|
|
|
49
|
-
|
|
93
|
+
---
|
|
50
94
|
|
|
51
|
-
|
|
52
|
-
- **Bun** - Runtime environment (not Node.js)
|
|
53
|
-
- **Zod** - Schema validation
|
|
95
|
+
### 5. Version Control
|
|
54
96
|
|
|
55
|
-
|
|
97
|
+
**MUST:**
|
|
98
|
+
- Write clear, descriptive commit messages
|
|
99
|
+
- Reference user story IDs: `feat: [US-XXX] - Description`
|
|
100
|
+
- Keep commits focused and atomic
|
|
101
|
+
- Never commit broken code
|
|
102
|
+
- Never commit secrets or credentials
|
|
56
103
|
|
|
57
|
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
104
|
+
**SHOULD:**
|
|
105
|
+
- Use conventional commit format
|
|
106
|
+
- Keep PR/MR size manageable (<500 lines)
|
|
107
|
+
- Update documentation with code changes
|
|
108
|
+
- Squash fixup commits before merge
|
|
60
109
|
|
|
61
|
-
|
|
110
|
+
**Rationale:** Good version control practices enable collaboration and debugging.
|
|
62
111
|
|
|
63
|
-
|
|
64
|
-
project/
|
|
65
|
-
├── bin/ # CLI entry points
|
|
66
|
-
├── src/ # Source code
|
|
67
|
-
│ ├── agents/ # Agent adapters
|
|
68
|
-
│ ├── config/ # Configuration
|
|
69
|
-
│ ├── execution/ # Orchestration
|
|
70
|
-
│ ├── init/ # Project scaffolding
|
|
71
|
-
│ └── prd/ # PRD handling
|
|
72
|
-
├── templates/ # Template files
|
|
73
|
-
├── skills/ # Agent skills
|
|
74
|
-
└── relentless/ # Relentless workspace
|
|
75
|
-
├── config.json
|
|
76
|
-
├── prompt.md
|
|
77
|
-
└── features/
|
|
78
|
-
```
|
|
112
|
+
---
|
|
79
113
|
|
|
80
|
-
|
|
114
|
+
### 6. Error Handling
|
|
81
115
|
|
|
82
|
-
|
|
116
|
+
**MUST:**
|
|
117
|
+
- Handle all error cases explicitly
|
|
118
|
+
- Provide descriptive error messages
|
|
119
|
+
- Validate input at system boundaries
|
|
120
|
+
- Never swallow errors silently
|
|
83
121
|
|
|
84
|
-
**
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
122
|
+
**SHOULD:**
|
|
123
|
+
- Include context in error messages
|
|
124
|
+
- Use typed error classes
|
|
125
|
+
- Provide recovery suggestions
|
|
126
|
+
- Log errors with appropriate levels
|
|
89
127
|
|
|
90
|
-
**
|
|
91
|
-
- Interface for public APIs
|
|
92
|
-
- Type for unions and intersections
|
|
93
|
-
- Explicit return types on public functions
|
|
128
|
+
**Rationale:** Proper error handling improves debugging and user experience.
|
|
94
129
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
**MUST** implement:
|
|
98
|
-
- Descriptive error messages
|
|
99
|
-
- Proper error types
|
|
100
|
-
- Validation at system boundaries
|
|
101
|
-
- Graceful degradation where appropriate
|
|
130
|
+
---
|
|
102
131
|
|
|
103
|
-
|
|
104
|
-
- Context in error messages
|
|
105
|
-
- Recovery suggestions
|
|
106
|
-
- Logging for debugging
|
|
132
|
+
### 7. Documentation
|
|
107
133
|
|
|
108
|
-
|
|
134
|
+
**MUST:**
|
|
135
|
+
- Document public APIs and interfaces
|
|
136
|
+
- Document breaking changes in commits
|
|
137
|
+
- Keep README updated with setup instructions
|
|
138
|
+
- Document non-obvious design decisions
|
|
109
139
|
|
|
110
|
-
**
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
140
|
+
**SHOULD:**
|
|
141
|
+
- Document configuration options
|
|
142
|
+
- Include usage examples
|
|
143
|
+
- Document troubleshooting steps
|
|
144
|
+
- Keep inline comments minimal but meaningful
|
|
115
145
|
|
|
116
|
-
**
|
|
117
|
-
- Helper functions
|
|
118
|
-
- Utilities
|
|
119
|
-
- Type guards
|
|
146
|
+
**Rationale:** Documentation reduces onboarding time and prevents knowledge loss.
|
|
120
147
|
|
|
121
|
-
|
|
148
|
+
---
|
|
122
149
|
|
|
123
|
-
|
|
124
|
-
- Public APIs and interfaces
|
|
125
|
-
- Complex algorithms or logic
|
|
126
|
-
- Breaking changes in commits
|
|
127
|
-
- Setup and installation steps
|
|
150
|
+
### 8. Security
|
|
128
151
|
|
|
129
|
-
**
|
|
130
|
-
-
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
-
|
|
152
|
+
**MUST:**
|
|
153
|
+
- Never commit secrets or credentials
|
|
154
|
+
- Validate and sanitize user input
|
|
155
|
+
- Use parameterized queries (no SQL injection)
|
|
156
|
+
- Follow principle of least privilege
|
|
134
157
|
|
|
135
|
-
|
|
158
|
+
**SHOULD:**
|
|
159
|
+
- Keep dependencies updated
|
|
160
|
+
- Run security audits periodically
|
|
161
|
+
- Use environment variables for configuration
|
|
162
|
+
- Implement rate limiting for APIs
|
|
136
163
|
|
|
137
|
-
**
|
|
138
|
-
- No secrets committed to git
|
|
139
|
-
- Proper input validation
|
|
140
|
-
- Safe file system operations
|
|
141
|
-
- Minimal permissions required
|
|
164
|
+
**Rationale:** Security is non-negotiable and must be built in from the start.
|
|
142
165
|
|
|
143
|
-
|
|
144
|
-
- Rate limiting where appropriate
|
|
145
|
-
- Audit logs for sensitive operations
|
|
146
|
-
- Security updates for dependencies
|
|
166
|
+
---
|
|
147
167
|
|
|
148
|
-
##
|
|
168
|
+
## Technology Stack
|
|
149
169
|
|
|
150
|
-
**
|
|
151
|
-
- Fast startup time (<1s)
|
|
152
|
-
- Responsive CLI commands
|
|
153
|
-
- Efficient file operations
|
|
154
|
-
- Minimal memory footprint
|
|
170
|
+
**Customize this section for your project:**
|
|
155
171
|
|
|
156
|
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
- Lazy loading of heavy modules
|
|
172
|
+
### Language & Runtime
|
|
173
|
+
- [Language] - Primary language
|
|
174
|
+
- [Runtime] - Runtime environment
|
|
160
175
|
|
|
161
|
-
|
|
176
|
+
### Key Libraries
|
|
177
|
+
- [Library 1] - Purpose
|
|
178
|
+
- [Library 2] - Purpose
|
|
179
|
+
- [Library 3] - Purpose
|
|
162
180
|
|
|
163
|
-
###
|
|
181
|
+
### Quality Tools
|
|
182
|
+
- [Linter] - Code linting
|
|
183
|
+
- [Formatter] - Code formatting
|
|
184
|
+
- [Test Framework] - Testing
|
|
164
185
|
|
|
165
|
-
|
|
166
|
-
- Add dependencies without justification
|
|
167
|
-
- Include deprecated packages
|
|
168
|
-
- Use packages with known security issues
|
|
186
|
+
---
|
|
169
187
|
|
|
170
|
-
|
|
171
|
-
- Prefer built-in solutions over dependencies
|
|
172
|
-
- Keep dependencies minimal and focused
|
|
173
|
-
- Regularly update dependencies
|
|
188
|
+
## File Organization
|
|
174
189
|
|
|
175
|
-
|
|
190
|
+
**Customize this section for your project:**
|
|
176
191
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
192
|
+
```
|
|
193
|
+
project/
|
|
194
|
+
├── src/ # Source code
|
|
195
|
+
│ ├── components/ # UI components (if applicable)
|
|
196
|
+
│ ├── services/ # Business logic
|
|
197
|
+
│ ├── utils/ # Utilities
|
|
198
|
+
│ └── types/ # Type definitions
|
|
199
|
+
├── tests/ # Test files
|
|
200
|
+
├── docs/ # Documentation
|
|
201
|
+
└── relentless/ # Relentless workspace
|
|
202
|
+
├── config.json # Configuration
|
|
203
|
+
├── constitution.md
|
|
204
|
+
├── prompt.md
|
|
205
|
+
└── features/ # Feature workspaces
|
|
206
|
+
```
|
|
181
207
|
|
|
182
|
-
|
|
183
|
-
- Deprecate features before removal
|
|
184
|
-
- Provide clear upgrade documentation
|
|
185
|
-
- Support at least 2 major versions
|
|
208
|
+
---
|
|
186
209
|
|
|
187
210
|
## Agent-Specific Guidelines
|
|
188
211
|
|
|
189
|
-
### For All Agents
|
|
212
|
+
### For All AI Agents
|
|
190
213
|
|
|
191
|
-
**MUST
|
|
192
|
-
- Read
|
|
214
|
+
**MUST:**
|
|
215
|
+
- Read spec.md and plan.md BEFORE starting work
|
|
216
|
+
- Read only the relevant story section from tasks.md
|
|
193
217
|
- Work on ONE story per iteration
|
|
218
|
+
- Follow TDD - write tests first
|
|
219
|
+
- Run ALL quality checks before committing
|
|
194
220
|
- Update PRD after completing a story
|
|
195
221
|
- Append learnings to progress.txt
|
|
196
|
-
- Run all quality checks before committing
|
|
197
222
|
|
|
198
|
-
**SHOULD
|
|
199
|
-
- Review existing code before modifying
|
|
200
|
-
-
|
|
201
|
-
- Ask questions when unclear
|
|
223
|
+
**SHOULD:**
|
|
224
|
+
- Review existing code patterns before modifying
|
|
225
|
+
- Ask questions when requirements are unclear
|
|
202
226
|
- Document non-obvious decisions
|
|
227
|
+
- Keep commits small and focused
|
|
203
228
|
|
|
204
229
|
### Iteration Workflow
|
|
205
230
|
|
|
206
|
-
1. Read
|
|
207
|
-
2.
|
|
231
|
+
1. Read spec.md, plan.md, checklist.md
|
|
232
|
+
2. Find your story in tasks.md (only read that section)
|
|
208
233
|
3. Review relevant existing code
|
|
209
|
-
4.
|
|
210
|
-
5.
|
|
211
|
-
6.
|
|
212
|
-
7.
|
|
213
|
-
8.
|
|
214
|
-
9.
|
|
215
|
-
10.
|
|
234
|
+
4. Write tests FIRST (TDD)
|
|
235
|
+
5. Verify tests FAIL
|
|
236
|
+
6. Implement minimum code to pass tests
|
|
237
|
+
7. Run typecheck, lint, test
|
|
238
|
+
8. Commit with proper message format
|
|
239
|
+
9. Update PRD: `passes: true`
|
|
240
|
+
10. Append to progress.txt
|
|
241
|
+
11. Check if all stories complete
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Routing and Cost Optimization
|
|
246
|
+
|
|
247
|
+
When using Relentless Auto Mode:
|
|
248
|
+
|
|
249
|
+
**MUST:**
|
|
250
|
+
- Respect routing decisions in prd.json
|
|
251
|
+
- Report actual costs vs estimated costs
|
|
252
|
+
- Not override routing without explicit permission
|
|
253
|
+
|
|
254
|
+
**SHOULD:**
|
|
255
|
+
- Use appropriate model for task complexity
|
|
256
|
+
- Consider cost when choosing approaches
|
|
257
|
+
- Track and report token usage
|
|
258
|
+
|
|
259
|
+
**Modes:**
|
|
260
|
+
- `free` - Free tier models only (~95% savings)
|
|
261
|
+
- `cheap` - Budget models (~75% savings)
|
|
262
|
+
- `good` - Balanced quality/cost (~50% savings)
|
|
263
|
+
- `genius` - Premium models (no savings)
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Governance
|
|
268
|
+
|
|
269
|
+
### Amendment Process
|
|
270
|
+
|
|
271
|
+
1. Propose changes via PR
|
|
272
|
+
2. Discuss with team
|
|
273
|
+
3. Update version semantically:
|
|
274
|
+
- **MAJOR**: Breaking changes to principles
|
|
275
|
+
- **MINOR**: New principles added
|
|
276
|
+
- **PATCH**: Clarifications, typo fixes
|
|
277
|
+
4. Update `Last Amended` date
|
|
278
|
+
5. Document rationale for change
|
|
279
|
+
|
|
280
|
+
### Compliance
|
|
281
|
+
|
|
282
|
+
- Constitution is checked before each feature implementation
|
|
283
|
+
- Violations should be flagged in code review
|
|
284
|
+
- Repeated violations require team discussion
|
|
285
|
+
- Emergency exceptions require documentation
|
|
286
|
+
|
|
287
|
+
### Review Schedule
|
|
288
|
+
|
|
289
|
+
- **Quarterly**: Full constitution review
|
|
290
|
+
- **Per Feature**: Relevance check
|
|
291
|
+
- **On Issues**: Investigate if constitution gap
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Customization Notes
|
|
296
|
+
|
|
297
|
+
This template should be customized with:
|
|
216
298
|
|
|
217
|
-
|
|
299
|
+
1. **Technology Stack** - Your specific languages, frameworks, tools
|
|
300
|
+
2. **File Organization** - Your project structure
|
|
301
|
+
3. **Quality Commands** - Your actual typecheck, lint, test commands
|
|
302
|
+
4. **Additional Principles** - Domain-specific rules
|
|
218
303
|
|
|
219
|
-
|
|
220
|
-
- **Reviewed** at project milestones
|
|
221
|
-
- **Updated** when patterns emerge
|
|
222
|
-
- **Referenced** in code reviews
|
|
223
|
-
- **Enforced** in CI/CD pipelines
|
|
304
|
+
Run `/relentless.constitution` to generate a personalized version.
|
|
224
305
|
|
|
225
306
|
---
|
|
226
307
|
|
|
227
|
-
|
|
228
|
-
|
|
308
|
+
**Template Version:** 2.0.0
|
|
309
|
+
**Compatible with:** Relentless v0.2.0+
|
|
@@ -1,6 +1,9 @@
|
|
|
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. Follow these instructions exactly.
|
|
6
|
+
You are an autonomous coding agent orchestrated by Relentless. Follow these instructions exactly.
|
|
4
7
|
|
|
5
8
|
**This is a generic template. Personalize it for your project using:**
|
|
6
9
|
```bash
|
|
@@ -9,26 +12,110 @@ You are an autonomous coding agent. Follow these instructions exactly.
|
|
|
9
12
|
|
|
10
13
|
---
|
|
11
14
|
|
|
15
|
+
## Before Starting ANY Story
|
|
16
|
+
|
|
17
|
+
**CRITICAL:** Read the feature artifacts in this order:
|
|
18
|
+
|
|
19
|
+
1. **`spec.md`** - Read FULL file to understand requirements
|
|
20
|
+
2. **`plan.md`** - Read FULL file to understand technical approach
|
|
21
|
+
3. **`tasks.md`** - Read ONLY the section for your current story (US-XXX)
|
|
22
|
+
4. **`checklist.md`** - Review quality criteria you must satisfy
|
|
23
|
+
5. **`prd.json`** - Find your story and check routing metadata
|
|
24
|
+
|
|
25
|
+
This context is essential. Do NOT skip reading these files.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
12
29
|
## Your Task (Per Iteration)
|
|
13
30
|
|
|
14
|
-
1.
|
|
15
|
-
2. Read
|
|
16
|
-
3.
|
|
17
|
-
4.
|
|
31
|
+
1. Check you're on the correct branch from PRD `branchName`
|
|
32
|
+
2. Read feature artifacts (spec.md, plan.md, your story in tasks.md)
|
|
33
|
+
3. Pick the **highest priority** story where `passes: false` and dependencies met
|
|
34
|
+
4. Check story routing metadata for complexity/model guidance
|
|
18
35
|
5. Review existing code to understand patterns
|
|
19
|
-
6.
|
|
20
|
-
7.
|
|
21
|
-
8.
|
|
22
|
-
9.
|
|
23
|
-
10.
|
|
36
|
+
6. **Write tests FIRST** (TDD is mandatory)
|
|
37
|
+
7. Verify tests FAIL before implementation
|
|
38
|
+
8. Implement the story to make tests PASS
|
|
39
|
+
9. Run ALL quality checks (typecheck, lint, test)
|
|
40
|
+
10. If ALL checks pass, commit: `feat: [Story ID] - [Story Title]`
|
|
41
|
+
11. Update PRD: set `passes: true`
|
|
42
|
+
12. Append progress to `progress.txt`
|
|
24
43
|
|
|
25
44
|
---
|
|
26
45
|
|
|
27
|
-
##
|
|
46
|
+
## TDD Workflow (MANDATORY)
|
|
47
|
+
|
|
48
|
+
You MUST follow Test-Driven Development:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
1. Write test → 2. Run test (MUST FAIL) → 3. Implement → 4. Run test (MUST PASS)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Before implementing ANY code:**
|
|
55
|
+
- Write unit tests for the functionality
|
|
56
|
+
- Run tests to verify they FAIL
|
|
57
|
+
- Then implement the minimum code to make them PASS
|
|
58
|
+
|
|
59
|
+
**Tests are NOT optional.** Every story must have test coverage.
|
|
60
|
+
|
|
61
|
+
---
|
|
28
62
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
63
|
+
## Quality Gates (Non-Negotiable)
|
|
64
|
+
|
|
65
|
+
Before marking ANY story as complete, run these commands:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# TypeScript check (customize for your project)
|
|
69
|
+
bun run typecheck # or: npx tsc --noEmit
|
|
70
|
+
|
|
71
|
+
# Linting (customize for your project)
|
|
72
|
+
bun run lint # or: npx eslint .
|
|
73
|
+
|
|
74
|
+
# Tests (customize for your project)
|
|
75
|
+
bun test # or: npm test
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**ALL checks must pass with ZERO errors and ZERO warnings.**
|
|
79
|
+
|
|
80
|
+
If ANY check fails:
|
|
81
|
+
1. Fix the issue
|
|
82
|
+
2. Re-run all checks
|
|
83
|
+
3. Only then mark the story complete
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Routing Awareness
|
|
88
|
+
|
|
89
|
+
Stories in `prd.json` may have routing metadata:
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"routing": {
|
|
94
|
+
"complexity": "medium",
|
|
95
|
+
"harness": "claude",
|
|
96
|
+
"model": "sonnet-4.5",
|
|
97
|
+
"estimatedCost": 0.0034
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**What this means:**
|
|
103
|
+
- **complexity**: How hard the task is (simple/medium/complex/expert)
|
|
104
|
+
- **harness/model**: Which AI was chosen for this task
|
|
105
|
+
- **estimatedCost**: Pre-execution cost estimate
|
|
106
|
+
|
|
107
|
+
After completion, execution history is saved for cost tracking.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Checklist Validation
|
|
112
|
+
|
|
113
|
+
Before completing a story, verify against `checklist.md`:
|
|
114
|
+
|
|
115
|
+
- [ ] All acceptance criteria from tasks.md satisfied
|
|
116
|
+
- [ ] Tests written and passing
|
|
117
|
+
- [ ] Typecheck passes
|
|
118
|
+
- [ ] Lint passes
|
|
32
119
|
- [ ] No debug code (console.log, debugger)
|
|
33
120
|
- [ ] No unused imports or variables
|
|
34
121
|
- [ ] Follows existing patterns
|
|
@@ -37,12 +124,22 @@ Before marking a story complete:
|
|
|
37
124
|
|
|
38
125
|
## Progress Report Format
|
|
39
126
|
|
|
40
|
-
APPEND to progress.txt:
|
|
41
|
-
|
|
42
|
-
|
|
127
|
+
APPEND to `progress.txt` after each story:
|
|
128
|
+
|
|
129
|
+
```markdown
|
|
130
|
+
## [Date] - [Story ID]: [Story Title]
|
|
131
|
+
|
|
132
|
+
**Completed:**
|
|
43
133
|
- What was implemented
|
|
44
134
|
- Files changed
|
|
45
|
-
|
|
135
|
+
|
|
136
|
+
**Tests:**
|
|
137
|
+
- Tests written and passing
|
|
138
|
+
|
|
139
|
+
**Learnings:**
|
|
140
|
+
- Patterns discovered
|
|
141
|
+
- Gotchas for future iterations
|
|
142
|
+
|
|
46
143
|
---
|
|
47
144
|
```
|
|
48
145
|
|
|
@@ -52,12 +149,40 @@ APPEND to progress.txt:
|
|
|
52
149
|
|
|
53
150
|
After completing a story, check if ALL stories have `passes: true`.
|
|
54
151
|
|
|
55
|
-
If ALL complete:
|
|
152
|
+
If ALL complete, output:
|
|
56
153
|
```
|
|
57
154
|
<promise>COMPLETE</promise>
|
|
58
155
|
```
|
|
59
156
|
|
|
60
|
-
Otherwise, end normally (next iteration continues).
|
|
157
|
+
Otherwise, end normally (next iteration continues with next story).
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## SpecKit Workflow Reference
|
|
162
|
+
|
|
163
|
+
The full Relentless workflow is:
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
/relentless.specify → /relentless.plan → /relentless.tasks → /relentless.convert → /relentless.analyze → /relentless.implement
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Each step generates an artifact in `relentless/features/<feature>/`:
|
|
170
|
+
- `spec.md` - Feature specification
|
|
171
|
+
- `plan.md` - Technical implementation plan
|
|
172
|
+
- `tasks.md` - User stories with acceptance criteria
|
|
173
|
+
- `checklist.md` - Quality validation checklist
|
|
174
|
+
- `prd.json` - Machine-readable PRD with routing
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Common Mistakes to Avoid
|
|
179
|
+
|
|
180
|
+
1. **Skipping spec/plan reading** - You MUST read context before coding
|
|
181
|
+
2. **Writing code before tests** - TDD is mandatory, tests come FIRST
|
|
182
|
+
3. **Ignoring lint warnings** - Zero warnings required, not just zero errors
|
|
183
|
+
4. **Marking incomplete stories done** - Only mark `passes: true` when ALL criteria met
|
|
184
|
+
5. **Not updating progress.txt** - Document learnings for future iterations
|
|
185
|
+
6. **Committing broken code** - All quality checks must pass before commit
|
|
61
186
|
|
|
62
187
|
---
|
|
63
188
|
|
|
@@ -70,3 +195,8 @@ This is the default template. You should personalize `relentless/prompt.md` with
|
|
|
70
195
|
- Project-specific gotchas
|
|
71
196
|
|
|
72
197
|
Run `/relentless.constitution` to generate a personalized prompt.
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
**Template Version:** 2.0.0
|
|
202
|
+
**Compatible with:** Relentless v0.2.0+
|