From b0c870ae727cd816ee69ad727ef6b3b92a89ca1c Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Fri, 15 May 2026 10:04:01 -0400 Subject: [PATCH 01/11] chore(ai-tools): skill audit --- .../guidelines/foundations/modes.md | 14 ++- .../gamut/agent-tools/guidelines/overview.md | 35 +++--- .../gamut/agent-tools/rules/accessibility.mdc | 5 +- .../skills/gamut-color-mode/SKILL.md | 113 ++++++++++++------ .../lib/Foundations/ColorMode/ColorMode.mdx | 12 +- 5 files changed, 111 insertions(+), 68 deletions(-) diff --git a/packages/gamut/agent-tools/guidelines/foundations/modes.md b/packages/gamut/agent-tools/guidelines/foundations/modes.md index c39db9880e2..00802c917c9 100644 --- a/packages/gamut/agent-tools/guidelines/foundations/modes.md +++ b/packages/gamut/agent-tools/guidelines/foundations/modes.md @@ -23,21 +23,23 @@ Use `` — not a raw `bg` prop — whenever setting a colored backgr ```tsx import { Background } from '@codecademy/gamut-styles'; -{children} +{children}; ``` Nesting is supported — each `` creates its own accessible color context. ## Hooks -| Hook | Returns | Use | -|---|---|---| -| `useCurrentMode()` | `"light" \| "dark"` | Read active mode in JS | -| `useColorMode()` | `[modeKey, modeColors, allModes]` | Access all mode data | -| `usePrefersDarkMode()` | `boolean` | Read OS dark preference only | +| Hook | Returns | Use | +| ---------------------- | --------------------------------- | ------------------------------------------------- | +| `useCurrentMode()` | `"light" \| "dark"` | Active mode key only | +| `useColorMode()` | `[modeKey, modeColors, allModes]` | Full mode data + resolver for semantic color keys | +| `usePrefersDarkMode()` | `boolean` | Read OS dark preference only | Import from `@codecademy/gamut-styles`. +**Storybook:** [Foundations / ColorMode](https://gamut.codecademy.com/?path=/docs-foundations-colormode--page) · [Meta / Best practices](https://gamut.codecademy.com/?path=/docs-meta-best-practices--page) + ## Common mistakes - Do not use raw color tokens (`navy-400`, `white`) for text/backgrounds that must be accessible across modes — use semantic aliases. diff --git a/packages/gamut/agent-tools/guidelines/overview.md b/packages/gamut/agent-tools/guidelines/overview.md index 7a411433d14..301f8307100 100644 --- a/packages/gamut/agent-tools/guidelines/overview.md +++ b/packages/gamut/agent-tools/guidelines/overview.md @@ -5,31 +5,34 @@ Gamut is the Codecademy / Skillsoft design system — React component library (` **Design voice**: "Ruled by logic, but creative and a bit unexpected." Structured and trustworthy for a learning platform, with engaging personality. Medium density — information-rich layouts with strong typographic hierarchy. Never cramped or overly airy. **Core principles**: + - Components are color mode–aware by default — never hardcode hex values for adaptive UI - All components work across all themes without modification - Mobile-first, 12-column grid - Semantic color tokens guarantee WCAG AA contrast automatically +\*ColorMode in product UI:\*\* Use `` and `` from `@codecademy/gamut-styles` for scoped light/dark and contrast-safe surfaces — see [foundations/modes.md](foundations/modes.md) and the `gamut-color-mode` skill. Storybook: [ColorMode](https://gamut.codecademy.com/?path=/docs-foundations-colormode--page), [Best practices](https://gamut.codecademy.com/?path=/docs-meta-best-practices--page) (semantic tokens + `css` / `variant` / `states`). + ## Themes -| Theme | Product | Base font | Dark mode | -|---|---|---|---| -| **Core** | Codecademy (default) | Apercu | ✓ | -| **Admin** | Codecademy admin tools | Apercu | ✓ | -| **Platform** | Codecademy learning environment | Apercu | ✓ | -| **LX Studio** | LX Studio application | Hanken Grotesk | — | -| **Percipio** | Skillsoft Percipio | Roboto | — | +| Theme | Product | Base font | Dark mode | +| ------------- | ------------------------------- | -------------- | --------- | +| **Core** | Codecademy (default) | Apercu | ✓ | +| **Admin** | Codecademy admin tools | Apercu | ✓ | +| **Platform** | Codecademy learning environment | Apercu | ✓ | +| **LX Studio** | LX Studio application | Hanken Grotesk | — | +| **Percipio** | Skillsoft Percipio | Roboto | — | Set the theme at the app root via ``. ## Reading order -| File | What it covers | -|---|---| -| [setup.md](setup.md) | Packages, GamutProvider, theme selection | -| [foundations/color.md](foundations/color.md) | Semantic aliases, raw palette, decision guide | -| [foundations/modes.md](foundations/modes.md) | Light/dark ColorMode, Background component | -| [foundations/typography.md](foundations/typography.md) | Typefaces, font scale, rules | -| [foundations/spacing.md](foundations/spacing.md) | Spacing, border radius, responsive grid | -| [components/overview.md](components/overview.md) | Full component catalog | -| [components/buttons.md](components/buttons.md) | Button variants, props, decision tree | +| File | What it covers | +| ------------------------------------------------------ | --------------------------------------------- | +| [setup.md](setup.md) | Packages, GamutProvider, theme selection | +| [foundations/color.md](foundations/color.md) | Semantic aliases, raw palette, decision guide | +| [foundations/modes.md](foundations/modes.md) | Light/dark ColorMode, Background component | +| [foundations/typography.md](foundations/typography.md) | Typefaces, font scale, rules | +| [foundations/spacing.md](foundations/spacing.md) | Spacing, border radius, responsive grid | +| [components/overview.md](components/overview.md) | Full component catalog | +| [components/buttons.md](components/buttons.md) | Button variants, props, decision tree | diff --git a/packages/gamut/agent-tools/rules/accessibility.mdc b/packages/gamut/agent-tools/rules/accessibility.mdc index 22fd3a871e7..b3f2fb9afa7 100644 --- a/packages/gamut/agent-tools/rules/accessibility.mdc +++ b/packages/gamut/agent-tools/rules/accessibility.mdc @@ -1,7 +1,7 @@ --- description: Apply these guardrails when editing Gamut UI in TS/JS/TSX/JSX. Mirrors the General rules in the `gamut-accessibility` skill; see `skills/gamut-accessibility/SKILL.md` in this plugin for full component patterns and checklists. Loaded automatically for matched files. alwaysApply: true -globs: ["*.tsx", "*.ts", "*.jsx", "*.js"] +globs: ['*.tsx', '*.ts', '*.jsx', '*.js'] --- # Gamut Accessibility Rules @@ -18,7 +18,6 @@ ARIA roles modify the accessibility tree and _imply_ behavior. Always ensure tha ARIA can augment native semantics (`aria-pressed` on a `