@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
@@ -0,0 +1,577 @@
1
+ ---
2
+ name: tasks
3
+ description: "Generate dependency-ordered task breakdowns with phase structure. Use for planning implementation. Triggers on: break down tasks, generate task list, create implementation plan, dependency-ordered tasks."
4
+ ---
5
+
6
+ # Dependency-Ordered Task Breakdown Skill
7
+
8
+ Generate comprehensive, dependency-ordered task breakdowns with phase structure to visualize implementation order and parallelize work effectively.
9
+
10
+ ---
11
+
12
+ ## The Job
13
+
14
+ 1. Read the PRD from `relentless/features/[feature-name]/prd.json` or `prd.md`
15
+ 2. Analyze user stories, dependencies, and acceptance criteria
16
+ 3. Generate phase structure: Setup → Foundation → Stories → Polish
17
+ 4. Create tasks with IDs (T001+), phase markers, story labels [US-X]
18
+ 5. Mark parallel tasks with [P]
19
+ 6. Ensure each story is independently testable
20
+ 7. Save to `relentless/features/[feature-name]/tasks.md`
21
+
22
+ **Important:** This skill works with Claude Code, Amp, Gemini, and other AI coding agents.
23
+
24
+ ---
25
+
26
+ ## Step 1: Analyze PRD Structure
27
+
28
+ ### Extract Key Information
29
+ - **User Stories**: Read all stories with their IDs, titles, descriptions, acceptance criteria
30
+ - **Dependencies**: Check for explicit dependencies between stories
31
+ - **Priority**: Note story priorities (if present)
32
+ - **Parallel Markers**: Check if stories are marked for parallel execution
33
+ - **Phases**: Look for explicit phase information in stories
34
+
35
+ ### Infer Task Structure
36
+ - **Identify foundations**: Which stories must be completed first? (schema, core types, base components)
37
+ - **Group related work**: Which stories touch similar files/systems?
38
+ - **Detect parallels**: Which stories can be worked on simultaneously?
39
+ - **Find polish items**: Which stories are enhancements/refinements that can come last?
40
+
41
+ ---
42
+
43
+ ## Step 2: Phase Structure
44
+
45
+ Every task breakdown follows this 4-phase structure:
46
+
47
+ ### Phase 0: Setup
48
+ **Purpose**: Prepare project structure, dependencies, configuration
49
+
50
+ **Typical tasks:**
51
+ - Install dependencies
52
+ - Create directory structure
53
+ - Set up configuration files
54
+ - Initialize templates
55
+ - Create type definitions
56
+
57
+ **Criteria for Setup tasks:**
58
+ - Required by ALL other phases
59
+ - No dependencies on business logic
60
+ - Quick to complete (< 30 minutes total)
61
+
62
+ ### Phase 1: Foundation
63
+ **Purpose**: Core infrastructure, schemas, base utilities
64
+
65
+ **Typical tasks:**
66
+ - Database schema setup
67
+ - Core data models/types
68
+ - Base API endpoints
69
+ - Authentication/authorization
70
+ - Utility functions
71
+
72
+ **Criteria for Foundation tasks:**
73
+ - Referenced by multiple user stories
74
+ - Form the "platform" for feature work
75
+ - Usually maps to stories with many dependents
76
+
77
+ ### Phase 2: Stories
78
+ **Purpose**: User-facing features from PRD
79
+
80
+ **Typical tasks:**
81
+ - Individual user story implementation
82
+ - Feature-specific UI components
83
+ - Feature-specific API routes
84
+ - Integration between components
85
+
86
+ **Criteria for Story tasks:**
87
+ - Maps 1:1 or 1:N to user stories
88
+ - Implements acceptance criteria
89
+ - Independently testable
90
+ - May have dependencies on Foundation
91
+
92
+ ### Phase 3: Polish
93
+ **Purpose**: Refinements, optimizations, documentation
94
+
95
+ **Typical tasks:**
96
+ - Performance optimization
97
+ - Error handling improvements
98
+ - Accessibility enhancements
99
+ - Documentation
100
+ - Analytics/monitoring
101
+
102
+ **Criteria for Polish tasks:**
103
+ - Enhances existing functionality
104
+ - Not blocking for core feature
105
+ - Can be done after basic implementation works
106
+
107
+ ---
108
+
109
+ ## Step 3: Task Format
110
+
111
+ Each task follows this format:
112
+
113
+ ```markdown
114
+ - [ ] **T[NNN]** [Phase X] [Story Label] Task description [Parallel Marker]
115
+ ```
116
+
117
+ ### Components:
118
+
119
+ 1. **Task ID**: `T001`, `T002`, etc. (3-digit, zero-padded)
120
+ 2. **Phase Marker**: `[Phase 0]`, `[Phase 1]`, `[Phase 2]`, `[Phase 3]`
121
+ 3. **Story Label**: `[US-001]`, `[US-002]`, `[Setup]`, `[Polish]`
122
+ 4. **Task Description**: Clear, actionable description (verb + object)
123
+ 5. **Parallel Marker**: `[P]` if task can run in parallel with others in same phase
124
+
125
+ ### Examples:
126
+
127
+ ```markdown
128
+ - [ ] **T001** [Phase 0] [Setup] Install required dependencies (zod, commander, js-yaml)
129
+ - [ ] **T002** [Phase 0] [Setup] Create templates directory structure [P]
130
+ - [ ] **T003** [Phase 1] [US-001] Extend UserStory schema with dependencies field
131
+ - [ ] **T004** [Phase 1] [US-001] Implement validateDependencies() with circular detection
132
+ - [ ] **T005** [Phase 2] [US-003] Create constitution.md template [P]
133
+ - [ ] **T006** [Phase 2] [US-003] Update loader to parse constitution [P]
134
+ - [ ] **T007** [Phase 3] [Polish] Add comprehensive JSDoc comments to public APIs
135
+ ```
136
+
137
+ ---
138
+
139
+ ## Step 4: Dependency Ordering Rules
140
+
141
+ ### Within a Phase:
142
+ 1. **Sequential by default**: Tasks should be done in order unless marked [P]
143
+ 2. **Parallel markers**: Use `[P]` when tasks:
144
+ - Touch completely different files
145
+ - Have no shared dependencies
146
+ - Can be verified independently
147
+ - Don't conflict when tested together
148
+
149
+ 3. **Dependency inference**: Task B depends on Task A if:
150
+ - B uses code/types created in A
151
+ - B tests functionality implemented in A
152
+ - B's files import from A's files
153
+
154
+ ### Cross-Phase Dependencies:
155
+ - **Phase 0 → Phase 1**: All Setup tasks must complete before Foundation starts
156
+ - **Phase 1 → Phase 2**: Foundation tasks must complete before their dependent Story tasks
157
+ - **Phase 2 → Phase 3**: Core functionality should work before Polish begins
158
+ - **Within Phase 2**: Respect user story dependencies from PRD
159
+
160
+ ### Task Granularity:
161
+ - **Too small**: "Change variable name", "Add comment" (combine these)
162
+ - **Too large**: "Implement entire authentication system" (break into subtasks)
163
+ - **Just right**: "Create login form component", "Add JWT validation middleware"
164
+
165
+ **Rule of thumb**: Each task should take 15-60 minutes
166
+
167
+ ---
168
+
169
+ ## Step 5: Independent Testability
170
+
171
+ Each user story (Phase 2 tasks) must be independently testable:
172
+
173
+ ### What does "independently testable" mean?
174
+ - Can run quality checks (typecheck, lint) after completing the story's tasks
175
+ - Can verify acceptance criteria without waiting for other stories
176
+ - Can commit the work without breaking existing functionality
177
+ - May depend on Foundation (Phase 1), but not on other Stories (Phase 2)
178
+
179
+ ### How to ensure testability:
180
+ 1. **Include test tasks**: For each story, add explicit testing tasks
181
+ 2. **Stub external dependencies**: Create mock implementations for dependent stories not yet completed
182
+ 3. **Incremental commits**: Break stories into sub-tasks that can each be committed
183
+ 4. **Feature flags**: Suggest feature flags for incomplete integrations
184
+
185
+ ### Example (testable story breakdown):
186
+
187
+ ```markdown
188
+ ## Phase 2: User Stories
189
+
190
+ ### US-003: Constitution Management System
191
+
192
+ - [ ] **T015** [Phase 2] [US-003] Create constitution.md template in /templates
193
+ - [ ] **T016** [Phase 2] [US-003] Add constitution loader in config/loader.ts
194
+ - [ ] **T017** [Phase 2] [US-003] Add constitution validation (MUST/SHOULD format)
195
+ - [ ] **T018** [Phase 2] [US-003] Update runner to include constitution in prompt
196
+ - [ ] **T019** [Phase 2] [US-003] Update scaffolder to copy constitution template
197
+ - [ ] **T020** [Phase 2] [US-003] Run typecheck and lint (verify US-003 passes)
198
+ ```
199
+
200
+ After T020, US-003 is complete and testable independently.
201
+
202
+ ---
203
+
204
+ ## Step 6: Tasks.md Template
205
+
206
+ ```markdown
207
+ # Implementation Tasks: [Feature Name]
208
+
209
+ Generated: [Date]
210
+ Total Stories: [N]
211
+ Total Tasks: [N]
212
+
213
+ This task breakdown provides dependency-ordered implementation steps for [Feature Name].
214
+
215
+ ---
216
+
217
+ ## Overview
218
+
219
+ **Phases:**
220
+ - **Phase 0 (Setup)**: [N] tasks - Project structure and dependencies
221
+ - **Phase 1 (Foundation)**: [N] tasks - Core infrastructure
222
+ - **Phase 2 (Stories)**: [N] tasks - User-facing features
223
+ - **Phase 3 (Polish)**: [N] tasks - Refinements and optimization
224
+
225
+ **Parallelization:**
226
+ - [N] tasks marked [P] can run in parallel
227
+ - Estimated speedup: [X]x with parallel execution
228
+
229
+ **Testing Strategy:**
230
+ - Each story includes explicit test/verification tasks
231
+ - Quality checks (typecheck, lint) after each story
232
+ - Commit after each completed story
233
+
234
+ ---
235
+
236
+ ## Phase 0: Setup
237
+
238
+ **Purpose**: Prepare project structure, dependencies, and configuration
239
+
240
+ - [ ] **T001** [Phase 0] [Setup] Task description
241
+ - [ ] **T002** [Phase 0] [Setup] Task description [P]
242
+ ...
243
+
244
+ ---
245
+
246
+ ## Phase 1: Foundation
247
+
248
+ **Purpose**: Core infrastructure that multiple stories depend on
249
+
250
+ **Dependencies**: Phase 0 must complete
251
+
252
+ - [ ] **T010** [Phase 1] [US-XXX] Task description
253
+ - [ ] **T011** [Phase 1] [US-XXX] Task description [P]
254
+ ...
255
+
256
+ ---
257
+
258
+ ## Phase 2: User Stories
259
+
260
+ **Purpose**: Implement user-facing features from PRD
261
+
262
+ **Dependencies**: Phase 1 must complete
263
+
264
+ ### US-001: [Story Title]
265
+
266
+ **Dependencies**: [US-XXX, US-YYY] or None
267
+ **Parallel**: [Yes/No]
268
+
269
+ - [ ] **T020** [Phase 2] [US-001] Task description
270
+ - [ ] **T021** [Phase 2] [US-001] Task description
271
+ - [ ] **T022** [Phase 2] [US-001] Run typecheck and lint (verify US-001 passes)
272
+
273
+ ### US-002: [Story Title]
274
+
275
+ ...
276
+
277
+ ---
278
+
279
+ ## Phase 3: Polish
280
+
281
+ **Purpose**: Refinements, optimizations, and documentation
282
+
283
+ **Dependencies**: Core functionality from Phase 2
284
+
285
+ - [ ] **T090** [Phase 3] [Polish] Task description
286
+ - [ ] **T091** [Phase 3] [Polish] Task description [P]
287
+ ...
288
+
289
+ ---
290
+
291
+ ## Summary
292
+
293
+ **Total Tasks**: [N]
294
+ - Phase 0: [N] tasks
295
+ - Phase 1: [N] tasks
296
+ - Phase 2: [N] tasks
297
+ - Phase 3: [N] tasks
298
+
299
+ **Parallelization**:
300
+ - [N] tasks can run in parallel
301
+ - Sequential: ~[X] hours
302
+ - Parallel: ~[Y] hours (estimated)
303
+
304
+ **Critical Path**:
305
+ Phase 0 → Phase 1 (US-XXX) → Phase 2 (US-YYY) → Phase 3
306
+
307
+ **Testing Checkpoints**:
308
+ 1. After each user story implementation
309
+ 2. After each phase completion
310
+ 3. Before moving to next phase
311
+ ```
312
+
313
+ ---
314
+
315
+ ## Step 7: Examples
316
+
317
+ ### Example 1: Simple Linear Feature (No Parallelization)
318
+
319
+ ```markdown
320
+ # Implementation Tasks: Add Task Status
321
+
322
+ Generated: 2026-01-11
323
+ Total Stories: 3
324
+ Total Tasks: 15
325
+
326
+ ---
327
+
328
+ ## Phase 0: Setup
329
+
330
+ - [ ] **T001** [Phase 0] [Setup] Create migration file for status column
331
+ - [ ] **T002** [Phase 0] [Setup] Define StatusType type definition
332
+
333
+ ---
334
+
335
+ ## Phase 1: Foundation
336
+
337
+ **Dependencies**: Phase 0 must complete
338
+
339
+ - [ ] **T003** [Phase 1] [US-001] Add status column to tasks table
340
+ - [ ] **T004** [Phase 1] [US-001] Set default value to 'pending'
341
+ - [ ] **T005** [Phase 1] [US-001] Run migration and verify schema
342
+
343
+ ---
344
+
345
+ ## Phase 2: User Stories
346
+
347
+ **Dependencies**: Phase 1 must complete
348
+
349
+ ### US-002: Display Status Badge
350
+
351
+ - [ ] **T006** [Phase 2] [US-002] Create StatusBadge component
352
+ - [ ] **T007** [Phase 2] [US-002] Add badge to TaskCard component
353
+ - [ ] **T008** [Phase 2] [US-002] Style badges (gray/blue/green)
354
+ - [ ] **T009** [Phase 2] [US-002] Run typecheck and lint
355
+
356
+ ### US-003: Status Update Functionality
357
+
358
+ **Dependencies**: US-002
359
+
360
+ - [ ] **T010** [Phase 2] [US-003] Add status update server action
361
+ - [ ] **T011** [Phase 2] [US-003] Create status dropdown component
362
+ - [ ] **T012** [Phase 2] [US-003] Wire dropdown to update action
363
+ - [ ] **T013** [Phase 2] [US-003] Add optimistic UI update
364
+ - [ ] **T014** [Phase 2] [US-003] Run typecheck and lint
365
+
366
+ ---
367
+
368
+ ## Phase 3: Polish
369
+
370
+ - [ ] **T015** [Phase 3] [Polish] Add loading spinner during status update
371
+ ```
372
+
373
+ ### Example 2: Complex Feature with Parallelization
374
+
375
+ ```markdown
376
+ # Implementation Tasks: GitHub Spec Kit Ideas Integration
377
+
378
+ Generated: 2026-01-11
379
+ Total Stories: 12
380
+ Total Tasks: 67
381
+
382
+ ---
383
+
384
+ ## Phase 0: Setup
385
+
386
+ - [ ] **T001** [Phase 0] [Setup] Install js-yaml dependency
387
+ - [ ] **T002** [Phase 0] [Setup] Create templates/ directory structure [P]
388
+ - [ ] **T003** [Phase 0] [Setup] Create skills/ directory for new skills [P]
389
+
390
+ ---
391
+
392
+ ## Phase 1: Foundation
393
+
394
+ **Dependencies**: Phase 0 must complete
395
+
396
+ - [ ] **T004** [Phase 1] [US-001] Extend UserStory schema with dependencies field
397
+ - [ ] **T005** [Phase 1] [US-001] Implement validateDependencies() function
398
+ - [ ] **T006** [Phase 1] [US-001] Update getNextStory() to respect dependencies
399
+ - [ ] **T007** [Phase 1] [US-001] Update parser to extract dependencies [P]
400
+ - [ ] **T008** [Phase 1] [US-003] Create progress metadata types [P]
401
+
402
+ ---
403
+
404
+ ## Phase 2: User Stories
405
+
406
+ **Dependencies**: Phase 1 must complete
407
+
408
+ ### US-002: Constitution Management System
409
+
410
+ - [ ] **T009** [Phase 2] [US-002] Create constitution.md template
411
+ - [ ] **T010** [Phase 2] [US-002] Add constitution loader
412
+ - [ ] **T011** [Phase 2] [US-002] Add MUST/SHOULD validation
413
+ - [ ] **T012** [Phase 2] [US-002] Update runner to include constitution
414
+ - [ ] **T013** [Phase 2] [US-002] Update scaffolder to copy template
415
+ - [ ] **T014** [Phase 2] [US-002] Run typecheck and lint
416
+
417
+ ### US-003: Enhanced Progress Tracking
418
+
419
+ **Dependencies**: US-002
420
+ **Parallel**: Can run parallel with US-004
421
+
422
+ - [ ] **T015** [Phase 2] [US-003] Implement parseProgress() with YAML support [P]
423
+ - [ ] **T016** [Phase 2] [US-003] Implement serializeProgress() [P]
424
+ - [ ] **T017** [Phase 2] [US-003] Add pattern extraction logic
425
+ - [ ] **T018** [Phase 2] [US-003] Update scaffolder to create YAML frontmatter
426
+ - [ ] **T019** [Phase 2] [US-003] Update runner to load and update metadata
427
+ - [ ] **T020** [Phase 2] [US-003] Run typecheck and lint
428
+
429
+ ### US-004: Technical Planning Template
430
+
431
+ **Dependencies**: US-002
432
+ **Parallel**: Can run parallel with US-003
433
+
434
+ - [ ] **T021** [Phase 2] [US-004] Create plan.md template [P]
435
+ - [ ] **T022** [Phase 2] [US-004] Add CreateFeatureOptions interface [P]
436
+ - [ ] **T023** [Phase 2] [US-004] Update scaffolder for withPlan option
437
+ - [ ] **T024** [Phase 2] [US-004] Update runner to load plan.md
438
+ - [ ] **T025** [Phase 2] [US-004] Run typecheck and lint
439
+
440
+ ...
441
+
442
+ ---
443
+
444
+ ## Phase 3: Polish
445
+
446
+ - [ ] **T065** [Phase 3] [Polish] Add comprehensive README examples
447
+ - [ ] **T066** [Phase 3] [Polish] Run final quality check (typecheck + lint)
448
+ - [ ] **T067** [Phase 3] [Polish] Create demo feature for testing
449
+
450
+ ---
451
+
452
+ ## Summary
453
+
454
+ **Total Tasks**: 67
455
+ - Phase 0: 3 tasks
456
+ - Phase 1: 5 tasks
457
+ - Phase 2: 55 tasks
458
+ - Phase 3: 4 tasks
459
+
460
+ **Parallelization**: 18 tasks marked [P]
461
+ ```
462
+
463
+ ---
464
+
465
+ ## Step 8: Advanced Patterns
466
+
467
+ ### Pattern 1: Story Dependencies
468
+ When US-003 depends on US-002:
469
+ ```markdown
470
+ ### US-002: Foundation Feature
471
+ - [ ] **T010** [Phase 2] [US-002] Implement core functionality
472
+ - [ ] **T011** [Phase 2] [US-002] Run tests
473
+
474
+ ### US-003: Dependent Feature
475
+ **Dependencies**: US-002 must complete first
476
+ - [ ] **T012** [Phase 2] [US-003] Build on US-002 functionality
477
+ ```
478
+
479
+ ### Pattern 2: Circular Dependencies (Error Case)
480
+ If you detect circular dependencies (US-A depends on US-B, US-B depends on US-A):
481
+ ```markdown
482
+ **⚠️ CIRCULAR DEPENDENCY DETECTED**
483
+
484
+ Stories US-A and US-B have circular dependencies. Cannot generate valid task order.
485
+
486
+ **Resolution needed:**
487
+ 1. Identify which dependency is a "soft" dependency (can be implemented with a stub)
488
+ 2. Break the cycle by implementing foundation in US-A, then US-B, then complete US-A
489
+ 3. Update PRD to reflect correct dependency order
490
+ ```
491
+
492
+ ### Pattern 3: Multi-File Stories
493
+ When a story touches many files:
494
+ ```markdown
495
+ ### US-007: Complex Multi-File Feature
496
+
497
+ - [ ] **T040** [Phase 2] [US-007] Update schema types
498
+ - [ ] **T041** [Phase 2] [US-007] Add backend parser logic
499
+ - [ ] **T042** [Phase 2] [US-007] Update orchestrator runner
500
+ - [ ] **T043** [Phase 2] [US-007] Create CLI command
501
+ - [ ] **T044** [Phase 2] [US-007] Update documentation
502
+ - [ ] **T045** [Phase 2] [US-007] Run typecheck and lint
503
+ ```
504
+
505
+ Break into logical sub-tasks but keep them grouped under the story.
506
+
507
+ ### Pattern 4: Research Tasks
508
+ For stories marked with `research: true`:
509
+ ```markdown
510
+ ### US-009: Feature Requiring Research
511
+
512
+ **Research Phase**:
513
+ - [ ] **T050** [Phase 2] [US-009] Research existing patterns in codebase
514
+ - [ ] **T051** [Phase 2] [US-009] Document findings in research/us-009.md
515
+
516
+ **Implementation Phase**:
517
+ **Dependencies**: Research tasks must complete
518
+ - [ ] **T052** [Phase 2] [US-009] Implement based on research findings
519
+ - [ ] **T053** [Phase 2] [US-009] Run typecheck and lint
520
+ ```
521
+
522
+ ---
523
+
524
+ ## Step 9: Quality Checklist
525
+
526
+ Before saving tasks.md, verify:
527
+
528
+ - [ ] All user stories from PRD are included
529
+ - [ ] Each story has at least one task in Phase 2
530
+ - [ ] Task IDs are sequential (T001, T002, T003...)
531
+ - [ ] Phase markers present on all tasks
532
+ - [ ] Story labels match PRD story IDs
533
+ - [ ] Dependencies explicitly noted where applicable
534
+ - [ ] Parallel markers [P] used appropriately (different files, no conflicts)
535
+ - [ ] Each story has a testing/verification task
536
+ - [ ] Setup phase covers all required dependencies
537
+ - [ ] Foundation phase covers shared infrastructure
538
+ - [ ] Polish phase includes only non-blocking enhancements
539
+ - [ ] Summary section has accurate counts
540
+ - [ ] Generated date included
541
+ - [ ] Saved to `relentless/features/[feature-name]/tasks.md`
542
+
543
+ ---
544
+
545
+ ## Step 10: Multi-Agent Support
546
+
547
+ This skill is designed to work with:
548
+ - **Claude Code**: Full support, can use Task tool for complex analysis
549
+ - **Amp**: Full support, analyze PRD structure automatically
550
+ - **Gemini**: Full support, infer dependencies from acceptance criteria
551
+ - **Codex**: Full support, generate tasks programmatically
552
+ - **Droid**: Full support, interactive clarification if dependencies unclear
553
+
554
+ The skill does NOT require agent-specific features - it only needs:
555
+ - File reading capability (read PRD)
556
+ - Dependency analysis (understand story relationships)
557
+ - Markdown file writing (save tasks.md)
558
+
559
+ ---
560
+
561
+ ## Common Pitfalls
562
+
563
+ ### ❌ Avoid:
564
+ 1. **Too many tasks**: Breaking "Add comma" into separate task
565
+ 2. **Too few tasks**: "Implement entire feature" as one task
566
+ 3. **Missing [P] markers**: Serializing tasks that could run in parallel
567
+ 4. **Wrong phases**: Putting polish items in Foundation
568
+ 5. **Missing test tasks**: Not explicitly including verification steps
569
+ 6. **Ignoring dependencies**: Tasks in wrong order, causing blockers
570
+
571
+ ### ✅ Do:
572
+ 1. **Right-sized tasks**: 15-60 minutes each
573
+ 2. **Clear dependencies**: Explicitly mark which tasks depend on others
574
+ 3. **Parallel opportunities**: Use [P] for tasks on different files/systems
575
+ 4. **Test after stories**: Include typecheck/lint tasks after each story
576
+ 5. **Logical grouping**: Keep related tasks together under story headers
577
+ 6. **Summary stats**: Provide total counts and parallelization estimates
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Amp Agent Adapter
3
+ *
4
+ * Adapter for Sourcegraph's Amp CLI
5
+ * https://ampcode.com
6
+ */
7
+
8
+ import type { AgentAdapter, AgentResult, InvokeOptions, RateLimitInfo } from "./types";
9
+
10
+ export const ampAdapter: AgentAdapter = {
11
+ name: "amp",
12
+ displayName: "Amp",
13
+ hasSkillSupport: true,
14
+ skillInstallCommand: "amp skill add github.com/ArvorCo/Relentless",
15
+
16
+ async isInstalled(): Promise<boolean> {
17
+ try {
18
+ const path = await this.getExecutablePath();
19
+ return path !== null;
20
+ } catch {
21
+ return false;
22
+ }
23
+ },
24
+
25
+ async getExecutablePath(): Promise<string | null> {
26
+ try {
27
+ const proc = Bun.spawn(["which", "amp"], { stdout: "pipe" });
28
+ const output = await new Response(proc.stdout).text();
29
+ const exitCode = await proc.exited;
30
+ if (exitCode === 0 && output.trim()) {
31
+ return output.trim();
32
+ }
33
+ return null;
34
+ } catch {
35
+ return null;
36
+ }
37
+ },
38
+
39
+ async invoke(prompt: string, options?: InvokeOptions): Promise<AgentResult> {
40
+ const startTime = Date.now();
41
+ const args: string[] = [];
42
+
43
+ if (options?.dangerouslyAllowAll) {
44
+ args.push("--dangerously-allow-all");
45
+ }
46
+
47
+ const proc = Bun.spawn(["amp", ...args], {
48
+ cwd: options?.workingDirectory,
49
+ stdin: new Blob([prompt]),
50
+ stdout: "pipe",
51
+ stderr: "pipe",
52
+ });
53
+
54
+ // Collect output
55
+ const stdout = await new Response(proc.stdout).text();
56
+ const stderr = await new Response(proc.stderr).text();
57
+ const exitCode = await proc.exited;
58
+
59
+ const output = stdout + (stderr ? `\n${stderr}` : "");
60
+ const duration = Date.now() - startTime;
61
+
62
+ return {
63
+ output,
64
+ exitCode,
65
+ isComplete: this.detectCompletion(output),
66
+ duration,
67
+ };
68
+ },
69
+
70
+ detectCompletion(output: string): boolean {
71
+ return output.includes("<promise>COMPLETE</promise>");
72
+ },
73
+
74
+ detectRateLimit(output: string): RateLimitInfo {
75
+ // Amp rate limit patterns
76
+ const patterns = [
77
+ /quota exceeded/i,
78
+ /limit reached/i,
79
+ /rate limit/i,
80
+ /too many requests/i,
81
+ ];
82
+
83
+ for (const pattern of patterns) {
84
+ if (pattern.test(output)) {
85
+ return {
86
+ limited: true,
87
+ message: "Amp rate limit exceeded",
88
+ };
89
+ }
90
+ }
91
+
92
+ return { limited: false };
93
+ },
94
+
95
+ async installSkills(projectPath: string): Promise<void> {
96
+ // Amp can install skills globally via amp skill add
97
+ // For project-local, we copy to the project
98
+ const skillsDir = `${projectPath}/.amp/skills`;
99
+ await Bun.spawn(["mkdir", "-p", skillsDir]).exited;
100
+
101
+ const relentlessRoot = import.meta.dir.replace("/src/agents", "");
102
+ await Bun.spawn([
103
+ "cp",
104
+ "-r",
105
+ `${relentlessRoot}/skills/prd`,
106
+ `${skillsDir}/`,
107
+ ]).exited;
108
+ await Bun.spawn([
109
+ "cp",
110
+ "-r",
111
+ `${relentlessRoot}/skills/relentless`,
112
+ `${skillsDir}/`,
113
+ ]).exited;
114
+ },
115
+ };