@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/prompt.md ADDED
@@ -0,0 +1,108 @@
1
+ # Ralph Agent Instructions
2
+
3
+ You are an autonomous coding agent working on a software project.
4
+
5
+ ## Your Task
6
+
7
+ 1. Read the PRD at `prd.json` (in the same directory as this file)
8
+ 2. Read the progress log at `progress.txt` (check Codebase Patterns section first)
9
+ 3. Check you're on the correct branch from PRD `branchName`. If not, check it out or create from main.
10
+ 4. Pick the **highest priority** user story where `passes: false`
11
+ 5. Implement that single user story
12
+ 6. Run quality checks (e.g., typecheck, lint, test - use whatever your project requires)
13
+ 7. Update AGENTS.md files if you discover reusable patterns (see below)
14
+ 8. If checks pass, commit ALL changes with message: `feat: [Story ID] - [Story Title]`
15
+ 9. Update the PRD to set `passes: true` for the completed story
16
+ 10. Append your progress to `progress.txt`
17
+
18
+ ## Progress Report Format
19
+
20
+ APPEND to progress.txt (never replace, always append):
21
+ ```
22
+ ## [Date/Time] - [Story ID]
23
+ Thread: https://ampcode.com/threads/$AMP_CURRENT_THREAD_ID
24
+ - What was implemented
25
+ - Files changed
26
+ - **Learnings for future iterations:**
27
+ - Patterns discovered (e.g., "this codebase uses X for Y")
28
+ - Gotchas encountered (e.g., "don't forget to update Z when changing W")
29
+ - Useful context (e.g., "the evaluation panel is in component X")
30
+ ---
31
+ ```
32
+
33
+ Include the thread URL so future iterations can use the `read_thread` tool to reference previous work if needed.
34
+
35
+ The learnings section is critical - it helps future iterations avoid repeating mistakes and understand the codebase better.
36
+
37
+ ## Consolidate Patterns
38
+
39
+ If you discover a **reusable pattern** that future iterations should know, add it to the `## Codebase Patterns` section at the TOP of progress.txt (create it if it doesn't exist). This section should consolidate the most important learnings:
40
+
41
+ ```
42
+ ## Codebase Patterns
43
+ - Example: Use `sql<number>` template for aggregations
44
+ - Example: Always use `IF NOT EXISTS` for migrations
45
+ - Example: Export types from actions.ts for UI components
46
+ ```
47
+
48
+ Only add patterns that are **general and reusable**, not story-specific details.
49
+
50
+ ## Update AGENTS.md Files
51
+
52
+ Before committing, check if any edited files have learnings worth preserving in nearby AGENTS.md files:
53
+
54
+ 1. **Identify directories with edited files** - Look at which directories you modified
55
+ 2. **Check for existing AGENTS.md** - Look for AGENTS.md in those directories or parent directories
56
+ 3. **Add valuable learnings** - If you discovered something future developers/agents should know:
57
+ - API patterns or conventions specific to that module
58
+ - Gotchas or non-obvious requirements
59
+ - Dependencies between files
60
+ - Testing approaches for that area
61
+ - Configuration or environment requirements
62
+
63
+ **Examples of good AGENTS.md additions:**
64
+ - "When modifying X, also update Y to keep them in sync"
65
+ - "This module uses pattern Z for all API calls"
66
+ - "Tests require the dev server running on PORT 3000"
67
+ - "Field names must match the template exactly"
68
+
69
+ **Do NOT add:**
70
+ - Story-specific implementation details
71
+ - Temporary debugging notes
72
+ - Information already in progress.txt
73
+
74
+ Only update AGENTS.md if you have **genuinely reusable knowledge** that would help future work in that directory.
75
+
76
+ ## Quality Requirements
77
+
78
+ - ALL commits must pass your project's quality checks (typecheck, lint, test)
79
+ - Do NOT commit broken code
80
+ - Keep changes focused and minimal
81
+ - Follow existing code patterns
82
+
83
+ ## Browser Testing (Required for Frontend Stories)
84
+
85
+ For any story that changes UI, you MUST verify it works in the browser:
86
+
87
+ 1. Load the `dev-browser` skill
88
+ 2. Navigate to the relevant page
89
+ 3. Verify the UI changes work as expected
90
+ 4. Take a screenshot if helpful for the progress log
91
+
92
+ A frontend story is NOT complete until browser verification passes.
93
+
94
+ ## Stop Condition
95
+
96
+ After completing a user story, check if ALL stories have `passes: true`.
97
+
98
+ If ALL stories are complete and passing, reply with:
99
+ <promise>COMPLETE</promise>
100
+
101
+ If there are still stories with `passes: false`, end your response normally (another iteration will pick up the next story).
102
+
103
+ ## Important
104
+
105
+ - Work on ONE story per iteration
106
+ - Commit frequently
107
+ - Keep CI green
108
+ - Read the Codebase Patterns section in progress.txt before starting
package/ralph.sh ADDED
@@ -0,0 +1,80 @@
1
+ #!/bin/bash
2
+ # Ralph Wiggum - Long-running AI agent loop
3
+ # Usage: ./ralph.sh [max_iterations]
4
+
5
+ set -e
6
+
7
+ MAX_ITERATIONS=${1:-10}
8
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ PRD_FILE="$SCRIPT_DIR/prd.json"
10
+ PROGRESS_FILE="$SCRIPT_DIR/progress.txt"
11
+ ARCHIVE_DIR="$SCRIPT_DIR/archive"
12
+ LAST_BRANCH_FILE="$SCRIPT_DIR/.last-branch"
13
+
14
+ # Archive previous run if branch changed
15
+ if [ -f "$PRD_FILE" ] && [ -f "$LAST_BRANCH_FILE" ]; then
16
+ CURRENT_BRANCH=$(jq -r '.branchName // empty' "$PRD_FILE" 2>/dev/null || echo "")
17
+ LAST_BRANCH=$(cat "$LAST_BRANCH_FILE" 2>/dev/null || echo "")
18
+
19
+ if [ -n "$CURRENT_BRANCH" ] && [ -n "$LAST_BRANCH" ] && [ "$CURRENT_BRANCH" != "$LAST_BRANCH" ]; then
20
+ # Archive the previous run
21
+ DATE=$(date +%Y-%m-%d)
22
+ # Strip "ralph/" prefix from branch name for folder
23
+ FOLDER_NAME=$(echo "$LAST_BRANCH" | sed 's|^ralph/||')
24
+ ARCHIVE_FOLDER="$ARCHIVE_DIR/$DATE-$FOLDER_NAME"
25
+
26
+ echo "Archiving previous run: $LAST_BRANCH"
27
+ mkdir -p "$ARCHIVE_FOLDER"
28
+ [ -f "$PRD_FILE" ] && cp "$PRD_FILE" "$ARCHIVE_FOLDER/"
29
+ [ -f "$PROGRESS_FILE" ] && cp "$PROGRESS_FILE" "$ARCHIVE_FOLDER/"
30
+ echo " Archived to: $ARCHIVE_FOLDER"
31
+
32
+ # Reset progress file for new run
33
+ echo "# Ralph Progress Log" > "$PROGRESS_FILE"
34
+ echo "Started: $(date)" >> "$PROGRESS_FILE"
35
+ echo "---" >> "$PROGRESS_FILE"
36
+ fi
37
+ fi
38
+
39
+ # Track current branch
40
+ if [ -f "$PRD_FILE" ]; then
41
+ CURRENT_BRANCH=$(jq -r '.branchName // empty' "$PRD_FILE" 2>/dev/null || echo "")
42
+ if [ -n "$CURRENT_BRANCH" ]; then
43
+ echo "$CURRENT_BRANCH" > "$LAST_BRANCH_FILE"
44
+ fi
45
+ fi
46
+
47
+ # Initialize progress file if it doesn't exist
48
+ if [ ! -f "$PROGRESS_FILE" ]; then
49
+ echo "# Ralph Progress Log" > "$PROGRESS_FILE"
50
+ echo "Started: $(date)" >> "$PROGRESS_FILE"
51
+ echo "---" >> "$PROGRESS_FILE"
52
+ fi
53
+
54
+ echo "Starting Ralph - Max iterations: $MAX_ITERATIONS"
55
+
56
+ for i in $(seq 1 $MAX_ITERATIONS); do
57
+ echo ""
58
+ echo "═══════════════════════════════════════════════════════"
59
+ echo " Ralph Iteration $i of $MAX_ITERATIONS"
60
+ echo "═══════════════════════════════════════════════════════"
61
+
62
+ # Run amp with the ralph prompt
63
+ OUTPUT=$(cat "$SCRIPT_DIR/prompt.md" | amp --dangerously-allow-all 2>&1 | tee /dev/stderr) || true
64
+
65
+ # Check for completion signal
66
+ if echo "$OUTPUT" | grep -q "<promise>COMPLETE</promise>"; then
67
+ echo ""
68
+ echo "Ralph completed all tasks!"
69
+ echo "Completed at iteration $i of $MAX_ITERATIONS"
70
+ exit 0
71
+ fi
72
+
73
+ echo "Iteration $i complete. Continuing..."
74
+ sleep 2
75
+ done
76
+
77
+ echo ""
78
+ echo "Ralph reached max iterations ($MAX_ITERATIONS) without completing all tasks."
79
+ echo "Check $PROGRESS_FILE for status."
80
+ exit 1
@@ -0,0 +1,38 @@
1
+ {
2
+ "defaultAgent": "claude",
3
+ "agents": {
4
+ "claude": {
5
+ "dangerouslyAllowAll": true
6
+ },
7
+ "amp": {
8
+ "dangerouslyAllowAll": true
9
+ },
10
+ "gemini": {
11
+ "dangerouslyAllowAll": true
12
+ }
13
+ },
14
+ "routing": {
15
+ "rules": [],
16
+ "default": "claude"
17
+ },
18
+ "fallback": {
19
+ "enabled": true,
20
+ "priority": [
21
+ "claude",
22
+ "codex",
23
+ "amp",
24
+ "opencode",
25
+ "gemini"
26
+ ],
27
+ "autoRecovery": true,
28
+ "retryDelay": 2000
29
+ },
30
+ "execution": {
31
+ "maxIterations": 20,
32
+ "iterationDelay": 2000,
33
+ "timeout": 600000
34
+ },
35
+ "prompt": {
36
+ "path": "prompt.md"
37
+ }
38
+ }
File without changes
@@ -0,0 +1,229 @@
1
+ {
2
+ "project": "GitHub Spec Kit Ideas Integration",
3
+ "branchName": "ralph/github-spec-kit-ideas-integration",
4
+ "description": "This feature integrates sophisticated specification-driven development capabilities from speckit into relentless while maintaining its agent-agnostic simplicity. The integration creates a professional, globally-installed binary with powerful enhancements for dependency-ordered tasks, constitution-based governance, quality checklists, consistency analysis, and enhanced orchestration.",
5
+ "userStories": [
6
+ {
7
+ "id": "US-000",
8
+ "title": "Single Binary with PATH Installation",
9
+ "description": "As a relentless user, I want relentless installed as a global binary in my PATH so that I can call it from anywhere without dealing with shell scripts.",
10
+ "acceptanceCriteria": [
11
+ "package.json has \"bin\" field pointing to bin/relentless.ts",
12
+ "bin/relentless.ts has #!/usr/bin/env bun shebang",
13
+ "Binary can be installed globally via `bun install -g`",
14
+ "relentless command available in PATH after install",
15
+ "All commands work: init, run, convert, analyze, features, status, reset",
16
+ "Shell script (bin/relentless.sh) completely removed",
17
+ "Scaffolder no longer copies shell script",
18
+ "Can call `relentless init` from any directory",
19
+ "Can call `relentless run --feature <name>` from project root",
20
+ "README.md fully reviewed and all shell script references replaced with binary commands",
21
+ "CLAUDE.md reviewed and updated with new CLI usage patterns",
22
+ "All documentation files searched and updated: replace ./relentless/bin/relentless.sh with relentless",
23
+ "Scaffolder output messages updated to remove all shell script references",
24
+ "All code comments reviewed and updated to remove shell script mentions",
25
+ "Template files reviewed: prompt.md and other templates use binary commands",
26
+ "All example commands updated to use relentless <action> --params format",
27
+ "Installation instructions complete: document bun install -g and bunx relentless",
28
+ "Skills documentation updated: prd and relentless skills reference binary",
29
+ "Typecheck passes",
30
+ "Linter passes (0 warnings)",
31
+ "Verify in terminal: `which relentless` shows installed binary",
32
+ "Verify documentation: grep for .sh and relentless.sh returns no results in docs"
33
+ ],
34
+ "priority": 1,
35
+ "passes": true,
36
+ "notes": ""
37
+ },
38
+ {
39
+ "id": "US-001",
40
+ "title": "Dependency-Ordered Task Schema",
41
+ "description": "As a developer, I want user stories to support dependencies, phases, and parallel execution markers so that I can express complex relationships between tasks.",
42
+ "acceptanceCriteria": [
43
+ "UserStory schema extended with dependencies, parallel, phase fields",
44
+ "getNextStory() respects dependencies and only returns stories with completed prerequisites",
45
+ "validateDependencies() detects circular dependencies and throws error",
46
+ "Parser extracts \"Dependencies: US-001, US-002\" from PRD markdown",
47
+ "Typecheck passes",
48
+ "Linter passes (0 warnings)"
49
+ ],
50
+ "priority": 2,
51
+ "passes": true,
52
+ "notes": ""
53
+ },
54
+ {
55
+ "id": "US-002",
56
+ "title": "Constitution Management System",
57
+ "description": "As a project lead, I want a constitution.md file containing project principles, patterns, and constraints so that all agents follow consistent guidelines.",
58
+ "acceptanceCriteria": [
59
+ "Template created at /templates/constitution.md with clear structure",
60
+ "Loader.ts reads and parses constitution.md",
61
+ "Runner.ts includes constitution in prompt context",
62
+ "Scaffolder copies constitution template during init",
63
+ "Constitution validates principles (MUST/SHOULD format)",
64
+ "Typecheck passes",
65
+ "Linter passes (0 warnings)"
66
+ ],
67
+ "priority": 3,
68
+ "passes": true,
69
+ "notes": ""
70
+ },
71
+ {
72
+ "id": "US-003",
73
+ "title": "Enhanced Progress Tracking with Metadata",
74
+ "description": "As an agent, I want progress.txt to have structured YAML frontmatter so that I can access machine-readable context about patterns and blockers.",
75
+ "acceptanceCriteria": [
76
+ "Progress.txt created with YAML frontmatter",
77
+ "Runner updates frontmatter after each iteration (last_updated, stories_completed)",
78
+ "Patterns array updated with learnings from progress log",
79
+ "Prompt context includes parsed frontmatter patterns",
80
+ "Typecheck passes",
81
+ "Linter passes (0 warnings)"
82
+ ],
83
+ "priority": 4,
84
+ "passes": true,
85
+ "notes": ""
86
+ },
87
+ {
88
+ "id": "US-004",
89
+ "title": "Technical Planning Template",
90
+ "description": "As a developer, I want an optional plan.md template so that I can document technical design decisions before implementation.",
91
+ "acceptanceCriteria": [
92
+ "Template created at /templates/plan.md with all sections",
93
+ "Scaffolder supports `createFeature(name, {withPlan: true})`",
94
+ "Plan.md copied to feature directory when flag enabled",
95
+ "Prompt references plan.md if present in feature directory",
96
+ "Typecheck passes",
97
+ "Linter passes (0 warnings)"
98
+ ],
99
+ "priority": 5,
100
+ "passes": true,
101
+ "notes": ""
102
+ },
103
+ {
104
+ "id": "US-005",
105
+ "title": "Quality Checklist Generator Skill",
106
+ "description": "As a quality-focused developer, I want a skill that generates custom quality checklists based on my PRD so that I can ensure comprehensive requirement validation.",
107
+ "acceptanceCriteria": [
108
+ "SKILL.md created with clear instructions for checklist generation",
109
+ "Skill analyzes PRD and infers appropriate checklist domain",
110
+ "Checklist has 20-40 items across 5-7 categories",
111
+ "80% of items reference specific spec sections or have [Gap]/[Ambiguity] markers",
112
+ "Checklist saved to feature directory",
113
+ "Skill works with Claude Code, Amp, Gemini",
114
+ "Typecheck passes",
115
+ "Linter passes (0 warnings)"
116
+ ],
117
+ "priority": 6,
118
+ "passes": true,
119
+ "notes": ""
120
+ },
121
+ {
122
+ "id": "US-006",
123
+ "title": "Cross-Artifact Consistency Analysis Command",
124
+ "description": "As a developer, I want an analyze command that checks consistency across PRD, JSON, and code so that I can catch errors early.",
125
+ "acceptanceCriteria": [
126
+ "Command added to bin/relentless.ts with analyze subcommand",
127
+ "Analyzer checks all 5 consistency categories",
128
+ "Output includes severity ratings and recommendations",
129
+ "Report includes coverage summary (stories completed/total per requirement)",
130
+ "Analyzer handles missing files gracefully",
131
+ "Typecheck passes",
132
+ "Linter passes (0 warnings)",
133
+ "Verify in terminal: Run analyze command and review output"
134
+ ],
135
+ "priority": 7,
136
+ "passes": true,
137
+ "notes": ""
138
+ },
139
+ {
140
+ "id": "US-007",
141
+ "title": "Interactive Clarification Skill",
142
+ "description": "As a PRD author, I want an interactive clarification skill that asks targeted questions about ambiguities so that I can create clearer specifications.",
143
+ "acceptanceCriteria": [
144
+ "SKILL.md created with clarification workflow",
145
+ "Skill scans PRD across 9 ambiguity categories",
146
+ "Generates max 5 questions with multiple-choice options",
147
+ "Adds [NEEDS CLARIFICATION] markers (max 3 per spec)",
148
+ "Saves clarification-log.md with questions and answers",
149
+ "Updates PRD in-place after each clarification",
150
+ "Typecheck passes",
151
+ "Linter passes (0 warnings)"
152
+ ],
153
+ "priority": 8,
154
+ "passes": true,
155
+ "notes": ""
156
+ },
157
+ {
158
+ "id": "US-008",
159
+ "title": "Dependency-Ordered Task Breakdown Skill",
160
+ "description": "As a developer, I want a skill that generates dependency-ordered task breakdowns with phase structure so that I can visualize implementation order.",
161
+ "acceptanceCriteria": [
162
+ "SKILL.md created with task breakdown instructions",
163
+ "Skill generates phase structure (Setup → Foundation → Stories → Polish)",
164
+ "Tasks include IDs (T001+), phase markers, story labels [US1]",
165
+ "Parallel tasks marked with [P]",
166
+ "Each story independently testable",
167
+ "Saves to tasks.md in feature directory",
168
+ "Typecheck passes",
169
+ "Linter passes (0 warnings)"
170
+ ],
171
+ "priority": 9,
172
+ "passes": true,
173
+ "notes": ""
174
+ },
175
+ {
176
+ "id": "US-009",
177
+ "title": "Research Phase Support",
178
+ "description": "As an agent, I want an optional research phase before implementation so that I can explore existing patterns and make better decisions.",
179
+ "acceptanceCriteria": [
180
+ "UserStory schema has optional research field",
181
+ "Runner detects research flag and runs two-phase execution",
182
+ "Research phase saves findings to research/<story-id>.md",
183
+ "Second phase includes research findings in prompt",
184
+ "Prompt template updated with research instructions",
185
+ "Typecheck passes",
186
+ "Linter passes (0 warnings)"
187
+ ],
188
+ "priority": 10,
189
+ "passes": true,
190
+ "notes": ""
191
+ },
192
+ {
193
+ "id": "US-010",
194
+ "title": "Branch Management with Auto-Numbering",
195
+ "description": "As a developer, I want features to have auto-generated numbers (001-feature-name) so that I can track them in order.",
196
+ "acceptanceCriteria": [
197
+ "Scaffolder supports createFeature with autoNumber option",
198
+ "Feature directories created with 001- prefix when enabled",
199
+ "PRD branchName auto-generated with number prefix",
200
+ "listFeatures() returns numbered features correctly",
201
+ "Existing features without numbers still work",
202
+ "Typecheck passes",
203
+ "Linter passes (0 warnings)"
204
+ ],
205
+ "priority": 11,
206
+ "passes": true,
207
+ "notes": ""
208
+ },
209
+ {
210
+ "id": "US-011",
211
+ "title": "GitHub Issues Generator",
212
+ "description": "As a team lead, I want to convert user stories to GitHub issues so that I can track work in GitHub Projects.",
213
+ "acceptanceCriteria": [
214
+ "Command added to bin/relentless.ts",
215
+ "Issues.ts creates GitHub issues via gh CLI",
216
+ "Each story mapped to issue with proper formatting",
217
+ "Labels inferred from story type (database, ui, api, etc.)",
218
+ "Dependencies mapped to issue relationships",
219
+ "Safety: validates git remote matches before creating issues",
220
+ "Typecheck passes",
221
+ "Linter passes (0 warnings)",
222
+ "Verify in browser: Check created issues on GitHub"
223
+ ],
224
+ "priority": 12,
225
+ "passes": true,
226
+ "notes": ""
227
+ }
228
+ ]
229
+ }
@@ -0,0 +1,191 @@
1
+ # PRD: GitHub Spec Kit Ideas Integration
2
+
3
+ ## Introduction
4
+
5
+ This feature integrates sophisticated specification-driven development capabilities inspired by GitHub's Spec Kit into relentless while maintaining its agent-agnostic simplicity. We're forking and adapting these concepts as relentless-native commands (relentless.plan, relentless.constitution, etc.) to create a professional, globally-installed binary with powerful enhancements for dependency-ordered tasks, constitution-based governance, quality checklists, consistency analysis, and enhanced orchestration.
6
+
7
+ ## User Stories
8
+
9
+ ### US-000: Single Binary with PATH Installation
10
+ **Description:** As a relentless user, I want relentless installed as a global binary in my PATH so that I can call it from anywhere without dealing with shell scripts.
11
+
12
+ **Acceptance Criteria:**
13
+ - [ ] package.json has "bin" field pointing to bin/relentless.ts
14
+ - [ ] bin/relentless.ts has #!/usr/bin/env bun shebang
15
+ - [ ] Binary can be installed globally via `bun install -g`
16
+ - [ ] relentless command available in PATH after install
17
+ - [ ] All commands work: init, run, convert, analyze, features, status, reset
18
+ - [ ] Shell script (bin/relentless.sh) completely removed
19
+ - [ ] Scaffolder no longer copies shell script
20
+ - [ ] Can call `relentless init` from any directory
21
+ - [ ] Can call `relentless run --feature <name>` from project root
22
+ - [ ] README.md fully reviewed and all shell script references replaced with binary commands
23
+ - [ ] CLAUDE.md reviewed and updated with new CLI usage patterns
24
+ - [ ] All documentation files searched and updated: replace ./relentless/bin/relentless.sh with relentless
25
+ - [ ] Scaffolder output messages updated to remove all shell script references
26
+ - [ ] All code comments reviewed and updated to remove shell script mentions
27
+ - [ ] Template files reviewed: prompt.md and other templates use binary commands
28
+ - [ ] All example commands updated to use relentless <action> --params format
29
+ - [ ] Installation instructions complete: document bun install -g and bunx relentless
30
+ - [ ] Skills documentation updated: prd and relentless skills reference binary
31
+ - [ ] Typecheck passes
32
+ - [ ] Linter passes (0 warnings)
33
+ - [ ] Verify in terminal: `which relentless` shows installed binary
34
+ - [ ] Verify documentation: grep for .sh and relentless.sh returns no results in docs
35
+
36
+ ---
37
+
38
+ ### US-001: Dependency-Ordered Task Schema
39
+ **Description:** As a developer, I want user stories to support dependencies, phases, and parallel execution markers so that I can express complex relationships between tasks.
40
+
41
+ **Acceptance Criteria:**
42
+ - [ ] UserStory schema extended with dependencies, parallel, phase fields
43
+ - [ ] getNextStory() respects dependencies and only returns stories with completed prerequisites
44
+ - [ ] validateDependencies() detects circular dependencies and throws error
45
+ - [ ] Parser extracts "Dependencies: US-001, US-002" from PRD markdown
46
+ - [ ] Typecheck passes
47
+ - [ ] Linter passes (0 warnings)
48
+
49
+ ---
50
+
51
+ ### US-002: Constitution Management System
52
+ **Description:** As a project lead, I want a constitution.md file containing project principles, patterns, and constraints so that all agents follow consistent guidelines.
53
+
54
+ **Acceptance Criteria:**
55
+ - [ ] Template created at /templates/constitution.md with clear structure
56
+ - [ ] Loader.ts reads and parses constitution.md
57
+ - [ ] Runner.ts includes constitution in prompt context
58
+ - [ ] Scaffolder copies constitution template during init
59
+ - [ ] Constitution validates principles (MUST/SHOULD format)
60
+ - [ ] Typecheck passes
61
+ - [ ] Linter passes (0 warnings)
62
+
63
+ ---
64
+
65
+ ### US-003: Enhanced Progress Tracking with Metadata
66
+ **Description:** As an agent, I want progress.txt to have structured YAML frontmatter so that I can access machine-readable context about patterns and blockers.
67
+
68
+ **Acceptance Criteria:**
69
+ - [ ] Progress.txt created with YAML frontmatter
70
+ - [ ] Runner updates frontmatter after each iteration (last_updated, stories_completed)
71
+ - [ ] Patterns array updated with learnings from progress log
72
+ - [ ] Prompt context includes parsed frontmatter patterns
73
+ - [ ] Typecheck passes
74
+ - [ ] Linter passes (0 warnings)
75
+
76
+ ---
77
+
78
+ ### US-004: Technical Planning Template
79
+ **Description:** As a developer, I want an optional plan.md template so that I can document technical design decisions before implementation.
80
+
81
+ **Acceptance Criteria:**
82
+ - [ ] Template created at /templates/plan.md with all sections
83
+ - [ ] Scaffolder supports `createFeature(name, {withPlan: true})`
84
+ - [ ] Plan.md copied to feature directory when flag enabled
85
+ - [ ] Prompt references plan.md if present in feature directory
86
+ - [ ] Typecheck passes
87
+ - [ ] Linter passes (0 warnings)
88
+
89
+ ---
90
+
91
+ ### US-005: Quality Checklist Generator Skill
92
+ **Description:** As a quality-focused developer, I want a skill that generates custom quality checklists based on my PRD so that I can ensure comprehensive requirement validation.
93
+
94
+ **Acceptance Criteria:**
95
+ - [ ] SKILL.md created with clear instructions for checklist generation
96
+ - [ ] Skill analyzes PRD and infers appropriate checklist domain
97
+ - [ ] Checklist has 20-40 items across 5-7 categories
98
+ - [ ] 80% of items reference specific spec sections or have [Gap]/[Ambiguity] markers
99
+ - [ ] Checklist saved to feature directory
100
+ - [ ] Skill works with Claude Code, Amp, Gemini
101
+ - [ ] Typecheck passes
102
+ - [ ] Linter passes (0 warnings)
103
+
104
+ ---
105
+
106
+ ### US-006: Cross-Artifact Consistency Analysis Command
107
+ **Description:** As a developer, I want an analyze command that checks consistency across PRD, JSON, and code so that I can catch errors early.
108
+
109
+ **Acceptance Criteria:**
110
+ - [ ] Command added to bin/relentless.ts with analyze subcommand
111
+ - [ ] Analyzer checks all 5 consistency categories
112
+ - [ ] Output includes severity ratings and recommendations
113
+ - [ ] Report includes coverage summary (stories completed/total per requirement)
114
+ - [ ] Analyzer handles missing files gracefully
115
+ - [ ] Typecheck passes
116
+ - [ ] Linter passes (0 warnings)
117
+ - [ ] Verify in terminal: Run analyze command and review output
118
+
119
+ ---
120
+
121
+ ### US-007: Interactive Clarification Skill
122
+ **Description:** As a PRD author, I want an interactive clarification skill that asks targeted questions about ambiguities so that I can create clearer specifications.
123
+
124
+ **Acceptance Criteria:**
125
+ - [ ] SKILL.md created with clarification workflow
126
+ - [ ] Skill scans PRD across 9 ambiguity categories
127
+ - [ ] Generates max 5 questions with multiple-choice options
128
+ - [ ] Adds [NEEDS CLARIFICATION] markers (max 3 per spec)
129
+ - [ ] Saves clarification-log.md with questions and answers
130
+ - [ ] Updates PRD in-place after each clarification
131
+ - [ ] Typecheck passes
132
+ - [ ] Linter passes (0 warnings)
133
+
134
+ ---
135
+
136
+ ### US-008: Dependency-Ordered Task Breakdown Skill
137
+ **Description:** As a developer, I want a skill that generates dependency-ordered task breakdowns with phase structure so that I can visualize implementation order.
138
+
139
+ **Acceptance Criteria:**
140
+ - [ ] SKILL.md created with task breakdown instructions
141
+ - [ ] Skill generates phase structure (Setup → Foundation → Stories → Polish)
142
+ - [ ] Tasks include IDs (T001+), phase markers, story labels [US1]
143
+ - [ ] Parallel tasks marked with [P]
144
+ - [ ] Each story independently testable
145
+ - [ ] Saves to tasks.md in feature directory
146
+ - [ ] Typecheck passes
147
+ - [ ] Linter passes (0 warnings)
148
+
149
+ ---
150
+
151
+ ### US-009: Research Phase Support
152
+ **Description:** As an agent, I want an optional research phase before implementation so that I can explore existing patterns and make better decisions.
153
+
154
+ **Acceptance Criteria:**
155
+ - [ ] UserStory schema has optional research field
156
+ - [ ] Runner detects research flag and runs two-phase execution
157
+ - [ ] Research phase saves findings to research/<story-id>.md
158
+ - [ ] Second phase includes research findings in prompt
159
+ - [ ] Prompt template updated with research instructions
160
+ - [ ] Typecheck passes
161
+ - [ ] Linter passes (0 warnings)
162
+
163
+ ---
164
+
165
+ ### US-010: Branch Management with Auto-Numbering
166
+ **Description:** As a developer, I want features to have auto-generated numbers (001-feature-name) so that I can track them in order.
167
+
168
+ **Acceptance Criteria:**
169
+ - [ ] Scaffolder supports createFeature with autoNumber option
170
+ - [ ] Feature directories created with 001- prefix when enabled
171
+ - [ ] PRD branchName auto-generated with number prefix
172
+ - [ ] listFeatures() returns numbered features correctly
173
+ - [ ] Existing features without numbers still work
174
+ - [ ] Typecheck passes
175
+ - [ ] Linter passes (0 warnings)
176
+
177
+ ---
178
+
179
+ ### US-011: GitHub Issues Generator
180
+ **Description:** As a team lead, I want to convert user stories to GitHub issues so that I can track work in GitHub Projects.
181
+
182
+ **Acceptance Criteria:**
183
+ - [ ] Command added to bin/relentless.ts
184
+ - [ ] Issues.ts creates GitHub issues via gh CLI
185
+ - [ ] Each story mapped to issue with proper formatting
186
+ - [ ] Labels inferred from story type (database, ui, api, etc.)
187
+ - [ ] Dependencies mapped to issue relationships
188
+ - [ ] Safety: validates git remote matches before creating issues
189
+ - [ ] Typecheck passes
190
+ - [ ] Linter passes (0 warnings)
191
+ - [ ] Verify in browser: Check created issues on GitHub