Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
4728ba1
feat(gamut-codemods): add the codemods CLI and an empty scope-swap pr…
dreamwasp Oct 20, 2026
5a91398
feat(gamut-codemods): rename packages and replace gamut-kit in scope-…
dreamwasp Oct 20, 2026
b3a27cd
feat(gamut-codemods): move Video imports and add Markdown video overr…
dreamwasp Oct 20, 2026
195e6d6
feat(gamut)!: promote deep imports to the root, renaming Menu and Sel…
dreamwasp Oct 20, 2026
161242f
feat(gamut-codemods): rename the ESLint plugin prefix in scope-swap
dreamwasp Oct 20, 2026
b39bd0c
feat(gamut-codemods): warn about esmExternals: false in next.config
dreamwasp Oct 20, 2026
3f2e1bd
Merge branch 'cass-gmt-1790-deep-imports' into cass-gmt-1790-scope-sw…
dreamwasp Oct 20, 2026
c44953d
Merge branch 'cass-gmt-1790-eslint' into cass-gmt-1790-scope-swap-skill
dreamwasp Oct 20, 2026
199d30f
Merge branch 'cass-gmt-1790-next-config' into cass-gmt-1790-scope-swa…
dreamwasp Oct 20, 2026
4a7dfb6
feat(gamut-agent-tools): add the gamut-scope-swap skill
dreamwasp Oct 20, 2026
e6923f5
fix(gamut-codemods): rename FileMigration.match to appliesTo
dreamwasp Oct 20, 2026
961c09b
Merge branch 'cass-gmt-1790-scaffold' into cass-gmt-1790-scope-rename
dreamwasp Oct 20, 2026
97d492c
fix(gamut-codemods): rename match to appliesTo in this branch's file …
dreamwasp Oct 20, 2026
6673ca8
Merge branch 'cass-gmt-1790-scope-rename' into cass-gmt-1790-video-ma…
dreamwasp Oct 20, 2026
34ad6a1
fix(gamut-codemods): rename match to appliesTo in this branch's file …
dreamwasp Oct 20, 2026
1436118
Merge branch 'cass-gmt-1790-scope-rename' into cass-gmt-1790-deep-imp…
dreamwasp Oct 20, 2026
7d0ce3d
Merge branch 'cass-gmt-1790-scope-rename' into cass-gmt-1790-eslint
dreamwasp Oct 20, 2026
b00216c
fix(gamut-codemods): rename match to appliesTo in this branch's file …
dreamwasp Oct 20, 2026
82bd085
Merge branch 'cass-gmt-1790-scope-rename' into cass-gmt-1790-next-config
dreamwasp Oct 20, 2026
84758da
fix(gamut-codemods): rename match to appliesTo in this branch's file …
dreamwasp Oct 20, 2026
6c622a1
Merge branch 'cass-gmt-1790-video-markdown' into cass-gmt-1790-scope-…
dreamwasp Oct 20, 2026
125cfa7
Merge branch 'cass-gmt-1790-deep-imports' into cass-gmt-1790-scope-sw…
dreamwasp Oct 20, 2026
4b86b7f
Merge branch 'cass-gmt-1790-eslint' into cass-gmt-1790-scope-swap-skill
dreamwasp Oct 20, 2026
e41c57d
Merge branch 'cass-gmt-1790-next-config' into cass-gmt-1790-scope-swa…
dreamwasp Oct 20, 2026
7cf5c68
refactor(gamut-codemods): drop the newer-than-source checklist item
dreamwasp Oct 20, 2026
1afc987
Merge branch 'cass-gmt-1790-scope-rename' into cass-gmt-1790-video-ma…
dreamwasp Oct 20, 2026
6670c23
Merge branch 'cass-gmt-1790-scope-rename' into cass-gmt-1790-deep-imp…
dreamwasp Oct 20, 2026
f14f0ae
Merge branch 'cass-gmt-1790-scope-rename' into cass-gmt-1790-eslint
dreamwasp Oct 20, 2026
413c601
Merge branch 'cass-gmt-1790-scope-rename' into cass-gmt-1790-next-config
dreamwasp Oct 20, 2026
fad1c46
Merge branch 'cass-gmt-1790-video-markdown' into cass-gmt-1790-scope-…
dreamwasp Oct 20, 2026
1d4aa4b
Merge branch 'cass-gmt-1790-deep-imports' into cass-gmt-1790-scope-sw…
dreamwasp Oct 20, 2026
8af554b
Merge branch 'cass-gmt-1790-eslint' into cass-gmt-1790-scope-swap-skill
dreamwasp Oct 20, 2026
8d639e5
Merge branch 'cass-gmt-1790-next-config' into cass-gmt-1790-scope-swa…
dreamwasp Oct 20, 2026
8c0b958
chore(changeset): one changeset per package for Video and Markdown
dreamwasp Oct 20, 2026
34cf28e
Merge branch 'cass-gmt-1790-video-markdown' into cass-gmt-1790-scope-…
dreamwasp Oct 20, 2026
79fe678
chore(changeset): one changeset for the new gamut root exports
dreamwasp Oct 20, 2026
4cd726f
Merge branch 'cass-gmt-1790-deep-imports' into cass-gmt-1790-scope-sw…
dreamwasp Oct 20, 2026
da715ae
Merge branch 'main' into cass-gmt-1790-scaffold
dreamwasp Oct 26, 2026
6d427e3
Merge branch 'cass-gmt-1790-scaffold' into cass-gmt-1790-scope-rename
dreamwasp Oct 26, 2026
f1d2a29
Merge branch 'cass-gmt-1790-scope-rename' into cass-gmt-1790-scope-sw…
dreamwasp Oct 26, 2026
5e3d707
feat(gamut-codemods): add a color-roles preset
dreamwasp Oct 27, 2026
75fc87a
Merge branch 'main' into cass-gmt-1825-color-codemod
dreamwasp Oct 28, 2026
2ba244b
feat(gamut-codemods): color-roles covers stylesheets, JS strings and …
dreamwasp Nov 4, 2026
17fc3ee
feat(gamut-codemods): color-roles renames the old theme names
dreamwasp Nov 4, 2026
75f068b
Merge main into cass-gmt-1825-color-codemod
dreamwasp Nov 4, 2026
2407db6
fix(gamut-codemods): narrow isString so the color-roles build typechecks
dreamwasp Nov 4, 2026
c641a95
docs(gamut-codemods): color-roles points at design's map in gamut-brand
dreamwasp Nov 5, 2026
6dad02d
docs(gamut-codemods): color-roles comments without sandbox commits
dreamwasp Nov 5, 2026
b3e6deb
Merge branch 'main' into cass-gmt-1825-color-codemod
dreamwasp Nov 9, 2026
d131a2d
refactor(gamut-codemods): rewrite old colors to the singular --color-…
dreamwasp Nov 10, 2026
f703ea4
Merge remote-tracking branch 'origin/cass-gmt-1825-color-codemod' int…
dreamwasp Nov 10, 2026
fc1fe42
test(gamut-codemods): check the stylesheet pass is idempotent
dreamwasp Nov 10, 2026
e9ac2bc
Merge branch 'main' into cass-gmt-1825-color-codemod
dreamwasp Nov 12, 2026
9a8b383
fix(gamut-codemods): skip build output in the source run, scope tscon…
dreamwasp Nov 18, 2026
ab96b1b
fix(gamut-codemods): skip generated files in the source run
dreamwasp Nov 18, 2026
f8144d8
docs(gamut-agent-tools): cover color-roles in the scope-swap skill
dreamwasp Nov 18, 2026
821ba35
docs(gamut-codemods): point the README at the gamut-migration skill
dreamwasp Nov 18, 2026
b69529b
docs(gamut-agent-tools): rename the scope-swap skill to gamut-migrati…
dreamwasp Nov 18, 2026
255be55
docs(gamut-agent-tools): point the README at the gamut-migration skill
dreamwasp Nov 18, 2026
39f86e3
docs(gamut-agent-tools): drop a duplicated sentence in the migration …
dreamwasp Nov 18, 2026
db63c5c
feat(gamut-codemods): add required peers, clarify the core theme
dreamwasp Nov 18, 2026
8b8aa0c
feat(gamut-codemods): mark palette colors in source, say where they a…
dreamwasp Nov 18, 2026
b61bf39
docs(gamut-agent-tools): cover the migration gaps in the gamut-migrat…
dreamwasp Nov 18, 2026
9067fcd
docs(gamut-codemods): document the added peers and palette markers
dreamwasp Nov 18, 2026
5fae384
feat(gamut-codemods): default roles for red, green, white and navy pa…
dreamwasp Nov 19, 2026
c0d8e0f
docs(gamut-agent-tools): explain the palette defaults in the gamut-mi…
dreamwasp Nov 19, 2026
2cc009f
docs(gamut-agent-tools): add hyper and yellow guidance to the gamut-m…
dreamwasp Nov 19, 2026
8761700
feat(gamut-codemods): default hyper to action-primary
dreamwasp Nov 19, 2026
0a97c85
feat(gamut-codemods): default blue-500 text to action-primary
dreamwasp Nov 19, 2026
4458316
docs(gamut-agent-tools): add blue-500 guidance to the gamut-migration…
dreamwasp Nov 19, 2026
e9b3605
docs(gamut-agent-tools): work through open color decisions with the u…
dreamwasp Nov 19, 2026
8c696a8
feat(gamut-codemods): default greys by their use
dreamwasp Nov 19, 2026
a7c1fe6
docs(gamut-agent-tools): stop adding stylis by hand; cover the duplic…
dreamwasp Nov 20, 2026
7e02172
fix(gamut-codemods): stop adding stylis as a peer
dreamwasp Nov 20, 2026
9403111
feat(gamut-codemods): add vidstack and react-player only for apps tha…
dreamwasp Nov 20, 2026
b725db9
docs(gamut-agent-tools): add Video peers only for apps that import Video
dreamwasp Nov 20, 2026
a8421d4
merge: bring main into the codemod branch
dreamwasp Nov 20, 2026
6a8df2c
Merge remote-tracking branch 'origin/main' into stack-codemod
dreamwasp Nov 20, 2026
09637a1
test(gamut-codemods): give the manifest checks a 60s timeout
dreamwasp Nov 20, 2026
f5bde06
Merge remote-tracking branch 'origin/main' into stack-codemod
dreamwasp Nov 20, 2026
15a1cc3
feat(gamut-codemods): map the warning family in color-roles
dreamwasp Nov 23, 2026
3c7ebc1
docs(gamut-agent-tools): say when to use Background instead of ColorMode
dreamwasp Nov 23, 2026
860022b
feat(gamut-codemods): default palette names in theme lookups and CSS …
dreamwasp Nov 30, 2026
93fec78
fix(gamut-codemods): drop an earlier run's comment when color-roles r…
dreamwasp Nov 30, 2026
a16e5a3
feat(gamut-codemods): border-disabled splits between border-default a…
dreamwasp Dec 1, 2026
8da414e
merge: bring main (7f6b1f100) into the codemod branch
dreamwasp Dec 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .changeset/gamut-codemods-color-roles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
'@skillsoft/gamut-codemods': minor
---

Add a `color-roles` preset that moves Gamut color names onto the generated color system's roles, using design's migration map.

- Renames and merges are applied. Names that split, were retired or are still pending stay in place, with a `/* color-roles: … */` comment carrying design's rule, and keep failing the type check until someone picks.
- Old palette names (`navy`, `gray-200`) get a `color-roles:` comment and a warning that names where the color is used (a prop, a `theme.colors` lookup, a CSS variable), so the review queue is in the source. Theme lookups are found through `props.theme`, `useTheme()`, a variable holding `theme.colors`, and `colors` or color keys destructured from the theme. Color names built at runtime get a warning.
- Some palette names now get a default role in a color prop, where the codemod knows the use: `red` becomes an error role (`surface-error` for a fill, `text-error` otherwise), `green` a success role, `white` `surface-raised`, `text-inverse` or `border-subtle`, `navy` the nearest role by brightness, `hyper` (the old primary) `action-primary`, and `blue-500` text (links and focus) `action-primary`. Blue fills and borders stay warnings, since they mix interactive and decorative uses. Greys follow their use: `gray-100` and `gray-200` to `surface-default` and `surface-sunken` as fills, `text-subtle` as text for `gray-600` and darker, and `border-subtle` or `border-default` as borders. A theme lookup, `themed()` call or CSS variable takes the same defaults when the CSS property or style key it is the value of says the use (`background-color: ${theme.colors['navy-100']}` becomes `surface-default`). Dark navy fills, colors inside a function like a gradient, and properties other than fills, text and borders stay warnings. The defaults are in `presets/color-roles/decisions.ts`.
- Old `--color-*` CSS variables are renamed to `--color-<role>` in `.css`, `.scss` and `.less` files and inside JS strings and template literals; splits get the same comment. The type check can't see stylesheets, so the leftovers report lists every one left. Indented-syntax `.sass` isn't rewritten.
- Card's `variant` moves onto design's two: `white`, `beige` and `navy` become `default`, `yellow` and `hyper` become `brand`. A `navy` card gets a comment, since it now renders light.
- Old theme names move to the brand themes that replace them: `percipioTheme` → `skillsoftTheme`, `coreTheme` → `originalCodecademyTheme`, and the `PercipioTheme` type → `SkillsoftTheme`. An aliased import (`percipioTheme as theme`) only changes the imported name. A `CoreTheme` type gets a comment pointing at `SkillsoftTheme`, which types every brand.
- Follows design's map: `shadow-primary` and `shadow-secondary` split onto `shadow-key` and `shadow-ambient`.
- Presets can bring their own manifest type, pre-filter and leftovers report. `scope-swap` is unchanged.
- The source run skips build output and caches (`.next`, `.nx`, `coverage`, `tmp`, plus the dirs it already skipped), so a dry run over an app no longer reads its bundles. `tsconfig-dom` warns only where gamut is imported.
- `scope-swap`'s `package-json` migration adds the peers the new packages need at runtime and no longer install: `@vidstack/react` and `react-player` for `@skillsoft/gamut`, at the ranges Gamut declares, only when the app imports `Video` from gamut and doesn't list them yet. It doesn't add `stylis`: `@emotion/cache` brings its own copy, and a second root copy can break emotion's style inserts.
- Themes differ in their spacing scale. In our repo, numeric spacing values (`padding`, `border` and similar) failed the type check under `skillsoftTheme` and passed under `originalCodecademyTheme`. Switching the theme changes that scale, so pick the theme the app was on, not the one the codemod's docs suggest.
5 changes: 5 additions & 0 deletions .changeset/gamut-migration-skill.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@skillsoft/gamut-agent-tools': minor
---

Add the `gamut-migration` agent skill. It covers every `@skillsoft/gamut-codemods` preset: `scope-swap` for the `@codecademy/gamut*` to `@skillsoft/gamut*` move, and `color-roles` for moving color names onto color roles. For each, it explains the warnings, leftovers and comments the codemod leaves, and what to do about them. It replaces the `gamut-scope-swap` skill.
6 changes: 0 additions & 6 deletions .changeset/gamut-scope-swap-skill.md

This file was deleted.

11 changes: 9 additions & 2 deletions packages/gamut-agent-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@ The first time you run `gamut plugin install` or `update`, it installs `@skillso

Before large PRs, or when onboarding an existing codebase, run the `gamut-review` skill to audit for Gamut usage — dependencies, setup, import patterns, `styled()` wrapping that bypasses system props, hardcoded colors, bespoke component duplication, and test conventions.

### Moving from `@codecademy/gamut`
### Migrating with `@skillsoft/gamut-codemods`

If your app still depends on `@codecademy/gamut*`, the `gamut-scope-swap` skill helps with the move to `@skillsoft/gamut*`. It works alongside the [`@skillsoft/gamut-codemods`](../gamut-codemods/README.md) `scope-swap` preset. The codemod does the mechanical rewrite. The skill reads what it reports, including warnings, leftovers, and next steps, and helps with the parts it can't rewrite: deep imports, `Video`, renamed Menu exports, tsconfig `dom`, jest mocks, ESLint plugin keys, Module Federation config, and preview builds. It doesn't run the codemod unless you ask it to.
The `gamut-migration` skill helps with each [`@skillsoft/gamut-codemods`](../gamut-codemods/README.md) preset. The codemod does the mechanical rewrite. The skill reads what it reports (warnings, leftovers, and comments), and helps with the parts it can't rewrite.

- `scope-swap` moves `@codecademy/gamut*` to `@skillsoft/gamut*`. The skill covers deep imports, `Video`, renamed Menu exports, tsconfig `dom`, jest mocks, ESLint plugin keys, Module Federation config, and preview builds.
- `color-roles` moves Gamut color names onto the roles of the color system. The skill covers the splits, palette colors, and runtime names it marks for a person.

It doesn't run the codemod unless you ask it to. When a preset ships, the skill gets a section for it.

If your app still depends on `@codecademy/gamut*`, run `scope-swap` first.

Install the plugin after the swap. The `gamut` CLI comes from `@skillsoft/gamut`, so that package has to be in the app first.

Expand Down
Loading
Loading