Skip to content

Commit 9b878a4

Browse files
committed
fix(scaffold): drop guard-main-merge hook so end users can merge to main locally
This hook prompted on every 'git merge' and every 'git push ... main' through Claude's Bash tool. That matches the framework dev's preference for a strict GitHub-PR-only workflow, but it is the wrong default for end users. Scaffolded webjs apps may use GitLab, Bitbucket, plain git, or just merge locally without a forge at all. End-user enforcement against main is now layered as: * .hooks/pre-commit (tool-agnostic) blocks direct commits to main * .claude/hooks/guard-branch-context.sh prompts before editing on main Both of those work with any git workflow including local merges and direct pushes to main. The framework repo keeps its own copy of the merge guard if the user wants to formalize their PR-only workflow there.
1 parent c63dacb commit 9b878a4

3 files changed

Lines changed: 1 addition & 55 deletions

File tree

packages/cli/lib/create.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ export async function scaffoldApp(name, cwd, opts = {}) {
267267
'.claude.json',
268268
'.claude/settings.json',
269269
'.claude/hooks/block-prose-punctuation.sh',
270-
'.claude/hooks/guard-main-merge.sh',
271270
'.claude/hooks/guard-branch-context.sh',
272271
'.claude/hooks/nudge-uncommitted.sh',
273272
// Gemini CLI config + hooks
@@ -295,7 +294,7 @@ export async function scaffoldApp(name, cwd, opts = {}) {
295294

296295
// Make hook scripts executable
297296
const { chmod } = await import('node:fs/promises');
298-
for (const hook of ['block-prose-punctuation.sh', 'guard-main-merge.sh', 'guard-branch-context.sh', 'nudge-uncommitted.sh']) {
297+
for (const hook of ['block-prose-punctuation.sh', 'guard-branch-context.sh', 'nudge-uncommitted.sh']) {
299298
const hookPath = join(appDir, '.claude', 'hooks', hook);
300299
if (existsSync(hookPath)) await chmod(hookPath, 0o755);
301300
}

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

Lines changed: 0 additions & 44 deletions
This file was deleted.

packages/cli/templates/.claude/settings.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@
1010
}
1111
]
1212
},
13-
{
14-
"matcher": "Bash",
15-
"hooks": [
16-
{
17-
"type": "command",
18-
"command": ".claude/hooks/guard-main-merge.sh"
19-
}
20-
]
21-
},
2213
{
2314
"matcher": "Edit|Write",
2415
"hooks": [

0 commit comments

Comments
 (0)