Skip to content

Commit 71a5055

Browse files
committed
fix(hooks): remove pre-commit placeholder + address bot review
- Remove pre-commit hook installation - it was just a no-op placeholder ('lib/ sync now handled by agent-core'), so installing it was pure redundancy. Only the pre-push hook (preflight + /enhance reminder + release tag validation) actually does anything. - CONTRIBUTING.md: replace em-dash with single dash per workspace rule; update text to reflect that only pre-push is installed now. - docs/ARCHITECTURE.md: update setup-hooks.js comment - was 'npm prepare' before xiaolai's PR; now correctly noted as manual.
1 parent 8a46725 commit 71a5055

3 files changed

Lines changed: 2 additions & 16 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ npm install
4040
npm run setup-hooks
4141
```
4242

43-
The `setup-hooks` script installs pre-commit and pre-push hooks into your local `.git/hooks/`. It does **not** run automatically on `npm install` you must opt in.
43+
The `setup-hooks` script installs the pre-push hook into your local `.git/hooks/` (it runs preflight checks, an `/enhance` reminder, and release-tag validation). It does **not** run automatically on `npm install` - you must opt in.
4444

4545
### Multi-File Changes
4646

docs/ARCHITECTURE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ agentsys/
6363
│ └── maintain-cross-platform/ # Cross-platform compatibility skill
6464
│ └── SKILL.md
6565
├── scripts/
66-
│ ├── setup-hooks.js # Git hooks installer (npm prepare)
66+
│ ├── setup-hooks.js # Git hooks installer (manual: npm run setup-hooks)
6767
│ └── graduate-plugin.js # Extract a plugin to a new standalone repo
6868
├── docs/ # User documentation
6969
│ ├── CROSS_PLATFORM.md

scripts/setup-hooks.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
#!/usr/bin/env node
22
/**
33
* Setup git hooks for development
4-
* - pre-commit: Placeholder (lib/ sync handled by agent-core CI)
54
* - pre-push: Runs preflight checks, /enhance reminder, release validation
65
*/
76

87
const fs = require('fs');
98
const path = require('path');
109

1110
const hookDir = path.join(__dirname, '..', '.git', 'hooks');
12-
const preCommitPath = path.join(hookDir, 'pre-commit');
1311
const prePushPath = path.join(hookDir, 'pre-push');
1412

15-
const preCommitHook = `#!/bin/sh
16-
# Pre-commit hook (lib/ sync now handled by agent-core)
17-
`;
18-
1913
const prePushHook = `#!/bin/sh
2014
# Pre-push validations:
2115
# 1. Run preflight checks (validators + gap checks)
@@ -135,14 +129,6 @@ function main() {
135129
return 0;
136130
}
137131

138-
try {
139-
fs.writeFileSync(preCommitPath, preCommitHook, { mode: 0o755 });
140-
console.log('Git pre-commit hook installed');
141-
} catch (err) {
142-
// Non-fatal - might not have write permissions
143-
console.warn('Could not install pre-commit hook:', err.message);
144-
}
145-
146132
try {
147133
fs.writeFileSync(prePushPath, prePushHook, { mode: 0o755 });
148134
console.log('Git pre-push hook installed (release tag validation)');

0 commit comments

Comments
 (0)