Skip to content

feat: corpus-back ui-ux principle loader + 4 foundational principles#86

Merged
KailasMahavarkar merged 4 commits intomainfrom
feat/corpus-ui-ux-principles
Apr 21, 2026
Merged

feat: corpus-back ui-ux principle loader + 4 foundational principles#86
KailasMahavarkar merged 4 commits intomainfrom
feat/corpus-ui-ux-principles

Conversation

@KailasMahavarkar
Copy link
Copy Markdown
Collaborator

Summary

  • Adds corpus support to src/plugins/ui-ux/tools/get-principle.ts with a generic per-principle loader (validates name/domain/rule/detail) that falls back to the in-file PRINCIPLES array when the slice is missing
  • Creates the frontend.ui-ux corpus namespace
  • Adds 4 corpus-backed principle slices: type-scale, wcag-contrast, dark-mode-principles, touch-targets
  • Registers frontend.ui-ux in corpus/index.yaml
  • New tests/ui-ux-principle-corpus-backed-tools-behaviour.test.ts asserts corpus source for every migrated principle

Test plan

  • bun test tests/ui-ux-principle-corpus-backed-tools-behaviour.test.ts - 5 pass
  • bun run build - typecheck exit 0

KailasMahavarkar and others added 4 commits April 22, 2026 02:28
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>
@KailasMahavarkar KailasMahavarkar force-pushed the feat/corpus-ui-ux-principles branch from 2bac0c5 to 7fa2676 Compare April 21, 2026 20:58
@KailasMahavarkar KailasMahavarkar merged commit 650012c into main Apr 21, 2026
4 checks passed
@KailasMahavarkar KailasMahavarkar deleted the feat/corpus-ui-ux-principles branch April 21, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant