tribunal-kit 5.8.2 β†’ 5.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/.agent/ARCHITECTURE.md +12 -12
  2. package/.agent/agents/complexity-reviewer.md +53 -0
  3. package/.agent/agents/precedence-reviewer.md +12 -12
  4. package/.agent/agents/swarm-worker-registry.md +3 -3
  5. package/.agent/history/integrity_manifest.json +958 -0
  6. package/.agent/history/memory/.memory.idx +305 -1
  7. package/.agent/history/memory/MEMORY.md +21 -1
  8. package/.agent/rules/GEMINI.md +31 -28
  9. package/.agent/scripts/case_law_manager.js +3 -15
  10. package/.agent/scripts/context_broker.js +3 -1
  11. package/.agent/scripts/guardrail_engine.js +643 -0
  12. package/.agent/scripts/integrity_manifest.js +486 -0
  13. package/.agent/scripts/signal_detector.js +1 -1
  14. package/.agent/scripts/skill_evolution.js +3 -15
  15. package/.agent/scripts/skill_integrator.js +2 -12
  16. package/.agent/scripts/swarm_dispatcher.js +2 -12
  17. package/.agent/skills/12-principles-of-animation/SKILL.md +69 -0
  18. package/.agent/skills/60fps-animation/SKILL.md +78 -0
  19. package/.agent/skills/accessible-animation/SKILL.md +86 -0
  20. package/.agent/skills/adapt/SKILL.md +75 -0
  21. package/.agent/skills/animation-on-scroll/SKILL.md +110 -0
  22. package/.agent/skills/animation-systems/SKILL.md +69 -0
  23. package/.agent/skills/antfu-conventions/SKILL.md +74 -0
  24. package/.agent/skills/app-builder/SKILL.md +1 -1
  25. package/.agent/skills/apple-design/SKILL.md +108 -0
  26. package/.agent/skills/audit-and-fix/SKILL.md +83 -0
  27. package/.agent/skills/baseline-ui/SKILL.md +74 -0
  28. package/.agent/skills/better-colors/SKILL.md +124 -0
  29. package/.agent/skills/better-typography/SKILL.md +111 -0
  30. package/.agent/skills/better-ui/SKILL.md +102 -0
  31. package/.agent/skills/bolder/SKILL.md +68 -0
  32. package/.agent/skills/build-primitive/SKILL.md +70 -0
  33. package/.agent/skills/clarify/SKILL.md +75 -0
  34. package/.agent/skills/cobejs/SKILL.md +96 -0
  35. package/.agent/skills/codebase-design/SKILL.md +84 -0
  36. package/.agent/skills/colorize/SKILL.md +77 -0
  37. package/.agent/skills/compact-landing/SKILL.md +70 -0
  38. package/.agent/skills/company-logos/SKILL.md +73 -0
  39. package/.agent/skills/create-design-md/SKILL.md +104 -0
  40. package/.agent/skills/critique/SKILL.md +95 -0
  41. package/.agent/skills/delight/SKILL.md +65 -0
  42. package/.agent/skills/design-lab/SKILL.md +59 -0
  43. package/.agent/skills/diagnosing-bugs/SKILL.md +190 -0
  44. package/.agent/skills/distill/SKILL.md +65 -0
  45. package/.agent/skills/domain-modeling/SKILL.md +78 -0
  46. package/.agent/skills/fixing-accessibility/SKILL.md +98 -0
  47. package/.agent/skills/fixing-metadata/SKILL.md +97 -0
  48. package/.agent/skills/fixing-motion-performance/SKILL.md +96 -0
  49. package/.agent/skills/gpt-taste/SKILL.md +68 -0
  50. package/.agent/skills/harden/SKILL.md +74 -0
  51. package/.agent/skills/impeccable/SKILL.md +72 -0
  52. package/.agent/skills/improve-codebase-architecture/SKILL.md +67 -0
  53. package/.agent/skills/improve-ui/SKILL.md +83 -0
  54. package/.agent/skills/landing-page/SKILL.md +88 -0
  55. package/.agent/skills/lint-and-validate/SKILL.md +1 -2
  56. package/.agent/skills/local-first-architecture/SKILL.md +66 -0
  57. package/.agent/skills/lottie-animation/SKILL.md +82 -0
  58. package/.agent/skills/marquee-loop/SKILL.md +96 -0
  59. package/.agent/skills/masked-reveal/SKILL.md +88 -0
  60. package/.agent/skills/micro-interaction/SKILL.md +100 -0
  61. package/.agent/skills/morphing-icons/SKILL.md +85 -0
  62. package/.agent/skills/page-transition-animation/SKILL.md +108 -0
  63. package/.agent/skills/parallel-agents/SKILL.md +5 -5
  64. package/.agent/skills/polish/SKILL.md +63 -0
  65. package/.agent/skills/pricing-page/SKILL.md +68 -0
  66. package/.agent/skills/progressive-blur/SKILL.md +100 -0
  67. package/.agent/skills/project-idioms/SKILL.md +7 -7
  68. package/.agent/skills/quieter/SKILL.md +68 -0
  69. package/.agent/skills/react-doctor/SKILL.md +70 -0
  70. package/.agent/skills/redesign-skill/SKILL.md +65 -0
  71. package/.agent/skills/shape/SKILL.md +73 -0
  72. package/.agent/skills/soft-skill/SKILL.md +72 -0
  73. package/.agent/skills/sounds-on-the-web/SKILL.md +100 -0
  74. package/.agent/skills/svg-animation/SKILL.md +91 -0
  75. package/.agent/skills/swiss-design/SKILL.md +64 -0
  76. package/.agent/skills/taste-skill/SKILL.md +71 -0
  77. package/.agent/skills/tdd-workflow/SKILL.md +36 -165
  78. package/.agent/skills/test-result-analyzer/SKILL.md +1 -1
  79. package/.agent/skills/thermo-nuclear-code-quality-review/SKILL.md +82 -0
  80. package/.agent/skills/to-spring-or-not-to-spring/SKILL.md +66 -0
  81. package/.agent/skills/transitions-dev/SKILL.md +101 -0
  82. package/.agent/skills/typeset/SKILL.md +76 -0
  83. package/.agent/skills/ui-skills-root/SKILL.md +85 -0
  84. package/.agent/skills/web-quality-audit/SKILL.md +67 -0
  85. package/.agent/workflows/fix.md +2 -2
  86. package/.agent/workflows/preview.md +5 -5
  87. package/.agent/workflows/status.md +1 -1
  88. package/.agent/workflows/tribunal-full.md +3 -3
  89. package/.agent/workflows/tribunal-speed.md +2 -2
  90. package/README.md +348 -238
  91. package/bin/tribunal-kit.js +62 -1482
  92. package/dist/cli.js +13 -0
  93. package/dist/commands/align.js +1 -1
  94. package/dist/commands/compile.js +1 -1
  95. package/dist/commands/guardrail.js +275 -0
  96. package/dist/commands/init.js +10 -9
  97. package/dist/commands/optimize.js +318 -0
  98. package/dist/utils/version.js +1 -1
  99. package/package.json +10 -8
  100. package/scripts/fix-vbc.js +98 -0
  101. package/scripts/fix-vbc.ps1 +119 -0
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: audit-and-fix
3
+ description: Accessibility auditing and remediation workflow combining detection, prioritization, and practical code fixes for WCAG 2.2 AA compliance issues.
4
+ version: 1.0.0
5
+ last-updated: 2026-07-22
6
+ applies-to-model: gemini-3-6-flash, claude-3-7-sonnet
7
+ routing:
8
+ domain: Accessibility Auditing & Remediation
9
+ tier: pro
10
+ co-requires: [web-accessibility-auditor, fixing-accessibility]
11
+ trigger-signals:
12
+ strong: [audit-and-fix, accessibility audit, WCAG remediation, fix accessibility, a11y audit, AccessLint]
13
+ weak: [a11y check, accessibility fix]
14
+ ---
15
+
16
+ # Audit and Fix β€” Accessibility Remediation Workflow
17
+
18
+ Systematically audit HTML/JSX markup against WCAG 2.2 AA standards, prioritize accessibility violations, and apply verified code fixes.
19
+
20
+ ---
21
+
22
+ ## 4-Step Remediation Pipeline
23
+
24
+ ### 1. Automated Violation Detection
25
+ Scan component code for:
26
+ - Missing `alt` tags on `<img>` elements.
27
+ - Form controls (`<input>`, `<select>`) missing associated `<label>` or `aria-label`.
28
+ - Buttons with icon-only content missing `aria-label`.
29
+ - Non-interactive elements (`<div>`, `<span>`) with `onClick` handlers missing `role="button"` and `tabIndex={0}`.
30
+
31
+ ### 2. Prioritization Matrix
32
+
33
+ | Severity Level | Violation Type | Remediation Action |
34
+ | --- | --- | --- |
35
+ | πŸ”΄ **Blocker (Level A)** | Inaccessible form inputs, un-trapped focus in modal, zero keyboard access | Add explicit `<label>`, focus trap, and keyboard handlers immediately. |
36
+ | 🟠 **Critical (Level AA)** | Low text contrast ratio ($< 4.5:1$), missing ARIA states on custom dropdowns | Adjust text colors to OKLCH contrast targets; add `aria-expanded`. |
37
+ | 🟑 **Moderate (Level AA)** | Missing landmark regions (`<main>`, `<nav>`, `<header>`), heading hierarchy gaps | Wrap layout blocks in semantic HTML5 tags. |
38
+
39
+ ### 3. Concrete Code Fix Examples
40
+
41
+ ```tsx
42
+ // BEFORE (Inaccessible)
43
+ <div onClick={submitForm} className="btn">Submit</div>
44
+
45
+ // AFTER (Accessible)
46
+ <button type="submit" onClick={submitForm} className="btn">Submit</button>
47
+ ```
48
+
49
+ ```tsx
50
+ // BEFORE (Icon Only Button)
51
+ <button onClick={openSettings}><SettingsIcon /></button>
52
+
53
+ // AFTER (Accessible Icon Button)
54
+ <button onClick={openSettings} aria-label="Open settings"><SettingsIcon aria-hidden="true" /></button>
55
+ ```
56
+
57
+ ---
58
+
59
+ ## πŸ€– LLM-Specific Traps
60
+
61
+ 1. **Adding Redundant ARIA**: Adding `role="button"` to native `<button>` tags (valid HTML5 buttons don't need redundant roles).
62
+ 2. **Deleting Decorative SVGs from Screen Readers**: Forgetting `aria-hidden="true"` on decorative icons inside labeled buttons.
63
+
64
+ ---
65
+
66
+ ## πŸ›οΈ Tribunal Integration (Anti-Hallucination)
67
+
68
+ **Active reviewers: `accessibility-reviewer` Β· `frontend-reviewer`**
69
+
70
+ ### βœ… Pre-Flight Self-Audit
71
+
72
+ ```
73
+ βœ… Are all icon-only buttons provided with descriptive `aria-label` attributes?
74
+ βœ… Are decorative SVG icons hidden from screen readers with `aria-hidden="true"`?
75
+ βœ… Do custom interactive controls support Enter and Space key triggers?
76
+ ```
77
+
78
+ ### πŸ›‘ Verification-Before-Completion (VBC) Protocol
79
+
80
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
81
+
82
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
83
+ - βœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: baseline-ui
3
+ description: Quickly deslop UI code by fixing spacing, hierarchy, typography, contrast, and small layout issues. Use when the interface needs a fast cleanup or polish pass.
4
+ version: 1.0.0
5
+ last-updated: 2026-07-22
6
+ applies-to-model: gemini-3-6-flash, claude-3-7-sonnet
7
+ routing:
8
+ domain: UI Cleanup & Refinement
9
+ tier: basic
10
+ co-requires: [better-ui, frontend-design]
11
+ trigger-signals:
12
+ strong: [baseline-ui, deslop, cleanup ui, fix spacing, visual hierarchy, fix alignment]
13
+ weak: [tidy up, fix css, layout cleanup]
14
+ ---
15
+
16
+ # Baseline UI β€” Fast Deslopping & Hierarchy Cleanup
17
+
18
+ Enforces an opinionated UI baseline to clean up sloppy code and prevent AI-generated interface slop without changing product architecture or feature scope.
19
+
20
+ ---
21
+
22
+ ## 1. Stack & System Constraints
23
+
24
+ - **Tailwind CSS Defaults**: MUST use Tailwind CSS default utilities unless custom values already exist or are explicitly requested.
25
+ - **Animation Primitives**: MUST use `motion/react` (formerly `framer-motion`) when JavaScript animation is required.
26
+ - **Utility Class Merging**: MUST use `cn` utility (`clsx` + `tailwind-merge`) for dynamic class logic.
27
+ - **Accessible Component Primitives**: MUST use established accessible primitives (`Base UI`, `React Aria`, `Radix`) for anything with keyboard or focus behavior. Prefer `Base UI` for new unstyled primitives.
28
+ - **Destructive Actions**: MUST use an `AlertDialog` for destructive or irreversible actions.
29
+ - **Loading States**: SHOULD use structural skeletons for loading states instead of plain spinners.
30
+
31
+ ---
32
+
33
+ ## 2. The 5-Step UI Deslop Protocol
34
+
35
+ 1. **Fix Spacing Violations**: Replace hardcoded arbitrary margins/paddings (`margin-top: 13px`, `padding: 7px 11px`) with an 8px grid system (`4px`, `8px`, `12px`, `16px`, `24px`, `32px`, `48px`).
36
+ 2. **Establish Typographic Hierarchy**: Max 3 font sizes per component context. Headings bold/semibold with tight letter-spacing (`-0.025em`) and `text-wrap: balance`. Body text regular with `1.5` line height.
37
+ 3. **Elevate Contrast Ratios**: Eliminate low-contrast gray-on-gray text. Ensure text meets minimum WCAG AA 4.5:1 ratio against background.
38
+ 4. **Clean Up Borders & Dividers**: Replace harsh 100% opaque black/white borders with subtle 8%-12% opacity borders (`border-color: rgba(255,255,255,0.08)` or `var(--border)`).
39
+ 5. **Enforce Container Alignment & Active Feedback**: Align text left with action buttons, group related controls with flex gaps, and add instant press feedback (`scale(0.97)`) on all interactive targets.
40
+
41
+ ---
42
+
43
+ ## Anti-Slop Table
44
+
45
+ | Slop Pattern | Baseline Fix | Rationale |
46
+ | --- | --- | --- |
47
+ | `color: #888` on dark background | `color: var(--text-muted)` (min 4.5:1 ratio) | Improves readability and WCAG compliance |
48
+ | `padding: 15px 23px` | `padding: 16px 24px` | Aligns to 8px structural grid |
49
+ | `border: 1px solid black` | `border: 1px solid rgba(0,0,0,0.1)` | Removes harsh, distracting lines |
50
+ | Mixed font sizes (13px, 14px, 15px) | Standardized scale (12px, 14px, 16px) | Establishes clear visual hierarchy |
51
+ | Plain text buttons without states | Rounded button with hover/active press feedback | Indicates clickability and tactile response |
52
+
53
+ ---
54
+
55
+ ## πŸ€– LLM-Specific Traps
56
+
57
+ 1. **Re-architecting when asked to deslop**: Modifying component state, context, or props when only CSS/visual cleanup was requested.
58
+ 2. **Rebuilding native accessibility by hand**: Writing custom keyboard listener loops instead of using primitives (`Base UI`, `Radix`).
59
+
60
+ ---
61
+
62
+ ## πŸ›οΈ Tribunal Integration (Anti-Hallucination)
63
+
64
+ ### βœ… Pre-Flight Self-Audit
65
+
66
+ ```
67
+ βœ… Did I retain existing product logic and HTML structure?
68
+ βœ… Are all spacing values aligned to standard multiples (4/8/12/16/24/32)?
69
+ βœ… Is text contrast WCAG AA compliant and are icon buttons labeled with aria-label?
70
+ ```
71
+
72
+ ### πŸ›‘ Verification-Before-Completion (VBC) Protocol
73
+
74
+ Inspect UI layout across desktop and mobile viewports in browser preview to verify visual polish.
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: better-colors
3
+ description: OKLCH color space for web projects. Convert hex/rgb/hsl to oklch, generate palettes, check contrast, handle gamut boundaries, and theme with Tailwind v4. Triggers on oklch, color conversion, palette generation, contrast ratio, gamut, display p3, design tokens, hue drift, chroma, dark mode colors.
4
+ version: 1.0.0
5
+ last-updated: 2026-07-22
6
+ applies-to-model: gemini-3-6-flash, claude-3-7-sonnet
7
+ routing:
8
+ domain: UI Craft & Design Engineering
9
+ tier: pro
10
+ co-requires: [colorize, better-ui]
11
+ trigger-signals:
12
+ strong: [better-colors, oklch, color palette, contrast ratio, gamut, display p3, hue drift, dark mode colors]
13
+ weak: [colors, palette, theme, dark mode]
14
+ ---
15
+
16
+ # Better Colors β€” OKLCH & Modern Web Color Systems
17
+
18
+ Design engineering guidelines for building perceptually uniform, WCAG 2.2 AA compliant, P3-gamut color systems using the modern **OKLCH** color space.
19
+
20
+ ---
21
+
22
+ ## 1. Why OKLCH Over HSL / RGB
23
+
24
+ - **Perceptual Uniformity**: In HSL, yellow (`hsl(60, 100%, 50%)`) is far brighter than blue (`hsl(240, 100%, 50%)`) at the exact same lightness value. OKLCH fixes this: lightness (`L`) corresponds directly to human eye perception.
25
+ - **Predictable Palette Steps**: Changing lightness in OKLCH scales brightness smoothly without hue drift (e.g. blue turning purple when lightened in HSL).
26
+ - **Wide Gamut Access**: Access Display P3 wide-gamut colors (`oklch(L C H)`), producing significantly richer, punchier vibrant tones on modern displays.
27
+
28
+ ---
29
+
30
+ ## 2. OKLCH Syntax & Variables
31
+
32
+ $$\text{Format: } \text{oklch}(L \quad C \quad H [\quad / \quad A])$$
33
+
34
+ - `L` (Lightness): `0%` (black) to `100%` (white) or `0` to `1`.
35
+ - `C` (Chroma): `0` (gray) to `0.37+` (vibrant peak). Typical UI chroma range: `0.02` to `0.22`.
36
+ - `H` (Hue): `0` to `360` degrees.
37
+ - `0` / `360`: Red / Magenta
38
+ - `90`: Yellow / Gold
39
+ - `140`: Green / Emerald
40
+ - `250`: Blue / Indigo
41
+ - `300`: Purple / Violet
42
+
43
+ ### CSS Custom Properties Setup
44
+
45
+ ```css
46
+ :root {
47
+ /* Brand Primary: Vibrant Indigo */
48
+ --color-primary: oklch(0.55 0.22 260);
49
+ --color-primary-hover: oklch(0.50 0.24 260);
50
+ --color-primary-active: oklch(0.45 0.25 260);
51
+ --color-primary-subtle: oklch(0.94 0.04 260);
52
+
53
+ /* Neutrals: Subtly Tinted (Chroma ~ 0.015) */
54
+ --bg-surface: oklch(0.99 0.005 260);
55
+ --bg-surface-raised: oklch(0.96 0.01 260);
56
+ --text-main: oklch(0.20 0.02 260);
57
+ --text-muted: oklch(0.45 0.02 260);
58
+ --border-subtle: oklch(0.88 0.015 260);
59
+ }
60
+
61
+ @media (prefers-color-scheme: dark) {
62
+ :root {
63
+ --bg-surface: oklch(0.14 0.015 260);
64
+ --bg-surface-raised: oklch(0.19 0.02 260);
65
+ --text-main: oklch(0.96 0.01 260);
66
+ --text-muted: oklch(0.68 0.02 260);
67
+ --border-subtle: oklch(0.26 0.02 260);
68
+ }
69
+ }
70
+ ```
71
+
72
+ ---
73
+
74
+ ## 3. WCAG 2.2 AA Contrast Standards
75
+
76
+ Always verify contrast using WCAG AA minimum thresholds:
77
+ - **Normal Text (< 18pt / < 24px)**: Minimum **4.5:1** contrast ratio.
78
+ - **Large Text (β‰₯ 18pt / β‰₯ 24px bold)**: Minimum **3.0:1** contrast ratio.
79
+ - **UI Components & Icons**: Minimum **3.0:1** contrast ratio against adjacent surface.
80
+
81
+ ### Rule of Thumb in OKLCH:
82
+ To achieve 4.5:1 text contrast against a surface:
83
+ - Against Light Surface (`L β‰ˆ 98%`): Text lightness `L` MUST be **`≀ 45%`**.
84
+ - Against Dark Surface (`L β‰ˆ 14%`): Text lightness `L` MUST be **`β‰₯ 70%`**.
85
+
86
+ ---
87
+
88
+ ## 4. Dark Mode & Gamut Boundaries
89
+
90
+ - **Avoid Raw Black (`#000`)**: Use deep OKLCH neutrals (`oklch(0.14 0.015 250)`). Pure black destroys depth perception and makes borders look harsh.
91
+ - **Desaturate Accent Colors in Dark Mode**: High chroma values (`C > 0.20`) cause visual fatigue and vibration on dark backgrounds. Lower chroma by ~20-30% (`C β‰ˆ 0.14-0.16`).
92
+
93
+ ---
94
+
95
+ ## Anti-Slop Table
96
+
97
+ | Anti-Pattern | OKLCH Solution | Rationale |
98
+ | --- | --- | --- |
99
+ | Single gray for all backgrounds | Neutral tinted with brand hue (`C: 0.01-0.02`) | Creates cohesive, harmonious UI surfaces |
100
+ | Over-saturated dark mode accents | Scale chroma down (`C: 0.22` β†’ `C: 0.15`) in dark mode | Eliminates glowing text vibration & visual strain |
101
+ | Harsh pure black borders (`#000`) | Alpha-tinted borders (`rgba(255,255,255,0.08)`) | Smooths elevation layers |
102
+
103
+ ---
104
+
105
+ ## πŸ€– LLM-Specific Traps
106
+
107
+ 1. **Using HSL for Dark Mode Inversion**: Inverting `lightness` in HSL causes dramatic hue shifts and contrast failures.
108
+ 2. **Exceeding Display P3 Gamut**: Setting Chroma `C > 0.32` without fallback causes clipping or dull rendering on non-P3 displays.
109
+
110
+ ---
111
+
112
+ ## πŸ›οΈ Tribunal Integration (Anti-Hallucination)
113
+
114
+ ### βœ… Pre-Flight Self-Audit
115
+
116
+ ```
117
+ βœ… Are all color custom properties defined using OKLCH?
118
+ βœ… Does text meet the minimum 4.5:1 WCAG AA contrast ratio?
119
+ βœ… Are dark mode surfaces subtly tinted rather than pure #000000 black?
120
+ ```
121
+
122
+ ### πŸ›‘ Verification-Before-Completion (VBC) Protocol
123
+
124
+ Inspect colors across light and dark modes in browser preview to verify contrast and visual harmony.
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: better-typography
3
+ description: Web typography from choosing fonts to spacing, wrapping, and accessibility. Use when picking or pairing typefaces, configuring variable fonts or OpenType features, setting up a type scale, styling text in components, truncating text, styling underlines, selection, placeholders, or carets. Triggers on typography, fonts, variable fonts, font-weight, opentype, letter-spacing, line-height, type scale, tabular numbers, text-wrap, truncation, line clamp, measure, line length.
4
+ version: 1.0.0
5
+ last-updated: 2026-07-22
6
+ applies-to-model: gemini-3-6-flash, claude-3-7-sonnet
7
+ routing:
8
+ domain: UI Craft & Design Engineering
9
+ tier: pro
10
+ co-requires: [typeset, better-ui]
11
+ trigger-signals:
12
+ strong: [better-typography, typography, type scale, font pairing, tabular numbers, text-wrap balance, line-length, optical sizing]
13
+ weak: [fonts, text style, line height]
14
+ ---
15
+
16
+ # Better Typography β€” Web Typography & Font Engineering
17
+
18
+ Design engineering guidelines for setting up modern, readable, scalable typography with OpenType features, fluid type scales, and optimal measure.
19
+
20
+ ---
21
+
22
+ ## 1. Modular Type Scales & Line Cadence
23
+
24
+ Scale font sizes using a consistent multiplier ($1.25$ Major Third or $1.20$ Minor Third):
25
+
26
+ ```css
27
+ :root {
28
+ --font-size-xs: 0.75rem; /* 12px - Labels, Badges */
29
+ --font-size-sm: 0.875rem; /* 14px - Meta, Caption */
30
+ --font-size-base: 1rem; /* 16px - Body Text */
31
+ --font-size-lg: 1.125rem; /* 18px - Lead Body */
32
+ --font-size-xl: 1.375rem; /* 22px - Subheadings */
33
+ --font-size-2xl: 1.75rem; /* 28px - H3 */
34
+ --font-size-3xl: 2.25rem; /* 36px - H2 */
35
+ --font-size-4xl: 3rem; /* 48px - H1 Hero */
36
+
37
+ /* Line Heights proportional to font size */
38
+ --line-height-heading: 1.15;
39
+ --line-height-body: 1.5;
40
+ --line-height-tight: 1.25;
41
+ }
42
+ ```
43
+
44
+ ---
45
+
46
+ ## 2. Line Length (Measure) & Text Wrapping
47
+
48
+ - **Optimal Line Length (Measure)**: Body text MUST be constrained between **45 to 75 characters** per line (`max-width: 65ch`).
49
+ - **Heading Balancing**: Always apply `text-wrap: balance` to headings (`h1`-`h4`) to eliminate single-word widows.
50
+ - **Paragraph Wrapping**: Use `text-wrap: pretty` for long body paragraphs to prevent awkward line breaks.
51
+
52
+ ```css
53
+ h1, h2, h3, h4 {
54
+ text-wrap: balance;
55
+ letter-spacing: -0.025em;
56
+ line-height: var(--line-height-heading);
57
+ }
58
+
59
+ p {
60
+ max-width: 65ch;
61
+ text-wrap: pretty;
62
+ line-height: var(--line-height-body);
63
+ }
64
+ ```
65
+
66
+ ---
67
+
68
+ ## 3. OpenType Features & Tabular Numbers
69
+
70
+ - **Tabular Numbers for Data & Timers**: Use `font-variant-numeric: tabular-nums` (or `tnum`) for data tables, counters, prices, and timestamps so numbers align vertically without jumping when values update.
71
+ - **Font Smoothing**: Enable crisp font smoothing on macOS/iOS:
72
+ ```css
73
+ body {
74
+ -webkit-font-smoothing: antialiased;
75
+ -moz-osx-font-smoothing: grayscale;
76
+ }
77
+ ```
78
+
79
+ ---
80
+
81
+ ## Anti-Slop Table
82
+
83
+ | Anti-Pattern | Typography Solution | Rationale |
84
+ | --- | --- | --- |
85
+ | Full-width body text (`width: 100%`) | `max-width: 65ch` | Prevents eye fatigue across wide desktop screens |
86
+ | Single-word widows on headings | `text-wrap: balance` | Creates balanced visual hierarchy |
87
+ | Jittering numbers in data tables | `font-variant-numeric: tabular-nums` | Keeps columns strictly aligned |
88
+ | Default browser line-height (`1.2` on body) | `line-height: 1.5` | Improves reading comfort |
89
+
90
+ ---
91
+
92
+ ## πŸ€– LLM-Specific Traps
93
+
94
+ 1. **Using Pixel Font Sizes**: Defining `font-size: 14px` instead of `0.875rem` breaks user browser accessibility font size preferences.
95
+ 2. **Missing `text-wrap` Support**: Forgetting `text-wrap: balance` on multi-line card titles.
96
+
97
+ ---
98
+
99
+ ## πŸ›οΈ Tribunal Integration (Anti-Hallucination)
100
+
101
+ ### βœ… Pre-Flight Self-Audit
102
+
103
+ ```
104
+ βœ… Are all body paragraph containers capped at max-width: 65ch?
105
+ βœ… Is text-wrap: balance applied to headings?
106
+ βœ… Are tabular numbers enabled on price grids and timer counters?
107
+ ```
108
+
109
+ ### πŸ›‘ Verification-Before-Completion (VBC) Protocol
110
+
111
+ Inspect typography scaling and line wrapping across desktop and mobile viewports in browser preview.
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: better-ui
3
+ description: Design engineering principles for making interfaces feel polished. Use when building UI components, reviewing frontend code, implementing animations, hover states, shadows, borders, micro-interactions, or visual detail work.
4
+ version: 1.0.0
5
+ last-updated: 2026-07-22
6
+ applies-to-model: gemini-3-6-flash, claude-3-7-sonnet
7
+ routing:
8
+ domain: UI Craft & Design Engineering
9
+ tier: pro
10
+ co-requires: [emil-design-eng, baseline-ui]
11
+ trigger-signals:
12
+ strong: [better-ui, ui polish, feels off, design details, optical alignment, micro-interactions, stagger animations, box shadows, make-interfaces-feel-better]
13
+ weak: [polish, refine, clean up ui, border radius]
14
+ ---
15
+
16
+ # Better UI β€” Design Engineering & Polish Rules
17
+
18
+ Distilled design engineering principles for transforming functional UIs into polished, state-of-the-art software interfaces, based on Jakub Krehel's *Details that make interfaces feel better*.
19
+
20
+ ---
21
+
22
+ ## 1. Micro-Interactions & State Feedback
23
+
24
+ - **Button Active Press Feedback**: Every interactive target MUST respond instantly to press with `transform: scale(0.97)` on `:active` using `transition: transform 120ms cubic-bezier(0.2, 0, 0, 1)`.
25
+ - **Targeted Hover Transitions**: NEVER use `transition: all` in CSS. Specify explicit properties (`transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms ease, border-color 200ms ease`).
26
+ - **Focus Rings**: Never use default browser outline rings or `outline: none` without replacement. Use `:focus-visible` with custom offset rings (`outline: 2px solid var(--ring); outline-offset: 2px`).
27
+
28
+ ---
29
+
30
+ ## 2. Spatial Discipline & Geometry
31
+
32
+ - **Nested Border Radius Formula**: Outer border radius MUST equal inner border radius plus inner padding.
33
+ $$\text{Radius}_{\text{outer}} = \text{Radius}_{\text{inner}} + \text{Padding}_{\text{inner}}$$
34
+ *Example*: If container padding is `16px` and inner avatar radius is `8px`, outer container radius MUST be `24px`.
35
+ - **Concentric Curves**: Avoid mismatched corner radii where an inner card has `rounded-2xl` inside an outer `rounded-md` container.
36
+ - **Optical Center Adjustment**: Text inside pill buttons or badges often looks vertically low if mathematically centered. Shift text upwards by `1px` or adjust `line-height` so optics match mathematics.
37
+
38
+ ---
39
+
40
+ ## 3. Multi-Layer Shadows & Depth
41
+
42
+ - **Avoid Muddy Single Shadows**: Single-layer `box-shadow: 0 4px 6px rgba(0,0,0,0.3)` creates dirty, cheap shadows. Use multi-layered ambient + direct lighting:
43
+
44
+ ```css
45
+ .card-shadow {
46
+ box-shadow:
47
+ 0 1px 2px 0 rgba(0, 0, 0, 0.05),
48
+ 0 4px 12px -2px rgba(0, 0, 0, 0.08),
49
+ 0 16px 32px -8px rgba(0, 0, 0, 0.12);
50
+ }
51
+ ```
52
+
53
+ - **Dark Mode Elevation**: Shadows are invisible on dark surfaces (`#121212`). Create depth in dark mode using subtle border highlights (`border: 1px solid rgba(255,255,255,0.08)`) and stepped background lightness (`oklch(0.14)` $\rightarrow$ `oklch(0.19)`).
54
+
55
+ ---
56
+
57
+ ## 4. Stagger Animations & Entry Flows
58
+
59
+ - **Cascading Entrances**: When revealing lists or grid items, stagger entry delays by `30ms` to `50ms` per item (max 6 items).
60
+ - **Scale Entrance Threshold**: Never animate from `scale(0)`. Start from `scale(0.96)` and `opacity: 0` to prevent popping artifacts.
61
+
62
+ ```css
63
+ .stagger-item {
64
+ animation: entrance 250ms cubic-bezier(0.16, 1, 0.3, 1) both;
65
+ }
66
+ .stagger-item:nth-child(1) { animation-delay: 0ms; }
67
+ .stagger-item:nth-child(2) { animation-delay: 40ms; }
68
+ .stagger-item:nth-child(3) { animation-delay: 80ms; }
69
+ ```
70
+
71
+ ---
72
+
73
+ ## Anti-Slop Table
74
+
75
+ | Slop Pattern | Better UI Standard | Rationale |
76
+ | --- | --- | --- |
77
+ | `transition: all 0.3s` | Specific CSS property transitions | Eliminates layout thrashing & unintended color transitions |
78
+ | Flat click targets without press feedback | `scale(0.97)` on `:active` | Provides tactile physical response |
79
+ | Arbitrary inner vs outer radii | $\text{Radius}_{\text{outer}} = \text{Radius}_{\text{inner}} + \text{Padding}$ | Maintains geometric optical harmony |
80
+
81
+ ---
82
+
83
+ ## πŸ€– LLM-Specific Traps
84
+
85
+ 1. **`transition: all` Laziness**: Causes layout recalculations and flashes during dark/light mode toggles.
86
+ 2. **Missing Active States**: Adding hover effects but forgetting `:active` click feedback.
87
+
88
+ ---
89
+
90
+ ## πŸ›οΈ Tribunal Integration (Anti-Hallucination)
91
+
92
+ ### βœ… Pre-Flight Self-Audit
93
+
94
+ ```
95
+ βœ… Are all inner vs outer radii mathematically aligned?
96
+ βœ… Did I use specific CSS transition properties instead of transition: all?
97
+ βœ… Is hover and active state feedback explicit on all interactive targets?
98
+ ```
99
+
100
+ ### πŸ›‘ Verification-Before-Completion (VBC) Protocol
101
+
102
+ Inspect micro-interactions and nested corner geometry in browser preview before delivery.
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: bolder
3
+ description: Increase visual impact, punch, and personality for generic or bland interfaces. Use when the user asks to make the UI pop, stand out, have more character, or feel less template-like.
4
+ version: 1.0.0
5
+ last-updated: 2026-07-22
6
+ applies-to-model: gemini-3-6-flash, claude-3-7-sonnet
7
+ routing:
8
+ domain: Visual Design & Brand Identity
9
+ tier: pro
10
+ co-requires: [better-colors, better-typography, impeccable]
11
+ trigger-signals:
12
+ strong: [bolder, make it pop, more punch, stand out, add character, feel less generic]
13
+ weak: [bold design, vibrant, striking]
14
+ ---
15
+
16
+ # Bolder β€” Injecting Punch & Personality into UI
17
+
18
+ Transform generic, boring template UIs into high-impact, distinctive interfaces with strong visual presence.
19
+
20
+ ---
21
+
22
+ ## 5 Tactics for Bold UI Transformation
23
+
24
+ ### 1. Typographic Contrast Scaling
25
+ - **Extreme Scale Jump**: Increase heading size contrast. Jump from `1.5rem` to `3.5rem` or `4.5rem` display type for key value propositions.
26
+ - **Font Weight Hierarchy**: Pair ultra-heavy display headings (`font-weight: 800` / `900`) with clean, lightweight body type (`font-weight: 400`).
27
+
28
+ ### 2. High-Contrast Accent System
29
+ - **Single Electric Accent**: Introduce one bold, unexpected accent color (e.g. electric lime `oklch(0.85 0.25 130)`, safety orange `oklch(0.68 0.22 40)`, or deep cobalt `oklch(0.45 0.28 260)`).
30
+ - **Asymmetric Color Application**: Use the accent color sparingly on primary CTA buttons, hero badges, or interactive active indicatorsβ€”never on body text.
31
+
32
+ ### 3. Oversized Spatial Framing & Borders
33
+ - **Crisp Structural Outlines**: Replace faint gray borders with thick 2px solid structural borders (`border: 2px solid var(--foreground)`).
34
+ - **Hard Drop Shadows**: Use sharp, solid offset shadows (`box-shadow: 4px 4px 0px var(--foreground)`) for brutalist or neo-brutalist energy.
35
+
36
+ ### 4. Hero Section Asymmetry
37
+ - **Break Symmetrical Grids**: Shift text alignment left, place a huge badge or key visual off-axis, or overlap card containers across background sections.
38
+
39
+ ### 5. Tactile Micro-Interactions
40
+ - **Snappy Press Springs**: Give buttons a satisfying 3D press effect on active (`transform: translate(2px, 2px); box-shadow: 2px 2px 0px var(--foreground)`).
41
+
42
+ ---
43
+
44
+ ## πŸ€– LLM-Specific Traps
45
+
46
+ 1. **Adding Generic Purple Gradients**: Relying on generic AI gradient presets instead of distinct brand colors.
47
+ 2. **Making Everything Loud**: Applying high contrast to all text and cards, which destroys readability. Keep body copy clean and legible.
48
+
49
+ ---
50
+
51
+ ## πŸ›οΈ Tribunal Integration (Anti-Hallucination)
52
+
53
+ **Active reviewers: `frontend-reviewer` Β· `ui-ux-auditor`**
54
+
55
+ ### βœ… Pre-Flight Self-Audit
56
+
57
+ ```
58
+ βœ… Is the primary accent color distinct and used intentionally?
59
+ βœ… Does the display typography maintain legibility while being high-impact?
60
+ βœ… Is body text kept crisp and high-contrast on readable backgrounds?
61
+ ```
62
+
63
+ ### πŸ›‘ Verification-Before-Completion (VBC) Protocol
64
+
65
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
66
+
67
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
68
+ - βœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: build-primitive
3
+ description: Build foundational, unstyled, accessible UI primitives from scratch with strong ARIA attributes, keyboard navigation, focus traps, and state management. Use when creating custom Headless UI components (Dialog, Combobox, Accordion, Popover, Menu).
4
+ version: 1.0.0
5
+ last-updated: 2026-07-22
6
+ applies-to-model: gemini-3-6-flash, claude-3-7-sonnet
7
+ routing:
8
+ domain: Headless UI & Accessible Primitives
9
+ tier: pro
10
+ co-requires: [web-accessibility-auditor, react-specialist]
11
+ trigger-signals:
12
+ strong: [build-primitive, headless UI, custom dialog primitive, custom popover, accessible primitive, ARIA combobox, keyboard navigation primitive]
13
+ weak: [custom component, headless component]
14
+ ---
15
+
16
+ # Build Primitive β€” Headless & Accessible UI Primitives
17
+
18
+ Build rock-solid, framework-agnostic or React headless UI primitives with complete ARIA pattern compliance, keyboard control, and focus management.
19
+
20
+ ---
21
+
22
+ ## 4 Rules for UI Primitives
23
+
24
+ ### 1. Complete ARIA Pattern Compliance
25
+ - **Dialog / Modal**: `role="dialog"`, `aria-modal="true"`, `aria-labelledby="{titleId}"`, `aria-describedby="{descId}"`.
26
+ - **Combobox / Autocomplete**: `role="combobox"`, `aria-expanded="{isOpen}"`, `aria-autocomplete="list"`, `aria-controls="{listboxId}"`.
27
+ - **Tabs**: Tablist `role="tablist"`, Tab `role="tab"`, `aria-selected="{isActive}"`, `aria-controls="{panelId}"`, TabPanel `role="tabpanel"`.
28
+
29
+ ### 2. Focus Management & Focus Traps
30
+ - **Modal Focus Lock**: When a dialog opens, trap focus within the modal container. On close, return focus to the element that triggered it.
31
+ - **Escape Key Dismiss**: Pressing `Escape` MUST close popovers, modals, and dropdown menus instantly.
32
+
33
+ ### 3. Keyboard Navigation Sequences
34
+ - **Listbox / Menu Navigation**:
35
+ - `ArrowDown`: Move active descendant down.
36
+ - `ArrowUp`: Move active descendant up.
37
+ - `Home`: Move to first item.
38
+ - `End`: Move to last item.
39
+ - `Enter` / `Space`: Select highlighted item.
40
+
41
+ ### 4. Zero Unnecessary Styling
42
+ - Primitives MUST output clean data attributes (`data-state="open|closed"`, `data-disabled`, `data-highlighted`) so consumers can style them effortlessly with CSS or Tailwind variants.
43
+
44
+ ---
45
+
46
+ ## πŸ€– LLM-Specific Traps
47
+
48
+ 1. **Forgetting `type="button"`**: Omitting `type="button"` on custom trigger buttons inside forms, causing unintended form submissions.
49
+ 2. **Missing `aria-expanded`**: Toggle triggers missing `aria-expanded` attributes.
50
+
51
+ ---
52
+
53
+ ## πŸ›οΈ Tribunal Integration (Anti-Hallucination)
54
+
55
+ **Active reviewers: `accessibility-reviewer` Β· `type-safety`**
56
+
57
+ ### βœ… Pre-Flight Self-Audit
58
+
59
+ ```
60
+ βœ… Are all WAI-ARIA roles and states correctly attached?
61
+ βœ… Is keyboard navigation fully implemented (Arrow keys, Enter, Escape)?
62
+ βœ… Is focus trapped inside modals and restored to the trigger upon exit?
63
+ ```
64
+
65
+ ### πŸ›‘ Verification-Before-Completion (VBC) Protocol
66
+
67
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
68
+
69
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
70
+ - βœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.