📝 Add hook-discipline rule to AGENTS.md
The agent must not use `git commit --no-verify` (or skip any hook) to get a green run — bypassing a check to silence it is the same anti-pattern as @ts-nocheck or an oxlint-disable. The pre-commit checks are fast and offline, so a redundant run costs nothing. Records the "redo through the hook" recovery command.
This commit is contained in:
1 parent
436b49e3be
commit
8940537fc0
1 file changed
+2
@@ -26,6 +26,8 @@ Don't silence the type system to force a green run. As an agent these are forbid
|
||||
|
||||
Fix the root cause with the type system instead — narrowing, generics, `satisfies`, conditional / mapped types, utility types (`NonNullable`, `Exclude`, …). TypeScript can express it; that's the intended tool. The `oxlint-disable`-location rule in [CONTRIBUTING.md § Rules the tools don't enforce](./CONTRIBUTING.md#rules-the-tools-dont-enforce) is a **human** last-resort convention (so a reviewer can spot a deliberate suppression) — it is not permission for you to add one. If the types genuinely cannot express something, stop and surface the conflict (commit message / MR) rather than suppress it.
|
||||
|
||||
The same applies to the checks themselves: **never `git commit --no-verify`** (or otherwise skip a pre-commit / pre-push hook). The checks are fast and offline, so a redundant run is fine — bypassing a hook to get green is the identical anti-pattern. If a commit already skipped a hook, redo it through one: `git reset --soft HEAD~1 && git commit -C <skipped-sha>`.
|
||||
|
||||
## Read these
|
||||
|
||||
- [CONTRIBUTING.md § Rules the tools don't enforce](./CONTRIBUTING.md#rules-the-tools-dont-enforce) — the constraints the linters don't catch; CI/review bounce these. **The most important section.**
|
||||
|
||||
Reference in new issue
Block a user