Commit 52aef3f
docs(agents): correct every rule against the codebase
Validated all 11 files rule by rule against the source. Roughly a third of
the rules were wrong, unrunnable, or described a state the repo does not
hold. Each finding below was verified directly before the fix.
Commands that could not work as written:
- `turbo` is not on PATH, so all three `turbo run …` rows failed with
"command not found". Now `pnpm exec turbo`.
- Turbo filters on the package `name`, not the directory: `--filter=components`
matches zero packages. The real names are now listed.
- `turbo run typecheck --filter=docs` resolves a task whose command is
`<NONEXISTENT>` and exits 0 — a false green. `apps/docs` has no typecheck
script at all. Same for stylelint on the two packages lacking it.
- `pnpm build:tokens` alone leaves styled-system's generated theme CSS stale.
- `pnpm build:doc` already chains generate → ai-docs → skills; the three-command
row was redundant, and the MCP server needs `pnpm build:mcp`.
Rules the codebase contradicts:
- "Rebuild after changing a public API" was wrong. The `hopper-source` export
condition resolves packages from source, so typecheck, tests, Storybook and
the docs site see TS changes with no rebuild. Split from build-after-install,
which is real because CSS resolves from `dist/`.
- "Declare devDependencies per package, pnpm does not hoist" was backwards. No
package declares `stylelint` or `vitest`; they are root-only by design, and
the rule contradicted root AGENTS.md.
- Component tokens are shared by *family*, not owned per component. Five
families have no owning component; `comp-field` is read by 12 modules.
- `packages/components/src/html-elements/` holds only doc previews. The native
wrappers are in `packages/styled-system/src/html-wrappers/html.ts`, where the
`Html` prefix convention makes a native select `HtmlSelect`.
- `Global<Name>CssSelector` is not universal — 14 of 116 components ship none.
- The `style` spread order is not settled: 26 files one way, 27 the other. It
was stated as a hard rule; now it says to match the file being edited.
- The `clsx` argument order carries no meaning and varies by helper; 44 files
use `composeClassnameRenderProps`, which went unmentioned.
Fabricated examples removed. An agent calibrates on these, so a fake one
teaches it to look for the wrong shape of mistake:
- `var(--hop-comp-tooltip-color)` in `AvatarGroup.module.css` — inherited from
the old AGENTS.md and never real; those tokens appear only in Tooltip.
- `[HeadingContext, { fontWeight: … }]` — no context object anywhere passes
`fontWeight`.
- `padding: 8px` — `px` is outside stylelint's `unit-allowed-list`, so it
cannot be written. And one hex colour exists across 90 CSS modules.
- `DefaultIconListSlot` — no such identifier; default slots use the `slot()`
HOC at export.
- `ValidationService.ts`, `ButtonProps.ts`, `breakpoints.ts`, `formatDate.ts`,
`useHover.ts` — none exist. Every naming example is now a real file, and
`Breakpoints.ts` is noted as a PascalCase exception.
- `"$value": "4px"` — component tokens contain no numeric literals; the real
cases are three `blur(10px)` values in sharegate.
PR #1015's guidelines were proposal language, so component-architecture.md now
separates confirmed rules from goals for new API surface, naming where the code
diverges: 8 components expose no wrapper prop bag, `Alert`'s `on*ButtonClick`
and `TextField.onClear` are typed `() => void` and cannot be fixed without a
break, and 18 `ReactNode` content props ship today. `Card` is the counterexample
for parent-driven appearance, not the compliant case — `Callout` is.
versioning.md now attributes Module Federation to consuming apps (this repo has
none), describes the real mechanism — class names version-stamped *and*
content-hashed via `localIdentName`, token declarations scoped under a
`.hop-<version>-<brand>` root class rather than hashed — and notes the two
genuinely unscoped outputs.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 274d919 commit 52aef3f
11 files changed
Lines changed: 329 additions & 188 deletions
File tree
- .claude/rules
- apps/docs
- docs/agents
- packages
- components
- icons
- tokens
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
| |||
25 | 33 | | |
26 | 34 | | |
27 | 35 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
34 | 38 | | |
35 | 39 | | |
36 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
0 commit comments