Skip to content

Commit a74450e

Browse files
committed
fix: merging ALWAYS requires user permission, even in bypass mode
Removed all 'auto-merge' language from AGENTS.md, CLAUDE.md, and every agent config template (.cursorrules, .windsurfrules, copilot-instructions, CONVENTIONS.md). Merge guard hook no longer respects bypass mode — it always prompts. Merging is irreversible and must never be autonomous.
1 parent 7257b49 commit a74450e

7 files changed

Lines changed: 10 additions & 16 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ using these defaults:**
6565
|---|---|---|
6666
| On `main`, need a branch | Auto-create `feature/<task-slug>` | Never pollute main |
6767
| Parent branch has new commits | Auto-rebase before starting | Avoid conflicts |
68-
| Ready to merge | Auto-merge (no prompt) | User opted into autonomy |
69-
| Delete branch after merge? | **Delete** feature/fix branches, **keep** long-lived branches (dev, staging, release/*) | Feature branches are disposable |
68+
| Ready to merge | **ALWAYS ask user** — merging is never autonomous | Merges are irreversible |
69+
| Delete branch after merge? | **ALWAYS ask user** — include in the merge prompt | User decides |
7070
| Commit message | Auto-generate meaningful message | Never ask "what should the message be?" |
7171
| Tests failing | Fix them, don't ask | User expects working code |
7272
| Convention violations | Fix them, don't ask | User expects clean code |

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ and defines the AI-driven development workflow for the webjs framework itself.
1818
3. Verify the branch matches the task at hand
1919

2020
**Autonomous mode (sandbox/bypass):** Don't ask questions. Auto-create
21-
branches, auto-rebase, auto-merge + delete feature branches, auto-generate
21+
branches, auto-rebase, auto-generate
2222
commit messages, fix failing tests and violations. Same quality bar.
2323

2424
**Every change to this framework MUST include — automatically, without the

packages/cli/templates/.claude/hooks/guard-main-merge.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,8 @@ if [ -z "$COMMAND" ]; then
2222
exit 0
2323
fi
2424

25-
# Respect bypass/dangerous mode.
26-
SETTINGS="$HOME/.claude/settings.json"
27-
if [ -f "$SETTINGS" ]; then
28-
BYPASS=$(jq -r '.skipDangerousModePermissionPrompt // false' "$SETTINGS" 2>/dev/null)
29-
if [ "$BYPASS" = "true" ]; then
30-
exit 0
31-
fi
32-
fi
25+
# Merge guard NEVER respects bypass mode. Merging is irreversible and
26+
# always requires explicit user approval, regardless of settings.
3327

3428
# Normalize whitespace so multi-line / heredoc commands match the same way.
3529
NORMALIZED=$(printf '%s' "$COMMAND" | tr -s '[:space:]' ' ')

packages/cli/templates/.cursorrules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ FIRST, before writing any code:
2020
If running without interactive approval, auto-decide:
2121
- On main? Auto-create feature/<task-slug> branch
2222
- Parent has new commits? Auto-rebase before starting
23-
- Merge? Auto-merge, auto-delete feature/fix branches
23+
- Merge? ALWAYS ask user — merging is never autonomous, even in bypass mode
2424
- Commit message? Auto-generate (meaningful, no AI attribution)
2525
- Tests failing? Fix them. Convention violations? Fix them.
2626
Quality bar stays the same — just no blocking on questions.

packages/cli/templates/.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ FIRST, before writing any code:
1616

1717
If running without interactive approval (sandbox, auto-approve, etc.):
1818
- On main? Auto-create feature/<task-slug> branch
19-
- Parent behind? Auto-rebase. Merge? Auto-merge + delete feature branches.
19+
- Parent behind? Auto-rebase. Merge? ALWAYS ask user — never autonomous.
2020
- Auto-generate meaningful commit messages. Fix tests and violations.
2121

2222
## Mandatory workflow

packages/cli/templates/.windsurfrules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ FIRST, before writing any code:
1616

1717
If running without interactive approval, auto-decide:
1818
- On main? Auto-create feature/<task-slug> branch
19-
- Parent behind? Auto-rebase. Merge? Auto-merge + delete feature branches.
19+
- Parent behind? Auto-rebase. Merge? ALWAYS ask user — never autonomous.
2020
- Auto-generate commit messages. Fix failing tests and violations.
2121
Quality bar stays the same — no blocking on questions.
2222

packages/cli/templates/CONVENTIONS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ When running without interactive approval, agents must NOT ask questions.
5252
Instead, auto-decide using best practices:
5353
- On `main`? → Auto-create `feature/<task-slug>` branch
5454
- Parent branch has new commits? → Auto-rebase before starting
55-
- Ready to merge? → Auto-merge, auto-delete feature/fix branches
56-
(keep long-lived branches like dev, staging, release/*)
55+
- Ready to merge? → **ALWAYS ask user**, even in bypass mode. Merging
56+
is never autonomous. Ask: "Merge <branch> into <target>? Delete or keep?"
5757
- Commit message? → Auto-generate: what changed and why
5858
- Tests failing? → Fix them, don't report the failure and stop
5959
- Convention violations? → Fix them silently

0 commit comments

Comments
 (0)