Repository navigation
feat(aidd-ui): validate the design system on every write - #1133
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mD4irAZumku9bknHhD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mD4irAZumku9bknHhD
… every write Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mD4irAZumku9bknHhD
…larms Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mD4irAZumku9bknHhD
…able folders Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mD4irAZumku9bknHhD
1 task
A link now covers its file's folder, so a component's styles, hooks and tests need no record of their own; a file at a code root still covers only itself. A molecule or composition with no file of its own is coded once every component it uses is. Code is checked for colour literals only. Components need a usage section and cite semantic tokens, never a group system.md declares primitive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mD4irAZumku9bknHhD
blafourcade
marked this pull request as ready for review
October 30, 2026 17:51
Extracting Gouvernail and Kairos into the format showed rules that fail real projects. A link covers its folder only when the folder bears the file's name, else the files of its stem, so a flat folder no longer hides its siblings. An element may use its own level, never itself. Only focus is required of an interactive component. The rem rule goes. The first theme is the base and a themed token gives every other one; an alias must match its type; a value DTCG cannot hold rides a raw CSS extension; $root is named unsupported instead of dropped. A render may set its own custom properties. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mD4irAZumku9bknHhD
…e Code
The hook read only Claude Code's tool_input.file_path and answered only on
stderr. Codex sends apply_patch's patch in tool_input.command; Copilot sends
either a patch string as tool_input or {path, old_str, new_str}, and reads
only additionalContext on stdout. The hook now reads every one of these
shapes and answers on both channels, with exit 2.
Verified against real hosts: a token added to a component without a
definition is quoted back by the model on Claude Code, Codex and Copilot CLI.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XeK3mD4irAZumku9bknHhD
This was referenced Oct 30, 2026
A Codex model read exit 2 after a write as a refused edit and reported no file changed, though the file was written. The hand-back now opens with a line saying the write landed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mD4irAZumku9bknHhD
…ed edit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mD4irAZumku9bknHhD
…host Exit 2 after a write read as a refused edit on Codex. The hook now exits 0 and answers in the shape each host reads: hookSpecificOutput.additionalContext on Claude Code and Codex, top-level additionalContext on Copilot. A write marks the turn; Stop blocks once while problems remain, and not again on a forced continuation. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mDvAh1xZvZGAKEVhJn
The shipped hooks.json listed SessionStart and PostToolUse only, so no install ran the turn-end check. Tests named it; a guard on the declaration now fails without Stop. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mDvAh1xZvZGAKEVhJn
… continuation Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mDvAh1xZvZGAKEVhJn
…ed link Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mDvAh1xZvZGAKEVhJn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mDvAh1xZvZGAKEVhJn
…ild on Split design status from the version the code implements, version the design system at publication only, name tasks by their folder, version the format, adopt the DTCG Resolver for themes, generate tokens only under aidd_docs/ui, one engine for every generation, and a severity per problem with scoped hook output. Record the decisions later pull requests own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mDvAh1xZvZGAKEVhJn
A check that throws becomes one problem naming it instead of silencing the rest. A turn mark that cannot be written no longer costs the write its feedback, and Stop reads no project on a turn that wrote nothing watched. Kinds and folders are own keys only, and a byte order mark or CRLF is dropped once for every file, tokens.json included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mDvAh1xZvZGAKEVhJn
…ments `implemented-version` replaces the coded status, so code lagging a new design stays visible. system.md versions at publication only, from the tasks a row lists, so parallel features on distinct elements never conflict, and a token-only change can break. Tasks are task folders, review verdicts carry the version they judge, and system.md states its record format: another format is one problem, never an avalanche. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mDvAh1xZvZGAKEVhJn
…a render uses tokens.json holds the base theme; tokens.resolver.json names a file per other theme, which redefines base tokens only, with their type. Screens cite tokens like components, a render uses only the tokens its record declares, and a raw CSS value's var() must name a token, so an impact report read from the records misses none. system.md names the code's token file, kept out of coverage and colour checks, and tests may state colours. tokens.json is parsed once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mDvAh1xZvZGAKEVhJn
…t the hook prints Every problem carries its rule id, and is an error unless its rule calls it a warning: a code file no record links, and a render width of 2px or less. Only errors fail the validator or block a turn's end. After a write, the hook prints the problems of the files the write reached, its render and the records citing it, or all of them after a shared file, with the count of the other errors; every hook output stops at 20 lines and names the command that shows the rest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mDvAh1xZvZGAKEVhJn
An alias cycle is now a problem on each of its tokens instead of a stated limit, and a walk into a cycle from outside it ends. A test now fails without each guard that had none: an export matched as a whole word, a code root or ignore with a trailing slash, and a length inside var() left to the token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mDvAh1xZvZGAKEVhJn
…er check The record model moves to model.cjs and the literal patterns to literals.cjs, so a check depends on the model, not on a sibling check. Dead guards go: the payload shape test, a trim no header needs, the folder test readdir already makes, the validate wrapper nothing called. Files sort by code unit, the same on every machine; the code tree caches on the project like the token tree; the script scan reads runs of plain text at once, from 1.37 s to 0.9 s on a 5,000-file project. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mDvAh1xZvZGAKEVhJn
validate-ui.cjs becomes aidd-ui.cjs, which takes the job as a command, validate for now, so the generators later pull requests add share its reader instead of copying it. The README states the new format: implemented-version, publication rows, task folders, verdict versions, the Resolver profile, code-tokens, severities and what each hook moment prints. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mDvAh1xZvZGAKEVhJn
…tten The change flow belongs to the design system skill, regenerating renders through the engine and handing review back without naming a skill. The README states what a code root walks, how loosely a variant and an export are found, and the unquoted plugin root. The foundation plan points to the spec for the decisions taken after it ran. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mDvAh1xZvZGAKEVhJn
… patterns One pattern mixing an unanchored folder branch with an anchored name branch read as a precedence mistake. A mock folder now has the test that proves it is skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeK3mDvAh1xZvZGAKEVhJn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 What & why
First of five pull requests rebuilding aidd-ui (roadmap). It lays the foundation: the format of a project's design system under
aidd_docs/ui/, and a deterministic validator that rejects any record, token, render or code link that breaks it. No skill yet.🛠️ How it works
## Historytable per record. Format: plugins/aidd-ui/README.md.statustracks the design;implemented-versionthe version the code implements, so code lagging a new design stays visible.system.mdstates its recordformatand versions at publication only, from the tasks a row lists: parallel features on distinct elements never conflict. A task is its folder; a review verdict names the version it judges.tokens.resolver.json, one file per theme). A render uses only the tokens its record declares, and a raw CSS value'svar()must name a token, so an impact report read from the records misses none.validate, that later generators extend; the hook (ui-hook.cjs) runs it at session start, after every write underaidd_docs/ui/or a code root, and at the end of a turn that wrote one. After a write it prints the problems of the files the write reached, capped at 20 lines.🧪 How to verify
node scripts/check-tests-leave-git-alone.js -- node --test scripts/__tests__/aidd-ui-*.test.js: every rule has one test its mutation turns red.writeProjectfrom scripts/tests/fixtures/aidd-ui/project.js, thennode plugins/aidd-ui/hooks/aidd-ui.cjs validate <dir>:VALID. Break any record: one✗line.## Usageand cite semantic tokens only, a code file no record links and a 2px-or-less render width are warnings, and tests and the code's token file are not checked for colours.🔗 Linked issue
Refs #1120
✅ I certify
🤖 Generated with Claude Code
https://claude.ai/code/session_01XeK3mDvAh1xZvZGAKEVhJn