Quick Reference: Step-by-step cards for token pipeline operations
Action: Open Figma file (file key in FIGMA_FILE_ID env var)
Expected: File opens in Figma
Action: Press Shift + Cmd/Ctrl + K to open Variables panel
Expected: Variables panel displays all collections
Action: Edit existing or create new variables in appropriate collection
Expected: Changes saved in Figma
Action: Confirm variable is in correct collection (Primitives, Semantic, etc.)
Expected: Variable appears in expected collection
Command: Create .env file or export: FIGMA_REST_API=<token>, FIGMA_FILE_ID=<file-id>
Expected: Environment variables set
Command: npm run tokens:sync
Expected: Token JSON files in packages/tokens/json/
Action: Check packages/tokens/json/metadata.json exists
Expected: Metadata file contains file list and sync timestamp
Action: List files: ls packages/tokens/json/*.json
Expected: Multiple JSON files (one per collection/mode)
Command: npm run tokens:build
Expected: CSS files generated in dist/packages/tokens/css/
Action: Check dist/packages/tokens/css/dev/
Expected: 10 CSS files (primitives, semantic, typography, component, each with light/dark variants)
Action: Check dist/packages/tokens/css/min/tokens.min.css
Expected: Single consolidated minified CSS file
Action: Open css/dev/tokens.primitives.css in editor
Expected: CSS custom properties with --s2a- prefix
Command: npm run tokens:test
Expected: All tests pass (205 tests)
Command: node packages/tokens/scripts/version.js patch (or minor/major)
Expected: Version updated in packages/tokens/package.json
Action: Edit packages/tokens/CHANGELOG.md with new version entry
Expected: CHANGELOG updated with changes
Command: npm run tokens:package
Expected: s2a-tokens-<version>.tgz created in repo root
Action: Check tarball: ls -lh s2a-tokens-*.tgz
Expected: Tarball file exists with correct version
Command: git add . && git commit -m "chore: release v<version>" && git tag "s2a-tokens-v<version>"
Expected: Changes committed, tag created
Command: cd dist/packages/tokens && npm publish
Expected: Package published to npm registry
Command: npm install ./s2a-tokens-<version>.tgz (or from registry)
Expected: Package installed in node_modules/s2a-tokens/
Action: Add to Milo root stylesheet: @import "s2a-tokens/css/min/tokens.min.css";
Expected: All tokens available as CSS custom properties
Action: Import individual files in order (primitives → semantic)
Expected: Tokens available for debugging
Action: Set document.documentElement.dataset.theme = "dark"
Expected: Dark mode tokens applied
Full Pipeline:
npm run tokens:sync && npm run tokens:build && npm run tokens:packageVersion Bump + Release:
node packages/tokens/scripts/version.js patch
npm run tokens:build
npm run tokens:package
git add . && git commit -m "chore: release v<version>"Clean Start:
npm run tokens:clean && npm run tokens:sync && npm run tokens:buildEnd of FigJam Steps