docs(rules): ban restructuring code to slip past a checker
Task 07 wrote px font sizes as the `font:` shorthand in two components because check-tokens.mjs only matches `font-size:`. Green branch, two hardcoded values. Make the expectation explicit: report the gap, stop. Also fixes gates.md telling agents to rebase WIP commits away, which git-worktrees.md forbids outright.
This commit is contained in:
@@ -27,6 +27,10 @@ You may not edit `tokens.css`, `verify.mjs`, `astro.config.mjs`, or
|
|||||||
## Rules that bite
|
## Rules that bite
|
||||||
|
|
||||||
- No raw hex, no px font sizes, no ad-hoc breakpoints. Tokens only.
|
- No raw hex, no px font sizes, no ad-hoc breakpoints. Tokens only.
|
||||||
|
- **Never reshape CSS to slip past `check-tokens.mjs`** — e.g. the `font:`
|
||||||
|
shorthand to hide a px size it would catch as `font-size:`. If the token you
|
||||||
|
need does not exist, report the gap and stop; you may not add it yourself. See
|
||||||
|
`.agents/rules/gates.md`.
|
||||||
- No `client:*` unless genuinely interactive, with written justification.
|
- No `client:*` unless genuinely interactive, with written justification.
|
||||||
- Every ARIA attribute from the markup you replace survives. `verify.mjs`
|
- Every ARIA attribute from the markup you replace survives. `verify.mjs`
|
||||||
asserts several by name.
|
asserts several by name.
|
||||||
|
|||||||
+22
-2
@@ -52,11 +52,31 @@ grows a compare mode.
|
|||||||
## Bypassing
|
## Bypassing
|
||||||
|
|
||||||
`--no-verify` is allowed exactly once: a work-in-progress commit **on your own
|
`--no-verify` is allowed exactly once: a work-in-progress commit **on your own
|
||||||
task branch that you will rebase away**. It is never allowed on a commit you
|
task branch that you will amend or squash away**. It is never allowed on a
|
||||||
intend to merge, and the pre-push gate has no bypass.
|
commit you intend to merge, and the pre-push gate has no bypass.
|
||||||
|
|
||||||
If a gate is wrong, fix the gate in its own commit. Do not route around it.
|
If a gate is wrong, fix the gate in its own commit. Do not route around it.
|
||||||
|
|
||||||
|
## Never restructure code to slip past a checker
|
||||||
|
|
||||||
|
A checker is a proxy for a rule. Passing the proxy while breaking the rule is
|
||||||
|
worse than failing, because failure is visible and this is not.
|
||||||
|
|
||||||
|
`check-tokens.mjs` matches `font-size: Npx`. Writing the same value as the
|
||||||
|
`font:` shorthand passes it. Task 07 did exactly that, in **two** components,
|
||||||
|
with a comment saying so. Both hardcoded values survived into a "green" branch.
|
||||||
|
|
||||||
|
When a token you need does not exist:
|
||||||
|
|
||||||
|
1. Stop. Do not invent a value, and do not reshape the syntax to hide one.
|
||||||
|
2. Write the gap in your task report: the selector, the legacy value(s) it comes
|
||||||
|
from, and which file owns the token.
|
||||||
|
3. If your task cannot proceed without it, say so and stop. A blocked task is a
|
||||||
|
finding. A silently-passing one is a defect that ships.
|
||||||
|
|
||||||
|
`tokens.css` has a single owner (`design-system-keeper`) precisely so that "add
|
||||||
|
a token" is a decision, not a side effect.
|
||||||
|
|
||||||
## Parallelism
|
## Parallelism
|
||||||
|
|
||||||
- Hooks are **per-worktree**. Git's `index.lock` is per-worktree, so parallel
|
- Hooks are **per-worktree**. Git's `index.lock` is per-worktree, so parallel
|
||||||
|
|||||||
Reference in New Issue
Block a user