@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.
- package/.documentation/agents.html +1 -1
- package/.documentation/apex.html +1 -1
- package/.documentation/business-analyse.html +1 -1
- package/.documentation/cli-commands.html +3 -3
- package/.documentation/commands.html +1 -1
- package/.documentation/efcore.html +1 -1
- package/.documentation/gitflow.html +231 -236
- package/.documentation/hooks.html +1 -1
- package/.documentation/index.html +1 -1
- package/.documentation/init.html +3 -3
- package/.documentation/installation.html +1075 -351
- package/.documentation/ralph-loop.html +1 -1
- package/.documentation/test-web.html +1 -1
- package/README.md +88 -20
- package/config/default-config.json +10 -1
- package/dist/index.js +276 -85
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/agents/code-reviewer.md +163 -0
- package/templates/agents/efcore/db-deploy.md +25 -7
- package/templates/agents/efcore/db-reset.md +31 -10
- package/templates/agents/efcore/db-status.md +22 -5
- package/templates/agents/efcore/migration.md +70 -20
- package/templates/agents/gitflow/cleanup.md +8 -1
- package/templates/agents/gitflow/commit.md +7 -5
- package/templates/agents/gitflow/finish.md +6 -4
- package/templates/agents/gitflow/pr.md +8 -1
- package/templates/agents/gitflow/start.md +1 -1
- package/templates/commands/check-version.md +267 -0
- package/templates/commands/efcore/_shared.md +31 -2
- package/templates/commands/efcore/db-reset.md +18 -6
- package/templates/commands/efcore/migration.md +1 -1
- package/templates/commands/efcore/rebase-snapshot.md +1 -1
- package/templates/commands/efcore/squash.md +1 -0
- package/templates/commands/refactor.md +164 -0
- package/templates/project/DependencyInjection.Application.cs.template +25 -0
- package/templates/project/DependencyInjection.Infrastructure.cs.template +61 -0
- package/templates/project/DesignTimeExtensionsDbContextFactory.cs.template +70 -0
- package/templates/project/ExampleEntity.cs.template +116 -0
- package/templates/project/ExampleEntityConfiguration.cs.template +64 -0
- package/templates/project/ExampleService.cs.template +146 -0
- package/templates/project/ExtensionsDbContext.cs.template +41 -0
- package/templates/project/IExtensionsDbContext.cs.template +22 -0
- package/templates/project/Program.cs.template +47 -0
- package/templates/project/README.md +79 -0
- package/templates/ralph/README.md +10 -8
- package/templates/ralph/ralph.config.yaml +2 -2
- package/templates/skills/_shared.md +44 -44
- package/templates/skills/ai-prompt/SKILL.md +55 -55
- package/templates/skills/apex/SKILL.md +235 -0
- package/templates/skills/apex/steps/step-00-init.md +203 -0
- package/templates/skills/apex/steps/step-01-analyze.md +210 -0
- package/templates/skills/apex/steps/step-02-plan.md +217 -0
- package/templates/skills/apex/steps/step-03-execute.md +178 -0
- package/templates/skills/apex/steps/step-04-validate.md +217 -0
- package/templates/skills/apex/steps/step-05-examine.md +207 -0
- package/templates/skills/apex/steps/step-06-resolve.md +181 -0
- package/templates/skills/apex/steps/step-07-tests.md +206 -0
- package/templates/skills/apex/steps/step-08-run-tests.md +207 -0
- package/templates/skills/apex/templates/00-context.md +46 -0
- package/templates/skills/apex/templates/01-analyze.md +63 -0
- package/templates/skills/apex/templates/02-plan.md +63 -0
- package/templates/skills/apex/templates/03-execute.md +34 -0
- package/templates/skills/apex/templates/04-validate.md +61 -0
- package/templates/skills/apex/templates/05-examine.md +58 -0
- package/templates/skills/apex/templates/06-resolve.md +39 -0
- package/templates/skills/apex/templates/07-tests.md +56 -0
- package/templates/skills/apex/templates/08-run-tests.md +41 -0
- package/templates/skills/apex/templates/README.md +69 -0
- package/templates/skills/application/SKILL.md +50 -50
- package/templates/skills/application/templates-backend.md +25 -25
- package/templates/skills/application/templates-frontend.md +43 -43
- package/templates/skills/application/templates-i18n.md +29 -29
- package/templates/skills/application/templates-seed.md +77 -77
- package/templates/skills/business-analyse/SKILL.md +223 -0
- package/templates/skills/business-analyse/_shared.md +258 -0
- package/templates/skills/business-analyse/questionnaire/01-context.md +33 -0
- package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +35 -0
- package/templates/skills/business-analyse/questionnaire/03-scope.md +35 -0
- package/templates/skills/business-analyse/questionnaire/04-data.md +36 -0
- package/templates/skills/business-analyse/questionnaire/05-integrations.md +36 -0
- package/templates/skills/business-analyse/questionnaire/06-security.md +40 -0
- package/templates/skills/business-analyse/questionnaire/07-ui.md +36 -0
- package/templates/skills/business-analyse/questionnaire/08-performance.md +35 -0
- package/templates/skills/business-analyse/questionnaire/09-constraints.md +35 -0
- package/templates/skills/business-analyse/questionnaire/10-documentation.md +35 -0
- package/templates/skills/business-analyse/questionnaire.md +177 -177
- package/templates/skills/business-analyse/react/components.md +340 -0
- package/templates/skills/business-analyse/react/i18n-template.md +245 -0
- package/templates/skills/business-analyse/react/schema.md +151 -0
- package/templates/skills/business-analyse/steps/step-00-init.md +293 -0
- package/templates/skills/business-analyse/steps/step-01-discover.md +267 -0
- package/templates/skills/business-analyse/steps/step-02-analyse.md +243 -0
- package/templates/skills/business-analyse/steps/step-03-specify.md +317 -0
- package/templates/skills/business-analyse/steps/step-04-validate.md +239 -0
- package/templates/skills/business-analyse/steps/step-05-handoff.md +336 -0
- package/templates/skills/business-analyse/steps/step-06-doc-html.md +261 -0
- package/templates/skills/business-analyse/templates/00-context.md +105 -0
- package/templates/skills/business-analyse/templates/frd-brd.md +97 -0
- package/templates/skills/business-analyse/templates/frd-discovery.md +78 -0
- package/templates/skills/business-analyse/templates/frd-handoff.md +118 -0
- package/templates/skills/business-analyse/templates/frd-spec.md +168 -0
- package/templates/skills/business-analyse/templates-frd.md +217 -217
- package/templates/skills/business-analyse/templates-react.md +26 -26
- package/templates/skills/controller/SKILL.md +141 -92
- package/templates/skills/controller/postman-templates.md +15 -15
- package/templates/skills/controller/steps/step-00-init.md +191 -0
- package/templates/skills/controller/steps/step-01-analyze.md +146 -0
- package/templates/skills/controller/steps/step-02-plan.md +176 -0
- package/templates/skills/controller/steps/step-03-generate.md +219 -0
- package/templates/skills/controller/steps/step-04-perms.md +219 -0
- package/templates/skills/controller/steps/step-05-validate.md +107 -0
- package/templates/skills/controller/templates.md +77 -77
- package/templates/skills/documentation/SKILL.md +79 -79
- package/templates/skills/feature-full/SKILL.md +38 -38
- package/templates/skills/gitflow/SKILL.md +277 -0
- package/templates/{commands → skills}/gitflow/_shared.md +20 -20
- package/templates/skills/gitflow/phases/abort.md +173 -0
- package/templates/skills/gitflow/phases/cleanup.md +226 -0
- package/templates/skills/gitflow/phases/status.md +178 -0
- package/templates/skills/gitflow/steps/step-commit.md +255 -0
- package/templates/skills/gitflow/steps/step-finish.md +255 -0
- package/templates/skills/gitflow/steps/step-init.md +209 -0
- package/templates/skills/gitflow/steps/step-merge.md +225 -0
- package/templates/skills/gitflow/steps/step-plan.md +208 -0
- package/templates/skills/gitflow/steps/step-pr.md +235 -0
- package/templates/skills/gitflow/steps/step-start.md +334 -0
- package/templates/skills/gitflow/steps/step-sync.md +200 -0
- package/templates/skills/gitflow/templates/config.json +53 -0
- package/templates/skills/notification/SKILL.md +51 -51
- package/templates/skills/ralph-loop/SKILL.md +228 -0
- package/templates/skills/ralph-loop/steps/step-00-init.md +201 -0
- package/templates/skills/ralph-loop/steps/step-01-task.md +169 -0
- package/templates/skills/ralph-loop/steps/step-02-execute.md +173 -0
- package/templates/skills/ralph-loop/steps/step-03-commit.md +170 -0
- package/templates/skills/ralph-loop/steps/step-04-check.md +162 -0
- package/templates/skills/ralph-loop/steps/step-05-report.md +181 -0
- package/templates/skills/review-code/SKILL.md +219 -0
- package/templates/skills/review-code/references/clean-code-principles.md +140 -0
- package/templates/skills/review-code/references/code-quality-metrics.md +174 -0
- package/templates/skills/review-code/references/feedback-patterns.md +149 -0
- package/templates/skills/review-code/references/security-checklist.md +127 -0
- package/templates/skills/ui-components/SKILL.md +54 -54
- package/templates/skills/workflow/SKILL.md +46 -46
- package/templates/commands/ai-prompt.md +0 -315
- package/templates/commands/apex/1-analyze.md +0 -100
- package/templates/commands/apex/2-plan.md +0 -145
- package/templates/commands/apex/3-execute.md +0 -171
- package/templates/commands/apex/4-examine.md +0 -116
- package/templates/commands/apex/5-tasks.md +0 -209
- package/templates/commands/apex.md +0 -76
- package/templates/commands/application/create.md +0 -362
- package/templates/commands/application/templates-backend.md +0 -463
- package/templates/commands/application/templates-frontend.md +0 -517
- package/templates/commands/application/templates-i18n.md +0 -478
- package/templates/commands/application/templates-seed.md +0 -362
- package/templates/commands/application.md +0 -303
- package/templates/commands/business-analyse/0-orchestrate.md +0 -156
- package/templates/commands/business-analyse/1-init.md +0 -99
- package/templates/commands/business-analyse/2-discover.md +0 -143
- package/templates/commands/business-analyse/3-analyse.md +0 -106
- package/templates/commands/business-analyse/4-specify.md +0 -133
- package/templates/commands/business-analyse/5-validate.md +0 -132
- package/templates/commands/business-analyse/6-handoff.md +0 -157
- package/templates/commands/business-analyse/7-doc-html.md +0 -103
- package/templates/commands/business-analyse/_shared.md +0 -176
- package/templates/commands/business-analyse/bug.md +0 -118
- package/templates/commands/business-analyse/change-request.md +0 -144
- package/templates/commands/business-analyse/hotfix.md +0 -116
- package/templates/commands/business-analyse.md +0 -121
- package/templates/commands/controller/create.md +0 -216
- package/templates/commands/controller/postman-templates.md +0 -528
- package/templates/commands/controller/templates.md +0 -600
- package/templates/commands/controller.md +0 -337
- package/templates/commands/create/agent.md +0 -138
- package/templates/commands/create/command.md +0 -166
- package/templates/commands/create/hook.md +0 -234
- package/templates/commands/create/plugin.md +0 -329
- package/templates/commands/create/project.md +0 -508
- package/templates/commands/create/skill.md +0 -199
- package/templates/commands/create.md +0 -220
- package/templates/commands/documentation/module.md +0 -202
- package/templates/commands/documentation/templates.md +0 -432
- package/templates/commands/documentation.md +0 -190
- package/templates/commands/epct.md +0 -69
- package/templates/commands/explain.md +0 -186
- package/templates/commands/feature-full.md +0 -267
- package/templates/commands/gitflow/1-init.md +0 -188
- package/templates/commands/gitflow/10-start.md +0 -190
- package/templates/commands/gitflow/11-finish.md +0 -382
- package/templates/commands/gitflow/12-cleanup.md +0 -103
- package/templates/commands/gitflow/13-sync.md +0 -216
- package/templates/commands/gitflow/14-rebase.md +0 -251
- package/templates/commands/gitflow/2-status.md +0 -122
- package/templates/commands/gitflow/3-commit.md +0 -209
- package/templates/commands/gitflow/4-plan.md +0 -174
- package/templates/commands/gitflow/5-exec.md +0 -202
- package/templates/commands/gitflow/6-abort.md +0 -121
- package/templates/commands/gitflow/7-pull-request.md +0 -176
- package/templates/commands/gitflow/8-review.md +0 -113
- package/templates/commands/gitflow/9-merge.md +0 -157
- package/templates/commands/gitflow.md +0 -128
- package/templates/commands/implement.md +0 -663
- package/templates/commands/init.md +0 -567
- package/templates/commands/mcp-integration.md +0 -330
- package/templates/commands/notification.md +0 -129
- package/templates/commands/oneshot.md +0 -57
- package/templates/commands/quickstart.md +0 -154
- package/templates/commands/ralph-loop/cancel-ralph.md +0 -18
- package/templates/commands/ralph-loop/help.md +0 -126
- package/templates/commands/ralph-loop/ralph-loop.md +0 -120
- package/templates/commands/review.md +0 -106
- package/templates/commands/workflow.md +0 -193
- package/templates/gitflow/config.json +0 -138
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: step-00-init
|
|
3
|
+
description: Initialize APEX workflow - parse flags, detect continuation, setup state
|
|
4
|
+
next_step: steps/step-01-analyze.md
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Step 0: Initialization
|
|
8
|
+
|
|
9
|
+
## MANDATORY EXECUTION RULES:
|
|
10
|
+
|
|
11
|
+
- NEVER skip flag parsing
|
|
12
|
+
- ALWAYS parse ALL flags before any other action
|
|
13
|
+
- ONLY check for resume if {resume_task} 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 APEX workflow by parsing flags, detecting continuation state, and setting up the execution environment.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
<defaults>
|
|
24
|
+
## Default Configuration
|
|
25
|
+
|
|
26
|
+
```yaml
|
|
27
|
+
auto_mode: false # -a: Skip confirmations
|
|
28
|
+
examine_mode: false # -x: Auto-proceed to adversarial review
|
|
29
|
+
save_mode: false # -s: Save outputs to .claude/output/apex/
|
|
30
|
+
test_mode: false # -t: Include test creation and runner steps
|
|
31
|
+
economy_mode: false # -e: No subagents, save tokens
|
|
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
|
+
{auto_mode} = false
|
|
45
|
+
{examine_mode} = false
|
|
46
|
+
{save_mode} = false
|
|
47
|
+
{test_mode} = false
|
|
48
|
+
{economy_mode} = false
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Step 2: Parse user input and override defaults:**
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
Enable flags (lowercase - turn ON):
|
|
55
|
+
-a or --auto -> {auto_mode} = true
|
|
56
|
+
-x or --examine -> {examine_mode} = true
|
|
57
|
+
-s or --save -> {save_mode} = true
|
|
58
|
+
-t or --test -> {test_mode} = true
|
|
59
|
+
-e or --economy -> {economy_mode} = true
|
|
60
|
+
|
|
61
|
+
Disable flags (UPPERCASE - turn OFF):
|
|
62
|
+
-A or --no-auto -> {auto_mode} = false
|
|
63
|
+
-X or --no-examine -> {examine_mode} = false
|
|
64
|
+
-S or --no-save -> {save_mode} = false
|
|
65
|
+
-T or --no-test -> {test_mode} = false
|
|
66
|
+
-E or --no-economy -> {economy_mode} = false
|
|
67
|
+
|
|
68
|
+
Other:
|
|
69
|
+
-r or --resume -> {resume_task} = <next argument>
|
|
70
|
+
-i or --interactive -> {interactive_mode} = true
|
|
71
|
+
Remainder -> {task_description}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Step 3: Generate feature_name and task_id:**
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
{feature_name} = kebab-case-description
|
|
78
|
+
Example: "add user authentication" -> "add-user-authentication"
|
|
79
|
+
|
|
80
|
+
{task_id} = NN-{feature_name}
|
|
81
|
+
- Auto-detect next available number from .claude/output/apex/
|
|
82
|
+
- Example: "01-add-user-authentication"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 2. Check Resume Mode
|
|
86
|
+
|
|
87
|
+
**ONLY execute if {resume_task} is set!**
|
|
88
|
+
|
|
89
|
+
If `{resume_task}` is set:
|
|
90
|
+
|
|
91
|
+
1. Search for matching task in `.claude/output/apex/`
|
|
92
|
+
2. If found: Read `00-context.md` to restore state variables
|
|
93
|
+
3. Find last completed step (look for "Status: Complete" markers)
|
|
94
|
+
4. Load next incomplete step
|
|
95
|
+
5. **STOP** - do not continue with fresh init
|
|
96
|
+
|
|
97
|
+
If no match found: List available tasks and ask user to specify.
|
|
98
|
+
|
|
99
|
+
### 3. Interactive Mode (if -i flag)
|
|
100
|
+
|
|
101
|
+
If `{interactive_mode}` = true:
|
|
102
|
+
|
|
103
|
+
```yaml
|
|
104
|
+
questions:
|
|
105
|
+
- header: "Configure"
|
|
106
|
+
question: "Select flags to enable for this workflow:"
|
|
107
|
+
options:
|
|
108
|
+
- label: "Auto mode (-a)"
|
|
109
|
+
description: "Skip all confirmations, use recommended options"
|
|
110
|
+
- label: "Examine mode (-x)"
|
|
111
|
+
description: "Include adversarial code review at end"
|
|
112
|
+
- label: "Save mode (-s)"
|
|
113
|
+
description: "Save all outputs to .claude/output/apex/"
|
|
114
|
+
- label: "Test mode (-t)"
|
|
115
|
+
description: "Include test creation and runner steps"
|
|
116
|
+
- label: "Economy mode (-e)"
|
|
117
|
+
description: "No subagents, direct tools only (saves tokens)"
|
|
118
|
+
multiSelect: true
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 4. Create Output Structure (if save_mode)
|
|
122
|
+
|
|
123
|
+
**If `{save_mode}` = true:**
|
|
124
|
+
|
|
125
|
+
1. Create directory: `.claude/output/apex/{task_id}/`
|
|
126
|
+
|
|
127
|
+
2. Write `00-context.md`:
|
|
128
|
+
|
|
129
|
+
```markdown
|
|
130
|
+
# APEX Task: {task_id}
|
|
131
|
+
|
|
132
|
+
**Created:** {timestamp}
|
|
133
|
+
**Task:** {task_description}
|
|
134
|
+
|
|
135
|
+
## Configuration
|
|
136
|
+
|
|
137
|
+
| Flag | Value |
|
|
138
|
+
|------|-------|
|
|
139
|
+
| Auto mode | {auto_mode} |
|
|
140
|
+
| Examine mode | {examine_mode} |
|
|
141
|
+
| Save mode | {save_mode} |
|
|
142
|
+
| Test mode | {test_mode} |
|
|
143
|
+
| Economy mode | {economy_mode} |
|
|
144
|
+
|
|
145
|
+
## User Request
|
|
146
|
+
|
|
147
|
+
{original user input}
|
|
148
|
+
|
|
149
|
+
## Acceptance Criteria
|
|
150
|
+
|
|
151
|
+
_To be defined in step-01-analyze_
|
|
152
|
+
|
|
153
|
+
## Progress
|
|
154
|
+
|
|
155
|
+
| Step | Status |
|
|
156
|
+
|------|--------|
|
|
157
|
+
| 00-init | In Progress |
|
|
158
|
+
| 01-analyze | Pending |
|
|
159
|
+
| 02-plan | Pending |
|
|
160
|
+
| 03-execute | Pending |
|
|
161
|
+
| 04-validate | Pending |
|
|
162
|
+
| 05-examine | {examine_mode ? "Pending" : "Skip"} |
|
|
163
|
+
| 06-resolve | {examine_mode ? "Pending" : "Skip"} |
|
|
164
|
+
| 07-tests | {test_mode ? "Pending" : "Skip"} |
|
|
165
|
+
| 08-run-tests | {test_mode ? "Pending" : "Skip"} |
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
3. Mark 00-init as Complete in the Progress table
|
|
169
|
+
|
|
170
|
+
### 5. Show Summary and Proceed
|
|
171
|
+
|
|
172
|
+
**Always show COMPACT summary:**
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
APEX: {task_description}
|
|
176
|
+
|
|
177
|
+
| Variable | Value |
|
|
178
|
+
|----------|-------|
|
|
179
|
+
| {task_id} | 01-kebab-name |
|
|
180
|
+
| {auto_mode} | true/false |
|
|
181
|
+
| {examine_mode} | true/false |
|
|
182
|
+
| {save_mode} | true/false |
|
|
183
|
+
| {test_mode} | true/false |
|
|
184
|
+
| {economy_mode} | true/false |
|
|
185
|
+
|
|
186
|
+
-> Analyzing...
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Then proceed directly to step-01-analyze.md**
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## SUCCESS METRICS:
|
|
194
|
+
|
|
195
|
+
- All flags correctly parsed
|
|
196
|
+
- Output is COMPACT (one table, no verbose logs)
|
|
197
|
+
- Variables shown with `{brackets}` notation
|
|
198
|
+
- Proceeded to step-01 immediately after summary
|
|
199
|
+
- Output folder created with 00-context.md (if save_mode)
|
|
200
|
+
|
|
201
|
+
## NEXT STEP:
|
|
202
|
+
|
|
203
|
+
After showing initialization summary, always proceed directly to `./step-01-analyze.md`
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: step-01-analyze
|
|
3
|
+
description: Pure context gathering - explore codebase to understand WHAT EXISTS
|
|
4
|
+
next_step: steps/step-02-plan.md
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Step 1: Analyze (Context Gathering)
|
|
8
|
+
|
|
9
|
+
## MANDATORY EXECUTION RULES:
|
|
10
|
+
|
|
11
|
+
- NEVER plan or design solutions - that's step 2
|
|
12
|
+
- NEVER create todos or implementation tasks
|
|
13
|
+
- NEVER decide HOW to implement anything
|
|
14
|
+
- ALWAYS focus on discovering WHAT EXISTS
|
|
15
|
+
- ALWAYS report findings with file paths and line numbers
|
|
16
|
+
- YOU ARE AN EXPLORER, not a planner
|
|
17
|
+
- FORBIDDEN to suggest implementations or approaches
|
|
18
|
+
|
|
19
|
+
## YOUR TASK:
|
|
20
|
+
|
|
21
|
+
Gather ALL relevant context about WHAT CURRENTLY EXISTS in the codebase related to the task.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
<available_state>
|
|
26
|
+
From step-00-init:
|
|
27
|
+
|
|
28
|
+
| Variable | Description |
|
|
29
|
+
|----------|-------------|
|
|
30
|
+
| `{task_description}` | What to implement |
|
|
31
|
+
| `{task_id}` | Kebab-case identifier |
|
|
32
|
+
| `{auto_mode}` | Skip confirmations |
|
|
33
|
+
| `{examine_mode}` | Auto-proceed to review |
|
|
34
|
+
| `{save_mode}` | Save outputs to files |
|
|
35
|
+
| `{test_mode}` | Include test steps |
|
|
36
|
+
| `{economy_mode}` | No subagents, direct tools |
|
|
37
|
+
| `{output_dir}` | Path to output (if save_mode) |
|
|
38
|
+
</available_state>
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## EXECUTION SEQUENCE:
|
|
43
|
+
|
|
44
|
+
### 1. Extract Search Keywords
|
|
45
|
+
|
|
46
|
+
From the task description, identify:
|
|
47
|
+
- **Domain terms**: auth, user, payment, etc.
|
|
48
|
+
- **Technical terms**: API, route, component, etc.
|
|
49
|
+
- **Action hints**: create, update, fix, add, etc.
|
|
50
|
+
|
|
51
|
+
These keywords guide exploration - NOT planning.
|
|
52
|
+
|
|
53
|
+
### 2. Explore Codebase
|
|
54
|
+
|
|
55
|
+
**If `{economy_mode}` = true:**
|
|
56
|
+
|
|
57
|
+
Use direct tools only:
|
|
58
|
+
1. Glob to find files: `**/*{keyword}*`
|
|
59
|
+
2. Grep to search content in likely locations
|
|
60
|
+
3. Read the most relevant 3-5 files
|
|
61
|
+
4. Skip web research unless stuck
|
|
62
|
+
|
|
63
|
+
**If `{economy_mode}` = false:**
|
|
64
|
+
|
|
65
|
+
Launch parallel exploration agents in a SINGLE message:
|
|
66
|
+
|
|
67
|
+
**Agent 1: Codebase Exploration** (`explore-codebase`)
|
|
68
|
+
```
|
|
69
|
+
Find existing code related to: {task_description}
|
|
70
|
+
|
|
71
|
+
Report ONLY what exists:
|
|
72
|
+
1. Files that contain related code (with paths and line numbers)
|
|
73
|
+
2. Existing patterns used for similar features
|
|
74
|
+
3. Utility functions that might be relevant
|
|
75
|
+
4. How similar features are currently structured
|
|
76
|
+
5. Test file locations and patterns
|
|
77
|
+
|
|
78
|
+
DO NOT suggest what to build. Just report what's there.
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Agent 2: Documentation Research** (`explore-docs`)
|
|
82
|
+
```
|
|
83
|
+
Research documentation for libraries used in: {task_description}
|
|
84
|
+
|
|
85
|
+
Find:
|
|
86
|
+
1. How the relevant libraries/frameworks work
|
|
87
|
+
2. API documentation for tools being used
|
|
88
|
+
3. Best practices from official docs
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Agent 3: Web Research** (`websearch`)
|
|
92
|
+
```
|
|
93
|
+
Search for context about: {task_description}
|
|
94
|
+
|
|
95
|
+
Find:
|
|
96
|
+
1. How this is typically implemented
|
|
97
|
+
2. Common patterns and approaches
|
|
98
|
+
3. Known pitfalls or gotchas
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 3. Synthesize Findings
|
|
102
|
+
|
|
103
|
+
Combine results into structured context:
|
|
104
|
+
|
|
105
|
+
```markdown
|
|
106
|
+
## Codebase Context
|
|
107
|
+
|
|
108
|
+
### Related Files Found
|
|
109
|
+
| File | Lines | Contains |
|
|
110
|
+
|------|-------|----------|
|
|
111
|
+
| `src/auth/login.ts` | 1-150 | Existing login implementation |
|
|
112
|
+
| `src/utils/validate.ts` | 20-45 | Email validation helper |
|
|
113
|
+
|
|
114
|
+
### Patterns Observed
|
|
115
|
+
- **Route pattern**: Uses Next.js App Router with `route.ts`
|
|
116
|
+
- **Validation**: Uses zod schemas in `schemas/` folder
|
|
117
|
+
- **Error handling**: Throws custom ApiError classes
|
|
118
|
+
|
|
119
|
+
### Utilities Available
|
|
120
|
+
- `src/lib/auth.ts` - JWT sign/verify functions
|
|
121
|
+
- `src/lib/db.ts` - Prisma client instance
|
|
122
|
+
|
|
123
|
+
### Similar Implementations
|
|
124
|
+
- `src/auth/login.ts:42` - Login flow (reference for patterns)
|
|
125
|
+
|
|
126
|
+
### Test Patterns
|
|
127
|
+
- Tests in `__tests__/` folders
|
|
128
|
+
- Uses vitest with testing-library
|
|
129
|
+
|
|
130
|
+
## Documentation Insights
|
|
131
|
+
|
|
132
|
+
### Libraries Used
|
|
133
|
+
- **jose**: JWT library - uses `SignJWT` class
|
|
134
|
+
- **prisma**: ORM - uses `prisma.user.create()` pattern
|
|
135
|
+
|
|
136
|
+
## Research Findings
|
|
137
|
+
|
|
138
|
+
### Common Approaches
|
|
139
|
+
- Registration: validate -> hash -> create -> issue token
|
|
140
|
+
- Use httpOnly cookies for tokens
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### 4. Infer Acceptance Criteria
|
|
144
|
+
|
|
145
|
+
Based on task and context, infer success criteria:
|
|
146
|
+
|
|
147
|
+
```markdown
|
|
148
|
+
## Inferred Acceptance Criteria
|
|
149
|
+
|
|
150
|
+
Based on "{task_description}" and existing patterns:
|
|
151
|
+
|
|
152
|
+
- [ ] AC1: [specific measurable outcome]
|
|
153
|
+
- [ ] AC2: [specific measurable outcome]
|
|
154
|
+
- [ ] AC3: [specific measurable outcome]
|
|
155
|
+
|
|
156
|
+
_These will be refined in the planning step._
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### 5. Save Output (if save_mode)
|
|
160
|
+
|
|
161
|
+
**If `{save_mode}` = true:**
|
|
162
|
+
|
|
163
|
+
Write findings to `{output_dir}/01-analyze.md`:
|
|
164
|
+
- Include all sections above
|
|
165
|
+
- Add timestamp at the end
|
|
166
|
+
- Update 00-context.md Progress table: 01-analyze -> Complete
|
|
167
|
+
|
|
168
|
+
### 6. Present Context Summary
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
**Context Gathering Complete**
|
|
172
|
+
|
|
173
|
+
**Files analyzed:** {count}
|
|
174
|
+
**Patterns identified:** {count}
|
|
175
|
+
**Utilities found:** {count}
|
|
176
|
+
|
|
177
|
+
**Key findings:**
|
|
178
|
+
- {summary of relevant files}
|
|
179
|
+
- {patterns that will guide implementation}
|
|
180
|
+
|
|
181
|
+
-> Proceeding to planning phase...
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Always proceed directly to step-02-plan.md**
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## SUCCESS METRICS:
|
|
189
|
+
|
|
190
|
+
- Related files identified with paths and line numbers
|
|
191
|
+
- Existing patterns documented with specific examples
|
|
192
|
+
- Available utilities noted
|
|
193
|
+
- Dependencies listed
|
|
194
|
+
- Acceptance criteria inferred
|
|
195
|
+
- NO planning or implementation decisions made
|
|
196
|
+
|
|
197
|
+
## FAILURE MODES:
|
|
198
|
+
|
|
199
|
+
- Starting to plan or design (that's step 2!)
|
|
200
|
+
- Suggesting implementations or approaches
|
|
201
|
+
- Missing obvious related files
|
|
202
|
+
- Not documenting patterns with file:line references
|
|
203
|
+
- Launching agents sequentially instead of parallel
|
|
204
|
+
- Using subagents when economy_mode is true
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## NEXT STEP:
|
|
209
|
+
|
|
210
|
+
Always proceed directly to `./step-02-plan.md` after presenting context summary.
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: step-02-plan
|
|
3
|
+
description: Strategic planning - create detailed file-by-file implementation strategy
|
|
4
|
+
prev_step: steps/step-01-analyze.md
|
|
5
|
+
next_step: steps/step-03-execute.md
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Step 2: Plan (Strategic Design)
|
|
9
|
+
|
|
10
|
+
## MANDATORY EXECUTION RULES:
|
|
11
|
+
|
|
12
|
+
- NEVER start implementing - that's step 3
|
|
13
|
+
- NEVER write or modify code in this step
|
|
14
|
+
- ALWAYS structure plan by FILE, not by feature
|
|
15
|
+
- ALWAYS include specific line numbers from analysis
|
|
16
|
+
- ALWAYS map acceptance criteria to file changes
|
|
17
|
+
- YOU ARE A PLANNER, not an implementer
|
|
18
|
+
- FORBIDDEN to use Edit, Write, or Bash tools
|
|
19
|
+
|
|
20
|
+
## YOUR TASK:
|
|
21
|
+
|
|
22
|
+
Transform analysis findings into a comprehensive, executable, file-by-file implementation plan.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
<available_state>
|
|
27
|
+
From previous steps:
|
|
28
|
+
|
|
29
|
+
| Variable | Description |
|
|
30
|
+
|----------|-------------|
|
|
31
|
+
| `{task_description}` | What to implement |
|
|
32
|
+
| `{task_id}` | Kebab-case identifier |
|
|
33
|
+
| `{acceptance_criteria}` | Success criteria from step-01 |
|
|
34
|
+
| `{auto_mode}` | Skip confirmations |
|
|
35
|
+
| `{save_mode}` | Save outputs to files |
|
|
36
|
+
| `{output_dir}` | Path to output (if save_mode) |
|
|
37
|
+
| Files found | From step-01 codebase exploration |
|
|
38
|
+
| Patterns | From step-01 pattern analysis |
|
|
39
|
+
| Utilities | From step-01 utility discovery |
|
|
40
|
+
</available_state>
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## EXECUTION SEQUENCE:
|
|
45
|
+
|
|
46
|
+
### 1. ULTRA THINK: Design Complete Strategy
|
|
47
|
+
|
|
48
|
+
**CRITICAL: Think through ENTIRE implementation before writing any plan.**
|
|
49
|
+
|
|
50
|
+
Mental simulation:
|
|
51
|
+
- Walk through the implementation step by step
|
|
52
|
+
- Identify all files that need changes
|
|
53
|
+
- Determine logical order (dependencies first)
|
|
54
|
+
- Consider edge cases and error handling
|
|
55
|
+
- Plan test coverage
|
|
56
|
+
|
|
57
|
+
### 2. Clarify Ambiguities
|
|
58
|
+
|
|
59
|
+
**If `{auto_mode}` = true:**
|
|
60
|
+
Use recommended option for any ambiguity, proceed automatically.
|
|
61
|
+
|
|
62
|
+
**If `{auto_mode}` = false AND multiple valid approaches exist:**
|
|
63
|
+
|
|
64
|
+
```yaml
|
|
65
|
+
questions:
|
|
66
|
+
- header: "Approach"
|
|
67
|
+
question: "Multiple approaches are possible. Which should we use?"
|
|
68
|
+
options:
|
|
69
|
+
- label: "Approach A (Recommended)"
|
|
70
|
+
description: "Description and tradeoffs of A"
|
|
71
|
+
- label: "Approach B"
|
|
72
|
+
description: "Description and tradeoffs of B"
|
|
73
|
+
- label: "Approach C"
|
|
74
|
+
description: "Description and tradeoffs of C"
|
|
75
|
+
multiSelect: false
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 3. Create Detailed Plan
|
|
79
|
+
|
|
80
|
+
**Structure by FILE, not by feature:**
|
|
81
|
+
|
|
82
|
+
```markdown
|
|
83
|
+
## Implementation Plan: {task_description}
|
|
84
|
+
|
|
85
|
+
### Overview
|
|
86
|
+
[1-2 sentences: High-level strategy and approach]
|
|
87
|
+
|
|
88
|
+
### Prerequisites
|
|
89
|
+
- [ ] Prerequisite 1 (if any)
|
|
90
|
+
- [ ] Prerequisite 2 (if any)
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
### File Changes
|
|
95
|
+
|
|
96
|
+
#### `src/path/file1.ts`
|
|
97
|
+
- Add `functionName` that handles X
|
|
98
|
+
- Extract logic from Y (follow pattern in `example.ts:45`)
|
|
99
|
+
- Handle error case: [specific scenario]
|
|
100
|
+
- Consider: [edge case or important context]
|
|
101
|
+
|
|
102
|
+
#### `src/path/file2.ts`
|
|
103
|
+
- Update imports to include new module
|
|
104
|
+
- Call `functionName` in existing flow at line ~42
|
|
105
|
+
- Update types: Add `NewType` interface
|
|
106
|
+
|
|
107
|
+
#### `src/path/file3.ts` (NEW FILE)
|
|
108
|
+
- Create utility for Z
|
|
109
|
+
- Export: `utilityFunction`, `HelperType`
|
|
110
|
+
- Pattern: Follow `similar-util.ts` structure
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
### Testing Strategy
|
|
115
|
+
|
|
116
|
+
**New tests:**
|
|
117
|
+
- `src/path/file1.test.ts` - Test functionName with:
|
|
118
|
+
- Happy path
|
|
119
|
+
- Error case
|
|
120
|
+
- Edge case
|
|
121
|
+
|
|
122
|
+
**Update existing:**
|
|
123
|
+
- `src/path/existing.test.ts` - Add test for new flow
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
### Acceptance Criteria Mapping
|
|
128
|
+
- [ ] AC1: Satisfied by changes in `file1.ts`
|
|
129
|
+
- [ ] AC2: Satisfied by changes in `file2.ts`
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
### Risks & Considerations
|
|
134
|
+
- Risk 1: [potential issue and mitigation]
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### 4. Verify Plan Completeness
|
|
138
|
+
|
|
139
|
+
Checklist:
|
|
140
|
+
- [ ] All files identified - nothing missing
|
|
141
|
+
- [ ] Logical order - dependencies handled first
|
|
142
|
+
- [ ] Clear actions - every step specific and actionable
|
|
143
|
+
- [ ] Test coverage - all paths have test strategy
|
|
144
|
+
- [ ] In scope - no scope creep
|
|
145
|
+
- [ ] AC mapped - every criterion has implementation
|
|
146
|
+
|
|
147
|
+
### 5. Save Plan (if save_mode)
|
|
148
|
+
|
|
149
|
+
**If `{save_mode}` = true:**
|
|
150
|
+
|
|
151
|
+
Write plan to `{output_dir}/02-plan.md`:
|
|
152
|
+
- Include full plan above
|
|
153
|
+
- Add timestamp
|
|
154
|
+
- Update 00-context.md Progress table: 02-plan -> Complete
|
|
155
|
+
|
|
156
|
+
### 6. Present Plan for Approval
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
**Implementation Plan Ready**
|
|
160
|
+
|
|
161
|
+
**Overview:** [1 sentence summary]
|
|
162
|
+
|
|
163
|
+
**Files to modify:** {count} files
|
|
164
|
+
**New files:** {count} files
|
|
165
|
+
**Tests:** {count} test files
|
|
166
|
+
|
|
167
|
+
**Estimated changes:**
|
|
168
|
+
- `file1.ts` - Major changes (add function, handle errors)
|
|
169
|
+
- `file2.ts` - Minor changes (imports, single call)
|
|
170
|
+
- `file1.test.ts` - New test file
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**If `{auto_mode}` = true:**
|
|
174
|
+
Skip confirmation, proceed directly to execution.
|
|
175
|
+
|
|
176
|
+
**If `{auto_mode}` = false:**
|
|
177
|
+
|
|
178
|
+
```yaml
|
|
179
|
+
questions:
|
|
180
|
+
- header: "Plan"
|
|
181
|
+
question: "Review the implementation plan. Ready to proceed?"
|
|
182
|
+
options:
|
|
183
|
+
- label: "Approve and execute (Recommended)"
|
|
184
|
+
description: "Plan looks good, start implementation"
|
|
185
|
+
- label: "Adjust plan"
|
|
186
|
+
description: "I want to modify specific parts"
|
|
187
|
+
- label: "Ask questions"
|
|
188
|
+
description: "I have questions about the plan"
|
|
189
|
+
- label: "Start over"
|
|
190
|
+
description: "Revise the entire plan"
|
|
191
|
+
multiSelect: false
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## SUCCESS METRICS:
|
|
197
|
+
|
|
198
|
+
- Complete file-by-file plan created
|
|
199
|
+
- Logical dependency order established
|
|
200
|
+
- All acceptance criteria mapped to changes
|
|
201
|
+
- Test strategy defined
|
|
202
|
+
- User approved plan (or auto-approved)
|
|
203
|
+
- NO code written or modified
|
|
204
|
+
|
|
205
|
+
## FAILURE MODES:
|
|
206
|
+
|
|
207
|
+
- Organizing by feature instead of file
|
|
208
|
+
- Vague actions like "add feature" or "fix issue"
|
|
209
|
+
- Missing test strategy
|
|
210
|
+
- Not mapping to acceptance criteria
|
|
211
|
+
- Starting to write code (that's step 3!)
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## NEXT STEP:
|
|
216
|
+
|
|
217
|
+
After user approves (or auto-proceed), load `./step-03-execute.md`
|