GitOps-powered design token generation and distribution.
Design tokens get out of sync. A designer updates the primary color in Figma, but three weeks later the React app still has the old blue. The marketing site has a different shade entirely. Nobody knows which version is "correct."
Without Clafoutis:
Designer updates Figma → exports JSON → emails developer →
developer copies values → commits to repo A → forgets repo B →
repos drift apart → Figma has different values than code →
"why does the button look different?"
With Clafoutis:
Update tokens in Git → PR merged → GitHub Release created →
all consuming repos sync the same version →
Figma variables regenerated from the same source →
design and code stay in sync
Producers (design system maintainers) define tokens in JSON and publish via GitHub Releases:
npx @clafoutis/cli init --producer
# Edit tokens/colors/primitives.json
git push # GitHub Action runs generate and creates release automaticallyThe default workflow generates build/, commits updated build/** back to the repository, and creates a GitHub Release.
If you opted out of the GitHub workflow during init, run npx @clafoutis/cli generate locally before pushing.
Consumers (application developers) pin to a version and sync:
npx @clafoutis/cli init --consumer --repo Acme/design-system
npx @clafoutis/cli sync
git commit -m "chore: sync design tokens v1.2.0"Tokens are committed to your repo. No runtime dependencies. No build-time network requests. Just static files under version control.
| Pain Point | How Clafoutis Solves It |
|---|---|
| "Which Figma file has the latest tokens?" | Single source of truth in a Git repo with tagged releases |
| "Our CI build failed because the token CDN was down" | Tokens are committed locally - no network needed at build time |
| "We updated tokens and broke three apps" | Pin to specific versions, update each app on its own schedule |
| "How do I know what changed between v1.0 and v2.0?" | Standard Git diff - tokens are just JSON files |
| "Setting up Style Dictionary is complicated" | Built-in generators for Tailwind and Figma, or bring your own |
npm install -D @clafoutis/cli# Initialize with interactive wizard
npx @clafoutis/cli init --producer
# Or non-interactive for CI
npx @clafoutis/cli init --producer --generators=tailwind,figma --non-interactiveThis creates:
.clafoutis/producer.json- configurationtokens/- starter token templates (colors, spacing, typography).github/workflows/clafoutis-release.yml- auto-release on push
Edit your tokens, push to main, and a GitHub Release is created automatically.
# Initialize
npx @clafoutis/cli init --consumer --repo Acme/design-system
# Sync tokens from the latest release
npx @clafoutis/cli sync
# Commit the synced files
git add .clafoutis/ src/tokens/
git commit -m "chore: sync design tokens"# Check available versions
gh release list -R Acme/design-system
# Update .clafoutis/consumer.json to new version
# Then sync
npx @clafoutis/cli sync{
"tokens": "./tokens",
"output": "./build",
"generators": {
"tailwind": true,
"figma": true
}
}{
"repo": "Acme/design-system",
"version": "v1.2.0",
"files": {
"tailwind.base.css": "src/styles/tokens.css",
"tailwind.config.js": "./tailwind.config.js"
}
}Use "version": "latest" during development to always get the newest release. Pin to a specific tag (e.g., "v1.2.0") for production stability.
Initialize configuration with an interactive wizard, or use flags for CI:
npx @clafoutis/cli init --producer # Interactive producer setup
npx @clafoutis/cli init --consumer --repo X/Y # Interactive consumer setup
npx @clafoutis/cli init --producer --cwd ./packages/design-system
npx @clafoutis/cli init --non-interactive # Skip prompts, use flags/defaults
npx @clafoutis/cli init --dry-run # Preview without writing filesTransform tokens into platform-specific outputs:
npx @clafoutis/cli generate # Use config file
npx @clafoutis/cli generate --tailwind --figma # Specify generators
npx @clafoutis/cli generate --cwd ./packages/design-system
npx @clafoutis/cli generate --dry-run # Preview outputDownload tokens from a GitHub Release:
npx @clafoutis/cli sync # Sync if version changed
npx @clafoutis/cli sync --force # Re-sync even if cached
npx @clafoutis/cli sync --cwd ./apps/web
npx @clafoutis/cli sync --dry-run # Preview what would syncUse --cwd <path> on all CLI commands when running from a monorepo root:
npx @clafoutis/cli init --producer --cwd ./packages/design-system
npx @clafoutis/cli generate --cwd ./packages/design-system
npx @clafoutis/cli format --cwd ./packages/design-system
npx @clafoutis/cli sync --cwd ./apps/webAll relative paths in config/options are resolved from the provided --cwd. Producer output remains ./build by default.
Create platform-specific generators when the built-ins don't fit:
{
"generators": {
"tailwind": true,
"brand-scss": "./generators/brand-scss.ts"
}
}// generators/brand-scss.ts
import type { GeneratorPlugin } from '@clafoutis/cli';
export const generate: GeneratorPlugin = async ({ tokensDir, outputDir, StyleDictionary }) => {
const sd = new StyleDictionary({
source: [`${tokensDir}/**/*.json`],
platforms: {
scss: {
transformGroup: 'scss',
buildPath: `${outputDir}/`,
files: [{ destination: '_brand.scss', format: 'scss/variables' }],
},
},
});
await sd.buildAllPlatforms();
};Set CLAFOUTIS_REPO_TOKEN with a GitHub PAT that has repo scope:
export CLAFOUTIS_REPO_TOKEN=ghp_xxxx
npx @clafoutis/cli syncIn CI:
- run: npx @clafoutis/cli sync
env:
CLAFOUTIS_REPO_TOKEN: ${{ secrets.DESIGN_SYSTEM_TOKEN }}Clafoutis uses the Design Tokens Community Group (DTCG) specification:
{
"color": {
"primary": {
"$type": "color",
"$value": "#3b82f6"
}
},
"spacing": {
"sm": {
"$type": "dimension",
"$value": "8px"
}
}
}- Distribution Guide - Detailed producer/consumer workflow
- Tailwind Generator - Tailwind-specific configuration
- Figma Generator - Figma variables export
make init # Install dependencies
make build-all # Build all packages
make check-all # Lint, format, type-check
make test-all # Run testsBUSL-1.1