@atlashub/smartstack-cli 1.13.2 → 1.14.1

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 (214) hide show
  1. package/.documentation/agents.html +1 -1
  2. package/.documentation/apex.html +1 -1
  3. package/.documentation/business-analyse.html +1 -1
  4. package/.documentation/cli-commands.html +3 -3
  5. package/.documentation/commands.html +1 -1
  6. package/.documentation/efcore.html +1 -1
  7. package/.documentation/gitflow.html +231 -236
  8. package/.documentation/hooks.html +1 -1
  9. package/.documentation/index.html +1 -1
  10. package/.documentation/init.html +3 -3
  11. package/.documentation/installation.html +1075 -351
  12. package/.documentation/ralph-loop.html +1 -1
  13. package/.documentation/test-web.html +1 -1
  14. package/README.md +88 -20
  15. package/config/default-config.json +10 -1
  16. package/dist/index.js +276 -85
  17. package/dist/index.js.map +1 -1
  18. package/package.json +1 -1
  19. package/templates/agents/code-reviewer.md +163 -0
  20. package/templates/agents/efcore/db-deploy.md +25 -7
  21. package/templates/agents/efcore/db-reset.md +31 -10
  22. package/templates/agents/efcore/db-status.md +22 -5
  23. package/templates/agents/efcore/migration.md +70 -20
  24. package/templates/agents/gitflow/cleanup.md +8 -1
  25. package/templates/agents/gitflow/commit.md +7 -5
  26. package/templates/agents/gitflow/finish.md +6 -4
  27. package/templates/agents/gitflow/pr.md +8 -1
  28. package/templates/agents/gitflow/start.md +1 -1
  29. package/templates/commands/check-version.md +267 -0
  30. package/templates/commands/efcore/_shared.md +31 -2
  31. package/templates/commands/efcore/db-reset.md +18 -6
  32. package/templates/commands/efcore/migration.md +1 -1
  33. package/templates/commands/efcore/rebase-snapshot.md +1 -1
  34. package/templates/commands/efcore/squash.md +1 -0
  35. package/templates/commands/refactor.md +164 -0
  36. package/templates/project/DependencyInjection.Application.cs.template +25 -0
  37. package/templates/project/DependencyInjection.Infrastructure.cs.template +61 -0
  38. package/templates/project/DesignTimeExtensionsDbContextFactory.cs.template +70 -0
  39. package/templates/project/ExampleEntity.cs.template +116 -0
  40. package/templates/project/ExampleEntityConfiguration.cs.template +64 -0
  41. package/templates/project/ExampleService.cs.template +146 -0
  42. package/templates/project/ExtensionsDbContext.cs.template +41 -0
  43. package/templates/project/IExtensionsDbContext.cs.template +22 -0
  44. package/templates/project/Program.cs.template +47 -0
  45. package/templates/project/README.md +79 -0
  46. package/templates/ralph/README.md +10 -8
  47. package/templates/ralph/ralph.config.yaml +2 -2
  48. package/templates/skills/_shared.md +44 -44
  49. package/templates/skills/ai-prompt/SKILL.md +55 -55
  50. package/templates/skills/apex/SKILL.md +235 -0
  51. package/templates/skills/apex/steps/step-00-init.md +203 -0
  52. package/templates/skills/apex/steps/step-01-analyze.md +210 -0
  53. package/templates/skills/apex/steps/step-02-plan.md +217 -0
  54. package/templates/skills/apex/steps/step-03-execute.md +178 -0
  55. package/templates/skills/apex/steps/step-04-validate.md +217 -0
  56. package/templates/skills/apex/steps/step-05-examine.md +207 -0
  57. package/templates/skills/apex/steps/step-06-resolve.md +181 -0
  58. package/templates/skills/apex/steps/step-07-tests.md +206 -0
  59. package/templates/skills/apex/steps/step-08-run-tests.md +207 -0
  60. package/templates/skills/apex/templates/00-context.md +46 -0
  61. package/templates/skills/apex/templates/01-analyze.md +63 -0
  62. package/templates/skills/apex/templates/02-plan.md +63 -0
  63. package/templates/skills/apex/templates/03-execute.md +34 -0
  64. package/templates/skills/apex/templates/04-validate.md +61 -0
  65. package/templates/skills/apex/templates/05-examine.md +58 -0
  66. package/templates/skills/apex/templates/06-resolve.md +39 -0
  67. package/templates/skills/apex/templates/07-tests.md +56 -0
  68. package/templates/skills/apex/templates/08-run-tests.md +41 -0
  69. package/templates/skills/apex/templates/README.md +69 -0
  70. package/templates/skills/application/SKILL.md +50 -50
  71. package/templates/skills/application/templates-backend.md +25 -25
  72. package/templates/skills/application/templates-frontend.md +43 -43
  73. package/templates/skills/application/templates-i18n.md +29 -29
  74. package/templates/skills/application/templates-seed.md +77 -77
  75. package/templates/skills/business-analyse/SKILL.md +223 -0
  76. package/templates/skills/business-analyse/_shared.md +258 -0
  77. package/templates/skills/business-analyse/questionnaire/01-context.md +33 -0
  78. package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +35 -0
  79. package/templates/skills/business-analyse/questionnaire/03-scope.md +35 -0
  80. package/templates/skills/business-analyse/questionnaire/04-data.md +36 -0
  81. package/templates/skills/business-analyse/questionnaire/05-integrations.md +36 -0
  82. package/templates/skills/business-analyse/questionnaire/06-security.md +40 -0
  83. package/templates/skills/business-analyse/questionnaire/07-ui.md +36 -0
  84. package/templates/skills/business-analyse/questionnaire/08-performance.md +35 -0
  85. package/templates/skills/business-analyse/questionnaire/09-constraints.md +35 -0
  86. package/templates/skills/business-analyse/questionnaire/10-documentation.md +35 -0
  87. package/templates/skills/business-analyse/questionnaire.md +177 -177
  88. package/templates/skills/business-analyse/react/components.md +340 -0
  89. package/templates/skills/business-analyse/react/i18n-template.md +245 -0
  90. package/templates/skills/business-analyse/react/schema.md +151 -0
  91. package/templates/skills/business-analyse/steps/step-00-init.md +293 -0
  92. package/templates/skills/business-analyse/steps/step-01-discover.md +267 -0
  93. package/templates/skills/business-analyse/steps/step-02-analyse.md +243 -0
  94. package/templates/skills/business-analyse/steps/step-03-specify.md +317 -0
  95. package/templates/skills/business-analyse/steps/step-04-validate.md +239 -0
  96. package/templates/skills/business-analyse/steps/step-05-handoff.md +336 -0
  97. package/templates/skills/business-analyse/steps/step-06-doc-html.md +261 -0
  98. package/templates/skills/business-analyse/templates/00-context.md +105 -0
  99. package/templates/skills/business-analyse/templates/frd-brd.md +97 -0
  100. package/templates/skills/business-analyse/templates/frd-discovery.md +78 -0
  101. package/templates/skills/business-analyse/templates/frd-handoff.md +118 -0
  102. package/templates/skills/business-analyse/templates/frd-spec.md +168 -0
  103. package/templates/skills/business-analyse/templates-frd.md +217 -217
  104. package/templates/skills/business-analyse/templates-react.md +26 -26
  105. package/templates/skills/controller/SKILL.md +141 -92
  106. package/templates/skills/controller/postman-templates.md +15 -15
  107. package/templates/skills/controller/steps/step-00-init.md +191 -0
  108. package/templates/skills/controller/steps/step-01-analyze.md +146 -0
  109. package/templates/skills/controller/steps/step-02-plan.md +176 -0
  110. package/templates/skills/controller/steps/step-03-generate.md +219 -0
  111. package/templates/skills/controller/steps/step-04-perms.md +219 -0
  112. package/templates/skills/controller/steps/step-05-validate.md +107 -0
  113. package/templates/skills/controller/templates.md +77 -77
  114. package/templates/skills/documentation/SKILL.md +79 -79
  115. package/templates/skills/feature-full/SKILL.md +38 -38
  116. package/templates/skills/gitflow/SKILL.md +277 -0
  117. package/templates/{commands → skills}/gitflow/_shared.md +20 -20
  118. package/templates/skills/gitflow/phases/abort.md +173 -0
  119. package/templates/skills/gitflow/phases/cleanup.md +226 -0
  120. package/templates/skills/gitflow/phases/status.md +178 -0
  121. package/templates/skills/gitflow/steps/step-commit.md +255 -0
  122. package/templates/skills/gitflow/steps/step-finish.md +255 -0
  123. package/templates/skills/gitflow/steps/step-init.md +209 -0
  124. package/templates/skills/gitflow/steps/step-merge.md +225 -0
  125. package/templates/skills/gitflow/steps/step-plan.md +208 -0
  126. package/templates/skills/gitflow/steps/step-pr.md +235 -0
  127. package/templates/skills/gitflow/steps/step-start.md +334 -0
  128. package/templates/skills/gitflow/steps/step-sync.md +200 -0
  129. package/templates/skills/gitflow/templates/config.json +53 -0
  130. package/templates/skills/notification/SKILL.md +51 -51
  131. package/templates/skills/ralph-loop/SKILL.md +228 -0
  132. package/templates/skills/ralph-loop/steps/step-00-init.md +201 -0
  133. package/templates/skills/ralph-loop/steps/step-01-task.md +169 -0
  134. package/templates/skills/ralph-loop/steps/step-02-execute.md +173 -0
  135. package/templates/skills/ralph-loop/steps/step-03-commit.md +170 -0
  136. package/templates/skills/ralph-loop/steps/step-04-check.md +162 -0
  137. package/templates/skills/ralph-loop/steps/step-05-report.md +181 -0
  138. package/templates/skills/review-code/SKILL.md +219 -0
  139. package/templates/skills/review-code/references/clean-code-principles.md +140 -0
  140. package/templates/skills/review-code/references/code-quality-metrics.md +174 -0
  141. package/templates/skills/review-code/references/feedback-patterns.md +149 -0
  142. package/templates/skills/review-code/references/security-checklist.md +127 -0
  143. package/templates/skills/ui-components/SKILL.md +54 -54
  144. package/templates/skills/workflow/SKILL.md +46 -46
  145. package/templates/commands/ai-prompt.md +0 -315
  146. package/templates/commands/apex/1-analyze.md +0 -100
  147. package/templates/commands/apex/2-plan.md +0 -145
  148. package/templates/commands/apex/3-execute.md +0 -171
  149. package/templates/commands/apex/4-examine.md +0 -116
  150. package/templates/commands/apex/5-tasks.md +0 -209
  151. package/templates/commands/apex.md +0 -76
  152. package/templates/commands/application/create.md +0 -362
  153. package/templates/commands/application/templates-backend.md +0 -463
  154. package/templates/commands/application/templates-frontend.md +0 -517
  155. package/templates/commands/application/templates-i18n.md +0 -478
  156. package/templates/commands/application/templates-seed.md +0 -362
  157. package/templates/commands/application.md +0 -303
  158. package/templates/commands/business-analyse/0-orchestrate.md +0 -156
  159. package/templates/commands/business-analyse/1-init.md +0 -99
  160. package/templates/commands/business-analyse/2-discover.md +0 -143
  161. package/templates/commands/business-analyse/3-analyse.md +0 -106
  162. package/templates/commands/business-analyse/4-specify.md +0 -133
  163. package/templates/commands/business-analyse/5-validate.md +0 -132
  164. package/templates/commands/business-analyse/6-handoff.md +0 -157
  165. package/templates/commands/business-analyse/7-doc-html.md +0 -103
  166. package/templates/commands/business-analyse/_shared.md +0 -176
  167. package/templates/commands/business-analyse/bug.md +0 -118
  168. package/templates/commands/business-analyse/change-request.md +0 -144
  169. package/templates/commands/business-analyse/hotfix.md +0 -116
  170. package/templates/commands/business-analyse.md +0 -121
  171. package/templates/commands/controller/create.md +0 -216
  172. package/templates/commands/controller/postman-templates.md +0 -528
  173. package/templates/commands/controller/templates.md +0 -600
  174. package/templates/commands/controller.md +0 -337
  175. package/templates/commands/create/agent.md +0 -138
  176. package/templates/commands/create/command.md +0 -166
  177. package/templates/commands/create/hook.md +0 -234
  178. package/templates/commands/create/plugin.md +0 -329
  179. package/templates/commands/create/project.md +0 -508
  180. package/templates/commands/create/skill.md +0 -199
  181. package/templates/commands/create.md +0 -220
  182. package/templates/commands/documentation/module.md +0 -202
  183. package/templates/commands/documentation/templates.md +0 -432
  184. package/templates/commands/documentation.md +0 -190
  185. package/templates/commands/epct.md +0 -69
  186. package/templates/commands/explain.md +0 -186
  187. package/templates/commands/feature-full.md +0 -267
  188. package/templates/commands/gitflow/1-init.md +0 -188
  189. package/templates/commands/gitflow/10-start.md +0 -190
  190. package/templates/commands/gitflow/11-finish.md +0 -382
  191. package/templates/commands/gitflow/12-cleanup.md +0 -103
  192. package/templates/commands/gitflow/13-sync.md +0 -216
  193. package/templates/commands/gitflow/14-rebase.md +0 -251
  194. package/templates/commands/gitflow/2-status.md +0 -122
  195. package/templates/commands/gitflow/3-commit.md +0 -209
  196. package/templates/commands/gitflow/4-plan.md +0 -174
  197. package/templates/commands/gitflow/5-exec.md +0 -202
  198. package/templates/commands/gitflow/6-abort.md +0 -121
  199. package/templates/commands/gitflow/7-pull-request.md +0 -176
  200. package/templates/commands/gitflow/8-review.md +0 -113
  201. package/templates/commands/gitflow/9-merge.md +0 -157
  202. package/templates/commands/gitflow.md +0 -128
  203. package/templates/commands/implement.md +0 -663
  204. package/templates/commands/init.md +0 -567
  205. package/templates/commands/mcp-integration.md +0 -330
  206. package/templates/commands/notification.md +0 -129
  207. package/templates/commands/oneshot.md +0 -57
  208. package/templates/commands/quickstart.md +0 -154
  209. package/templates/commands/ralph-loop/cancel-ralph.md +0 -18
  210. package/templates/commands/ralph-loop/help.md +0 -126
  211. package/templates/commands/ralph-loop/ralph-loop.md +0 -120
  212. package/templates/commands/review.md +0 -106
  213. package/templates/commands/workflow.md +0 -193
  214. package/templates/gitflow/config.json +0 -138
@@ -0,0 +1,201 @@
1
+ ---
2
+ name: step-00-init
3
+ description: Initialize Ralph loop - parse args, verify MCP, setup state
4
+ next_step: steps/step-01-task.md
5
+ ---
6
+
7
+ # Step 0: Initialization
8
+
9
+ ## MANDATORY EXECUTION RULES:
10
+
11
+ - NEVER skip MCP verification
12
+ - ALWAYS parse ALL flags before any other action
13
+ - ONLY check for resume if -r flag is set
14
+ - YOU ARE AN INITIALIZER, not an executor
15
+ - FORBIDDEN to load step-01 until init is complete
16
+
17
+ ## YOUR TASK:
18
+
19
+ Initialize the Ralph loop by parsing flags, verifying MCP availability, and setting up the execution environment.
20
+
21
+ ---
22
+
23
+ <defaults>
24
+ ## Default Configuration
25
+
26
+ ```yaml
27
+ max_iterations: 50
28
+ completion_promise: null
29
+ verbose_mode: false
30
+ resume_mode: false
31
+ current_iteration: 1
32
+ ```
33
+ </defaults>
34
+
35
+ ---
36
+
37
+ ## EXECUTION SEQUENCE:
38
+
39
+ ### 1. Parse Flags and Input
40
+
41
+ **Step 1: Load defaults from config above**
42
+
43
+ ```
44
+ {max_iterations} = 50
45
+ {completion_promise} = null
46
+ {verbose_mode} = false
47
+ {resume_mode} = false
48
+ {current_iteration} = 1
49
+ ```
50
+
51
+ **Step 2: Parse user input and override defaults:**
52
+
53
+ ```
54
+ Flags:
55
+ -m N or --max-iterations N -> {max_iterations} = N
56
+ -c TEXT or --completion-promise TEXT -> {completion_promise} = TEXT
57
+ -v or --verbose -> {verbose_mode} = true
58
+ -r or --resume -> {resume_mode} = true
59
+
60
+ Remainder -> {task_description}
61
+ ```
62
+
63
+ ### 2. Verify MCP Servers (MANDATORY)
64
+
65
+ **CRITICAL: Do NOT proceed without MCP verification!**
66
+
67
+ **Check SmartStack MCP:**
68
+ ```
69
+ mcp__smartstack__validate_conventions:
70
+ checks: ["all"]
71
+ (just to verify connectivity)
72
+ ```
73
+
74
+ **Check Context7 MCP:**
75
+ ```
76
+ mcp__plugin_context7_context7__resolve-library-id:
77
+ libraryName: "test"
78
+ query: "connectivity check"
79
+ (just to verify connectivity)
80
+ ```
81
+
82
+ **If ANY MCP fails:**
83
+ ```
84
+ ╔══════════════════════════════════════════════════════════════════╗
85
+ ║ ❌ MCP SERVER UNAVAILABLE ║
86
+ ╠══════════════════════════════════════════════════════════════════╣
87
+ ║ Server: {failed_server} ║
88
+ ║ Status: Connection failed ║
89
+ ╠══════════════════════════════════════════════════════════════════╣
90
+ ║ RALPH CANNOT PROCEED WITHOUT MCP ║
91
+ ║ ║
92
+ ║ Troubleshooting: ║
93
+ ║ 1. Run: smartstack check-mcp ║
94
+ ║ 2. Restart Claude Code ║
95
+ ║ 3. Check MCP server configuration ║
96
+ ╚══════════════════════════════════════════════════════════════════╝
97
+
98
+ STOP - Do not proceed.
99
+ ```
100
+
101
+ ### 3. Check Resume Mode
102
+
103
+ **If {resume_mode} = true:**
104
+
105
+ 1. Check for existing `.ralph/prd.json`
106
+ 2. If found:
107
+ - Read prd.json to restore state
108
+ - Read progress.txt for context
109
+ - Set {current_iteration} from state
110
+ - Continue to step-01
111
+ 3. If not found:
112
+ - Error: "No active Ralph loop to resume"
113
+ - Ask user to start new loop
114
+
115
+ ### 4. Initialize .ralph/ Structure
116
+
117
+ **Create directory structure:**
118
+
119
+ ```
120
+ .ralph/
121
+ ├── prd.json # Will be created in step-01
122
+ ├── progress.txt # Will be created in step-01
123
+ ├── logs/
124
+ └── reports/
125
+ ```
126
+
127
+ **Commands:**
128
+ ```bash
129
+ mkdir -p .ralph/logs
130
+ mkdir -p .ralph/reports
131
+ ```
132
+
133
+ ### 5. Validate Completion Promise
134
+
135
+ **If {completion_promise} is null:**
136
+
137
+ ```yaml
138
+ AskUserQuestion:
139
+ header: "Promise"
140
+ question: "What text should signal completion?"
141
+ options:
142
+ - label: "COMPLETE"
143
+ description: "Standard completion signal"
144
+ - label: "ALL TESTS PASS"
145
+ description: "For test-focused tasks"
146
+ - label: "DONE"
147
+ description: "Simple completion"
148
+ - label: "Custom..."
149
+ description: "Specify custom text"
150
+ ```
151
+
152
+ ### 6. Log Initialization
153
+
154
+ **If {verbose_mode} = true:**
155
+
156
+ Write to `.ralph/logs/{timestamp}.log`:
157
+ ```
158
+ [{timestamp}] RALPH LOOP INITIALIZED
159
+ Task: {task_description}
160
+ Max iterations: {max_iterations}
161
+ Completion promise: {completion_promise}
162
+ MCP Status: SmartStack ✅, Context7 ✅
163
+ ```
164
+
165
+ ### 7. Show Summary and Proceed
166
+
167
+ **Always show COMPACT summary:**
168
+
169
+ ```
170
+ ╔══════════════════════════════════════════════════════════════════╗
171
+ ║ RALPH LOOP INITIALIZED ║
172
+ ╠══════════════════════════════════════════════════════════════════╣
173
+ ║ Task: {task_description} ║
174
+ ║ Max iterations: {max_iterations} ║
175
+ ║ Completion: <promise>{completion_promise}</promise> ║
176
+ ║ MCP: ✅ Ready ║
177
+ ╠══════════════════════════════════════════════════════════════════╣
178
+ ║ Files: ║
179
+ ║ - .ralph/prd.json (tasks) ║
180
+ ║ - .ralph/progress.txt (memory) ║
181
+ ╚══════════════════════════════════════════════════════════════════╝
182
+
183
+ -> Loading tasks...
184
+ ```
185
+
186
+ **Then proceed directly to step-01-task.md**
187
+
188
+ ---
189
+
190
+ ## SUCCESS METRICS:
191
+
192
+ - All flags correctly parsed
193
+ - MCP servers verified and available
194
+ - .ralph/ directory structure created
195
+ - Completion promise defined
196
+ - Output is COMPACT
197
+ - Proceeded to step-01 immediately after summary
198
+
199
+ ## NEXT STEP:
200
+
201
+ After showing initialization summary, always proceed directly to `./step-01-task.md`
@@ -0,0 +1,169 @@
1
+ ---
2
+ name: step-01-task
3
+ description: Load or create tasks from prd.json
4
+ next_step: steps/step-02-execute.md
5
+ ---
6
+
7
+ # Step 1: Load Task
8
+
9
+ ## YOUR TASK:
10
+
11
+ Load the current task from prd.json or create initial task breakdown.
12
+
13
+ **ULTRA THINK about task decomposition.**
14
+
15
+ ---
16
+
17
+ ## EXECUTION SEQUENCE:
18
+
19
+ ### 1. Check for Existing prd.json
20
+
21
+ **If `.ralph/prd.json` exists:**
22
+ - Read and parse the file
23
+ - Find the next task with `passes: false`
24
+ - Load into state
25
+ - Skip to step 4
26
+
27
+ **If `.ralph/prd.json` does NOT exist:**
28
+ - Continue to step 2 (create tasks)
29
+
30
+ ### 2. Analyze Task Description
31
+
32
+ **ULTRA THINK about the task:**
33
+
34
+ - What are the logical subtasks?
35
+ - What order should they be executed?
36
+ - What are the success criteria for each?
37
+ - What files will be modified?
38
+
39
+ **Generate task breakdown:**
40
+
41
+ For `{task_description}`, identify 3-10 subtasks.
42
+
43
+ **Example for "implement user authentication":**
44
+ ```json
45
+ {
46
+ "tasks": [
47
+ { "id": 1, "description": "Create User entity in Domain layer", "passes": false },
48
+ { "id": 2, "description": "Add User DbSet to ApplicationDbContext", "passes": false },
49
+ { "id": 3, "description": "Create EF Core migration", "passes": false },
50
+ { "id": 4, "description": "Implement IPasswordService", "passes": false },
51
+ { "id": 5, "description": "Implement IJwtService", "passes": false },
52
+ { "id": 6, "description": "Create AuthController with login endpoint", "passes": false },
53
+ { "id": 7, "description": "Add authentication middleware", "passes": false },
54
+ { "id": 8, "description": "Write integration tests", "passes": false }
55
+ ]
56
+ }
57
+ ```
58
+
59
+ ### 3. Create prd.json
60
+
61
+ **Write `.ralph/prd.json`:**
62
+
63
+ ```json
64
+ {
65
+ "feature": "{task_description}",
66
+ "created": "{timestamp}",
67
+ "max_iterations": {max_iterations},
68
+ "completion_promise": "{completion_promise}",
69
+ "current_iteration": 1,
70
+ "tasks": [
71
+ { "id": 1, "description": "...", "passes": false },
72
+ { "id": 2, "description": "...", "passes": false }
73
+ ]
74
+ }
75
+ ```
76
+
77
+ **Initialize `.ralph/progress.txt`:**
78
+
79
+ ```markdown
80
+ # Ralph Loop Progress
81
+
82
+ ## Task: {task_description}
83
+ ## Started: {timestamp}
84
+
85
+ ---
86
+
87
+ ## Iteration 1
88
+
89
+ ### Context
90
+ Starting fresh implementation.
91
+
92
+ ### Learnings
93
+ (To be updated after each iteration)
94
+ ```
95
+
96
+ ### 4. Find Current Task
97
+
98
+ **Find the next task with `passes: false`:**
99
+
100
+ ```javascript
101
+ const currentTask = tasks.find(t => !t.passes);
102
+ ```
103
+
104
+ **If all tasks are `passes: true`:**
105
+ - This shouldn't happen in step-01
106
+ - If it does, skip to step-05 (report)
107
+
108
+ **Store in state:**
109
+ ```
110
+ {current_task_id} = currentTask.id
111
+ {current_task_description} = currentTask.description
112
+ {tasks_completed} = tasks.filter(t => t.passes).length
113
+ {tasks_total} = tasks.length
114
+ ```
115
+
116
+ ### 5. Read Previous Progress
117
+
118
+ **If iteration > 1:**
119
+
120
+ Read `.ralph/progress.txt` to understand:
121
+ - What was done in previous iterations
122
+ - Key learnings and context
123
+ - Files that were modified
124
+ - Issues encountered
125
+
126
+ **This provides context for the current iteration.**
127
+
128
+ ### 6. Show Task Status
129
+
130
+ **Display current state:**
131
+
132
+ ```
133
+ ╔══════════════════════════════════════════════════════════════════╗
134
+ ║ ITERATION {current_iteration} / {max_iterations} ║
135
+ ╠══════════════════════════════════════════════════════════════════╣
136
+ ║ Progress: {tasks_completed} / {tasks_total} tasks complete ║
137
+ ║ ║
138
+ ║ Current Task: ║
139
+ ║ [{current_task_id}] {current_task_description} ║
140
+ ╠══════════════════════════════════════════════════════════════════╣
141
+ ║ Previous Learnings: ║
142
+ ║ {summary from progress.txt} ║
143
+ ╚══════════════════════════════════════════════════════════════════╝
144
+
145
+ -> Executing task...
146
+ ```
147
+
148
+ ---
149
+
150
+ ## OUTPUT FORMAT:
151
+
152
+ ```
153
+ Task Loaded:
154
+
155
+ | Field | Value |
156
+ |-------|-------|
157
+ | Iteration | {current_iteration} / {max_iterations} |
158
+ | Task ID | {current_task_id} |
159
+ | Task | {current_task_description} |
160
+ | Progress | {tasks_completed} / {tasks_total} |
161
+
162
+ -> Executing...
163
+ ```
164
+
165
+ ---
166
+
167
+ ## NEXT STEP:
168
+
169
+ After task loaded, proceed to `./step-02-execute.md`
@@ -0,0 +1,173 @@
1
+ ---
2
+ name: step-02-execute
3
+ description: Execute ONE task from the task list
4
+ next_step: steps/step-03-commit.md
5
+ ---
6
+
7
+ # Step 2: Execute Task
8
+
9
+ ## YOUR TASK:
10
+
11
+ Execute exactly ONE task from prd.json. Do NOT batch multiple tasks.
12
+
13
+ **ULTRA THINK about the implementation.**
14
+
15
+ ---
16
+
17
+ ## EXECUTION RULES:
18
+
19
+ 1. **ONE TASK ONLY** - Execute only `{current_task_description}`
20
+ 2. **ATOMIC CHANGES** - Changes should be complete and working
21
+ 3. **USE MCP** - Validate with SmartStack MCP as needed
22
+ 4. **DOCUMENT** - Track what you're doing
23
+
24
+ ---
25
+
26
+ ## EXECUTION SEQUENCE:
27
+
28
+ ### 1. Understand the Task
29
+
30
+ **ULTRA THINK:**
31
+
32
+ - What exactly needs to be done?
33
+ - What files need to be created/modified?
34
+ - What are the success criteria?
35
+ - What patterns should be followed?
36
+
37
+ ### 2. Explore Context (if needed)
38
+
39
+ **Use subagents sparingly:**
40
+
41
+ ```
42
+ If exploration needed:
43
+ - Use explore-codebase agent for file discovery
44
+ - Use explore-docs agent for library docs
45
+ - Use Context7 MCP for documentation
46
+ ```
47
+
48
+ **Prefer direct tool usage:**
49
+ - Glob for file patterns
50
+ - Grep for code search
51
+ - Read for file contents
52
+
53
+ ### 3. Execute Implementation
54
+
55
+ **Implement the task:**
56
+
57
+ - Create/modify files as needed
58
+ - Follow existing patterns in codebase
59
+ - Use SmartStack conventions
60
+ - Add appropriate logging
61
+ - Handle errors properly
62
+
63
+ **Use TodoWrite to track sub-steps:**
64
+
65
+ ```
66
+ If task has multiple parts:
67
+ 1. Create TodoWrite entries for each part
68
+ 2. Mark in_progress as you work
69
+ 3. Mark completed when done
70
+ ```
71
+
72
+ ### 4. Validate with MCP
73
+
74
+ **After implementation, validate:**
75
+
76
+ ```
77
+ mcp__smartstack__validate_conventions:
78
+ checks: ["all"]
79
+ ```
80
+
81
+ **If validation fails:**
82
+ - Fix the issues
83
+ - Re-validate
84
+ - Do NOT proceed until valid
85
+
86
+ ### 5. Run Quick Tests
87
+
88
+ **If applicable:**
89
+
90
+ ```bash
91
+ # For backend changes
92
+ dotnet build src/SmartStack.Api/SmartStack.Api.csproj --no-restore
93
+
94
+ # For frontend changes
95
+ npm run lint && npm run typecheck
96
+
97
+ # For specific tests
98
+ dotnet test --filter "FullyQualifiedName~{relevant_test}"
99
+ ```
100
+
101
+ **If tests fail:**
102
+ - Fix the failing tests
103
+ - Re-run until passing
104
+ - Document what was fixed
105
+
106
+ ### 6. Track Progress
107
+
108
+ **Update internal state:**
109
+
110
+ ```
111
+ {files_created} = ["path/to/file1.cs", "path/to/file2.ts"]
112
+ {files_modified} = ["path/to/existing.cs"]
113
+ {tests_run} = true/false
114
+ {validation} = "passed" / "failed"
115
+ ```
116
+
117
+ ---
118
+
119
+ ## IMPORTANT CONSTRAINTS:
120
+
121
+ ### What TO DO:
122
+ - Implement exactly what the task describes
123
+ - Follow existing patterns
124
+ - Validate changes
125
+ - Write minimal, clean code
126
+
127
+ ### What NOT TO DO:
128
+ - Don't implement other tasks
129
+ - Don't refactor unrelated code
130
+ - Don't add "nice to have" features
131
+ - Don't skip validation
132
+
133
+ ---
134
+
135
+ ## OUTPUT FORMAT:
136
+
137
+ ```
138
+ Task Executed:
139
+
140
+ | Action | Details |
141
+ |--------|---------|
142
+ | Task | [{current_task_id}] {current_task_description} |
143
+ | Files Created | {files_created} |
144
+ | Files Modified | {files_modified} |
145
+ | Validation | ✅ Passed |
146
+ | Tests | ✅ Passed |
147
+
148
+ -> Committing changes...
149
+ ```
150
+
151
+ ---
152
+
153
+ ## ERROR HANDLING:
154
+
155
+ **If task cannot be completed:**
156
+
157
+ 1. Document the blocker
158
+ 2. Update progress.txt with learnings
159
+ 3. Mark task with a note (don't mark passes: true)
160
+ 4. Proceed to step-03 to save progress
161
+
162
+ **If build fails:**
163
+
164
+ 1. Analyze error messages
165
+ 2. Fix the issues
166
+ 3. Re-build until success
167
+ 4. Then proceed
168
+
169
+ ---
170
+
171
+ ## NEXT STEP:
172
+
173
+ After task executed and validated, proceed to `./step-03-commit.md`
@@ -0,0 +1,170 @@
1
+ ---
2
+ name: step-03-commit
3
+ description: Commit changes, update prd.json and progress.txt
4
+ next_step: steps/step-04-check.md
5
+ ---
6
+
7
+ # Step 3: Commit Changes
8
+
9
+ ## YOUR TASK:
10
+
11
+ Commit the changes from the executed task, update prd.json and progress.txt.
12
+
13
+ ---
14
+
15
+ ## EXECUTION SEQUENCE:
16
+
17
+ ### 1. Stage Changes
18
+
19
+ **Add modified files:**
20
+
21
+ ```bash
22
+ git add {files_created} {files_modified}
23
+ ```
24
+
25
+ **Verify staged changes:**
26
+
27
+ ```bash
28
+ git status
29
+ ```
30
+
31
+ ### 2. Create Commit
32
+
33
+ **Commit with descriptive message:**
34
+
35
+ ```bash
36
+ git commit -m "$(cat <<'EOF'
37
+ feat(ralph): {current_task_description}
38
+
39
+ Task {current_task_id}/{tasks_total} - Iteration {current_iteration}
40
+
41
+ Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
42
+ EOF
43
+ )"
44
+ ```
45
+
46
+ **Commit message format:**
47
+ - Type: `feat`, `fix`, `refactor`, `test`, `docs`
48
+ - Scope: `ralph` or specific module
49
+ - Description: Task description
50
+ - Footer: Iteration info
51
+
52
+ ### 3. Update prd.json
53
+
54
+ **Mark current task as complete:**
55
+
56
+ ```json
57
+ {
58
+ "feature": "{task_description}",
59
+ "current_iteration": {current_iteration + 1},
60
+ "tasks": [
61
+ { "id": 1, "description": "...", "passes": true }, // was false
62
+ { "id": 2, "description": "...", "passes": false } // next task
63
+ ]
64
+ }
65
+ ```
66
+
67
+ **Write updated prd.json:**
68
+
69
+ ```javascript
70
+ const prd = readJSON('.ralph/prd.json');
71
+ const task = prd.tasks.find(t => t.id === currentTaskId);
72
+ task.passes = true;
73
+ prd.current_iteration++;
74
+ writeJSON('.ralph/prd.json', prd);
75
+ ```
76
+
77
+ ### 4. Update progress.txt
78
+
79
+ **Append learnings to progress.txt:**
80
+
81
+ ```markdown
82
+ ---
83
+
84
+ ## Iteration {current_iteration}
85
+
86
+ ### Task Completed
87
+ [{current_task_id}] {current_task_description}
88
+
89
+ ### Files Changed
90
+ - Created: {files_created}
91
+ - Modified: {files_modified}
92
+
93
+ ### Learnings
94
+ {What was learned during this task}
95
+ {Any issues encountered and how they were resolved}
96
+ {Patterns discovered that might help future tasks}
97
+
98
+ ### Context for Next Task
99
+ {What the next iteration should know}
100
+ ```
101
+
102
+ ### 5. Verify Commit
103
+
104
+ **Check commit was created:**
105
+
106
+ ```bash
107
+ git log -1 --oneline
108
+ ```
109
+
110
+ **Expected output:**
111
+ ```
112
+ abc1234 feat(ralph): {current_task_description}
113
+ ```
114
+
115
+ ### 6. Log Activity (if verbose)
116
+
117
+ **If {verbose_mode} = true:**
118
+
119
+ Append to `.ralph/logs/{date}.log`:
120
+ ```
121
+ [{timestamp}] TASK COMPLETED
122
+ Task: [{current_task_id}] {current_task_description}
123
+ Commit: {commit_hash}
124
+ Files: {file_count} changed
125
+ Iteration: {current_iteration}
126
+ ```
127
+
128
+ ---
129
+
130
+ ## OUTPUT FORMAT:
131
+
132
+ ```
133
+ Changes Committed:
134
+
135
+ | Field | Value |
136
+ |-------|-------|
137
+ | Commit | {commit_hash} |
138
+ | Task | [{current_task_id}] ✅ |
139
+ | Iteration | {current_iteration} |
140
+ | Files | {file_count} changed |
141
+
142
+ prd.json: Updated task {current_task_id} to passes: true
143
+ progress.txt: Added iteration {current_iteration} learnings
144
+
145
+ -> Checking completion...
146
+ ```
147
+
148
+ ---
149
+
150
+ ## ERROR HANDLING:
151
+
152
+ **If commit fails (pre-commit hook):**
153
+
154
+ 1. Read hook error message
155
+ 2. Fix the issue (lint, format, etc.)
156
+ 3. Stage fixes
157
+ 4. Create NEW commit (don't amend)
158
+ 5. Proceed to step-04
159
+
160
+ **If prd.json write fails:**
161
+
162
+ 1. Log error
163
+ 2. Retry write
164
+ 3. If still fails, output error and stop
165
+
166
+ ---
167
+
168
+ ## NEXT STEP:
169
+
170
+ After commit and updates complete, proceed to `./step-04-check.md`