/figma-pack:figma-advanced-troubleshootingfrom figma-pack
Deep debugging for Figma REST API issues: network analysis with curl, response shape validation, rate limit edge cases, and support escalation evidence gathering.
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.
Deep debugging techniques for complex Figma REST API issues that resist standard error handling: intermittent failures, unexpected response shapes, rate limit edge cases, and large file timeouts.
curl with verbose mode for network inspection# Full HTTP request/response trace for a Figma API call
curl -v -H "X-Figma-Token: ${FIGMA_PAT}" \
"https://api.figma.com/v1/files/${FIGMA_FILE_KEY}?depth=1" 2>&1 \
| tee figma-debug-trace.txt
# Extract key diagnostic info:
# - TLS version and cipher
# - Response status and headers
# - Timing breakdown
curl -w "
DNS: %{time_namelookup}s
Connect: %{time_connect}s
TLS: %{time_appconnect}s
TTFB: %{time_starttransfer}s
Total: %{time_total}s
Size: %{size_download} bytes
Status: %{http_code}
" -s -o /dev/null \
-H "X-Figma-Token: ${FIGMA_PAT}" \
"https://api.figma.com/v1/files/${FIGMA_FILE_KEY}?depth=1"
// Figma API responses can be unexpectedly shaped when:
// - File is empty or newly created
// - Nodes have been deleted between requests
// - Plugin data is corrupted
function validateFileResponse(data: any): string[] {
const issues: string[] = [];
if (!data.document) issues.push('Missing document root');
if (!data.document?.children?.length) issues.push('Document has no pages');
if (typeof data.name !== 'string') issues.push('Missing file name');
if (!data.version) issues.push('Missing version field');
// Check for null nodes (deleted between list and fetch)
if (data.nodes) {
for (const [id, node] of Object.entries(data.nodes)) {
if (node === null) issues.push(`Null node: ${id} (deleted or invisible)`);
}
}
// Check images response for null renders
if (data.images) {
for (const [id, url] of Object.entries(data.images)) {
if (url === null) issues.push(`Image render failed for node: ${id}`);
}
}
return issues;
}
// Problem: Figma rate limits are per-user, per-minute, but the exact
// limit is not published and varies by plan tier and seat type.
// Diagnostic: measure your actual limit by counting successful requests
async function measureRateLimit(token: string): Promise<{
requestsMade: number;
firstRateLimitAt: number | null;
retryAfter: number | null;
}> {
let count = 0;
let rateLimitAt: number | null = null;
let retryAfter: number | null = null;
// Make requests until rate limited (use a read-only endpoint)
while (count < 200) {
const res = await fetch('https://api.figma.com/v1/me', {
headers: { 'X-Figma-Token': token },
});
if (res.status === 429) {
rateLimitAt = count;
retryAfter = parseInt(res.headers.get('Retry-After') || '0');
break;
}
count++;
// Small delay to avoid instant burst
await new Promise(r => setTimeout(r, 100));
}
return { requestsMade: count, firstRateLimitAt: rateLimitAt, retryAfter };
}
// Large Figma files (1000+ components) can cause:
// - Response timeouts (>30s)
// - Memory issues (100+ MB JSON)
// - Rate limits from repeated retries
// Strategy: chunk the file by page
async function fetchLargeFileSafely(fileKey: string, token: string) {
// 1. Get file metadata with depth=1 (just pages, not children)
const meta = await fetch(
`https://api.figma.com/v1/files/${fileKey}?depth=1`,
{ headers: { 'X-Figma-Token': token } }
).then(r => r.json());
console.log(`File: ${meta.name}, Pages: ${meta.document.children.length}`);
// 2. Fetch each page's content individually
const results = [];
for (const page of meta.document.children) {
console.log(`Fetching page: ${page.name} (${page.id})`);
const pageData = await fetch(
`https://api.figma.com/v1/files/${fileKey}/nodes?ids=${page.id}`,
{ headers: { 'X-Figma-Token': token } }
).then(r => r.json());
results.push({ pageId: page.id, pageName: page.name, data: pageData });
// Respect rate limits between page fetches
await new Promise(r => setTimeout(r, 500));
}
return results;
}
## Figma API Support Request
**Account email:** [your-email]
**Plan tier:** [Starter/Professional/Organization/Enterprise]
**Endpoint:** [e.g., GET /v1/files/:key]
**File key:** [file key, not sensitive]
### Issue Description
[1-2 sentences describing the problem]
### Reproduction Steps
1. Call `GET https://api.figma.com/v1/files/FILE_KEY?depth=1`
2. Observe: [expected vs actual behavior]
### Diagnostic Data
- HTTP status: [status code]
- Response headers: [relevant headers, especially rate limit]
- Response time: [from curl timing]
- Frequency: [every time / intermittent / specific conditions]
### Request/Response (redacted)
curl -v -H "X-Figma-Token: [REDACTED]"
"https://api.figma.com/v1/files/FILE_KEY?depth=1"
HTTP/2 [status] x-figma-rate-limit-type: [value] retry-after: [value]
### Environment
- Node.js: [version]
- OS: [os]
- Region: [your server region]
- Behind proxy: [yes/no]
| Issue | Diagnostic | Solution |
|---|---|---|
| Intermittent 500s | Track frequency and timing | Log every request; report pattern to Figma |
| Slow responses | curl timing breakdown | Check if DNS/TLS is the bottleneck |
| Null image renders | Validate node visibility | Check node opacity and visibility in Figma |
| Memory crash | Large file JSON | Use depth=1 + per-page /nodes calls |
A sync that "randomly fails" — verbose inspection (Step 1) shows it's not random:
curl -sv -H "X-Figma-Token: ${FIGMA_PAT}" \
"https://api.figma.com/v1/files/${FIGMA_FILE_KEY}?depth=1" 2>&1 \
| /usr/bin/grep -E '^< (HTTP|retry-after|x-)'
< HTTP/2 429
< retry-after: 47
The failures cluster at the top of each hour — a cron thundering herd, not flakiness. Fix per Step 3 (jitter + honor Retry-After).
A "works for small files, breaks for the design system" report is usually payload size — Step 4:
curl -s -o /dev/null -w '%{size_download}\n' -H "X-Figma-Token: ${FIGMA_PAT}" \
"https://api.figma.com/v1/files/${FIGMA_FILE_KEY}"
# 48731210 ← 48 MB full tree; switch to ?depth=1 + /nodes?ids=
Escalation packet for Figma support: references/support-escalation-template.md.
For load testing, see figma-load-scale.
references/errors.md (opens in a new tab)references/large-file-debugging.md (opens in a new tab)references/rate-limit-edge-cases.md (opens in a new tab)references/response-shape-validation.md (opens in a new tab)references/support-escalation-template.md (opens in a new tab)references/verbose-request-inspection.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
30 skills in this plugin
/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-ci-integrationAutomate Figma design token sync and asset export in CI/CD pipelines.
Use when setting up GitHub Actions for Figma, automating icon exports,
or validating design token changes in pull requests.
Trigger with phrases like "figma CI", "figma GitHub Actions",
"automate figma export", "figma CI pipeline".
/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