aiblueprint-cli 1.4.99 → 1.4.101

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/README.md +0 -1
  2. package/agents-config/skills/agents-manager/SKILL.md +2 -2
  3. package/agents-config/skills/agents-manager/agents/openai.yaml +7 -0
  4. package/agents-config/skills/agents-manager/assets/codex-icon.svg +20 -0
  5. package/agents-config/skills/apex/SKILL.md +120 -118
  6. package/agents-config/skills/apex/agents/openai.yaml +10 -0
  7. package/agents-config/skills/apex/assets/codex-icon.svg +15 -0
  8. package/agents-config/skills/apex/scripts/apex-state.py +740 -0
  9. package/agents-config/skills/apex/scripts/setup-templates.sh +27 -145
  10. package/agents-config/skills/apex/scripts/test_apex_state.py +413 -0
  11. package/agents-config/skills/apex/scripts/update-progress.sh +17 -73
  12. package/agents-config/skills/apex/steps/step-00-init.md +85 -231
  13. package/agents-config/skills/apex/steps/step-00b-branch.md +10 -118
  14. package/agents-config/skills/apex/steps/step-00b-economy.md +12 -239
  15. package/agents-config/skills/apex/steps/step-00b-interactive.md +13 -162
  16. package/agents-config/skills/apex/steps/step-00b-save.md +13 -114
  17. package/agents-config/skills/apex/steps/step-01-analyze.md +40 -361
  18. package/agents-config/skills/apex/steps/step-02-plan.md +55 -562
  19. package/agents-config/skills/apex/steps/step-02b-tasks.md +15 -291
  20. package/agents-config/skills/apex/steps/step-03-execute-teams.md +47 -267
  21. package/agents-config/skills/apex/steps/step-03-execute.md +32 -212
  22. package/agents-config/skills/apex/steps/step-04-validate.md +42 -246
  23. package/agents-config/skills/apex/steps/step-05-examine.md +47 -371
  24. package/agents-config/skills/apex/steps/step-06-resolve.md +19 -221
  25. package/agents-config/skills/apex/steps/step-07-tests.md +19 -234
  26. package/agents-config/skills/apex/steps/step-08-run-tests.md +13 -300
  27. package/agents-config/skills/apex/steps/step-09-finish.md +36 -200
  28. package/agents-config/skills/apex/steps/step-10-verify.md +46 -264
  29. package/agents-config/skills/appstore-connect/agents/openai.yaml +7 -0
  30. package/agents-config/skills/appstore-connect/assets/codex-icon.svg +17 -0
  31. package/agents-config/skills/commit/agents/openai.yaml +10 -0
  32. package/agents-config/skills/commit/assets/codex-icon.svg +17 -0
  33. package/agents-config/skills/create-pr/agents/openai.yaml +10 -0
  34. package/agents-config/skills/create-pr/assets/codex-icon.svg +17 -0
  35. package/agents-config/skills/environments-manager/SKILL.md +1 -1
  36. package/agents-config/skills/environments-manager/agents/openai.yaml +7 -0
  37. package/agents-config/skills/environments-manager/assets/codex-icon.svg +16 -0
  38. package/agents-config/skills/environments-manager/examples/scripts/claude-worktree-remove.sh +19 -3
  39. package/agents-config/skills/environments-manager/examples/scripts/worktree-up.sh +1 -1
  40. package/agents-config/skills/environments-manager/references/claude.md +1 -1
  41. package/agents-config/skills/fix-pr-comments/agents/openai.yaml +10 -0
  42. package/agents-config/skills/fix-pr-comments/assets/codex-icon.svg +17 -0
  43. package/agents-config/skills/grill-me/SKILL.md +25 -4
  44. package/agents-config/skills/grill-me/agents/openai.yaml +8 -0
  45. package/agents-config/skills/grill-me/assets/codex-icon.svg +16 -0
  46. package/agents-config/skills/hooks-manager/SKILL.md +19 -9
  47. package/agents-config/skills/hooks-manager/assets/codex-icon.svg +15 -4
  48. package/agents-config/skills/hooks-manager/references/claude-code.md +32 -0
  49. package/agents-config/skills/hooks-manager/references/codex.md +23 -0
  50. package/agents-config/skills/hooks-manager/references/cursor.md +18 -0
  51. package/agents-config/skills/hooks-manager/references/hook-types.md +5 -3
  52. package/agents-config/skills/hooks-manager/references/input-output-schemas.md +2 -2
  53. package/agents-config/skills/hooks-manager/references/research-sources.md +25 -0
  54. package/agents-config/skills/hooks-manager/references/router.md +32 -0
  55. package/agents-config/skills/hooks-manager/references/troubleshooting.md +3 -3
  56. package/agents-config/skills/merge/agents/openai.yaml +10 -0
  57. package/agents-config/skills/merge/assets/codex-icon.svg +17 -0
  58. package/agents-config/skills/oneshot/SKILL.md +4 -0
  59. package/agents-config/skills/oneshot/agents/openai.yaml +10 -0
  60. package/agents-config/skills/oneshot/assets/codex-icon.svg +18 -0
  61. package/agents-config/skills/rules-manager/agents/openai.yaml +7 -0
  62. package/agents-config/skills/rules-manager/assets/codex-icon.svg +23 -0
  63. package/agents-config/skills/skill-manager/SKILL.md +45 -3
  64. package/agents-config/skills/skill-manager/agents/openai.yaml +7 -0
  65. package/agents-config/skills/skill-manager/assets/codex-icon.svg +23 -0
  66. package/agents-config/skills/skill-manager/references/skill-writing-glossary.md +201 -0
  67. package/agents-config/skills/skill-manager/scripts/setup-codex-icons.ts +143 -0
  68. package/agents-config/skills/ultrathink/agents/openai.yaml +10 -0
  69. package/agents-config/skills/ultrathink/assets/codex-icon.svg +20 -0
  70. package/agents-config/skills/use-artifacts/SKILL.md +102 -51
  71. package/agents-config/skills/use-artifacts/assets/local-runtime.js +299 -0
  72. package/agents-config/skills/use-artifacts/scripts/create_artifact.py +1 -1
  73. package/agents-config/skills/use-delegate/SKILL.md +4 -0
  74. package/agents-config/skills/use-delegate/agents/openai.yaml +10 -0
  75. package/agents-config/skills/use-delegate/assets/codex-icon.svg +20 -0
  76. package/agents-config/skills/use-goal/SKILL.md +70 -9
  77. package/agents-config/skills/use-goal/agents/openai.yaml +1 -1
  78. package/agents-config/skills/use-goal/assets/codex-icon.svg +17 -3
  79. package/agents-config/skills/use-goal/references/claude-code-goal.md +54 -6
  80. package/agents-config/skills/use-goal/references/codex-goal.md +59 -4
  81. package/agents-config/skills/use-goal/references/verification-harnesses.md +104 -3
  82. package/dist/cli.js +365 -363
  83. package/package.json +1 -1
  84. package/agents-config/skills/apex/templates/00-context.md +0 -55
  85. package/agents-config/skills/apex/templates/01-analyze.md +0 -10
  86. package/agents-config/skills/apex/templates/02-plan.md +0 -10
  87. package/agents-config/skills/apex/templates/03-execute.md +0 -10
  88. package/agents-config/skills/apex/templates/04-validate.md +0 -10
  89. package/agents-config/skills/apex/templates/05-examine.md +0 -10
  90. package/agents-config/skills/apex/templates/06-resolve.md +0 -10
  91. package/agents-config/skills/apex/templates/07-tests.md +0 -10
  92. package/agents-config/skills/apex/templates/08-run-tests.md +0 -10
  93. package/agents-config/skills/apex/templates/09-finish.md +0 -10
  94. package/agents-config/skills/apex/templates/10-verify.md +0 -9
  95. package/agents-config/skills/apex/templates/README.md +0 -195
  96. package/agents-config/skills/apex/templates/step-complete.md +0 -7
  97. package/agents-config/skills/prompt-creator/SKILL.md +0 -285
  98. package/agents-config/skills/prompt-creator/references/anthropic-best-practices.md +0 -126
  99. package/agents-config/skills/prompt-creator/references/anti-patterns.md +0 -57
  100. package/agents-config/skills/prompt-creator/references/clarity-principles.md +0 -54
  101. package/agents-config/skills/prompt-creator/references/context-management.md +0 -389
  102. package/agents-config/skills/prompt-creator/references/few-shot-patterns.md +0 -47
  103. package/agents-config/skills/prompt-creator/references/openai-best-practices.md +0 -50
  104. package/agents-config/skills/prompt-creator/references/prompt-templates.md +0 -110
  105. package/agents-config/skills/prompt-creator/references/reasoning-techniques.md +0 -52
  106. package/agents-config/skills/prompt-creator/references/system-prompt-patterns.md +0 -48
  107. package/agents-config/skills/prompt-creator/references/xml-structure.md +0 -36
@@ -1,314 +1,27 @@
1
1
  ---
2
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
3
+ description: Run focused APEX tests in a causal fix loop and stop or re-plan when attempts stop making progress.
4
+ next_step: step-04-validate.md
6
5
  ---
7
6
 
8
- # Step 8: Run Tests (Fix Loop)
7
+ # Step 8: Test loop
9
8
 
10
- ## MANDATORY EXECUTION RULES (READ FIRST):
9
+ ## 1. Prepare the environment
11
10
 
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
11
+ Follow project rules for services, ports, fixtures, devices, credentials, and cleanup. Reuse healthy managed services when required by local instructions. Do not launch unmanaged persistent processes.
21
12
 
22
- ## EXECUTION PROTOCOLS:
13
+ ## 2. Run narrow to broad
23
14
 
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)
15
+ Start with the new or affected tests, then expand to the relevant suite. Capture command, environment, revision, exit status, and decisive output.
28
16
 
29
- ## CONTEXT BOUNDARIES:
17
+ ## 3. Diagnose causally
30
18
 
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
19
+ For every failure, classify whether it is introduced, pre-existing, unrelated, unavailable, or test-design error. Change code or tests only when evidence supports the cause.
35
20
 
36
- ## YOUR TASK:
21
+ ## 4. Bound unproductive retries
37
22
 
38
- Run tests, fix any failures, and loop until ALL tests pass.
23
+ Continue while each attempt produces new evidence or measurable progress. If two consecutive rounds reproduce the same blocker without new information, stop repeating the command, record the blocker, and re-plan or request the precise missing input.
39
24
 
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 `{verify_mode}` = true:**
254
- → Load step-10-verify.md
255
-
256
- **If `{auto_mode}` = false:**
257
-
258
- ```yaml
259
- questions:
260
- - header: "Next"
261
- question: "All tests passing. What next?"
262
- options:
263
- - label: "Run adversarial review"
264
- description: "Deep review for security/logic"
265
- - label: "Verify feature"
266
- description: "Launch app and test feature works"
267
- - label: "Complete workflow"
268
- description: "Finalize and show summary"
269
- multiSelect: false
270
- ```
271
-
272
- **Else:**
273
- → Complete workflow
274
-
275
- ---
276
-
277
- ## SUCCESS METRICS:
278
-
279
- ✅ All tests passing
280
- ✅ No stuck failures without user decision
281
- ✅ Config issues resolved
282
- ✅ Services cleaned up
283
- ✅ Clear summary
284
-
285
- ## FAILURE MODES:
286
-
287
- ❌ Giving up after first failure
288
- ❌ Infinite loop on same failure
289
- ❌ Starting services without permission
290
- ❌ Not cleaning up background processes
291
- ❌ Ignoring config errors
292
- ❌ **CRITICAL**: Not using AskUserQuestion when stuck
293
-
294
- ## RUN PROTOCOLS:
295
-
296
- - Loop until green
297
- - Analyze before fixing
298
- - Ask user when stuck (3x)
299
- - Clean up services
300
- - Clear summary at end
301
-
302
- ---
303
-
304
- ## NEXT STEP:
305
-
306
- Based on flags (check in order):
307
- - **If examine_mode:** Load `./step-05-examine.md`
308
- - **If verify_mode:** Load `./step-10-verify.md` to verify feature
309
- - **If pr_mode:** Load `./step-09-finish.md` to create pull request
310
- - **Otherwise:** Workflow complete - show summary
25
+ ## 5. Clean up and return
311
26
 
312
- <critical>
313
- Remember: Loop until ALL tests pass - don't give up after first failure!
314
- </critical>
27
+ Clean up task-owned fixtures and processes. Return to `step-04-validate.md` so the integrated ledger reflects the latest code and tests.
@@ -1,223 +1,59 @@
1
1
  ---
2
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)
3
+ description: Complete an APEX run with scope review, proof-boundary reporting, and only the delivery actions authorized by the user.
5
4
  ---
6
5
 
7
- # Step 9: Finish & Create PR
6
+ # Step 9: Handoff
8
7
 
9
- ## MANDATORY EXECUTION RULES (READ FIRST):
8
+ Do not edit implementation code here. Return to the relevant phase if the completion audit finds a defect.
10
9
 
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
10
+ ## 1. Audit completion
18
11
 
19
- ## EXECUTION PROTOCOLS:
12
+ Confirm:
20
13
 
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
14
+ - every acceptance criterion has current evidence at the required level;
15
+ - all introduced failures are resolved;
16
+ - review requirements and confirmed findings are closed;
17
+ - current Git diff matches the intended task scope;
18
+ - unrelated staged, unstaged, deleted, and untracked paths remain untouched;
19
+ - run state lists every unavailable check, blocker, and residual risk honestly.
25
20
 
26
- ## CONTEXT BOUNDARIES:
21
+ Do not call a blocked, unverified, or partially validated task complete.
27
22
 
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
23
+ ## 2. Report proof boundaries
31
24
 
32
- ## YOUR TASK:
25
+ Separate claims explicitly:
33
26
 
34
- Finalize the APEX workflow by committing remaining changes, pushing to remote, and creating a pull request.
27
+ | Layer | Example evidence | Claim boundary |
28
+ |---|---|---|
29
+ | Local/static | Diff, typecheck, lint, tests, local runtime | What the inspected local state proves |
30
+ | Provider | Authoritative provider/API read-back | What provider configuration or state proves |
31
+ | Public artifact/deployment | Re-downloaded artifact, public URL, deployment revision | What an unauthenticated external consumer can obtain |
32
+ | Authenticated live | Controlled signed-in flow, send/receipt, persistent read-back | What was observed through the real protected surface |
35
33
 
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)
34
+ Use `NOT RUN`, `UNAVAILABLE`, `NOT PROVEN`, or `BLOCKED` where appropriate. Do not let a stronger-sounding summary erase those boundaries.
120
35
 
121
- **If `{pr_mode}` = true:**
36
+ ## 3. Perform only requested delivery actions
122
37
 
123
- Generate PR content:
124
- - **Title:** `feat({task_id}): {task_description}`
125
- - **Body:** Summary of changes from the workflow
38
+ Implementation permission does not by itself request a commit, push, pull request, merge, deploy, release, provider mutation, or external message.
126
39
 
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
- ---
40
+ When a delivery action is in scope:
142
41
 
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}`
42
+ 1. Review the exact paths and diff that belong to the task.
43
+ 2. Stage only those paths unless the user explicitly requested the entire reviewed tree.
44
+ 3. Scan the staged diff for secrets and scope drift.
45
+ 4. Commit using the repository convention.
46
+ 5. Push only the intended branch.
47
+ 6. Create or update the requested pull request with actual validation and proof boundaries.
48
+ 7. Read back the remote branch, pull request, deployment, provider state, or public artifact needed to support the delivery claim.
153
49
 
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
- ```
50
+ Never force push, merge, release, deploy, or communicate externally without the corresponding authority.
161
51
 
162
- Append to `{output_dir}/09-finish.md`: branch, PR URL, commits, timestamp.
52
+ ## 4. Close run state
163
53
 
164
54
  ```bash
165
- bash {skill_dir}/scripts/update-progress.sh "{task_id}" "09" "finish" "complete"
55
+ python3 "{skill_dir}/scripts/apex-state.py" event --root "$PWD" --run-id "{run_id}" --phase handoff --status complete --message "Completion audit and authorized handoff finished"
56
+ python3 "{skill_dir}/scripts/apex-state.py" checkpoint --root "$PWD" --run-id "{run_id}" --phase handoff --message "APEX run complete"
166
57
  ```
167
58
 
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>
59
+ Present the outcome, changed files, validation ledger, review disposition, proof boundaries, delivery read-back, and any remaining local changes.