feat: corpus-back ui-ux principle loader + 4 foundational principles#86
Merged
KailasMahavarkar merged 4 commits intomainfrom Apr 21, 2026
Merged
feat: corpus-back ui-ux principle loader + 4 foundational principles#86KailasMahavarkar merged 4 commits intomainfrom
KailasMahavarkar merged 4 commits intomainfrom
Conversation
Adds corpus support to `src/plugins/ui-ux/tools/get-principle.ts`. Tool now reads per-principle slices from `corpus/frontend/ui-ux/<name>.yaml`, validates required fields (domain, rule, detail), and falls back to the in-file PRINCIPLES array when the corpus entry is missing or invalid. Creates the ui-ux corpus namespace: - `corpus/frontend/ui-ux/index.yaml` registers the `frontend.ui-ux` namespace and principle files - `corpus/frontend/ui-ux/type-scale.yaml` captures the typography type-scale principle (rule, detail, clamp() CSS, anti-patterns) - `corpus/index.yaml` registers the new namespace New `tests/ui-ux-principle-corpus-backed-tools-behaviour.test.ts` asserts corpus source for type-scale and fallback for wcag-contrast. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds corpus/frontend/ui-ux/wcag-contrast.yaml with AA/AAA thresholds, OKLCH lightness fix guidance, and contrast tooling examples. Registers wcag-contrast in namespace index. Test asserts corpus source for wcag-contrast; fallback check moves to dark-mode-principles. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds corpus/frontend/ui-ux/dark-mode-principles.yaml with warm-charcoal background, off-white text, elevation-by-bg-color, and saturation rules for dark UIs. Registers dark-mode-principles in namespace index. Test asserts corpus source for dark-mode-principles; fallback check moves to touch-targets. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds corpus/frontend/ui-ux/touch-targets.yaml with WCAG 44px minimum, 48px recommendation, hit-area expansion pattern, and gap rules. Registers touch-targets in namespace index. Test asserts corpus source for touch-targets; fallback check moves to easing-rules. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2bac0c5 to
7fa2676
Compare
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.
Summary
src/plugins/ui-ux/tools/get-principle.tswith a generic per-principle loader (validates name/domain/rule/detail) that falls back to the in-file PRINCIPLES array when the slice is missingfrontend.ui-uxcorpus namespacefrontend.ui-uxincorpus/index.yamltests/ui-ux-principle-corpus-backed-tools-behaviour.test.tsasserts corpus source for every migrated principleTest plan