Skip to content

chore: add design-sync config for Claude Design upload#3381

Draft
dreamwasp wants to merge 10 commits into
mainfrom
cass-gmt-4007
Draft

chore: add design-sync config for Claude Design upload#3381
dreamwasp wants to merge 10 commits into
mainfrom
cass-gmt-4007

Conversation

@dreamwasp

Copy link
Copy Markdown
Contributor

Adds .design-sync/ config set for syncing @codecademy/gamut to the [DRAFT] Gamut Design System project on claude.ai/design (71 components).

  • config.json: project ID, storybook shape, build cmd, provider config, card mode overrides, titleMap for docs-only stories
  • tsconfig.json: resolves ~styleguide webpack aliases for esbuild
  • overrides/bundle.mjs: enables minification (icons-as-code pushes unminified bundle to 5.2MB, over the 5MB upload limit)
  • previews/SkipToContent.tsx: custom preview for hidden skip-link component
  • NOTES.md: setup notes and re-apply instructions for dist patches
  • packages/gamut/package.json: add "types" field so design-sync converter can locate dist/index.d.ts in this NX monorepo (NX omits it by default)
  • .gitignore: exclude .ds-sync/, ds-bundle/, and ephemeral .design-sync/ subdirs

Overview

PR Checklist

  • Related to designs:
  • Related to JIRA ticket: [ABC-123]
  • Version plan added/updated (or not needed)
  • I have run this code to verify it works
  • This PR includes unit tests for the code change
  • This PR includes testing instructions tests for the code change
  • The alpha package of this PR is passing end-to-end tests in all relevant Codecademy repositories

Testing Instructions

Don't make me tap the sign.

  1. Go to story X
  2. Do something
  3. Do that something in dark mode
  4. Check it with VO
  5. Finish and do a celebratory dance

PR Links and Envs

Repository PR Link
Monolith Monolith PR
Mono Mono PR

Adds .design-sync/ config set for syncing @Codecademy/gamut to the
[DRAFT] Gamut Design System project on claude.ai/design (71 components).

- config.json: project ID, storybook shape, build cmd, provider config,
  card mode overrides, titleMap for docs-only stories
- tsconfig.json: resolves ~styleguide webpack aliases for esbuild
- overrides/bundle.mjs: enables minification (icons-as-code pushes
  unminified bundle to 5.2MB, over the 5MB upload limit)
- previews/SkipToContent.tsx: custom preview for hidden skip-link component
- NOTES.md: setup notes and re-apply instructions for dist patches
- packages/gamut/package.json: add "types" field so design-sync converter
  can locate dist/index.d.ts in this NX monorepo (NX omits it by default)
- .gitignore: exclude .ds-sync/, ds-bundle/, and ephemeral .design-sync/ subdirs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nx-cloud

nx-cloud Bot commented Jun 22, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit f5069e9


☁️ Nx Cloud last updated this comment at 2026-07-15 18:54:53 UTC

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

dreamwasp and others added 9 commits June 24, 2026 10:41
…header

- Add @codecademy/gamut-styles/dist/themes to extraEntries so all 5 named
  themes (coreTheme, adminTheme, platformTheme, lxStudioTheme, percipioTheme)
  are available in the bundle for theme-swapping in Claude Design
- Fix tsconfig path (../../ not ../../../ from PKG_DIR=packages/gamut)
- Add .design-sync/conventions.md as readmeHeader: GamutProvider wrapping,
  theme table, props-only styling idiom, idiomatic build example
- Update NOTES.md with tsconfig fix, grade edge cases, and theme export finding

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… Design

Switches the design-sync provider default from coreTheme to percipioTheme
for the [DRAFT] Gamut Design System project, and mirrors the 13 relevant
gamut-* skill docs plus a new gamut-code-style.md (a Claude-Design-oriented
rewrite of gamut-review's build rules) into .design-sync/guidelines/ so
future syncs stay in sync with what's already been pushed to the project.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…nomy, merge guideline corpus

Forks source-storybook.mjs to group components by their real Storybook
top-level sidebar category (atoms/molecules/organisms/layouts/typography)
instead of an inconsistent sub-category name. Full nested grouping was
tried and reverted — emit.mjs hardcodes a 3-level relative asset path
that a 4th nesting level breaks, and emit.mjs is off-limits to fork.

Replaces the flat gamut-*.md guideline set with a merged structure based
on a more mature, purpose-built corpus (Guidelines.md reading order,
design-tokens/, per-component guides), folding in unique detail from the
prior skill-doc set and fixing every percipioTheme-vs-lxStudioTheme
default reference along the way.

Rewrites conventions.md with a human-readable intro and an explicit
"Agent Information" section pointing at the guidelines reading order.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Two rounds of real build feedback from Claude Design surfaced concrete
documentation gaps. Addresses: runtime-loading gotchas in the x-import
environment (React injection order, single-React-instance rule), an icon
index (371 exports enumerated from gamut-icons' built .d.ts, not
transcribed), per-theme resolved token values (theme-core/percipio/
lxstudio.md — including a real LX Studio border-radius scale discrepancy),
a reconciliation note for the auto-generated "0 CSS custom properties"
README stat vs ColorMode's runtime-injected --color-* properties, deeper
Input/Select docs (controlled/uncontrolled patterns, and a correction that
Input's icon slot is trailing not leading), and supplemental docs for
BarChart/DatePicker content that was being truncated out of their
auto-generated .prompt.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…omponent rules

Real prototyping surfaced hardcoded status colors/backgrounds, ColorMode
skipped, and small atoms (Tag/Badge) rebuilt as styled Box. Root cause per
the user's diagnosis: the fast path (setup doc -> one component's .prompt.md
-> build) skips the color docs entirely, and "prefer purpose-built
components" only demonstrated big organisms.

- Fork docs.mjs to append a fixed semantic-color reminder to every
  auto-generated .prompt.md (70/71 - GridForm has no doc source to hook,
  it's a .d.ts-only floor card assembled in the off-limits emit.mjs).
- Non-negotiables block at the top of conventions.md and Guidelines.md's
  Core Principle.
- colors.md gets a hardcode->token table, a dedicated status/feedback
  section, and cross-links to ColorMode's common mistakes + Departures.
- overview-components.md explicitly calls out small styled Box/FlexBox as
  a Tag/Badge reinvention, not just big organisms.
- Corrected theme-percipio.md: Percipio supports both light and dark mode
  via ColorMode, not light-only as previously documented.
- Dropped the checklist's two oxlint-rule asks (hex/style literal
  detection, Box-as-Tag heuristic) - _adherence.oxlintrc.json is generated
  by fixed tag-mapping logic and then overwritten server-side by Claude
  Design's own self-check, with no lever for property-value linting.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…sistance

Learner Dashboard build notes: the builder never opened overview-components.md
or the List/DataList/DataTable guides, going straight from README to specific
.prompt.md files - and rebuilt List, DataTable, Tabs, and Alert from Box/FlexBox
as a result. Same root cause as the color-hardcode issue: the fast path never
reaches the doc that would prevent the mistake.

- New guidelines/components/index.md - one-line decision table (use when /
  not this-use X instead) for every component, linked as Guidelines.md's
  second read.
- Extend the docs.mjs fork: Box/FlexBox/GridBox's .prompt.md now carry a
  "reach for this instead" block; every icon-prop-bearing component
  (FillButton, StrokeButton, TextButton, IconButton, Badge, Tag, Menu) points
  at the icons.md reference instead of the builder grepping the bundle.
- New guidelines/recipes/ - data-list-with-status.md and tabbed-sections.md,
  full composed examples for the two patterns actually rebuilt.
- New component.md files for Alert, Badge, Tag, Tabs, and a Card <-> ColorMode
  clarification (variant="default" follows ColorMode; others are fixed).
  Caught and fixed real API mistakes while sourcing these from actual story
  files: Alert's variant prop is `type`, not `variant`; Badge has no built-in
  status-color variant (use variant="custom" + semantic bg); Tabs is a
  composite (TabList/Tab/TabPanels/TabPanel), not a `tabs` prop array.
- Dropped the checklist's manifest-mirroring ask (_ds_manifest.json is
  generated server-side by Claude Design's own self-check, same as
  _adherence.oxlintrc.json - no lever to add a useWhen field) and the
  systemic 43-component empty-variant-block gap (would need AST-based
  extraction from story sources - out of scope this round; hand-fixed the
  8 highest-traffic components instead: List, DataList, DataTable, Tabs,
  Alert, Badge, Card, Tag).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…eering, theme-switch docs

Closes a set of concrete deviations seen in real builds:

- STOP gate at the top of Guidelines.md and conventions.md (README header) -
  required reading order before generating any code.
- Inlined the styling do/don't list, pattern->component table, and
  semantic-token mapping directly into Guidelines.md's body, so they're
  present without an agent choosing to open the linked files.
- "Before you ship" checklist added to Guidelines.md.
- Props-only promoted to non-negotiable #1 in both Guidelines.md and
  conventions.md; extended to ban Emotion's inline `css` prop alongside
  `style`/`className`.
- Departures rule made proactive: when the request itself asks for
  something off-system (exact hex, arbitrary pixel value, one-off font
  size), say so before building it - not just call it out after the fact.
- "Switching themes" section in overview-setup.md - all three steps
  (provider prop, destructure, re-resolve hardcoded fallbacks) must move
  together or stale values get left behind.
- Menu strengthened as the required component for nav/action lists in
  overview-components.md's discovery table + Component Discovery section,
  mirrored in Guidelines.md's inlined table.
- docs.mjs fork extended with a prepend mechanism (front-of-file, not
  footer) for List (redirect to DataTable/DataList for tabular data) and
  Menu (redirect away from hand-built Box/FlexBox nav rows).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@codecademydev

Copy link
Copy Markdown
Collaborator

📬 Published Alpha Packages:

Package Version npm Diff
@codecademy/gamut 72.2.5-alpha.54361e.0 npm diff
@codecademy/gamut-icons 9.57.11-alpha.54361e.0 npm diff
@codecademy/gamut-illustrations 0.58.16-alpha.54361e.0 npm diff
@codecademy/gamut-kit 3.0.9-alpha.54361e.0 npm diff
@codecademy/gamut-patterns 0.10.35-alpha.54361e.0 npm diff
@codecademy/gamut-styles 20.0.3-alpha.54361e.0 npm diff
@codecademy/gamut-tests 6.0.6-alpha.54361e.0 npm diff
@codecademy/variance 0.26.2-alpha.54361e.0 npm diff
eslint-plugin-gamut 2.4.4-alpha.54361e.0 npm diff

@github-actions

Copy link
Copy Markdown
Contributor

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.

2 participants