@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,149 @@
1
+ ---
2
+ name: analyze
3
+ description: "Analyze consistency across spec, plan, tasks, and checklist. Use before implementation. Triggers on: analyze consistency, check artifacts, validate feature."
4
+ ---
5
+
6
+ # Cross-Artifact Consistency Analyzer
7
+
8
+ Validate consistency across feature artifacts before implementation.
9
+
10
+ ---
11
+
12
+ ## The Job
13
+
14
+ 1. Read all feature artifacts
15
+ 2. Check for consistency issues
16
+ 3. Validate against constitution
17
+ 4. Report findings
18
+
19
+ ---
20
+
21
+ ## Files to Analyze
22
+
23
+ Required:
24
+ - `relentless/constitution.md`
25
+ - `relentless/features/NNN-feature/spec.md`
26
+ - `relentless/features/NNN-feature/plan.md`
27
+ - `relentless/features/NNN-feature/tasks.md`
28
+ - `relentless/features/NNN-feature/checklist.md`
29
+
30
+ Optional:
31
+ - `relentless/features/NNN-feature/prd.json`
32
+ - `relentless/features/NNN-feature/progress.txt`
33
+
34
+ ---
35
+
36
+ ## Validation Checks
37
+
38
+ ### 1. Completeness
39
+ - [ ] All functional requirements from spec have tasks
40
+ - [ ] All tasks reference spec requirements
41
+ - [ ] Plan addresses all spec requirements
42
+ - [ ] Checklist covers all tasks
43
+
44
+ ### 2. Constitution Compliance
45
+ - [ ] Plan follows MUST rules
46
+ - [ ] Tasks include required quality checks
47
+ - [ ] Testing requirements met
48
+ - [ ] Security requirements addressed
49
+
50
+ ### 3. Dependency Consistency
51
+ - [ ] Task dependencies are valid (no circular refs)
52
+ - [ ] Referenced dependencies exist
53
+ - [ ] Dependency order makes sense
54
+
55
+ ### 4. Scope Consistency
56
+ - [ ] Plan doesn't include out-of-scope items
57
+ - [ ] Tasks match plan scope
58
+ - [ ] No scope creep in checklist
59
+
60
+ ### 5. Data Model Consistency
61
+ - [ ] Entities mentioned in spec are in plan
62
+ - [ ] Plan data models match spec requirements
63
+ - [ ] Tasks create required entities
64
+
65
+ ### 6. API Consistency
66
+ - [ ] Endpoints in plan match spec scenarios
67
+ - [ ] Tasks implement all planned endpoints
68
+ - [ ] Checklist validates all endpoints
69
+
70
+ ### 7. Testing Coverage
71
+ - [ ] Each task has test acceptance criteria
72
+ - [ ] Checklist includes test validation
73
+ - [ ] Test types match constitution requirements
74
+
75
+ ---
76
+
77
+ ## Issue Severity
78
+
79
+ **CRITICAL:** Blocks implementation
80
+ - Constitution MUST rule violations
81
+ - Circular dependencies
82
+ - Missing required artifacts
83
+
84
+ **WARNING:** Should fix before implementation
85
+ - Incomplete coverage of requirements
86
+ - Ambiguous acceptance criteria
87
+ - Missing test criteria
88
+
89
+ **INFO:** Nice to have
90
+ - Style inconsistencies
91
+ - Minor gaps in checklist
92
+ - Optimization opportunities
93
+
94
+ ---
95
+
96
+ ## Report Format
97
+
98
+ ```markdown
99
+ # Consistency Analysis: Feature Name
100
+
101
+ **Date:** 2026-01-11
102
+ **Status:** PASS / ISSUES FOUND
103
+
104
+ ## Summary
105
+ - Stories: N/M completed
106
+ - Issues: X total (Y critical, Z warnings, W info)
107
+
108
+ ## Critical Issues
109
+
110
+ ### CRIT-001: Circular Dependency
111
+ **Location:** tasks.md
112
+ **Details:** US-002 depends on US-003, US-003 depends on US-002
113
+ **Fix:** Remove circular dependency, reorder tasks
114
+
115
+ ## Warnings
116
+
117
+ ### WARN-001: Missing Test Coverage
118
+ **Location:** tasks.md, US-004
119
+ **Details:** No integration test in acceptance criteria
120
+ **Fix:** Add integration test requirement
121
+
122
+ ## Info
123
+
124
+ ### INFO-001: Checklist Gap
125
+ **Location:** checklist.md
126
+ **Details:** No performance validation for US-005
127
+ **Suggestion:** Add performance checklist item
128
+
129
+ ## Recommendations
130
+
131
+ 1. Fix all CRITICAL issues before proceeding
132
+ 2. Address WARNINGS for better quality
133
+ 3. Consider INFO items for completeness
134
+
135
+ **Next Steps:**
136
+ - If CRITICAL issues: Fix and re-run analysis
137
+ - If only WARNINGS: Proceed with caution
138
+ - If PASS: Ready for `/relentless.implement`
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Notes
144
+
145
+ - Run before starting implementation
146
+ - Constitution compliance is non-negotiable
147
+ - Fix critical issues immediately
148
+ - Warnings can sometimes be deferred
149
+ - Re-run after making fixes
@@ -0,0 +1,173 @@
1
+ ---
2
+ name: checklist
3
+ description: "Generate quality validation checklist from spec, plan, and tasks. Use after creating tasks. Triggers on: create checklist, quality checklist, validation checklist."
4
+ ---
5
+
6
+ # Quality Validation Checklist Generator
7
+
8
+ Generate domain-specific quality checklists to validate implementation completeness.
9
+
10
+ ---
11
+
12
+ ## The Job
13
+
14
+ 1. Read spec.md, plan.md, and tasks.md
15
+ 2. Extract quality requirements from constitution
16
+ 3. Generate comprehensive checklist
17
+ 4. Save to `checklist.md`
18
+
19
+ **Important:** Checklist items get merged into prd.json acceptance criteria!
20
+
21
+ ---
22
+
23
+ ## Step 1: Locate Feature Files
24
+
25
+ Verify these files exist:
26
+ - `relentless/features/NNN-feature/spec.md`
27
+ - `relentless/features/NNN-feature/plan.md`
28
+ - `relentless/features/NNN-feature/tasks.md`
29
+
30
+ ---
31
+
32
+ ## Step 2: Load Context
33
+
34
+ Read:
35
+ 1. `relentless/constitution.md` - Quality standards and requirements
36
+ 2. Feature files (spec, plan, tasks)
37
+ 3. Identify the feature domain (auth, payments, dashboard, etc.)
38
+
39
+ ---
40
+
41
+ ## Step 3: Generate Checklist Categories
42
+
43
+ Create 5-7 categories based on feature domain:
44
+
45
+ **Common Categories:**
46
+ - Schema & Database
47
+ - Backend Logic
48
+ - Frontend Components (if applicable)
49
+ - API Integration
50
+ - Testing & Validation
51
+ - Security & Permissions
52
+ - Performance & UX
53
+ - Documentation
54
+
55
+ ---
56
+
57
+ ## Step 4: Generate Checklist Items
58
+
59
+ For each category, create 5-10 specific validation items:
60
+
61
+ **Format:**
62
+ ```markdown
63
+ - [ ] CHK-001 [US-001] Specific, testable requirement
64
+ - [ ] CHK-002 [Gap] Missing specification identified
65
+ - [ ] CHK-003 [Ambiguity] Unclear requirement needs clarification
66
+ - [ ] CHK-004 [Edge Case] Potential edge case to handle
67
+ ```
68
+
69
+ **Guidelines:**
70
+ - 80% of items should reference specific user stories `[US-XXX]`
71
+ - 20% should identify gaps, ambiguities, or edge cases
72
+ - Each item must be specific and testable
73
+ - Total: 20-40 items across all categories
74
+
75
+ ---
76
+
77
+ ## Step 5: Reference Constitution
78
+
79
+ Ensure checklist includes items for constitution MUST rules:
80
+ - Type safety requirements
81
+ - Testing coverage
82
+ - Security standards
83
+ - Performance expectations
84
+ - Code quality standards
85
+
86
+ ---
87
+
88
+ ## Step 6: Save & Report
89
+
90
+ 1. Save to `relentless/features/NNN-feature/checklist.md`
91
+ 2. Report:
92
+ - Total checklist items: N
93
+ - Items per category
94
+ - Constitution compliance items: N
95
+ - Gaps identified: N
96
+ - Next step: `relentless convert tasks.md`
97
+
98
+ ---
99
+
100
+ ## Example Checklist
101
+
102
+ ```markdown
103
+ # Quality Checklist: User Authentication
104
+
105
+ **Purpose:** Validate completeness of user authentication implementation
106
+ **Created:** 2026-01-11
107
+ **Feature:** [spec.md](./spec.md)
108
+
109
+ ## Schema & Database
110
+
111
+ - [ ] CHK-001 [US-001] User table has all required fields (id, email, password_hash, confirmed, timestamps)
112
+ - [ ] CHK-002 [US-001] Email field has UNIQUE constraint
113
+ - [ ] CHK-003 [US-001] Indexes created on frequently queried fields (email)
114
+ - [ ] CHK-004 [Gap] Consider adding last_login_at timestamp for analytics
115
+ - [ ] CHK-005 [US-001] Migration script tested on clean database
116
+
117
+ ## Backend Logic
118
+
119
+ - [ ] CHK-006 [US-001] Password hashing uses bcrypt with appropriate cost factor
120
+ - [ ] CHK-007 [US-001] Email validation prevents common typos and invalid formats
121
+ - [ ] CHK-008 [US-002] JWT tokens include user ID and expiration
122
+ - [ ] CHK-009 [US-002] Token verification handles expired tokens gracefully
123
+ - [ ] CHK-010 [Ambiguity] Password reset flow not specified - out of scope?
124
+
125
+ ## API Integration
126
+
127
+ - [ ] CHK-011 [US-001] POST /api/auth/register returns 201 on success
128
+ - [ ] CHK-012 [US-001] Register endpoint returns 400 for invalid email
129
+ - [ ] CHK-013 [US-001] Register endpoint returns 409 for duplicate email
130
+ - [ ] CHK-014 [US-002] POST /api/auth/login returns 401 for wrong password
131
+ - [ ] CHK-015 [US-002] Login endpoint returns 403 for unconfirmed account
132
+ - [ ] CHK-016 [Edge Case] Rate limiting on auth endpoints to prevent brute force
133
+
134
+ ## Testing & Validation
135
+
136
+ - [ ] CHK-017 [US-001] Unit tests for password hashing utility
137
+ - [ ] CHK-018 [US-001] Unit tests for email validation
138
+ - [ ] CHK-019 [US-002] Integration test for full registration flow
139
+ - [ ] CHK-020 [US-002] Integration test for login flow
140
+ - [ ] CHK-021 [US-003] E2E test for email confirmation
141
+ - [ ] CHK-022 [Constitution] Test coverage meets minimum 80% requirement
142
+
143
+ ## Security & Permissions
144
+
145
+ - [ ] CHK-023 [US-001] Passwords never logged or exposed in errors
146
+ - [ ] CHK-024 [US-001] Password requirements enforced (min length, complexity)
147
+ - [ ] CHK-025 [US-002] JWT secret stored in environment variable, not code
148
+ - [ ] CHK-026 [US-002] Token expiration validated on every request
149
+ - [ ] CHK-027 [Gap] Consider adding account lockout after N failed attempts
150
+
151
+ ## Performance & UX
152
+
153
+ - [ ] CHK-028 [US-001] Registration completes within 2 seconds
154
+ - [ ] CHK-029 [US-002] Login completes within 1 second
155
+ - [ ] CHK-030 [US-003] Confirmation email sent within 30 seconds
156
+ - [ ] CHK-031 [Edge Case] Graceful handling when email service is down
157
+
158
+ ## Documentation
159
+
160
+ - [ ] CHK-032 API endpoints documented with examples
161
+ - [ ] CHK-033 Environment variables documented in README
162
+ - [ ] CHK-034 Database schema documented
163
+ ```
164
+
165
+ ---
166
+
167
+ ## Notes
168
+
169
+ - Checklist items will be merged into acceptance criteria during convert
170
+ - Reference user stories with `[US-XXX]` tags
171
+ - Identify gaps and ambiguities with `[Gap]` and `[Ambiguity]` tags
172
+ - Each item must be independently verifiable
173
+ - Balance between comprehensiveness and practicality
@@ -0,0 +1,40 @@
1
+ # [CHECKLIST TYPE] Checklist: [FEATURE NAME]
2
+
3
+ **Purpose**: [Brief description of what this checklist covers]
4
+ **Created**: [DATE]
5
+ **Feature**: [Link to spec.md or relevant documentation]
6
+
7
+ **Note**: This checklist is generated by the `/relentless.checklist` command based on feature context and requirements.
8
+
9
+ <!--
10
+ ============================================================================
11
+ IMPORTANT: The checklist items below are SAMPLE ITEMS for illustration only.
12
+
13
+ The /relentless.checklist command MUST replace these with actual items based on:
14
+ - User's specific checklist request
15
+ - Feature requirements from spec.md
16
+ - Technical context from plan.md
17
+ - Implementation details from tasks.md
18
+
19
+ DO NOT keep these sample items in the generated checklist file.
20
+ ============================================================================
21
+ -->
22
+
23
+ ## [Category 1]
24
+
25
+ - [ ] CHK001 First checklist item with clear action
26
+ - [ ] CHK002 Second checklist item
27
+ - [ ] CHK003 Third checklist item
28
+
29
+ ## [Category 2]
30
+
31
+ - [ ] CHK004 Another category item
32
+ - [ ] CHK005 Item with specific criteria
33
+ - [ ] CHK006 Final item in this category
34
+
35
+ ## Notes
36
+
37
+ - Check items off as completed: `[x]`
38
+ - Add comments or findings inline
39
+ - Link to relevant resources or documentation
40
+ - Items are numbered sequentially for easy reference
@@ -0,0 +1,174 @@
1
+ ---
2
+ name: clarify
3
+ description: "Identify and resolve ambiguities in feature specifications. Use when spec has unclear requirements. Triggers on: clarify spec, resolve ambiguities, clarify requirements."
4
+ ---
5
+
6
+ # Specification Clarification Tool
7
+
8
+ Systematically identify and resolve ambiguities in feature specifications.
9
+
10
+ ---
11
+
12
+ ## The Job
13
+
14
+ 1. Read spec.md
15
+ 2. Scan for 9 types of ambiguities
16
+ 3. Present clarification questions to user
17
+ 4. Update spec with answers
18
+ 5. Save clarification log
19
+
20
+ ---
21
+
22
+ ## Step 1: Load Specification
23
+
24
+ Read `relentless/features/NNN-feature/spec.md`
25
+
26
+ ---
27
+
28
+ ## Step 2: Scan for Ambiguities
29
+
30
+ Check for these 9 types:
31
+
32
+ **1. Behavioral Ambiguities**
33
+ - What happens when [action]?
34
+ - How should system respond to [event]?
35
+ - Example: "What happens when user enters wrong password 5 times?"
36
+
37
+ **2. Data Ambiguities**
38
+ - What are required vs optional fields?
39
+ - What validation rules apply?
40
+ - Example: "What email format validation should we use?"
41
+
42
+ **3. UI/UX Ambiguities**
43
+ - Where should this be displayed?
44
+ - How should user interact?
45
+ - What visual style?
46
+ - Example: "Should password field show/hide toggle?"
47
+
48
+ **4. Integration Ambiguities**
49
+ - Which external API/service?
50
+ - What happens if service unavailable?
51
+ - Example: "Which email provider: SendGrid, Mailgun, or AWS SES?"
52
+
53
+ **5. Permission Ambiguities**
54
+ - Who can perform this action?
55
+ - What authorization rules?
56
+ - Example: "Can unconfirmed users log in or should we block them?"
57
+
58
+ **6. Performance Ambiguities**
59
+ - What are acceptable response times?
60
+ - Pagination requirements?
61
+ - Example: "How many login attempts allowed per minute?"
62
+
63
+ **7. Error Handling Ambiguities**
64
+ - What errors can occur?
65
+ - How should errors be displayed?
66
+ - Example: "What message for duplicate email: '409 Conflict' or custom message?"
67
+
68
+ **8. State Management Ambiguities**
69
+ - How is data persisted?
70
+ - What about caching?
71
+ - Example: "Should we remember failed login attempts across sessions?"
72
+
73
+ **9. Edge Case Ambiguities**
74
+ - What about empty data?
75
+ - Race conditions?
76
+ - Example: "What if two users register with same email simultaneously?"
77
+
78
+ ---
79
+
80
+ ## Step 3: Present Questions
81
+
82
+ For each ambiguity found (max 5 most critical):
83
+
84
+ ```markdown
85
+ ## Question N: [Topic]
86
+
87
+ **Context:** [Quote relevant spec section]
88
+
89
+ **What we need to know:** [Specific question]
90
+
91
+ **Options:**
92
+ A. [Option 1] - [Implications]
93
+ B. [Option 2] - [Implications]
94
+ C. [Option 3] - [Implications]
95
+ D. Custom - [Your answer]
96
+
97
+ **Your choice:** _
98
+ ```
99
+
100
+ ---
101
+
102
+ ## Step 4: Update Specification
103
+
104
+ After receiving answers:
105
+ 1. Update spec.md with clarifications
106
+ 2. Remove `[NEEDS CLARIFICATION]` markers
107
+ 3. Add concrete details based on answers
108
+
109
+ ---
110
+
111
+ ## Step 5: Save Clarification Log
112
+
113
+ Create `relentless/features/NNN-feature/clarification-log.md`:
114
+
115
+ ```markdown
116
+ # Clarification Log: Feature Name
117
+
118
+ ## Q1: [Topic] - RESOLVED
119
+ **Date:** 2026-01-11
120
+ **Question:** [Question]
121
+ **Answer:** [User's choice]
122
+ **Updated Sections:** [List spec sections updated]
123
+
124
+ ## Q2: [Topic] - DEFERRED
125
+ **Date:** 2026-01-11
126
+ **Question:** [Question]
127
+ **Reason:** Can be decided during implementation
128
+ ```
129
+
130
+ ---
131
+
132
+ ## Example
133
+
134
+ ```markdown
135
+ ## Question 1: Password Requirements
136
+
137
+ **Context:** Spec says "password must be secure" but doesn't define requirements.
138
+
139
+ **What we need to know:** What are the specific password requirements?
140
+
141
+ **Options:**
142
+ A. Basic (min 8 characters) - Simple, user-friendly
143
+ B. Moderate (min 8 chars + number + symbol) - Balanced security
144
+ C. Strict (min 12 chars + number + symbol + upper/lower) - High security
145
+ D. Custom - Define your own rules
146
+
147
+ **Your choice:** B
148
+
149
+ ---
150
+
151
+ ## Question 2: Failed Login Handling
152
+
153
+ **Context:** Spec doesn't mention what happens after failed login attempts.
154
+
155
+ **What we need to know:** How should we handle repeated failed logins?
156
+
157
+ **Options:**
158
+ A. No limit - Allow unlimited attempts
159
+ B. Rate limit - Max 5 attempts per minute per IP
160
+ C. Account lockout - Lock account after 5 failed attempts for 30 minutes
161
+ D. Custom - Define your own approach
162
+
163
+ **Your choice:** C
164
+ ```
165
+
166
+ ---
167
+
168
+ ## Notes
169
+
170
+ - Prioritize by impact: security > scope > UX > technical
171
+ - Maximum 5 questions per session
172
+ - Some ambiguities can be deferred to implementation
173
+ - Update spec immediately after clarification
174
+ - Keep clarification log for future reference
@@ -0,0 +1,150 @@
1
+ ---
2
+ name: constitution
3
+ description: "Create or update the project constitution - personalized governance and coding principles. Use when starting a project or updating project standards. Triggers on: create constitution, update principles, set project rules."
4
+ ---
5
+
6
+ # Project Constitution Generator
7
+
8
+ Create a personalized project constitution that defines your team's coding principles, patterns, and governance.
9
+
10
+ ---
11
+
12
+ ## The Job
13
+
14
+ 1. Ask the user about their project's coding philosophy and standards
15
+ 2. Generate a personalized constitution based on their answers
16
+ 3. Save to `relentless/constitution.md`
17
+ 4. Ensure consistency with project templates and documentation
18
+
19
+ **Important:** The constitution is the foundation for all feature work - create this before generating features.
20
+
21
+ ---
22
+
23
+ ## Step 1: Gather Project Information
24
+
25
+ Ask essential questions about the project:
26
+
27
+ **Project Identity:**
28
+ - Project name?
29
+ - Primary programming language(s)?
30
+ - Tech stack (frameworks, libraries)?
31
+
32
+ **Testing Philosophy:**
33
+ - Testing approach? (TDD, test after, pragmatic)
34
+ - Required test coverage?
35
+ - Testing frameworks preferred?
36
+
37
+ **Code Quality:**
38
+ - Linting/formatting tools?
39
+ - Required checks before commit? (typecheck, lint, test)
40
+ - Code review requirements?
41
+
42
+ **Architecture Principles:**
43
+ - Preferred patterns? (MVC, clean architecture, etc.)
44
+ - Modularity requirements?
45
+ - Performance expectations?
46
+
47
+ **Version Control:**
48
+ - Branch naming conventions?
49
+ - Commit message format?
50
+ - CI/CD requirements?
51
+
52
+ ---
53
+
54
+ ## Step 2: Generate Constitution
55
+
56
+ Load the template from `templates/constitution-template.md` and:
57
+
58
+ 1. Replace all `[PLACEHOLDER]` tokens with concrete values from user answers
59
+ 2. Add/remove principles based on project needs (template is a starting point)
60
+ 3. Ensure each principle has:
61
+ - **MUST** rules (enforced, blocking)
62
+ - **SHOULD** rules (best practices, warnings)
63
+ - Clear rationale
64
+ 4. Set version to `1.0.0` for new constitutions
65
+ 5. Set ratification date to today
66
+ 6. Add governance section with amendment procedures
67
+
68
+ ---
69
+
70
+ ## Step 3: Validate & Save
71
+
72
+ Before saving:
73
+ - No `[PLACEHOLDER]` tokens remain (unless explicitly marked as TODO)
74
+ - All dates in ISO format (YYYY-MM-DD)
75
+ - Principles are declarative and testable
76
+ - Version format is semantic (X.Y.Z)
77
+
78
+ Save to: `relentless/constitution.md`
79
+
80
+ ---
81
+
82
+ ## Step 4: Report
83
+
84
+ Output summary:
85
+ - Constitution version created
86
+ - Number of principles defined
87
+ - Key MUST/SHOULD rules
88
+ - Next steps: "Now create your first feature with `/relentless.specify`"
89
+
90
+ ---
91
+
92
+ ## Updating Existing Constitution
93
+
94
+ If `relentless/constitution.md` exists:
95
+ 1. Load current version
96
+ 2. Ask what needs to change
97
+ 3. Increment version appropriately:
98
+ - **MAJOR**: Breaking changes to principles
99
+ - **MINOR**: New principles added
100
+ - **PATCH**: Clarifications, typo fixes
101
+ 4. Update `LAST_AMENDED_DATE` to today
102
+ 5. Add amendment notes at top
103
+
104
+ ---
105
+
106
+ ## Example Constitution Structure
107
+
108
+ ```markdown
109
+ # Project Constitution
110
+
111
+ **Version:** 1.0.0
112
+ **Ratified:** 2026-01-11
113
+ **Last Amended:** 2026-01-11
114
+
115
+ ## Principles
116
+
117
+ ### Principle 1: Type Safety
118
+ **MUST:**
119
+ - All code must pass TypeScript strict mode
120
+ - No `any` types except in documented cases
121
+
122
+ **SHOULD:**
123
+ - Use Zod for runtime validation
124
+ - Prefer inference over explicit types
125
+
126
+ **Rationale:** Type safety prevents runtime errors and improves maintainability.
127
+
128
+ ### Principle 2: Testing
129
+ **MUST:**
130
+ - All features must have unit tests
131
+ - CI must pass before merging
132
+
133
+ **SHOULD:**
134
+ - Aim for 80% coverage
135
+ - Write tests before implementation (TDD)
136
+
137
+ **Rationale:** Tests document behavior and prevent regressions.
138
+
139
+ ## Governance
140
+
141
+ **Amendment Process:**
142
+ 1. Propose changes via PR
143
+ 2. Discuss with team
144
+ 3. Update version semantically
145
+ 4. Document rationale
146
+
147
+ **Compliance:**
148
+ - Constitution checked before each feature implementation
149
+ - Violations block PR merge
150
+ ```