CLAUDE.md did not name the overzicht context that RD-03 created, and it did not name the max-lines budget that RD-02 enforces. An agent that follows it writes a long page into the wrong context, and meets a red build with no warning. CLAUDE.md now names the context, the @overzicht/* alias, the overzicht -> registratie arrow, the 250-line budget and its glob, and the step-component contract. layers.mdx gains the same arrow. atomic-design.mdx credited eslint.config.mjs with the layer rules. dependency-cruiser enforces them. Each tool is now named for what it does. The page also gains the layer-folder table and the step contract. Four paths were pre-monorepo: three example paths in the ui-component skill, and two citations of libs/shared/src/ui/async, which RD-27 moved to libs/shared/src/ui/molecules/async. npm run ci --full passes: 67 and 45 storybook suites, 306 axe tests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
5.8 KiB
5.8 KiB
RD-33 — CLAUDE.md, atomic-design.mdx and the ui-component skill
Status: done Phase: 5 — fix the docs that describe this flow
Why
This arc added a context, a lint rule and a component contract. Three agent-facing documents still describe the app as it was before.
CLAUDE.md is the file every agent reads first. It does not name the overzicht context that
RD-03 created, and it does not name the max-lines budget that RD-02 enforces. An agent that
follows it writes a 400-line page into the wrong context and meets a red build it was never
warned about.
atomic-design.mdx credits eslint.config.mjs with the layer rules. Dependency-cruiser
enforces them. Crediting the wrong tool sends the next reader to the wrong file.
Read first
docs/project/readable-codebase/PLAN.md§3c (line 604, the step contract), §4a (line 721, the layer move) and phase 5 items 4 and 5 (line 837).CLAUDE.md— sections "1. DDD", "2. Atomic design", "5. Testing" and "Enforced, not just hoped-for".libs/shared/docs/atomic-design.mdx:60,libs/shared/docs/layers.mdx:41-45..claude/skills/ui-component/SKILL.md.
Decisions (pre-made, do not relitigate)
- CLAUDE.md gains
overzichtin three places. The context list in section 1, the alias list (@overzicht/*, whichapps/ssp/tsconfig.json:9already declares), and the cross-context arrow. The rule in.dependency-cruiser.ssp.js:8isoverzicht: ['registratie'], so the arrow isoverzicht → registratie → libs/shared|beheer. - CLAUDE.md gains the
max-linesbudget under "Enforced, not just hoped-for", stated as the rule states it: 250 lines,skipBlankLinesandskipComments, over{apps,libs}/**/*.{page,component,section,step}.ts(eslint.config.mjs:64-68). Say that 250 is reachable, not a style-guide default — the dashboard page is 42 lines. - CLAUDE.md gains the step-component contract, in section 2 beside the atomic rules. Three
clauses, from PLAN §3c: inputs down, one narrow output up, and
dispatchis never passed down. Add the corollary: a step gets no story of its own, because the wizard's story already mounts it by seeding the machine. - The
libs/beheertitle rule is already in CLAUDE.md. RD-28 landed it. Verify the sentence is there and correct; do not write it a second time. atomic-design.mdx:60names the wrong tool. The layer rules are dependency-cruiser (npm run dep:check,.dependency-cruiser.base.jsplus one file per app). ESLint owns theanyban andmax-lines. Name each tool for what it actually does.atomic-design.mdxgains the step contract and the layer table, so the Storybook reader and the CLAUDE.md reader get the same rule. The table is the shape RD-27 produced:libs/shared/src/ui/atoms|molecules|organisms/andlibs/shared/src/layout/, with the note thatlayout/deliberately holds several layers.layers.mdxis missing theoverzichtarrow. Its list at lines 41-45 predates RD-03. Add the same arrow as decision 1. This is one line, in the same commit, because the two documents state the same rule and must not disagree.- The
ui-componentskill's example paths are pre-monorepo. Lines 44-46 readsrc/app/shared/ui/button/,src/app/shared/ui/async/andsrc/app/shared/layout/wizard-shell/. They are nowlibs/shared/src/ui/atoms/button/,libs/shared/src/ui/molecules/async/andlibs/shared/src/layout/wizard-shell/. Lines 8, 13 and 24 sayshared/ui/where the folder is now the layer — name the layer folder, because that is the whole point of RD-27. - CLAUDE.md:153 and CLAUDE.md:259 carry the same stale-path defect. Both cite
libs/shared/src/ui/async, which RD-27 moved tolibs/shared/src/ui/molecules/async. Fix both in this commit, alongside decision 8's identical fix in the skill file.
Files
CLAUDE.mdlibs/shared/docs/atomic-design.mdxlibs/shared/docs/layers.mdx.claude/skills/ui-component/SKILL.md
Steps
- CLAUDE.md: decisions 1, 2, 3, and the check in decision 4.
atomic-design.mdx: decisions 5 and 6.layers.mdx: decision 7..claude/skills/ui-component/SKILL.md: decision 8.npm run ci --full.
Acceptance criteria
grep -n overzicht CLAUDE.mdreturns the context, the alias and the arrow.grep -n max-lines CLAUDE.mdreturns the budget, with the glob and the two skip options.- CLAUDE.md states the step contract and the "no story for a step" corollary.
- No document credits
eslint.config.mjswith the layer rules. - Every path in
.claude/skills/ui-component/SKILL.mdresolves. npm run ci --fullis green.
Verification
npm run ci --full. This ticket edits two.mdxfiles, and onlybuild-storybookcatches a broken MDX import. Plainnpm run cidoes not build Storybook.npm run storybook— open Foundations, Atomic design and Layers. Both pages render, and the new table is readable at a narrow width.grep -oE '\[^`](apps|libs)/[^`]`' .claude/skills/ui-component/SKILL.md | tr -d '`' | xargs ls -d` — every path resolves.
Out of scope
ARCHITECTURE.md(RD-31) andfp-tea-atomic-design.md(RD-32).- The other skills in
.claude/skills/. Onlyui-componentcarries stale layer paths. - Renaming
ui/dashboard/. RD-36 owns that, and it runs after this ticket.
Risks
- A broken MDX import passes
npm run ciand fails CI. This is PLAN risk 7. Run--full. - CLAUDE.md is long, and a rule added in the wrong section is a rule nobody finds. Put each addition in the section that already owns its subject: contexts in 1, the step contract in 2, the lint budget in "Enforced, not just hoped-for".
- Two documents, one rule.
layers.mdxand CLAUDE.md both state the cross-context arrows. Write the same arrow in both, or the next reader gets to choose which one to believe.