Skip to content

Commit 7b9fea1

Browse files
jwaldripclaude
andcommitted
fix: skip auto-merge question for unit strategy
In unit strategy, merging is the user's responsibility via PRs — the agent should not ask about or perform auto-merging. Auto-merge now only applies to intent strategy where unit branches merge into the intent branch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2015042 commit 7b9fea1

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

plugin/schemas/settings.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241
},
242242
"auto_merge": {
243243
"type": "boolean",
244-
"description": "Whether to automatically merge completed unit branches. Only applies to 'unit' and 'intent' strategies."
244+
"description": "Whether to automatically merge completed unit branches into the intent branch. Only applies to 'intent' strategy. For 'unit' strategy, merging is the user's responsibility via PRs."
245245
},
246246
"auto_squash": {
247247
"type": "boolean",

plugin/skills/elaborate/SKILL.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -748,12 +748,21 @@ Use `AskUserQuestion`:
748748
{"label": "Trunk-based", "description": "All work on main, no feature branches. Best for small, low-risk changes."}
749749
],
750750
"multiSelect": false
751-
},
751+
}
752+
]
753+
}
754+
```
755+
756+
**If the user selected "Intent branch"**, ask a follow-up about auto-merge:
757+
758+
```json
759+
{
760+
"questions": [
752761
{
753-
"question": "Should completed branches auto-merge when approved?",
762+
"question": "Should completed unit branches auto-merge into the intent branch when approved?",
754763
"header": "Auto-merge",
755764
"options": [
756-
{"label": "Yes (Recommended)", "description": "Automatically merge when reviewer approves. For 'unit' strategy, merges unit branches to the default branch via per-unit MRs. For 'intent' strategy, merges unit branches to the intent branch."},
765+
{"label": "Yes (Recommended)", "description": "Automatically merge unit branches into the intent branch when reviewer approves."},
757766
{"label": "No", "description": "Manual merge — you decide when to merge. More control, more manual work."}
758767
],
759768
"multiSelect": false
@@ -762,21 +771,23 @@ Use `AskUserQuestion`:
762771
}
763772
```
764773

774+
**Skip the auto-merge question for "Unit branches"** — in unit strategy, each unit creates its own PR and the user is responsible for merging. **Skip for "Trunk-based"** — no branches to merge.
775+
765776
Store the selections. These will be written into the `intent.md` frontmatter in Phase 6 under a `git:` key:
766777

767778
```yaml
768779
git:
769780
change_strategy: unit # or intent, trunk
770-
auto_merge: true # or false
771-
auto_squash: false # default false
781+
auto_merge: true # only for intent strategy; omit for unit/trunk
782+
auto_squash: false # default false, only relevant when auto_merge is true
772783
```
773784
774785
Map user selections to config values:
775-
- "Unit branches" → `unit`
786+
- "Unit branches" → `unit` (no `auto_merge` key — user merges their own PRs)
776787
- "Intent branch" → `intent`
777788
- "Trunk-based" → `trunk`
778-
- "Yes" auto-merge → `true`
779-
- "No" auto-merge → `false`
789+
- "Yes" auto-merge → `auto_merge: true` (intent strategy only)
790+
- "No" auto-merge → `auto_merge: false` (intent strategy only)
780791

781792
### Hybrid Per-Unit Strategy (Optional)
782793

plugin/skills/setup/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,15 @@ Use `AskUserQuestion`:
258258
259259
Pre-fill from existing `settings.yml` `{vcs}.change_strategy` if available.
260260
261-
**Question 2: Auto-merge**
262-
- "Should completed unit branches be automatically merged?"
261+
**Question 2: Auto-merge** *(intent strategy only)*
262+
- "Should completed unit branches be automatically merged into the intent branch?"
263263
- Options:
264264
- **Yes (Recommended)** — Auto-merge when unit passes review
265265
- **No** — Manual merge after review
266266
267267
Pre-fill from existing `settings.yml` `{vcs}.auto_merge` if available.
268268
269-
Only ask auto-merge if strategy is `unit` or `intent` (the strategies that use branches to merge).
269+
Only ask auto-merge if strategy is `intent`. For `unit` strategy, merging is the user's responsibility (they merge their own PRs), so skip this question and do not set `auto_merge`. For `trunk`, branches aren't used.
270270
271271
---
272272

0 commit comments

Comments
 (0)