@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,228 @@
1
+ # Project Constitution
2
+
3
+ ## Overview
4
+
5
+ This document defines the governing principles, patterns, and constraints for this project. All agents and developers MUST follow these guidelines when working on the codebase.
6
+
7
+ ## Core Principles
8
+
9
+ ### Architecture
10
+
11
+ **MUST** follow these architectural patterns:
12
+ - Follow existing code structure and organization patterns
13
+ - Keep modules focused and single-purpose
14
+ - Use dependency injection where appropriate
15
+
16
+ **SHOULD** consider these best practices:
17
+ - Prefer composition over inheritance
18
+ - Keep functions small and focused
19
+ - Write self-documenting code
20
+
21
+ ### Code Quality
22
+
23
+ **MUST** maintain these quality standards:
24
+ - All commits MUST pass typecheck with 0 errors
25
+ - All commits MUST pass lint with 0 warnings
26
+ - All new features MUST include appropriate tests
27
+ - All code MUST be formatted consistently
28
+
29
+ **SHOULD** strive for:
30
+ - High test coverage (aim for >80%)
31
+ - Clear, descriptive variable and function names
32
+ - Comprehensive error handling
33
+
34
+ ### Version Control
35
+
36
+ **MUST** follow these Git practices:
37
+ - Write clear, descriptive commit messages
38
+ - Reference user story IDs in commits: `feat: [US-XXX] - Description`
39
+ - Keep commits focused and atomic
40
+ - Do not commit broken code
41
+
42
+ **SHOULD** maintain:
43
+ - Clean commit history
44
+ - Meaningful branch names
45
+ - Updated documentation with code changes
46
+
47
+ ## Technology Stack
48
+
49
+ ### Language & Runtime
50
+
51
+ - **TypeScript** - Primary language
52
+ - **Bun** - Runtime environment (not Node.js)
53
+ - **Zod** - Schema validation
54
+
55
+ ### Key Libraries
56
+
57
+ - Commander - CLI parsing
58
+ - Chalk - Terminal formatting
59
+ - Execa - Process execution
60
+
61
+ ## File Organization
62
+
63
+ ```
64
+ project/
65
+ ├── bin/ # CLI entry points
66
+ ├── src/ # Source code
67
+ │ ├── agents/ # Agent adapters
68
+ │ ├── config/ # Configuration
69
+ │ ├── execution/ # Orchestration
70
+ │ ├── init/ # Project scaffolding
71
+ │ └── prd/ # PRD handling
72
+ ├── templates/ # Template files
73
+ ├── skills/ # Agent skills
74
+ └── relentless/ # Relentless workspace
75
+ ├── config.json
76
+ ├── prompt.md
77
+ └── features/
78
+ ```
79
+
80
+ ## Coding Standards
81
+
82
+ ### TypeScript
83
+
84
+ **MUST** follow:
85
+ - Use strict TypeScript mode
86
+ - Avoid `any` type - use `unknown` or proper types
87
+ - Export types alongside implementations
88
+ - Use Zod schemas for runtime validation
89
+
90
+ **SHOULD** prefer:
91
+ - Interface for public APIs
92
+ - Type for unions and intersections
93
+ - Explicit return types on public functions
94
+
95
+ ### Error Handling
96
+
97
+ **MUST** implement:
98
+ - Descriptive error messages
99
+ - Proper error types
100
+ - Validation at system boundaries
101
+ - Graceful degradation where appropriate
102
+
103
+ **SHOULD** include:
104
+ - Context in error messages
105
+ - Recovery suggestions
106
+ - Logging for debugging
107
+
108
+ ### Testing
109
+
110
+ **MUST** test:
111
+ - Core business logic
112
+ - Edge cases and error conditions
113
+ - Integration points
114
+ - CLI commands
115
+
116
+ **SHOULD** test:
117
+ - Helper functions
118
+ - Utilities
119
+ - Type guards
120
+
121
+ ## Documentation
122
+
123
+ **MUST** document:
124
+ - Public APIs and interfaces
125
+ - Complex algorithms or logic
126
+ - Breaking changes in commits
127
+ - Setup and installation steps
128
+
129
+ **SHOULD** document:
130
+ - Configuration options
131
+ - Architecture decisions
132
+ - Common workflows
133
+ - Troubleshooting steps
134
+
135
+ ## Security
136
+
137
+ **MUST** ensure:
138
+ - No secrets committed to git
139
+ - Proper input validation
140
+ - Safe file system operations
141
+ - Minimal permissions required
142
+
143
+ **SHOULD** consider:
144
+ - Rate limiting where appropriate
145
+ - Audit logs for sensitive operations
146
+ - Security updates for dependencies
147
+
148
+ ## Performance
149
+
150
+ **MUST** maintain:
151
+ - Fast startup time (<1s)
152
+ - Responsive CLI commands
153
+ - Efficient file operations
154
+ - Minimal memory footprint
155
+
156
+ **SHOULD** optimize:
157
+ - Parallel operations where safe
158
+ - Caching for repeated operations
159
+ - Lazy loading of heavy modules
160
+
161
+ ## Constraints
162
+
163
+ ### Dependencies
164
+
165
+ **MUST NOT**:
166
+ - Add dependencies without justification
167
+ - Include deprecated packages
168
+ - Use packages with known security issues
169
+
170
+ **SHOULD**:
171
+ - Prefer built-in solutions over dependencies
172
+ - Keep dependencies minimal and focused
173
+ - Regularly update dependencies
174
+
175
+ ### Backwards Compatibility
176
+
177
+ **MUST**:
178
+ - Maintain compatibility with existing PRDs
179
+ - Provide migration paths for breaking changes
180
+ - Version configuration formats
181
+
182
+ **SHOULD**:
183
+ - Deprecate features before removal
184
+ - Provide clear upgrade documentation
185
+ - Support at least 2 major versions
186
+
187
+ ## Agent-Specific Guidelines
188
+
189
+ ### For All Agents
190
+
191
+ **MUST**:
192
+ - Read progress.txt before starting work
193
+ - Work on ONE story per iteration
194
+ - Update PRD after completing a story
195
+ - Append learnings to progress.txt
196
+ - Run all quality checks before committing
197
+
198
+ **SHOULD**:
199
+ - Review existing code before modifying
200
+ - Follow established patterns
201
+ - Ask questions when unclear
202
+ - Document non-obvious decisions
203
+
204
+ ### Iteration Workflow
205
+
206
+ 1. Read PRD to find next incomplete story
207
+ 2. Read progress.txt for context and patterns
208
+ 3. Review relevant existing code
209
+ 4. Implement the single story
210
+ 5. Run typecheck and lint
211
+ 6. Run tests if applicable
212
+ 7. Commit with proper message format
213
+ 8. Update PRD passes: true
214
+ 9. Append to progress.txt
215
+ 10. Check if all stories complete
216
+
217
+ ## Review and Updates
218
+
219
+ This constitution should be:
220
+ - **Reviewed** at project milestones
221
+ - **Updated** when patterns emerge
222
+ - **Referenced** in code reviews
223
+ - **Enforced** in CI/CD pipelines
224
+
225
+ ---
226
+
227
+ Last Updated: YYYY-MM-DD
228
+ Version: 1.0.0
@@ -0,0 +1,141 @@
1
+ ---
2
+ name: implement
3
+ description: "Execute implementation workflow phase by phase. Use after analysis passes. Triggers on: start implementation, implement feature, begin coding."
4
+ ---
5
+
6
+ # Implementation Workflow Executor
7
+
8
+ Guide systematic implementation of features using the task breakdown.
9
+
10
+ ---
11
+
12
+ ## The Job
13
+
14
+ Guide user through implementing tasks in correct order following dependencies.
15
+
16
+ ---
17
+
18
+ ## Prerequisites
19
+
20
+ Before starting:
21
+ - `/relentless.analyze` must pass (no CRITICAL issues)
22
+ - All artifacts exist (spec, plan, tasks, checklist)
23
+ - Constitution reviewed
24
+
25
+ ---
26
+
27
+ ## Implementation Flow
28
+
29
+ ### Phase 0: Setup
30
+ 1. Review `tasks.md` for setup tasks
31
+ 2. Install dependencies
32
+ 3. Create directory structure
33
+ 4. Initialize configuration
34
+
35
+ ### Phase 1: Foundation
36
+ 1. Implement data models
37
+ 2. Create base utilities
38
+ 3. Set up infrastructure
39
+ 4. Tests for foundation
40
+
41
+ ### Phase 2: User Stories
42
+ For each story in dependency order:
43
+ 1. Read story acceptance criteria
44
+ 2. Implement functionality
45
+ 3. Write tests
46
+ 4. Run quality checks (typecheck, lint)
47
+ 5. Verify against checklist
48
+ 6. Commit changes
49
+ 7. Mark story complete in prd.json
50
+
51
+ ### Phase 3: Polish
52
+ 1. Performance optimization
53
+ 2. Error handling improvements
54
+ 3. Documentation
55
+ 4. Final quality checks
56
+
57
+ ---
58
+
59
+ ## Per-Story Workflow
60
+
61
+ ```markdown
62
+ **Current:** US-001: Create User Registration Endpoint
63
+
64
+ **Acceptance Criteria:**
65
+ - [ ] POST /api/auth/register endpoint exists
66
+ - [ ] Email validation works
67
+ - [ ] Password requirements enforced
68
+ - [ ] Password hashed before storage
69
+ - [ ] Confirmation email sent
70
+ - [ ] Returns 201 with user ID
71
+ - [ ] Returns 400 for invalid input
72
+ - [ ] Typecheck passes
73
+ - [ ] Tests pass
74
+
75
+ **Checklist Items:**
76
+ - CHK-001: User table created
77
+ - CHK-006: Password hashing uses bcrypt
78
+ - CHK-011: Returns correct status codes
79
+
80
+ **Steps:**
81
+ 1. Create endpoint handler
82
+ 2. Implement validation
83
+ 3. Add password hashing
84
+ 4. Integrate email service
85
+ 5. Write unit tests
86
+ 6. Write integration tests
87
+ 7. Run typecheck
88
+ 8. Run tests
89
+ 9. Verify checklist items
90
+ 10. Commit with message: "feat: US-001 - Create User Registration Endpoint"
91
+ ```
92
+
93
+ ---
94
+
95
+ ## Quality Gates
96
+
97
+ Before marking story complete:
98
+ - [ ] All acceptance criteria checked
99
+ - [ ] Typecheck passes
100
+ - [ ] Linter passes
101
+ - [ ] Tests pass
102
+ - [ ] Relevant checklist items verified
103
+ - [ ] Code committed
104
+
105
+ ---
106
+
107
+ ## Progress Tracking
108
+
109
+ Update `progress.txt` after each story:
110
+
111
+ ```markdown
112
+ ## 2026-01-11 - US-001
113
+ - Implemented user registration endpoint
114
+ - Added email validation and password hashing
115
+ - Email service integration working
116
+ - All tests passing
117
+
118
+ **Learnings:**
119
+ - Bcrypt cost factor 12 provides good balance
120
+ - Email validation regex from validator.js works well
121
+ - Nodemailer setup straightforward
122
+
123
+ **Files Changed:**
124
+ - src/api/auth/register.ts (new)
125
+ - src/services/user.service.ts (new)
126
+ - src/utils/password.ts (new)
127
+ - tests/auth/register.test.ts (new)
128
+
129
+ ---
130
+ ```
131
+
132
+ ---
133
+
134
+ ## Notes
135
+
136
+ - Work on ONE story at a time
137
+ - Follow dependency order
138
+ - Don't skip quality checks
139
+ - Commit frequently
140
+ - Update progress after each story
141
+ - This is a guided workflow, not automated
@@ -0,0 +1,179 @@
1
+ ---
2
+ name: plan
3
+ description: "Generate technical implementation plan from feature specification. Use after creating spec. Triggers on: create plan, technical plan, implementation design."
4
+ ---
5
+
6
+ # Technical Implementation Plan Generator
7
+
8
+ Create detailed technical plans that translate feature specifications into implementation designs.
9
+
10
+ ---
11
+
12
+ ## The Job
13
+
14
+ 1. Read the feature specification (`spec.md`)
15
+ 2. Read project constitution for technical constraints
16
+ 3. Generate technical architecture and implementation plan
17
+ 4. Save to `plan.md` in the feature directory
18
+
19
+ ---
20
+
21
+ ## Step 1: Locate Feature Files
22
+
23
+ Find the current feature directory:
24
+ - Look in `relentless/features/` for the most recent feature
25
+ - Or ask user which feature to plan
26
+ - Verify `spec.md` exists
27
+
28
+ ---
29
+
30
+ ## Step 2: Load Context
31
+
32
+ Read these files:
33
+ 1. **relentless/constitution.md** - Project governance and technical standards
34
+ 2. **relentless/features/NNN-feature/spec.md** - Feature requirements
35
+ 3. Project README or docs for tech stack information
36
+
37
+ ---
38
+
39
+ ## Step 3: Generate Technical Plan
40
+
41
+ Using the template at `templates/plan-template.md`, create a plan with:
42
+
43
+ ### Required Sections:
44
+
45
+ **1. Technical Overview**
46
+ - Architecture approach
47
+ - Key technologies to use (from constitution/existing stack)
48
+ - Integration points
49
+
50
+ **2. Data Models**
51
+ - Database schemas
52
+ - Entity relationships
53
+ - Field definitions with types
54
+ - Indexes and constraints
55
+
56
+ **3. API Contracts**
57
+ - Endpoints and methods
58
+ - Request/response formats
59
+ - Authentication requirements
60
+ - Error responses
61
+
62
+ **4. Implementation Strategy**
63
+ - Phase breakdown
64
+ - Dependencies between components
65
+ - Integration approach
66
+
67
+ **5. Testing Strategy**
68
+ - Unit test approach
69
+ - Integration test scenarios
70
+ - E2E test cases
71
+ - Test data requirements
72
+
73
+ **6. Security Considerations**
74
+ - Authentication/authorization
75
+ - Data validation
76
+ - Security best practices
77
+ - Compliance requirements
78
+
79
+ **7. Rollout Plan**
80
+ - Deployment strategy
81
+ - Migration requirements (if any)
82
+ - Monitoring and observability
83
+ - Rollback plan
84
+
85
+ ---
86
+
87
+ ## Step 4: Ensure Constitution Compliance
88
+
89
+ Validate the plan against constitution:
90
+ - **MUST** rules: Required, plan must follow these
91
+ - **SHOULD** rules: Best practices, document any deviations
92
+
93
+ If plan violates MUST rules, revise until compliant.
94
+
95
+ ---
96
+
97
+ ## Step 5: Save & Report
98
+
99
+ 1. Save plan to `relentless/features/NNN-feature/plan.md`
100
+ 2. Update progress.txt with plan creation timestamp
101
+ 3. Report:
102
+ - Plan location
103
+ - Key technical decisions
104
+ - Constitution compliance: PASS/FAIL
105
+ - Next step: `/relentless.tasks`
106
+
107
+ ---
108
+
109
+ ## Example Sections
110
+
111
+ ```markdown
112
+ # Technical Implementation Plan: User Authentication
113
+
114
+ ## Technical Overview
115
+
116
+ **Architecture:** Three-tier (API, Service, Data)
117
+ **Stack:** Node.js, TypeScript, PostgreSQL
118
+ **Authentication:** JWT tokens with refresh mechanism
119
+
120
+ ## Data Models
121
+
122
+ ### User Table
123
+ \`\`\`sql
124
+ CREATE TABLE users (
125
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
126
+ email VARCHAR(255) UNIQUE NOT NULL,
127
+ password_hash VARCHAR(255) NOT NULL,
128
+ confirmed BOOLEAN DEFAULT FALSE,
129
+ created_at TIMESTAMP DEFAULT NOW(),
130
+ updated_at TIMESTAMP DEFAULT NOW()
131
+ );
132
+
133
+ CREATE INDEX idx_users_email ON users(email);
134
+ \`\`\`
135
+
136
+ ## API Contracts
137
+
138
+ ### POST /api/auth/register
139
+ **Request:**
140
+ \`\`\`json
141
+ {
142
+ "email": "user@example.com",
143
+ "password": "password123"
144
+ }
145
+ \`\`\`
146
+
147
+ **Response (201):**
148
+ \`\`\`json
149
+ {
150
+ "id": "uuid",
151
+ "email": "user@example.com",
152
+ "message": "Confirmation email sent"
153
+ }
154
+ \`\`\`
155
+
156
+ ## Testing Strategy
157
+
158
+ **Unit Tests:**
159
+ - Password hashing utility
160
+ - Email validation
161
+ - Token generation/verification
162
+
163
+ **Integration Tests:**
164
+ - Full registration flow
165
+ - Email sending
166
+ - Database operations
167
+
168
+ **E2E Tests:**
169
+ - Complete user journey from signup to login
170
+ ```
171
+
172
+ ---
173
+
174
+ ## Notes
175
+
176
+ - Plan bridges WHAT (spec) to HOW (implementation)
177
+ - Include specific technologies and patterns
178
+ - Must comply with constitution
179
+ - Detailed enough for task generation
@@ -0,0 +1,104 @@
1
+ # Implementation Plan: [FEATURE]
2
+
3
+ **Branch**: `[###-feature-name]` | **Date**: [DATE] | **Spec**: [link]
4
+ **Input**: Feature specification from `/specs/[###-feature-name]/spec.md`
5
+
6
+ **Note**: This template is filled in by the `/relentless.plan` command. See `.specify/templates/commands/plan.md` for the execution workflow.
7
+
8
+ ## Summary
9
+
10
+ [Extract from feature spec: primary requirement + technical approach from research]
11
+
12
+ ## Technical Context
13
+
14
+ <!--
15
+ ACTION REQUIRED: Replace the content in this section with the technical details
16
+ for the project. The structure here is presented in advisory capacity to guide
17
+ the iteration process.
18
+ -->
19
+
20
+ **Language/Version**: [e.g., Python 3.11, Swift 5.9, Rust 1.75 or NEEDS CLARIFICATION]
21
+ **Primary Dependencies**: [e.g., FastAPI, UIKit, LLVM or NEEDS CLARIFICATION]
22
+ **Storage**: [if applicable, e.g., PostgreSQL, CoreData, files or N/A]
23
+ **Testing**: [e.g., pytest, XCTest, cargo test or NEEDS CLARIFICATION]
24
+ **Target Platform**: [e.g., Linux server, iOS 15+, WASM or NEEDS CLARIFICATION]
25
+ **Project Type**: [single/web/mobile - determines source structure]
26
+ **Performance Goals**: [domain-specific, e.g., 1000 req/s, 10k lines/sec, 60 fps or NEEDS CLARIFICATION]
27
+ **Constraints**: [domain-specific, e.g., <200ms p95, <100MB memory, offline-capable or NEEDS CLARIFICATION]
28
+ **Scale/Scope**: [domain-specific, e.g., 10k users, 1M LOC, 50 screens or NEEDS CLARIFICATION]
29
+
30
+ ## Constitution Check
31
+
32
+ *GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.*
33
+
34
+ [Gates determined based on constitution file]
35
+
36
+ ## Project Structure
37
+
38
+ ### Documentation (this feature)
39
+
40
+ ```text
41
+ specs/[###-feature]/
42
+ ├── plan.md # This file (/relentless.plan command output)
43
+ ├── research.md # Phase 0 output (/relentless.plan command)
44
+ ├── data-model.md # Phase 1 output (/relentless.plan command)
45
+ ├── quickstart.md # Phase 1 output (/relentless.plan command)
46
+ ├── contracts/ # Phase 1 output (/relentless.plan command)
47
+ └── tasks.md # Phase 2 output (/relentless.tasks command - NOT created by /relentless.plan)
48
+ ```
49
+
50
+ ### Source Code (repository root)
51
+ <!--
52
+ ACTION REQUIRED: Replace the placeholder tree below with the concrete layout
53
+ for this feature. Delete unused options and expand the chosen structure with
54
+ real paths (e.g., apps/admin, packages/something). The delivered plan must
55
+ not include Option labels.
56
+ -->
57
+
58
+ ```text
59
+ # [REMOVE IF UNUSED] Option 1: Single project (DEFAULT)
60
+ src/
61
+ ├── models/
62
+ ├── services/
63
+ ├── cli/
64
+ └── lib/
65
+
66
+ tests/
67
+ ├── contract/
68
+ ├── integration/
69
+ └── unit/
70
+
71
+ # [REMOVE IF UNUSED] Option 2: Web application (when "frontend" + "backend" detected)
72
+ backend/
73
+ ├── src/
74
+ │ ├── models/
75
+ │ ├── services/
76
+ │ └── api/
77
+ └── tests/
78
+
79
+ frontend/
80
+ ├── src/
81
+ │ ├── components/
82
+ │ ├── pages/
83
+ │ └── services/
84
+ └── tests/
85
+
86
+ # [REMOVE IF UNUSED] Option 3: Mobile + API (when "iOS/Android" detected)
87
+ api/
88
+ └── [same as backend above]
89
+
90
+ ios/ or android/
91
+ └── [platform-specific structure: feature modules, UI flows, platform tests]
92
+ ```
93
+
94
+ **Structure Decision**: [Document the selected structure and reference the real
95
+ directories captured above]
96
+
97
+ ## Complexity Tracking
98
+
99
+ > **Fill ONLY if Constitution Check has violations that must be justified**
100
+
101
+ | Violation | Why Needed | Simpler Alternative Rejected Because |
102
+ |-----------|------------|-------------------------------------|
103
+ | [e.g., 4th project] | [current need] | [why 3 projects insufficient] |
104
+ | [e.g., Repository pattern] | [specific problem] | [why direct DB access insufficient] |