aiblueprint-cli 1.4.42 → 1.4.43

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 (24) hide show
  1. package/claude-code-config/skills/apex/SKILL.md +229 -84
  2. package/claude-code-config/skills/apex/scripts/setup-templates.sh +6 -50
  3. package/claude-code-config/skills/apex/steps/step-00-init.md +33 -39
  4. package/claude-code-config/skills/apex/steps/step-00b-interactive.md +1 -13
  5. package/claude-code-config/skills/apex/steps/step-01-analyze.md +17 -36
  6. package/claude-code-config/skills/apex/steps/step-02-plan.md +24 -353
  7. package/claude-code-config/skills/apex/steps/step-03-execute.md +0 -1
  8. package/claude-code-config/skills/apex/steps/step-04-validate.md +26 -41
  9. package/claude-code-config/skills/apex/templates/00-context.md +0 -10
  10. package/claude-code-config/skills/apex/templates/README.md +6 -25
  11. package/package.json +1 -1
  12. package/claude-code-config/skills/apex/steps/step-00b-save.md +0 -123
  13. package/claude-code-config/skills/apex/steps/step-02b-tasks.md +0 -301
  14. package/claude-code-config/skills/apex/steps/step-03-execute-teams.md +0 -296
  15. package/claude-code-config/skills/apex/steps/step-05-examine.md +0 -351
  16. package/claude-code-config/skills/apex/steps/step-06-resolve.md +0 -238
  17. package/claude-code-config/skills/apex/steps/step-07-tests.md +0 -250
  18. package/claude-code-config/skills/apex/steps/step-08-run-tests.md +0 -308
  19. package/claude-code-config/skills/apex/steps/step-09-finish.md +0 -223
  20. package/claude-code-config/skills/apex/templates/05-examine.md +0 -10
  21. package/claude-code-config/skills/apex/templates/06-resolve.md +0 -10
  22. package/claude-code-config/skills/apex/templates/07-tests.md +0 -10
  23. package/claude-code-config/skills/apex/templates/08-run-tests.md +0 -10
  24. package/claude-code-config/skills/apex/templates/09-finish.md +0 -10
@@ -1,308 +0,0 @@
1
- ---
2
- name: step-08-run-tests
3
- description: Run tests in a loop - fix issues until all pass
4
- prev_step: steps/step-07-tests.md
5
- next_step: steps/step-05-examine.md
6
- ---
7
-
8
- # Step 8: Run Tests (Fix Loop)
9
-
10
- ## MANDATORY EXECUTION RULES (READ FIRST):
11
-
12
- - 🛑 NEVER give up after first failure
13
- - 🛑 NEVER start services without permission (unless auto_mode)
14
- - 🛑 NEVER infinite loop on same failure (max 3 attempts)
15
- - ✅ ALWAYS loop until all tests pass
16
- - ✅ ALWAYS ask user when stuck (unless auto_mode)
17
- - ✅ ALWAYS clean up background processes
18
- - 📋 YOU ARE A TEST RUNNER, fixing until green
19
- - 💬 FOCUS on "Run → Fail → Fix → Repeat until green"
20
- - 🚫 FORBIDDEN to ignore configuration errors
21
-
22
- ## EXECUTION PROTOCOLS:
23
-
24
- - 🎯 Check requirements before running
25
- - 💾 Log each test run (if save_mode)
26
- - 📖 Analyze failures before fixing
27
- - 🚫 FORBIDDEN to proceed with failing tests (without explicit skip)
28
-
29
- ## CONTEXT BOUNDARIES:
30
-
31
- - Tests were created in step-07
32
- - Tests may require services (DB, server)
33
- - Failures may be code bugs or test bugs
34
- - Loop until all green or user decides to skip
35
-
36
- ## YOUR TASK:
37
-
38
- Run tests, fix any failures, and loop until ALL tests pass.
39
-
40
- ---
41
-
42
- <available_state>
43
- From previous steps:
44
-
45
- | Variable | Description |
46
- |----------|-------------|
47
- | `{task_description}` | What was implemented |
48
- | `{task_id}` | Kebab-case identifier |
49
- | `{auto_mode}` | Auto-start servers, auto-retry |
50
- | `{examine_mode}` | Auto-proceed to review after |
51
- | `{save_mode}` | Save outputs to files |
52
- | `{output_dir}` | Path to output (if save_mode) |
53
- | Tests created | From step-07 |
54
- | Test command | Discovered in step-07 |
55
- </available_state>
56
-
57
- ---
58
-
59
- ## EXECUTION SEQUENCE:
60
-
61
- ### 1. Initialize Save Output (if save_mode)
62
-
63
- **If `{save_mode}` = true:**
64
-
65
- ```bash
66
- bash {skill_dir}/scripts/update-progress.sh "{task_id}" "08" "run-tests" "in_progress"
67
- ```
68
-
69
- Append logs to `{output_dir}/08-run-tests.md` as you work.
70
-
71
- ### 2. Check Requirements
72
-
73
- **Identify required services:**
74
- ```bash
75
- cat package.json | grep -A 10 '"scripts"'
76
- ```
77
-
78
- Common: Database, dev server, Redis
79
-
80
- **Check if running:**
81
- ```bash
82
- curl -s http://localhost:3000 > /dev/null 2>&1 && echo "Server running"
83
- ```
84
-
85
- ### 3. Handle Missing Services
86
-
87
- **If `{auto_mode}` = true:**
88
- → Start services automatically:
89
- ```bash
90
- pnpm run dev &
91
- sleep 5
92
- ```
93
-
94
- **If `{auto_mode}` = false:**
95
-
96
- ```yaml
97
- questions:
98
- - header: "Services"
99
- question: "Tests require services that aren't running. How proceed?"
100
- options:
101
- - label: "I'll start manually"
102
- description: "Give me a moment to start them"
103
- - label: "Start automatically"
104
- description: "Try to start services automatically"
105
- - label: "Skip tests needing services"
106
- description: "Only run tests that don't need services"
107
- - label: "Skip test step"
108
- description: "Continue without running tests"
109
- multiSelect: false
110
- ```
111
-
112
- ### 4. Run Test Loop
113
-
114
- **CRITICAL: Loop until all pass**
115
-
116
- ```
117
- max_attempts = 10
118
- attempt = 0
119
-
120
- WHILE attempt < max_attempts:
121
- attempt += 1
122
-
123
- 1. Run tests
124
- 2. If all pass → EXIT (success)
125
- 3. If failure:
126
- a. Analyze failure
127
- b. Determine: code bug or test bug?
128
- c. Fix the issue
129
- d. CONTINUE LOOP
130
- 4. If same failure 3x → ASK USER
131
- ```
132
-
133
- **Run tests:**
134
- ```bash
135
- pnpm run test 2>&1
136
- ```
137
-
138
- **Log each run:**
139
- ```
140
- **Run #{attempt}:**
141
- - Total: 5, Passed: 3, Failed: 2
142
- - Fixing: {description}
143
- ```
144
-
145
- ### 5. Handle Failures
146
-
147
- For each failing test:
148
-
149
- ```
150
- **Analyzing:**
151
- Test: "creates user with valid data"
152
- File: src/auth/register.test.ts:25
153
- Error: Expected 201, got 500
154
- Stack: TypeError: Cannot read 'email' of undefined
155
-
156
- **Diagnosis:** Code bug - null handling
157
- **Fix:** Add null check in handler
158
- ```
159
-
160
- **Fix location:**
161
- | Error Type | Fix |
162
- |------------|-----|
163
- | Assertion failed | Usually code bug |
164
- | TypeError in code | Code bug |
165
- | TypeError in test | Test bug |
166
- | Timeout | async/await issue |
167
- | Import error | Missing dep |
168
-
169
- ### 6. Handle Stuck (3x same failure)
170
-
171
- **If `{auto_mode}` = true:**
172
- → Try different approach once, then continue
173
-
174
- **If `{auto_mode}` = false:**
175
-
176
- ```yaml
177
- questions:
178
- - header: "Stuck"
179
- question: "Test keeps failing. How proceed?"
180
- options:
181
- - label: "I'll debug manually"
182
- description: "Let me investigate"
183
- - label: "Skip this test"
184
- description: "Mark as skip, continue others"
185
- - label: "Delete test"
186
- description: "Remove this test entirely"
187
- - label: "Keep trying"
188
- description: "Try more approaches"
189
- multiSelect: false
190
- ```
191
-
192
- ### 7. Handle Config Errors
193
-
194
- | Error | Solution |
195
- |-------|----------|
196
- | Cannot find module | Check imports, pnpm install |
197
- | Connection refused | DB/server not running |
198
- | Timeout | Increase timeout, check async |
199
-
200
- **If `{auto_mode}` = false:**
201
-
202
- ```yaml
203
- questions:
204
- - header: "Config"
205
- question: "Configuration issue detected. How proceed?"
206
- options:
207
- - label: "I'll fix manually"
208
- description: "Let me handle config"
209
- - label: "Try automatic fix"
210
- description: "Attempt suggested fix"
211
- - label: "Skip tests"
212
- description: "Continue without tests"
213
- multiSelect: false
214
- ```
215
-
216
- ### 8. Success - All Passing
217
-
218
- ```
219
- **✓ All Tests Passing**
220
-
221
- **Results:**
222
- - Total: {count}
223
- - Passed: {count}
224
- - Failed: 0
225
-
226
- **Attempts:** {count}
227
-
228
- **Tests:**
229
- - src/auth/register.test.ts - 3 tests
230
- - src/utils/validation.test.ts - 2 tests
231
- ```
232
-
233
- ### 9. Complete Save Output (if save_mode)
234
-
235
- **If `{save_mode}` = true:**
236
-
237
- Append to `{output_dir}/08-run-tests.md`:
238
- ```markdown
239
- ---
240
- ## Step Complete
241
- **Status:** ✓ Complete
242
- **Tests passed:** {count}
243
- **Attempts:** {count}
244
- **Next:** {next step}
245
- **Timestamp:** {ISO timestamp}
246
- ```
247
-
248
- ### 10. Determine Next Step
249
-
250
- **If `{examine_mode}` = true:**
251
- → Load step-05-examine.md
252
-
253
- **If `{auto_mode}` = false:**
254
-
255
- ```yaml
256
- questions:
257
- - header: "Next"
258
- question: "All tests passing. What next?"
259
- options:
260
- - label: "Run adversarial review"
261
- description: "Deep review for security/logic"
262
- - label: "Complete workflow"
263
- description: "Finalize and show summary"
264
- multiSelect: false
265
- ```
266
-
267
- **Else:**
268
- → Complete workflow
269
-
270
- ---
271
-
272
- ## SUCCESS METRICS:
273
-
274
- ✅ All tests passing
275
- ✅ No stuck failures without user decision
276
- ✅ Config issues resolved
277
- ✅ Services cleaned up
278
- ✅ Clear summary
279
-
280
- ## FAILURE MODES:
281
-
282
- ❌ Giving up after first failure
283
- ❌ Infinite loop on same failure
284
- ❌ Starting services without permission
285
- ❌ Not cleaning up background processes
286
- ❌ Ignoring config errors
287
- ❌ **CRITICAL**: Not using AskUserQuestion when stuck
288
-
289
- ## RUN PROTOCOLS:
290
-
291
- - Loop until green
292
- - Analyze before fixing
293
- - Ask user when stuck (3x)
294
- - Clean up services
295
- - Clear summary at end
296
-
297
- ---
298
-
299
- ## NEXT STEP:
300
-
301
- Based on flags (check in order):
302
- - **If examine_mode:** Load `./step-05-examine.md`
303
- - **If pr_mode:** Load `./step-09-finish.md` to create pull request
304
- - **Otherwise:** Workflow complete - show summary
305
-
306
- <critical>
307
- Remember: Loop until ALL tests pass - don't give up after first failure!
308
- </critical>
@@ -1,223 +0,0 @@
1
- ---
2
- name: step-09-finish
3
- description: Finish APEX workflow and create pull request
4
- previous_step: step-08-run-tests.md (or step-04-validate.md if no tests)
5
- ---
6
-
7
- # Step 9: Finish & Create PR
8
-
9
- ## MANDATORY EXECUTION RULES (READ FIRST):
10
-
11
- - 🛑 NEVER push without user confirmation (unless auto_mode)
12
- - 🛑 NEVER create PR if there are uncommitted changes
13
- - ✅ ALWAYS verify all changes are committed
14
- - ✅ ALWAYS push to remote before creating PR
15
- - 📋 YOU ARE A FINISHER, completing the workflow
16
- - 💬 FOCUS on PR creation and workflow summary
17
- - 🚫 FORBIDDEN to make code changes in this step
18
-
19
- ## EXECUTION PROTOCOLS:
20
-
21
- - 🎯 Verify git status before any push/PR operations
22
- - 💾 Save PR details to output file if save_mode enabled
23
- - 📖 Provide clear workflow summary
24
- - 🚫 FORBIDDEN to proceed with uncommitted changes
25
-
26
- ## CONTEXT BOUNDARIES:
27
-
28
- - Variables available: `{task_id}`, `{task_description}`, `{branch_name}`, `{pr_mode}`, `{auto_mode}`, `{save_mode}`, `{teams_mode}`, `{output_dir}`
29
- - Previous steps completed: analyze, plan, execute, validate (+ optional: tests, examine)
30
- - All implementation should be done at this point
31
-
32
- ## YOUR TASK:
33
-
34
- Finalize the APEX workflow by committing remaining changes, pushing to remote, and creating a pull request.
35
-
36
- ---
37
-
38
- ## EXECUTION SEQUENCE:
39
-
40
- ### 0. Shutdown Agent Team (if teams_mode)
41
-
42
- <critical>
43
- This is the ONLY step where team shutdown should happen.
44
- All previous steps (validate, examine, resolve) keep the team alive.
45
- </critical>
46
-
47
- **If `{teams_mode}` = true:**
48
-
49
- 1. Send shutdown_request to each teammate:
50
- ```
51
- SendMessage:
52
- type: "shutdown_request"
53
- recipient: "impl-{name}"
54
- content: "APEX workflow complete. Shutting down team."
55
- ```
56
-
57
- 2. Wait for all teammates to confirm shutdown.
58
-
59
- 3. Delete the team:
60
- ```
61
- TeamDelete
62
- ```
63
-
64
- → This cleans up team files and task directories.
65
-
66
- ### 1. Verify Git Status
67
-
68
- ```bash
69
- git status
70
- ```
71
-
72
- **If uncommitted changes exist:**
73
- → Commit them with message: `feat({task_id}): {task_description}`
74
-
75
- **If working tree is clean:**
76
- → Continue to step 2
77
-
78
- ### 2. Check Commits to Push
79
-
80
- ```bash
81
- git log origin/{branch_name}..HEAD --oneline 2>/dev/null || git log --oneline -5
82
- ```
83
-
84
- Display commits that will be included in PR.
85
-
86
- ### 3. Confirm Push (if not auto_mode)
87
-
88
- **If `{auto_mode}` = true:**
89
- → Auto-push to remote
90
-
91
- **If `{auto_mode}` = false:**
92
- Use AskUserQuestion:
93
- ```yaml
94
- questions:
95
- - header: "Push"
96
- question: "Ready to push {branch_name} and create PR?"
97
- options:
98
- - label: "Push and create PR (Recommended)"
99
- description: "Push commits to remote and open pull request"
100
- - label: "Push only"
101
- description: "Push to remote without creating PR"
102
- - label: "Review commits first"
103
- description: "Show me the full diff before pushing"
104
- - label: "Cancel"
105
- description: "Don't push or create PR"
106
- multiSelect: false
107
- ```
108
-
109
- ### 4. Push to Remote
110
-
111
- ```bash
112
- git push -u origin {branch_name}
113
- ```
114
-
115
- **If push fails:**
116
- → Display error and ask user how to proceed
117
- → Common fixes: pull --rebase, force push (with warning)
118
-
119
- ### 5. Create Pull Request (if pr_mode)
120
-
121
- **If `{pr_mode}` = true:**
122
-
123
- Generate PR content:
124
- - **Title:** `feat({task_id}): {task_description}`
125
- - **Body:** Summary of changes from the workflow
126
-
127
- ```bash
128
- gh pr create --title "feat({task_id}): {task_description}" --body "$(cat <<'EOF'
129
- ## Summary
130
-
131
- {Brief description of what was implemented}
132
-
133
- ## Changes
134
-
135
- {List of key changes made}
136
-
137
- ## Testing
138
-
139
- {How the changes were validated}
140
-
141
- ---
142
-
143
- _Generated by APEX workflow_
144
- EOF
145
- )"
146
- ```
147
-
148
- **Capture PR URL:**
149
- ```bash
150
- gh pr view --json url -q '.url'
151
- ```
152
- → Store as `{pr_url}`
153
-
154
- ### 6. Save Output (if save_mode)
155
-
156
- **If `{save_mode}` = true:**
157
-
158
- ```bash
159
- bash {skill_dir}/scripts/update-progress.sh "{task_id}" "09" "finish" "in_progress"
160
- ```
161
-
162
- Append to `{output_dir}/09-finish.md`: branch, PR URL, commits, timestamp.
163
-
164
- ```bash
165
- bash {skill_dir}/scripts/update-progress.sh "{task_id}" "09" "finish" "complete"
166
- ```
167
-
168
- ### 7. Final Summary
169
-
170
- Display workflow completion summary:
171
-
172
- ```
173
- ═══════════════════════════════════════════════════════
174
- APEX WORKFLOW COMPLETE
175
- ═══════════════════════════════════════════════════════
176
-
177
- Task: {task_description}
178
- ID: {task_id}
179
-
180
- ✓ Analysis complete
181
- ✓ Plan created and approved
182
- ✓ Implementation done
183
- ✓ Validation passed
184
- {if test_mode: "✓ Tests passing"}
185
- {if examine_mode: "✓ Review findings resolved"}
186
- ✓ Changes pushed to {branch_name}
187
- {if pr_mode: "✓ PR created: {pr_url}"}
188
-
189
- ═══════════════════════════════════════════════════════
190
- ```
191
-
192
- ---
193
-
194
- ## SUCCESS METRICS:
195
-
196
- ✅ Agent team shut down gracefully via SendMessage shutdown_request (if teams_mode)
197
- ✅ TeamDelete called to clean up team resources (if teams_mode)
198
- ✅ All changes committed
199
- ✅ Branch pushed to remote
200
- ✅ PR created with proper title and description (if pr_mode)
201
- ✅ PR URL captured and displayed
202
- ✅ Output saved (if save_mode)
203
- ✅ Clear completion summary provided
204
-
205
- ## FAILURE MODES:
206
-
207
- ❌ Creating PR with uncommitted changes
208
- ❌ Pushing without user confirmation (when not auto_mode)
209
- ❌ Force pushing without explicit user request
210
- ❌ Not displaying PR URL after creation
211
- ❌ **CRITICAL**: Using plain text prompts instead of AskUserQuestion
212
-
213
- ---
214
-
215
- ## WORKFLOW COMPLETE
216
-
217
- This is the final step of the APEX workflow. No next step to load.
218
-
219
- <critical>
220
- Remember: This step handles git operations, PR creation, AND team shutdown (if teams_mode).
221
- All code changes should have been completed in earlier steps.
222
- Team shutdown MUST happen here — step 0 of execution sequence — before git operations.
223
- </critical>
@@ -1,10 +0,0 @@
1
- # Step 05: Examine
2
-
3
- **Task:** {{task_description}}
4
- **Started:** {{timestamp}}
5
-
6
- ---
7
-
8
- ## Adversarial Review
9
-
10
- _Review findings will be documented here..._
@@ -1,10 +0,0 @@
1
- # Step 06: Resolve
2
-
3
- **Task:** {{task_description}}
4
- **Started:** {{timestamp}}
5
-
6
- ---
7
-
8
- ## Resolution Log
9
-
10
- _Fixes will be logged here..._
@@ -1,10 +0,0 @@
1
- # Step 07: Tests
2
-
3
- **Task:** {{task_description}}
4
- **Started:** {{timestamp}}
5
-
6
- ---
7
-
8
- ## Test Analysis and Creation
9
-
10
- _Test strategy and implementation will be documented here..._
@@ -1,10 +0,0 @@
1
- # Step 08: Run Tests
2
-
3
- **Task:** {{task_description}}
4
- **Started:** {{timestamp}}
5
-
6
- ---
7
-
8
- ## Test Runner Log
9
-
10
- _Test execution results will be logged here..._
@@ -1,10 +0,0 @@
1
- # Step 09: Finish
2
-
3
- **Task:** {{task_description}}
4
- **Started:** {{timestamp}}
5
-
6
- ---
7
-
8
- ## Pull Request Creation
9
-
10
- _PR creation process will be logged here..._