Commit 74e4489
fix(gx): enforce symlink parity pre-commit + document scripts layout convention (#553)
G5 — Symlink parity check now runs pre-commit
.githooks/pre-commit (the gitguardex local shim) now invokes
scripts/check-script-symlinks.sh before delegating to `gx hook run
pre-commit`. A contributor who accidentally replaces a paired symlink
with a regular file gets instant local feedback instead of waiting for
CI to fail minutes later. The check is guarded by an existence test on
scripts/check-script-symlinks.sh, so consumer repos (where that script
is not scaffolded) silently skip the parity step.
G6 — Document the scripts/ ↔ templates/scripts/ layout convention
A long comment above TEMPLATE_FILES in src/context.js spells out the
two patterns that coexist in this repo, eliminating the "which side is
canonical?" ambiguity that motivated G6:
1. PAIRED files (10): tracked on both sides; scripts/<file> is a
symlink into ../templates/scripts/<file> per PR #548. Edit the
templates/ copy.
2. SCAFFOLD-ONLY files: tracked only under templates/; scaffolded
into gitignored scripts/<file> by `gx setup`. Edit the templates/
copy.
Future contributors adding a new file know exactly which list to
update (check-script-symlinks.sh's required_symlinks vs the
multiagent-safety .gitignore block).
Verified G5 live: breaking a symlink and re-running the hook produces
the FAIL output + "aborting commit" exit 1, matching the CI behavior.
Co-authored-by: NagyVikt <nagy.viktordp@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 7d8a7ca commit 74e4489
4 files changed
Lines changed: 53 additions & 0 deletions
File tree
- .githooks
- openspec/changes/agent-claude-g5-g6-symlink-precommit-gitignore-cleanu-2026-05-11-12-34
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
4 | 19 | | |
5 | 20 | | |
6 | 21 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
140 | 160 | | |
141 | 161 | | |
142 | 162 | | |
| |||
0 commit comments