Skip to content

Commit 03350db

Browse files
authored
Merge pull request #175 from maystudios/worktree-agent-a7b4e544
fix(workflows): align 4 workflow templates with PROJECT.md spec
2 parents d1806d8 + 6130159 commit 03350db

4 files changed

Lines changed: 52 additions & 2 deletions

File tree

templates/workflows/execute-plan.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,25 @@ Self-check result:
184184
- All key files exist + all commits found + all sub-issues closed → `## Self-Check: PASSED`
185185
- Any miss → `## Self-Check: FAILED — {reason}`
186186

187+
## Step 5a — Review Cycle
188+
189+
Before posting the summary, run a focused review cycle:
190+
191+
| Stage | Check | Action on Fail |
192+
|-------|-------|----------------|
193+
| Spec Review | Do outputs match all plan requirements and acceptance criteria? | Fix gaps (1 retry) |
194+
| Code Review | Does code pass linting? All tests pass? No anti-patterns? | Fix issues (1 retry) |
195+
| Simplify | Can code be cleaner? Any dead code, redundancy, or unnecessary complexity? | Refactor (1 retry) |
196+
| Final Review | Overall quality approved? Ready to merge? | Accept or flag for orchestrator |
197+
198+
For each stage:
199+
1. Run the check
200+
2. If PASS: advance to next stage
201+
3. If FAIL: attempt a targeted fix (max 1 retry per stage)
202+
4. If retry fails: record as BLOCKED and proceed (the orchestrator handles escalation)
203+
204+
Record results in the summary comment's `## Review Cycle` section with: stage name, result (PASS/FAIL/BLOCKED/SKIPPED), attempt count, and findings.
205+
187206
## Step 6 — Post Summary to GitHub
188207

189208
Build summary content and post as a comment on the phase issue.

templates/workflows/execute.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,27 @@ git push origin HEAD
452452

453453
**If human_needed:** Present items for human testing. If approved, treat as passed. If issues reported, proceed to Retry Loop.
454454

455+
### 8.2 Error Recovery Protocol
456+
457+
When verification identifies unresolved gaps, recovery proceeds through three tiers:
458+
459+
**Tier 1 — Debug (attempts 1–3):**
460+
- Spawn a fresh planner to analyze the failure and produce a targeted gap-closure plan
461+
- Spawn a fresh executor to implement the fix in an isolated worktree
462+
- Run verification again on the result
463+
- If successful: phase completes. If fails: advance to next tier.
464+
465+
**Tier 2 — Rollback (after 3 failed attempts):**
466+
- Revert the failing changes: `git revert HEAD --no-edit`
467+
- Document which gaps remain unresolved with evidence
468+
- Surface blockers to the user with exact error output
469+
470+
**Tier 3 — Escalate:**
471+
- Create a diagnostic GitHub Issue labeled `type:bug` and `maxsim:auto`
472+
- Include: original spec, all attempt summaries, exact gate failures, root cause analysis
473+
- Move the phase to "Blocked" on the Project Board
474+
- Notify the user and await manual intervention
475+
455476
## 9. Retry Loop (Max 3 Retries — 4 Total Attempts)
456477

457478
### 9.1 Check attempt budget

templates/workflows/help.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Execute all plans in a phase using wave-ordered parallel agents.
6666

6767
- Runs plans in wave order (parallel within waves, sequential across waves)
6868
- Auto-verifies after execution via GitHub Issue task completion
69-
- Retries failed verification (max 2 retries, 3 total attempts)
69+
- Retries failed verification (max 3 retries, 4 total attempts)
7070

7171
```
7272
/maxsim:execute 3

templates/workflows/settings.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,15 @@ AskUserQuestion([
109109
{ label: "Deep", description: "Maximum competition. Highest quality, highest cost." }
110110
]
111111
},
112+
{
113+
question: "Auto-advance: Should MaxsimCLI automatically proceed between stages (research → plan → execute) without waiting for confirmation?",
114+
header: "Auto-Advance",
115+
multiSelect: false,
116+
options: [
117+
{ label: "Yes", description: "Automatically proceed between stages without confirmation. Maps to config key: workflow.auto_advance" },
118+
{ label: "No (Recommended)", description: "Pause between stages for user confirmation. Maps to config key: workflow.auto_advance" }
119+
]
120+
},
112121
{
113122
question: "Git branching strategy?",
114123
header: "Branching",
@@ -157,6 +166,7 @@ node .claude/maxsim/bin/maxsim-tools.cjs config-set worktrees.auto_cleanup [true
157166
node .claude/maxsim/bin/maxsim-tools.cjs config-set worktrees.branch_prefix "[value]"
158167
node .claude/maxsim/bin/maxsim-tools.cjs config-set automation.auto_commit_on_success [true/false]
159168
node .claude/maxsim/bin/maxsim-tools.cjs config-set automation.conventional_commits [true/false]
169+
node .claude/maxsim/bin/maxsim-tools.cjs config-set workflow.auto_advance [true/false]
160170
node .claude/maxsim/bin/maxsim-tools.cjs config-set automation.co_author "[value]"
161171
node .claude/maxsim/bin/maxsim-tools.cjs config-set hooks.enabled [true/false]
162172
# Per-agent model overrides (only if custom overrides selected)
@@ -210,7 +220,7 @@ Re-run /maxsim:settings anytime to change these.
210220

211221
<success_criteria>
212222
- [ ] Current config loaded and displayed
213-
- [ ] User presented with all 8 settings
223+
- [ ] User presented with all 9 settings
214224
- [ ] Config updated via maxsim-tools config-set commands
215225
- [ ] User offered to save as global defaults
216226
- [ ] Confirmation displayed after save

0 commit comments

Comments
 (0)