diff --git a/.agents/agents/component-builder.md b/.agents/agents/component-builder.md index c8151e7..9e7af8a 100644 --- a/.agents/agents/component-builder.md +++ b/.agents/agents/component-builder.md @@ -27,6 +27,10 @@ You may not edit `tokens.css`, `verify.mjs`, `astro.config.mjs`, or ## Rules that bite - 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. - Every ARIA attribute from the markup you replace survives. `verify.mjs` asserts several by name. diff --git a/.agents/rules/gates.md b/.agents/rules/gates.md index f547acc..233f262 100644 --- a/.agents/rules/gates.md +++ b/.agents/rules/gates.md @@ -52,11 +52,31 @@ grows a compare mode. ## Bypassing `--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 -intend to merge, and the pre-push gate has no bypass. +task branch that you will amend or squash away**. It is never allowed on a +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. +## 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 - Hooks are **per-worktree**. Git's `index.lock` is per-worktree, so parallel