/figma-pack:figma-ci-integrationfrom figma-pack
Automates Figma design token sync and asset export in CI/CD pipelines via GitHub Actions. Useful for scheduled token sync, PR-triggered icon exports, and design token validation.
Ships in figma-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Automate Figma API workflows in CI/CD: sync design tokens on schedule, export assets on PR, and validate design system consistency.
FIGMA_PAT stored as GitHub secretfigma-core-workflow-a)# .github/workflows/figma-token-sync.yml
name: Sync Figma Design Tokens
on:
schedule:
- cron: '0 9 * * 1-5' # Weekdays at 9am UTC
workflow_dispatch: # Manual trigger
jobs:
sync-tokens:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- name: Extract tokens from Figma
env:
FIGMA_PAT: ${{ secrets.FIGMA_PAT }}
FIGMA_FILE_KEY: ${{ vars.FIGMA_FILE_KEY }}
run: node scripts/extract-figma-tokens.mjs
- name: Check for changes
id: diff
run: |
git diff --quiet src/styles/tokens.css || echo "changed=true" >> $GITHUB_OUTPUT
- name: Create PR with token updates
if: steps.diff.outputs.changed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BRANCH="figma/token-sync-$(date +%Y%m%d)"
git checkout -b "$BRANCH"
git add src/styles/tokens.css
git commit -m "chore: sync design tokens from Figma"
git push origin "$BRANCH"
gh pr create \
--title "Sync design tokens from Figma" \
--body "Automated token sync from Figma file. Review the CSS changes." \
--label "design-tokens,automated"
# .github/workflows/figma-asset-export.yml
name: Export Figma Assets
on:
pull_request:
paths:
- 'figma-config.json' # Trigger when asset config changes
jobs:
export-assets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npm ci
- name: Export icons from Figma
env:
FIGMA_PAT: ${{ secrets.FIGMA_PAT }}
FIGMA_FILE_KEY: ${{ vars.FIGMA_ICON_FILE_KEY }}
FIGMA_ICON_FRAME: ${{ vars.FIGMA_ICON_FRAME_ID }}
run: node scripts/export-figma-icons.mjs
- name: Commit exported assets
run: |
git add assets/icons/
if ! git diff --cached --quiet; then
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "chore: export icons from Figma"
git push
fi
- name: Validate design tokens
run: |
# Check that all CSS custom properties are valid
node -e "
const fs = require('fs');
const css = fs.readFileSync('src/styles/tokens.css', 'utf-8');
const vars = css.match(/--[\w-]+:/g) || [];
console.log('Token count:', vars.length);
if (vars.length < 10) {
console.error('Too few tokens extracted -- possible Figma API error');
process.exit(1);
}
// Check for duplicate variable names
const dupes = vars.filter((v, i) => vars.indexOf(v) !== i);
if (dupes.length > 0) {
console.error('Duplicate tokens:', dupes);
process.exit(1);
}
"
# Add PAT as repository secret
gh secret set FIGMA_PAT --body "figd_your-token-here"
# Add file key as repository variable (not secret -- it's not sensitive)
gh variable set FIGMA_FILE_KEY --body "abc123XYZdefaultFileKey"
gh variable set FIGMA_ICON_FILE_KEY --body "def456IconFileKey"
gh variable set FIGMA_ICON_FRAME_ID --body "123:456"
| Issue | Cause | Solution |
|---|---|---|
| 403 in CI | PAT expired | Rotate secret: gh secret set FIGMA_PAT |
| Empty token output | File key wrong | Verify FIGMA_FILE_KEY variable |
| Rate limited in CI | Concurrent workflows | Add concurrency group to workflow |
| Stale cache | Node modules cached | Clear with actions/cache invalidation |
Trigger the Step 1 token-sync workflow manually and verify it opens a PR only when tokens changed:
gh workflow run figma-token-sync.yml
gh run watch && gh pr list --label design-tokens
#142 chore(tokens): sync design tokens from Figma design-tokens open
The diff shows exactly what changed in the design file:
- "color-brand-primary": "#4338ca",
+ "color-brand-primary": "#4f46e5",
No-change runs exit green without a PR (idempotent by design). Asset export on PR and the validation gate: references/asset-export-on-pr.md, references/design-system-validation.md.
For deployment patterns, see figma-deploy-integration.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
figma-ci, design-tokens, asset-export, github-actions, ci-cd, design-system
30 skills in this plugin
/figma-advanced-troubleshootingDeep debugging for Figma API issues: network analysis, response inspection, and support escalation.
Use when standard troubleshooting fails, diagnosing intermittent failures,
or preparing detailed evidence for Figma support.
Trigger with phrases like "figma hard bug", "figma mystery error",
"figma deep debug", "figma intermittent failure", "figma support ticket".
/figma-architecture-variantsChoose between Figma integration architectures: CLI script, webhook service, or plugin.
Use when deciding how to integrate with Figma, comparing REST API vs Plugin API,
or planning a Figma-connected application.
Trigger with phrases like "figma architecture", "figma blueprint",
"how to integrate figma", "figma plugin vs api", "figma project type".
/figma-common-errorsDiagnose and fix common Figma REST API and Plugin API errors.
Use when encountering HTTP errors, plugin sandbox crashes,
or unexpected API responses from Figma.
Trigger with phrases like "figma error", "fix figma",
"figma not working", "figma 403", "figma 429".
/figma-core-workflow-aExtract design tokens, colors, typography, and spacing from Figma files via REST API.
Use when building a design-to-code pipeline, syncing design tokens,
or extracting styles from a Figma design system file.
Trigger with phrases like "figma design tokens", "extract figma styles",
"figma to CSS", "sync figma colors", "figma typography".
/figma-core-workflow-bExport images, icons, and assets from Figma files via the REST API.
Use when building an asset pipeline, exporting icons as SVG/PNG,
or rendering frames to images for documentation or previews.
Trigger with phrases like "figma export", "figma images",
"export figma icons", "figma assets", "figma render".
/figma-cost-tuningOptimize Figma API usage to minimize costs and stay within plan limits.
Use when analyzing request volumes, reducing unnecessary API calls,
or choosing the right Figma plan for your integration needs.
Trigger with phrases like "figma cost", "figma pricing",
"reduce figma API calls", "figma plan limits", "figma budget".
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin figma-packOther plugins' skills for the same job