@arvorco/relentless 0.1.0

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 (107) hide show
  1. package/.claude/commands/relentless.analyze.md +20 -0
  2. package/.claude/commands/relentless.checklist.md +15 -0
  3. package/.claude/commands/relentless.clarify.md +19 -0
  4. package/.claude/commands/relentless.constitution.md +78 -0
  5. package/.claude/commands/relentless.implement.md +15 -0
  6. package/.claude/commands/relentless.plan.md +22 -0
  7. package/.claude/commands/relentless.plan.old.md +89 -0
  8. package/.claude/commands/relentless.specify.md +254 -0
  9. package/.claude/commands/relentless.tasks.md +25 -0
  10. package/.claude/commands/relentless.taskstoissues.md +15 -0
  11. package/.claude/settings.local.json +23 -0
  12. package/.claude/skills/analyze/SKILL.md +149 -0
  13. package/.claude/skills/checklist/SKILL.md +173 -0
  14. package/.claude/skills/checklist/templates/checklist-template.md +40 -0
  15. package/.claude/skills/clarify/SKILL.md +174 -0
  16. package/.claude/skills/constitution/SKILL.md +150 -0
  17. package/.claude/skills/constitution/templates/constitution-template.md +228 -0
  18. package/.claude/skills/implement/SKILL.md +141 -0
  19. package/.claude/skills/plan/SKILL.md +179 -0
  20. package/.claude/skills/plan/templates/plan-template.md +104 -0
  21. package/.claude/skills/prd/SKILL.md +242 -0
  22. package/.claude/skills/relentless/SKILL.md +265 -0
  23. package/.claude/skills/specify/SKILL.md +220 -0
  24. package/.claude/skills/specify/scripts/bash/check-prerequisites.sh +166 -0
  25. package/.claude/skills/specify/scripts/bash/common.sh +156 -0
  26. package/.claude/skills/specify/scripts/bash/create-new-feature.sh +305 -0
  27. package/.claude/skills/specify/scripts/bash/setup-plan.sh +61 -0
  28. package/.claude/skills/specify/scripts/bash/update-agent-context.sh +799 -0
  29. package/.claude/skills/specify/templates/spec-template.md +115 -0
  30. package/.claude/skills/tasks/SKILL.md +202 -0
  31. package/.claude/skills/tasks/templates/tasks-template.md +251 -0
  32. package/.claude/skills/taskstoissues/SKILL.md +97 -0
  33. package/.specify/memory/constitution.md +50 -0
  34. package/.specify/scripts/bash/check-prerequisites.sh +166 -0
  35. package/.specify/scripts/bash/common.sh +156 -0
  36. package/.specify/scripts/bash/create-new-feature.sh +297 -0
  37. package/.specify/scripts/bash/setup-plan.sh +61 -0
  38. package/.specify/scripts/bash/update-agent-context.sh +799 -0
  39. package/.specify/templates/agent-file-template.md +28 -0
  40. package/.specify/templates/checklist-template.md +40 -0
  41. package/.specify/templates/plan-template.md +104 -0
  42. package/.specify/templates/spec-template.md +115 -0
  43. package/.specify/templates/tasks-template.md +251 -0
  44. package/CHANGES_SUMMARY.md +255 -0
  45. package/CLAUDE.md +92 -0
  46. package/GEMINI_SETUP.md +256 -0
  47. package/LICENSE +21 -0
  48. package/README.md +1171 -0
  49. package/REFACTOR_SUMMARY.md +267 -0
  50. package/bin/relentless.ts +536 -0
  51. package/bun.lock +352 -0
  52. package/eslint.config.js +37 -0
  53. package/package.json +61 -0
  54. package/prd.json.example +64 -0
  55. package/prompt.md +108 -0
  56. package/ralph.sh +80 -0
  57. package/relentless/config.json +38 -0
  58. package/relentless/features/.gitkeep +0 -0
  59. package/relentless/features/ghsk-ideas/prd.json +229 -0
  60. package/relentless/features/ghsk-ideas/prd.md +191 -0
  61. package/relentless/features/ghsk-ideas/progress.txt +408 -0
  62. package/relentless/prompt.md +79 -0
  63. package/skills/checklist/SKILL.md +349 -0
  64. package/skills/clarify/SKILL.md +476 -0
  65. package/skills/prd/SKILL.md +242 -0
  66. package/skills/relentless/SKILL.md +268 -0
  67. package/skills/tasks/SKILL.md +577 -0
  68. package/src/agents/amp.ts +115 -0
  69. package/src/agents/claude.ts +185 -0
  70. package/src/agents/codex.ts +89 -0
  71. package/src/agents/droid.ts +90 -0
  72. package/src/agents/gemini.ts +109 -0
  73. package/src/agents/index.ts +16 -0
  74. package/src/agents/opencode.ts +88 -0
  75. package/src/agents/registry.ts +95 -0
  76. package/src/agents/types.ts +101 -0
  77. package/src/config/index.ts +8 -0
  78. package/src/config/loader.ts +237 -0
  79. package/src/config/schema.ts +115 -0
  80. package/src/execution/index.ts +8 -0
  81. package/src/execution/router.ts +49 -0
  82. package/src/execution/runner.ts +512 -0
  83. package/src/index.ts +11 -0
  84. package/src/init/index.ts +7 -0
  85. package/src/init/scaffolder.ts +377 -0
  86. package/src/prd/analyzer.ts +512 -0
  87. package/src/prd/index.ts +11 -0
  88. package/src/prd/issues.ts +249 -0
  89. package/src/prd/parser.ts +281 -0
  90. package/src/prd/progress.ts +198 -0
  91. package/src/prd/types.ts +170 -0
  92. package/src/tui/App.tsx +85 -0
  93. package/src/tui/TUIRunner.tsx +400 -0
  94. package/src/tui/components/AgentOutput.tsx +45 -0
  95. package/src/tui/components/AgentStatus.tsx +64 -0
  96. package/src/tui/components/CurrentStory.tsx +66 -0
  97. package/src/tui/components/Header.tsx +49 -0
  98. package/src/tui/components/ProgressBar.tsx +39 -0
  99. package/src/tui/components/StoryGrid.tsx +86 -0
  100. package/src/tui/hooks/useTUI.ts +147 -0
  101. package/src/tui/hooks/useTimer.ts +51 -0
  102. package/src/tui/index.tsx +17 -0
  103. package/src/tui/theme.ts +41 -0
  104. package/src/tui/types.ts +77 -0
  105. package/templates/constitution.md +228 -0
  106. package/templates/plan.md +273 -0
  107. package/tsconfig.json +27 -0
package/README.md ADDED
@@ -0,0 +1,1171 @@
1
+ # Relentless
2
+
3
+ <div align="center">
4
+
5
+ **Universal AI Agent Orchestrator**
6
+
7
+ [![GitHub](https://img.shields.io/badge/GitHub-ArvorCo%2FRelentless-blue?logo=github)](https://github.com/ArvorCo/Relentless)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+
10
+ *Run any AI coding agent repeatedly until all tasks are complete.*
11
+
12
+ </div>
13
+
14
+ ---
15
+
16
+ ## Quick Start
17
+
18
+ ### Choose Your Workflow
19
+
20
+ **For Claude Code, Amp, or OpenCode users** (Recommended - Full Skills Support):
21
+ ```bash
22
+ # 1. Install Relentless globally
23
+ bun install -g github:ArvorCo/Relentless
24
+
25
+ # 2. Initialize in your project
26
+ cd your-project
27
+ relentless init
28
+
29
+ # 3. Create constitution (personalized governance)
30
+ /relentless.constitution
31
+
32
+ # 4. Create feature specification
33
+ /relentless.specify Add user authentication with OAuth2
34
+
35
+ # 5. Generate plan, tasks, and checklist
36
+ /relentless.plan I'm using React, TypeScript, PostgreSQL
37
+ /relentless.tasks
38
+ /relentless.checklist
39
+
40
+ # 6. Convert tasks to JSON and run
41
+ relentless convert relentless/features/003-user-auth/tasks.md --feature 003-user-auth
42
+ relentless run --feature 003-user-auth --tui
43
+ ```
44
+
45
+ **For Droid, Codex, or other agents** (Manual Workflow):
46
+ ```bash
47
+ # 1. Install and initialize
48
+ bun install -g github:ArvorCo/Relentless
49
+ cd your-project
50
+ relentless init
51
+
52
+ # 2. Create feature
53
+ relentless features create user-auth
54
+
55
+ # 3. Manually create or prompt agent to create files:
56
+ # - relentless/constitution.md
57
+ # - relentless/features/001-user-auth/spec.md
58
+ # - relentless/features/001-user-auth/plan.md
59
+ # - relentless/features/001-user-auth/tasks.md
60
+
61
+ # 4. Convert and run
62
+ relentless convert relentless/features/001-user-auth/tasks.md --feature 001-user-auth
63
+ relentless run --feature 001-user-auth --tui
64
+ ```
65
+
66
+ See [Supported Agents](#supported-agents) section for detailed workflows per agent.
67
+
68
+ ### Legacy PRD Workflow (Still Supported)
69
+
70
+ You can still use the original workflow with direct PRD creation:
71
+
72
+ ```bash
73
+ # 1. Install and initialize
74
+ bun install -g github:ArvorCo/Relentless
75
+ cd your-project
76
+ relentless init
77
+
78
+ # 2. Create PRD using prd skill (Claude/Amp only)
79
+ claude "Load the prd skill and create a PRD for user authentication"
80
+
81
+ # 3. Convert and run
82
+ relentless convert relentless/features/user-auth/prd.md --feature user-auth
83
+ relentless run --feature user-auth --tui
84
+ ```
85
+
86
+ **Alternative: Create PRD manually**
87
+
88
+ Create `relentless/features/my-feature/prd.md`:
89
+ ```markdown
90
+ # My Feature
91
+
92
+ ## User Stories
93
+
94
+ ### US-001: First Task
95
+ As a user, I want X so that Y.
96
+
97
+ **Acceptance Criteria:**
98
+ - Criterion 1
99
+ - Criterion 2
100
+ - Typecheck passes
101
+ ```
102
+
103
+ That's it. Relentless will run your AI agent in a loop until all PRD stories are complete.
104
+
105
+ ---
106
+
107
+ ## What is Relentless?
108
+
109
+ Relentless is a universal AI agent orchestrator that runs any AI coding agent (Claude Code, Amp, OpenCode, Codex, Droid, Gemini) in an autonomous loop until all tasks are complete.
110
+
111
+ Each iteration spawns a **fresh agent instance** with clean context. Memory persists via:
112
+ - **Git history** - commits from previous iterations
113
+ - **progress.txt** - learnings and context notes
114
+ - **prd.json** - task completion status
115
+
116
+ Evolved from the [Ralph Wiggum Pattern](https://ghuntley.com/ralph/).
117
+
118
+ ### Features
119
+
120
+ #### Core Orchestration
121
+ - **Beautiful TUI** - Real-time terminal interface with progress bars, story grid, and agent output
122
+ - **Intelligent Agent Fallback** - Automatically switches agents when rate limits are hit
123
+ - **Rate Limit Detection** - Detects limits for Claude, Codex, Amp, OpenCode, Gemini, and Droid
124
+ - **Auto-Recovery** - Switches back to preferred agent when limits reset
125
+ - **Auto-Numbered Branches** - Automatic feature numbering (001-feature, 002-feature, etc.)
126
+
127
+ #### Specification & Planning (Relentless Commands Integration)
128
+ - **Interactive Specification** - `/relentless.specify` command for creating feature specs from natural language
129
+ - **Technical Planning** - `/relentless.plan` command for generating implementation plans
130
+ - **Hierarchical Task Breakdown** - 4-phase structure (Setup → Foundation → Stories → Polish) with dependency ordering
131
+ - **Quality Checklists** - Domain-specific validation checklists generated from PRD requirements
132
+ - **Interactive Clarification** - Systematic ambiguity detection with targeted questions and multiple-choice options
133
+ - **Constitution Management** - Project-level principles, patterns, and constraints (MUST/SHOULD format)
134
+
135
+ #### Task & Dependency Management
136
+ - **Dependency-Ordered Execution** - Stories with dependencies are executed in correct order
137
+ - **Circular Dependency Detection** - Validates dependencies and prevents circular references
138
+ - **Parallel Task Markers** - Tasks marked with `[P]` can run simultaneously
139
+ - **Phase-Based Planning** - Tasks organized into Setup, Foundation, Stories, and Polish phases
140
+ - **Research Phase Support** - Stories can require research before implementation
141
+
142
+ #### Analysis & Integration
143
+ - **Cross-Artifact Analysis** - Consistency checks across PRD, JSON, progress, and constitution files
144
+ - **GitHub Issues Generation** - Convert user stories directly to GitHub issues via `gh` CLI
145
+ - **Progress Tracking** - YAML frontmatter metadata in progress.txt for machine-readable context
146
+
147
+ #### Skills for AI Agents
148
+ Five specialized skills for Claude Code, Amp, and other AI agents:
149
+ - **prd skill** - Generate comprehensive PRDs with acceptance criteria
150
+ - **tasks skill** - Create dependency-ordered task breakdowns
151
+ - **checklist skill** - Generate domain-specific quality checklists
152
+ - **clarify skill** - Identify and resolve PRD ambiguities
153
+ - **relentless skill** - Integration commands for orchestration
154
+
155
+ ---
156
+
157
+ ## Installation
158
+
159
+ ### Prerequisites
160
+
161
+ - [Bun](https://bun.sh) runtime
162
+ - At least one AI coding agent installed (Claude Code, Amp, etc.)
163
+
164
+ ```bash
165
+ # Install Bun (if needed)
166
+ curl -fsSL https://bun.sh/install | bash
167
+ ```
168
+
169
+ ### Option 1: Clone the Repository (Recommended)
170
+
171
+ ```bash
172
+ git clone https://github.com/ArvorCo/Relentless.git
173
+ cd Relentless
174
+ bun install
175
+ ```
176
+
177
+ ### Option 2: Install Globally
178
+
179
+ ```bash
180
+ bun install -g github:ArvorCo/Relentless
181
+
182
+ # Or install from npm when published
183
+ bun install -g relentless
184
+ ```
185
+
186
+ ### Option 3: Run with bunx (No Installation)
187
+
188
+ ```bash
189
+ bunx github:ArvorCo/Relentless init
190
+ ```
191
+
192
+ ---
193
+
194
+ ## Step-by-Step Guide
195
+
196
+ ### Step 1: Initialize Relentless in Your Project
197
+
198
+ ```bash
199
+ cd your-project
200
+ relentless init
201
+ ```
202
+
203
+ This creates:
204
+ ```
205
+ your-project/
206
+ ├── relentless/
207
+ │ ├── config.json # Configuration
208
+ │ ├── prompt.md # Agent prompt template
209
+ │ └── features/ # Feature folders
210
+ │ └── .gitkeep
211
+ └── .claude/skills/ # Skills (for Claude Code)
212
+ ├── prd/
213
+ └── relentless/
214
+ ```
215
+
216
+ ### Step 2: Create a Feature
217
+
218
+ ```bash
219
+ relentless features create my-feature
220
+ ```
221
+
222
+ This creates:
223
+ ```
224
+ relentless/features/my-feature/
225
+ └── progress.txt
226
+ ```
227
+
228
+ ### Step 3: Write Your PRD
229
+
230
+ Create `relentless/features/my-feature/prd.md`:
231
+
232
+ ```markdown
233
+ # My Feature
234
+
235
+ ## Overview
236
+ Description of what this feature does.
237
+
238
+ ## User Stories
239
+
240
+ ### US-001: First Story
241
+ **Description:** As a user, I want X so that Y.
242
+
243
+ **Acceptance Criteria:**
244
+ - [ ] Criterion 1
245
+ - [ ] Criterion 2
246
+ - [ ] Typecheck passes
247
+
248
+ ### US-002: Second Story
249
+ **Description:** As a user, I want A so that B.
250
+
251
+ **Acceptance Criteria:**
252
+ - [ ] Criterion 1
253
+ - [ ] Criterion 2
254
+ - [ ] Typecheck passes
255
+ ```
256
+
257
+ **Or use the prd skill with Claude Code:**
258
+ ```bash
259
+ claude "Load the prd skill and create a PRD for adding user authentication"
260
+ ```
261
+
262
+ ### Step 4: Convert PRD to JSON
263
+
264
+ ```bash
265
+ relentless convert relentless/features/my-feature/prd.md --feature my-feature
266
+ ```
267
+
268
+ This generates `relentless/features/my-feature/prd.json`:
269
+ ```json
270
+ {
271
+ "project": "My Project",
272
+ "branchName": "relentless/my-feature",
273
+ "userStories": [
274
+ {
275
+ "id": "US-001",
276
+ "title": "First Story",
277
+ "passes": false
278
+ }
279
+ ]
280
+ }
281
+ ```
282
+
283
+ ### Step 5: Run the Orchestrator
284
+
285
+ ```bash
286
+ relentless run --feature my-feature
287
+ ```
288
+
289
+ **Options:**
290
+ ```bash
291
+ # Run with beautiful terminal UI
292
+ relentless run --feature my-feature --tui
293
+
294
+ # Specify agent (default: claude)
295
+ relentless run --feature my-feature --agent amp
296
+
297
+ # Set max iterations (default: 20)
298
+ relentless run --feature my-feature --max-iterations 30
299
+
300
+ # Show status of all stories
301
+ relentless status --feature my-feature
302
+
303
+ # Reset a story to re-run it
304
+ relentless reset US-005 --feature my-feature
305
+
306
+ # Available agents: claude, amp, opencode, codex, droid, gemini, auto
307
+ ```
308
+
309
+ The orchestrator will:
310
+ 1. Read `prd.json` to find incomplete stories (`passes: false`)
311
+ 2. Build a prompt from `prompt.md` with the feature context
312
+ 3. Invoke the AI agent
313
+ 4. Agent works on one story, commits, updates prd.json
314
+ 5. Repeat until all stories have `passes: true`
315
+ 6. Stop when agent outputs `<promise>COMPLETE</promise>`
316
+
317
+ ---
318
+
319
+ ## Project Structure
320
+
321
+ After initialization, your project will have:
322
+
323
+ ```
324
+ your-project/
325
+ ├── relentless/
326
+ │ ├── config.json # Relentless configuration
327
+ │ ├── prompt.md # Prompt template for agents
328
+ │ └── features/
329
+ │ └── my-feature/ # or 001-my-feature with auto-numbering
330
+ │ ├── prd.md # Your PRD (markdown)
331
+ │ ├── prd.json # Converted PRD (JSON)
332
+ │ ├── progress.txt # Progress log with YAML frontmatter
333
+ │ ├── plan.md # Technical implementation plan (optional)
334
+ │ ├── tasks.md # Dependency-ordered task breakdown (optional)
335
+ │ ├── checklist.md # Quality validation checklist (optional)
336
+ │ ├── constitution.md # Project coding principles (optional)
337
+ │ ├── clarification-log.md # Ambiguity resolutions (optional)
338
+ │ └── research/ # Research findings (optional)
339
+ │ └── US-XXX.md
340
+ ├── .claude/
341
+ │ ├── skills/ # Skills for Claude Code
342
+ │ │ ├── prd/SKILL.md
343
+ │ │ ├── tasks/SKILL.md
344
+ │ │ ├── checklist/SKILL.md
345
+ │ │ ├── clarify/SKILL.md
346
+ │ │ └── relentless/SKILL.md
347
+ │ └── commands/ # Relentless Commands commands
348
+ │ ├── relentless.specify.md
349
+ │ ├── relentless.plan.md
350
+ │ ├── relentless.tasks.md
351
+ │ ├── relentless.checklist.md
352
+ │ ├── relentless.clarify.md
353
+ │ ├── relentless.constitution.md
354
+ │ ├── relentless.analyze.md
355
+ │ ├── relentless.implement.md
356
+ │ └── relentless.taskstoissues.md
357
+ └── templates/ # Templates copied from Relentless
358
+ ├── prompt.md
359
+ ├── plan.md
360
+ ├── constitution.md
361
+ └── progress.txt
362
+ ```
363
+
364
+ **Note:** Files marked as "(optional)" are created when using the Relentless Commands workflow or specific CLI options (`--with-plan`, etc.).
365
+
366
+ ---
367
+
368
+ ## Supported Agents
369
+
370
+ Relentless works with multiple AI coding agents. Feature generation workflow varies by agent capabilities:
371
+
372
+ ### Tier 1: Full Skills Support (Recommended)
373
+
374
+ Full `/relentless.*` command support with interactive workflows:
375
+
376
+ | Agent | Command | Status |
377
+ |-------|---------|--------|
378
+ | **Claude Code** | `claude` | ✅ Full skills support |
379
+ | **Amp** | `amp` | ✅ Full skills support |
380
+ | **OpenCode** | `opencode` | ✅ Full skills support |
381
+
382
+ **Workflow:**
383
+ ```bash
384
+ /relentless.constitution
385
+ /relentless.specify Add user authentication
386
+ /relentless.plan
387
+ /relentless.tasks
388
+ /relentless.checklist
389
+ relentless convert tasks.md --feature 003-user-auth
390
+ relentless run --feature 003-user-auth --tui
391
+ ```
392
+
393
+ ### Tier 2: Extensions/Hybrid Support
394
+
395
+ Support through extensions or alternative mechanisms:
396
+
397
+ | Agent | Command | Status |
398
+ |-------|---------|--------|
399
+ | **Gemini** | `gemini` | 🔄 Extensions (see below) |
400
+
401
+ **Gemini Setup:** See [GEMINI_SETUP.md](./GEMINI_SETUP.md) for extensions integration guide.
402
+
403
+ ### Tier 3: Manual/CLI Workflow
404
+
405
+ Use CLI commands and manual file creation:
406
+
407
+ | Agent | Command | Status |
408
+ |-------|---------|--------|
409
+ | **Droid** | `droid` | 📝 Manual workflow |
410
+ | **Codex** | `codex` | 📝 Manual workflow |
411
+
412
+ **Manual Workflow:**
413
+ ```bash
414
+ # 1. Initialize and create feature structure
415
+ relentless init
416
+ relentless features create user-auth --with-plan
417
+
418
+ # 2. Create constitution manually or prompt agent
419
+ # Manual: Edit relentless/constitution.md
420
+ # Or prompt:
421
+ droid "Create relentless/constitution.md with governance rules for a TypeScript/React project with strict testing"
422
+
423
+ # 3. Create specification files by prompting agent
424
+ droid "Create relentless/features/001-user-auth/spec.md with feature specification for user authentication with OAuth2"
425
+
426
+ # 4. Create technical plan
427
+ droid "Create relentless/features/001-user-auth/plan.md with technical implementation plan using React, TypeScript, PostgreSQL"
428
+
429
+ # 5. Create user stories (most important!)
430
+ droid "Create relentless/features/001-user-auth/tasks.md with user stories in format:
431
+ ### US-001: Title
432
+ **Description:** As a [user], I want [goal] so that [benefit].
433
+ **Acceptance Criteria:**
434
+ - [ ] Specific criterion
435
+ - [ ] Typecheck passes
436
+ - [ ] Tests pass"
437
+
438
+ # 6. Convert and run orchestration
439
+ relentless convert relentless/features/001-user-auth/tasks.md --feature 001-user-auth
440
+ relentless run --feature 001-user-auth --tui
441
+ ```
442
+
443
+ **Pro Tip for Droid/Codex:** Reference the skill files for detailed instructions:
444
+ ```bash
445
+ droid "Read .claude/skills/tasks/SKILL.md and create tasks.md following that format"
446
+ ```
447
+
448
+ ### Check Agent Availability
449
+
450
+ ```bash
451
+ # List installed agents
452
+ relentless agents list
453
+
454
+ # Check agent health
455
+ relentless agents doctor
456
+ ```
457
+
458
+ ---
459
+
460
+ ## CLI Commands
461
+
462
+ ### Core Commands
463
+
464
+ ```bash
465
+ # Initialize Relentless in current project
466
+ relentless init
467
+
468
+ # Run orchestration for a feature
469
+ relentless run --feature <name> [--agent <name>] [--max-iterations <n>] [--tui]
470
+
471
+ # Show status of all user stories
472
+ relentless status --feature <name>
473
+
474
+ # Reset a story to incomplete (to re-run it)
475
+ relentless reset <story-id> --feature <name>
476
+ ```
477
+
478
+ ### Feature Management
479
+
480
+ ```bash
481
+ # Create a new feature (with optional auto-numbering)
482
+ relentless features create <name>
483
+ relentless features create <name> --auto-number # Creates 001-<name>, 002-<name>, etc.
484
+ relentless features create <name> --with-plan # Include plan.md template
485
+
486
+ # List all features
487
+ relentless features list
488
+
489
+ # Convert PRD markdown to JSON
490
+ relentless convert <prd.md> --feature <name>
491
+ relentless convert <prd.md> --feature <name> --auto-number
492
+
493
+ # Create PRD from natural language description
494
+ relentless prd "<feature description>"
495
+ ```
496
+
497
+ ### Analysis & Integration
498
+
499
+ ```bash
500
+ # Analyze cross-artifact consistency (PRD, JSON, progress, constitution)
501
+ relentless analyze --feature <name>
502
+
503
+ # Generate GitHub issues from user stories
504
+ relentless issues --feature <name> [--dry-run] [--all]
505
+ ```
506
+
507
+ ### Agent Management
508
+
509
+ ```bash
510
+ # List installed agents
511
+ relentless agents list
512
+
513
+ # Check agent health
514
+ relentless agents doctor
515
+ ```
516
+
517
+ ### Relentless Commands Commands (For Claude Code & Compatible Agents)
518
+
519
+ These commands are available when using Claude Code or other agents that support custom commands:
520
+
521
+ ```bash
522
+ # Create or update feature specification
523
+ /relentless.specify <feature description>
524
+
525
+ # Generate technical implementation plan
526
+ /relentless.plan [options]
527
+
528
+ # Generate dependency-ordered task breakdown
529
+ /relentless.tasks
530
+
531
+ # Generate domain-specific quality checklist
532
+ /relentless.checklist
533
+
534
+ # Clarify ambiguities in PRD
535
+ /relentless.clarify
536
+
537
+ # Manage project constitution
538
+ /relentless.constitution
539
+
540
+ # Analyze cross-artifact consistency
541
+ /relentless.analyze
542
+
543
+ # Convert tasks to GitHub issues
544
+ /relentless.taskstoissues
545
+
546
+ # Execute implementation workflow
547
+ /relentless.implement
548
+ ```
549
+
550
+ ### Alternative: Run with bunx (No Installation)
551
+
552
+ ```bash
553
+ # Initialize
554
+ bunx github:ArvorCo/Relentless init
555
+
556
+ # Run orchestration
557
+ bunx github:ArvorCo/Relentless run --feature <name>
558
+
559
+ # Check status
560
+ bunx github:ArvorCo/Relentless status --feature <name>
561
+ ```
562
+
563
+ ---
564
+
565
+ ## Relentless Commands Integration (Optional but Recommended)
566
+
567
+ Relentless now includes comprehensive Relentless Commands-inspired features for structured specification, planning, and quality assurance. These features work with Claude Code and other compatible AI agents.
568
+
569
+ ### Overview
570
+
571
+ The Relentless Commands workflow provides:
572
+ 1. **Interactive Specification** - Natural language to structured specs
573
+ 2. **Technical Planning** - Implementation design and architecture
574
+ 3. **Hierarchical Task Breakdown** - Dependency-ordered, phase-structured tasks
575
+ 4. **Quality Checklists** - Domain-specific validation
576
+ 5. **Constitution Management** - Project-level coding principles
577
+
578
+ ### Workflow
579
+
580
+ #### 1. Create Feature Specification
581
+
582
+ Use the `/relentless.specify` command to create a feature spec from a natural language description:
583
+
584
+ ```bash
585
+ /relentless.specify Add user authentication with email/password and OAuth2 support
586
+ ```
587
+
588
+ This will:
589
+ - Generate a short name for the feature (e.g., "user-auth")
590
+ - Check for existing branches and auto-number (e.g., "003-user-auth")
591
+ - Create a comprehensive specification with:
592
+ - User scenarios and acceptance criteria
593
+ - Functional requirements
594
+ - Success criteria (measurable, technology-agnostic)
595
+ - Key entities and data models
596
+ - Dependencies and assumptions
597
+ - Validate specification quality with a checklist
598
+ - Identify ambiguities and present clarification questions (max 3)
599
+
600
+ **Optional: Clarify Ambiguities**
601
+
602
+ If the spec has unclear areas, use `/relentless.clarify` to systematically resolve them:
603
+
604
+ ```bash
605
+ /relentless.clarify
606
+ ```
607
+
608
+ This scans for 9 types of ambiguities:
609
+ - Behavioral (what happens when...)
610
+ - Data (required fields, validation)
611
+ - UI/UX (where, how, what style)
612
+ - Integration (which APIs, fallbacks)
613
+ - Permissions (who can do what)
614
+ - Performance (limits, pagination)
615
+ - Error handling (what errors, how displayed)
616
+ - State management (persistence)
617
+ - Edge cases (empty data, race conditions)
618
+
619
+ #### 2. Generate Technical Plan
620
+
621
+ Create an implementation plan using `/relentless.plan`:
622
+
623
+ ```bash
624
+ /relentless.plan I'm building with React, TypeScript, and PostgreSQL
625
+ ```
626
+
627
+ This generates:
628
+ - Technical architecture and design patterns
629
+ - Data models and API contracts
630
+ - Integration points and migration strategy
631
+ - Testing strategy (unit, integration, E2E)
632
+ - Security considerations
633
+ - Rollout and monitoring plan
634
+
635
+ Saved to: `relentless/features/<feature-name>/plan.md`
636
+
637
+ #### 3. Generate Task Breakdown
638
+
639
+ Break down the plan into dependency-ordered tasks:
640
+
641
+ ```bash
642
+ /relentless.tasks
643
+ ```
644
+
645
+ **Hierarchical 4-Phase Structure:**
646
+
647
+ ```markdown
648
+ Phase 0: Setup
649
+ - Install dependencies
650
+ - Create directory structure
651
+ - Initialize configuration
652
+
653
+ Phase 1: Foundation
654
+ - Database schema
655
+ - Core types and models
656
+ - Base utilities
657
+
658
+ Phase 2: Stories
659
+ - US-001: Feature implementation
660
+ - US-002: UI components
661
+ - US-003: API endpoints
662
+
663
+ Phase 3: Polish
664
+ - Performance optimization
665
+ - Documentation
666
+ - Analytics
667
+ ```
668
+
669
+ **Key Features:**
670
+ - **Task IDs**: T001, T002, T003 (sequential)
671
+ - **Phase Markers**: `[Phase 0]`, `[Phase 1]`, etc.
672
+ - **Story Labels**: `[US-001]`, `[US-002]`
673
+ - **Parallel Markers**: `[P]` for tasks that can run simultaneously
674
+ - **Dependencies**: Tasks ordered by dependencies
675
+ - **Testing**: Explicit verification tasks after each story
676
+
677
+ Example:
678
+ ```markdown
679
+ - [ ] **T001** [Phase 0] [Setup] Install required dependencies (zod, commander)
680
+ - [ ] **T002** [Phase 1] [US-001] Create User schema with email field [P]
681
+ - [ ] **T003** [Phase 1] [US-001] Add password hashing utility [P]
682
+ - [ ] **T004** [Phase 2] [US-001] Implement login endpoint
683
+ - [ ] **T005** [Phase 2] [US-001] Run typecheck and lint (verify US-001)
684
+ ```
685
+
686
+ Saved to: `relentless/features/<feature-name>/tasks.md`
687
+
688
+ #### 4. Generate Quality Checklist
689
+
690
+ Create a domain-specific quality checklist:
691
+
692
+ ```bash
693
+ /relentless.checklist
694
+ ```
695
+
696
+ This generates 20-40 validation items across 5-7 categories:
697
+ - Schema & Database
698
+ - Backend Logic
699
+ - Frontend Components
700
+ - Integration & Flow
701
+ - Testing & Validation
702
+ - Security & Permissions
703
+ - Performance & UX
704
+
705
+ **80% of items** reference specific PRD sections or identify gaps/ambiguities:
706
+ - `[US-001]` - References user story
707
+ - `[Gap]` - Missing specification
708
+ - `[Ambiguity]` - Unclear requirement
709
+ - `[Edge Case]` - Potential edge case
710
+
711
+ Saved to: `relentless/features/<feature-name>/checklist.md`
712
+
713
+ ### Hierarchical Planning Details
714
+
715
+ #### Phase Structure
716
+
717
+ **Phase 0: Setup** (Infrastructure)
718
+ - Project structure and dependencies
719
+ - Configuration files
720
+ - Base templates and types
721
+ - Required by all other phases
722
+
723
+ **Phase 1: Foundation** (Core Platform)
724
+ - Database schemas and migrations
725
+ - Core data models and types
726
+ - Base API endpoints
727
+ - Authentication/authorization
728
+ - Utility functions
729
+ - Used by multiple user stories
730
+
731
+ **Phase 2: Stories** (User Features)
732
+ - Individual user story implementation
733
+ - Feature-specific UI components
734
+ - Feature-specific API routes
735
+ - Integration between components
736
+ - Independently testable
737
+
738
+ **Phase 3: Polish** (Refinement)
739
+ - Performance optimization
740
+ - Error handling improvements
741
+ - Accessibility enhancements
742
+ - Documentation and analytics
743
+
744
+ #### Dependency Management
745
+
746
+ **Story Dependencies in PRD:**
747
+
748
+ ```json
749
+ {
750
+ "id": "US-002",
751
+ "title": "User Profile Page",
752
+ "dependencies": ["US-001"],
753
+ "passes": false
754
+ }
755
+ ```
756
+
757
+ **Features:**
758
+ - **Validation**: Checks for missing or circular dependencies
759
+ - **Execution Order**: Stories run in dependency order
760
+ - **Independent Testing**: Each story is independently testable
761
+ - **Parallel Markers**: Stories without dependencies can run in parallel
762
+
763
+ #### Task Granularity
764
+
765
+ Each task should take 15-60 minutes:
766
+ - **Too small**: "Change variable name" (combine these)
767
+ - **Too large**: "Implement entire authentication" (break into subtasks)
768
+ - **Just right**: "Create login form component", "Add JWT validation middleware"
769
+
770
+ ### Constitution Management
771
+
772
+ Create a project constitution to enforce coding standards:
773
+
774
+ ```bash
775
+ /relentless.constitution
776
+ ```
777
+
778
+ The constitution defines:
779
+ - **MUST** rules (enforced, blocking)
780
+ - **SHOULD** rules (best practices, warnings)
781
+
782
+ Categories:
783
+ - Architecture patterns
784
+ - Code quality standards
785
+ - Version control practices
786
+ - Technology stack constraints
787
+ - Security requirements
788
+ - Performance expectations
789
+
790
+ Saved to: `relentless/features/<feature-name>/constitution.md`
791
+
792
+ Agents check the constitution before implementing each story.
793
+
794
+ ### Skills for AI Agents
795
+
796
+ Five skills are automatically installed in `.claude/skills/`:
797
+
798
+ **1. prd skill** - Generate PRDs
799
+ ```bash
800
+ claude "Load the prd skill and create a PRD for user authentication"
801
+ ```
802
+
803
+ **2. tasks skill** - Generate task breakdowns
804
+ ```bash
805
+ claude "Load the tasks skill and generate tasks for the auth feature"
806
+ ```
807
+
808
+ **3. checklist skill** - Generate quality checklists
809
+ ```bash
810
+ claude "Load the checklist skill and create a checklist for the API feature"
811
+ ```
812
+
813
+ **4. clarify skill** - Clarify ambiguities
814
+ ```bash
815
+ claude "Load the clarify skill and identify ambiguities in the PRD"
816
+ ```
817
+
818
+ **5. relentless skill** - Orchestration integration
819
+ ```bash
820
+ claude "Load the relentless skill and show me the next incomplete story"
821
+ ```
822
+
823
+ ### Complete Workflow Example
824
+
825
+ ```bash
826
+ # 1. Initialize project
827
+ relentless init
828
+
829
+ # 2. Create feature specification (Claude Code)
830
+ /relentless.specify Add user authentication with OAuth2 and 2FA support
831
+
832
+ # 3. Clarify any ambiguities (if needed)
833
+ /relentless.clarify
834
+
835
+ # 4. Generate technical plan
836
+ /relentless.plan I'm using React, Node.js, PostgreSQL
837
+
838
+ # 5. Generate task breakdown
839
+ /relentless.tasks
840
+
841
+ # 6. Generate quality checklist
842
+ /relentless.checklist
843
+
844
+ # 7. Convert spec to PRD for orchestration
845
+ relentless convert relentless/features/003-user-auth/spec.md --feature 003-user-auth
846
+
847
+ # 8. Run orchestration
848
+ relentless run --feature 003-user-auth --tui
849
+
850
+ # 9. Generate GitHub issues (optional)
851
+ relentless issues --feature 003-user-auth
852
+ ```
853
+
854
+ ---
855
+
856
+ ## Quality Assurance Commands
857
+
858
+ ### Analyze Cross-Artifact Consistency
859
+
860
+ Check for issues across your PRD, JSON, and progress files:
861
+
862
+ ```bash
863
+ relentless analyze --feature my-feature
864
+ ```
865
+
866
+ This checks for:
867
+ - **Schema Validation** - Missing required fields, invalid story IDs
868
+ - **Dependency Consistency** - Circular dependencies, missing dependencies
869
+ - **File Existence** - Missing prd.md, progress.txt, constitution.md
870
+ - **Story Completeness** - Stories with few acceptance criteria
871
+ - **Progress Log Sync** - Completed stories not mentioned in progress.txt
872
+
873
+ Example output:
874
+ ```
875
+ ╔═══════════════════════════════════════════════════════╗
876
+ ║ Cross-Artifact Consistency Analysis ║
877
+ ╚═══════════════════════════════════════════════════════╝
878
+
879
+ Feature: my-feature
880
+ Summary:
881
+ Stories: 10/12 completed (2 pending)
882
+ Issues: 3 total
883
+ Critical: 0
884
+ Warnings: 2
885
+ Info: 1
886
+ ```
887
+
888
+ ### Generate GitHub Issues
889
+
890
+ Convert user stories directly to GitHub issues:
891
+
892
+ ```bash
893
+ # Preview what would be created (dry run)
894
+ relentless issues --feature my-feature --dry-run
895
+
896
+ # Create issues for incomplete stories only
897
+ relentless issues --feature my-feature
898
+
899
+ # Create issues for all stories (including completed)
900
+ relentless issues --feature my-feature --all
901
+ ```
902
+
903
+ **Requirements:**
904
+ - [GitHub CLI (gh)](https://cli.github.com/) must be installed and authenticated
905
+ - Git remote must be a GitHub repository
906
+
907
+ Each issue includes:
908
+ - Story title and description
909
+ - Acceptance criteria as checkboxes
910
+ - Labels based on story type (database, ui, api, etc.)
911
+ - Priority labels (high, medium, low)
912
+ - Dependencies listed
913
+
914
+ ---
915
+
916
+ ## Configuration
917
+
918
+ `relentless/config.json`:
919
+
920
+ ```json
921
+ {
922
+ "defaultAgent": "claude",
923
+ "agents": {
924
+ "claude": {
925
+ "model": "sonnet",
926
+ "dangerouslyAllowAll": true
927
+ }
928
+ },
929
+ "fallback": {
930
+ "enabled": true,
931
+ "priority": ["claude", "codex", "amp", "opencode", "gemini"],
932
+ "autoRecovery": true
933
+ },
934
+ "execution": {
935
+ "maxIterations": 20,
936
+ "iterationDelay": 2000
937
+ }
938
+ }
939
+ ```
940
+
941
+ ---
942
+
943
+ ## Writing Good PRDs
944
+
945
+ ### Right-Sized Stories
946
+
947
+ Each story should be completable in **one context window**. If a task is too big, the agent runs out of context before finishing.
948
+
949
+ **Good story sizes:**
950
+ - Add a database column and migration
951
+ - Create a UI component
952
+ - Implement a single API endpoint
953
+
954
+ **Too big (split these):**
955
+ - "Build the entire dashboard"
956
+ - "Add authentication"
957
+ - "Refactor the API"
958
+
959
+ ### Acceptance Criteria
960
+
961
+ Make criteria **verifiable**, not vague:
962
+
963
+ **Good:**
964
+ - "Button shows confirmation dialog before deleting"
965
+ - "Email field validates format on blur"
966
+ - "Typecheck passes"
967
+
968
+ **Bad:**
969
+ - "Works correctly"
970
+ - "Good UX"
971
+ - "Handles edge cases"
972
+
973
+ ### Always Include
974
+
975
+ - `Typecheck passes` in every story
976
+ - `Verify in browser` for UI stories
977
+
978
+ ### Advanced PRD Features
979
+
980
+ #### Story Dependencies
981
+
982
+ Stories can depend on other stories. Relentless ensures dependencies are completed first and validates for circular dependencies:
983
+
984
+ **In Markdown:**
985
+ ```markdown
986
+ ### US-002: Add User Profile Page
987
+ **Dependencies:** US-001
988
+ **Description:** Create user profile page showing user information.
989
+ ```
990
+
991
+ **In prd.json:**
992
+ ```json
993
+ {
994
+ "id": "US-002",
995
+ "title": "Add User Profile Page",
996
+ "dependencies": ["US-001"],
997
+ "passes": false
998
+ }
999
+ ```
1000
+
1001
+ **Features:**
1002
+ - Validates dependencies exist
1003
+ - Detects circular dependencies (US-A → US-B → US-A)
1004
+ - Executes in correct order
1005
+ - Shows dependency errors in `relentless analyze`
1006
+
1007
+ #### Parallel Execution
1008
+
1009
+ Mark stories that can run simultaneously:
1010
+
1011
+ ```json
1012
+ {
1013
+ "id": "US-003",
1014
+ "title": "Add Analytics Dashboard",
1015
+ "parallel": true,
1016
+ "passes": false
1017
+ }
1018
+ ```
1019
+
1020
+ Stories without dependencies and marked `parallel: true` can be implemented concurrently by different agent runs.
1021
+
1022
+ #### Phase Markers
1023
+
1024
+ Organize stories into phases for better task planning:
1025
+
1026
+ ```json
1027
+ {
1028
+ "id": "US-001",
1029
+ "title": "Create Database Schema",
1030
+ "phase": "Foundation",
1031
+ "passes": false
1032
+ }
1033
+ ```
1034
+
1035
+ **Common phases:**
1036
+ - `Setup` - Infrastructure and dependencies
1037
+ - `Foundation` - Core platform and shared code
1038
+ - `Stories` - User-facing features
1039
+ - `Polish` - Optimizations and refinements
1040
+
1041
+ #### Research Phase
1042
+
1043
+ For complex stories requiring exploration before implementation:
1044
+
1045
+ **In Markdown:**
1046
+ ```markdown
1047
+ ### US-005: Integrate Payment Provider
1048
+ **Research Required:** true
1049
+ **Description:** Research best payment provider options before implementing.
1050
+ ```
1051
+
1052
+ **In prd.json:**
1053
+ ```json
1054
+ {
1055
+ "id": "US-005",
1056
+ "title": "Integrate Payment Provider",
1057
+ "research": true,
1058
+ "passes": false
1059
+ }
1060
+ ```
1061
+
1062
+ When `research: true`, Relentless will:
1063
+ 1. Run a research phase first to gather context
1064
+ 2. Save findings to `relentless/features/<feature>/research/US-005.md`
1065
+ 3. Then run the implementation phase with research context
1066
+
1067
+ ---
1068
+
1069
+ ## How It Works
1070
+
1071
+ ### Core Orchestration Loop
1072
+
1073
+ 1. **Fresh Context Each Iteration** - Each loop spawns a new agent instance with clean context
1074
+ 2. **Load Constitution** - Agent reads project coding principles and constraints (if present)
1075
+ 3. **Agent Reads PRD** - Finds the next story with `passes: false` that has dependencies met
1076
+ 4. **Dependency Validation** - Ensures all story dependencies are completed before execution
1077
+ 5. **Research Phase** (if needed) - Agent explores and documents findings for complex stories
1078
+ 6. **Agent Implements** - Makes changes, follows constitution rules, runs tests, commits
1079
+ 7. **Agent Updates PRD** - Sets `passes: true` for completed story
1080
+ 8. **Agent Updates Progress** - Appends learnings to `progress.txt` with YAML frontmatter
1081
+ 9. **Loop Continues** - Until all stories pass or max iterations reached
1082
+ 10. **Completion Signal** - Agent outputs `<promise>COMPLETE</promise>` when done
1083
+
1084
+ ### Dependency Resolution
1085
+
1086
+ - **Before execution**: Validates all dependencies exist and no circular references
1087
+ - **During execution**: Only selects stories where all dependencies have `passes: true`
1088
+ - **Priority order**: Follows story priority while respecting dependencies
1089
+ - **Parallel execution**: Stories marked `parallel: true` without dependencies can run concurrently
1090
+
1091
+ ### Memory Persistence
1092
+
1093
+ Each agent iteration has access to:
1094
+ - **Git history** - All commits from previous iterations
1095
+ - **progress.txt** - YAML metadata + learnings and context notes
1096
+ - **prd.json** - Task completion status and dependencies
1097
+ - **constitution.md** - Project coding principles (MUST/SHOULD rules)
1098
+ - **tasks.md** - Dependency-ordered task breakdown (if present)
1099
+ - **checklist.md** - Quality validation checklist (if present)
1100
+
1101
+ ---
1102
+
1103
+ ## Troubleshooting
1104
+
1105
+ ### Feature not found
1106
+ ```
1107
+ Error: Feature 'my-feature' not found
1108
+ ```
1109
+ Create the feature first:
1110
+ ```bash
1111
+ bun run relentless.ts features create my-feature
1112
+ ```
1113
+
1114
+ ### PRD not found
1115
+ ```
1116
+ Error: relentless/features/my-feature/prd.json not found
1117
+ ```
1118
+ Convert your PRD first:
1119
+ ```bash
1120
+ bun run relentless.ts convert path/to/prd.md --feature my-feature
1121
+ ```
1122
+
1123
+ ### Max iterations reached
1124
+ ```
1125
+ Warning: Reached maximum iterations (20) without completion
1126
+ ```
1127
+ Either increase `--max-iterations` or break stories into smaller tasks.
1128
+
1129
+ ---
1130
+
1131
+ ## Development
1132
+
1133
+ ```bash
1134
+ # Clone
1135
+ git clone https://github.com/ArvorCo/Relentless.git
1136
+ cd Relentless
1137
+
1138
+ # Install dependencies
1139
+ bun install
1140
+
1141
+ # Run CLI locally
1142
+ bun run bin/relentless.ts --help
1143
+
1144
+ # Type check
1145
+ bun run typecheck
1146
+
1147
+ # Lint
1148
+ bun run lint
1149
+ ```
1150
+
1151
+ ---
1152
+
1153
+ ## References
1154
+
1155
+ - [Ralph Wiggum Pattern](https://ghuntley.com/ralph/) - Original concept by Geoffrey Huntley
1156
+ - [Ralph by Snarktank](https://github.com/snarktank/ralph) - Reference implementation that inspired Relentless
1157
+ - [GitHub Relentless Commands](https://github.com/github/spec-kit) - Specification workflow and structure inspiration for hierarchical planning, quality checklists, and interactive clarification features
1158
+
1159
+ ---
1160
+
1161
+ ## License
1162
+
1163
+ MIT License - see [LICENSE](LICENSE) for details.
1164
+
1165
+ ---
1166
+
1167
+ <div align="center">
1168
+
1169
+ **Built by [Arvor](https://arvor.co)**
1170
+
1171
+ </div>