figma-data-handling
Handle Figma API data correctly: comments, versions, user data, and privacy compliance. Use when working with Figma comments API, version history, or ensuring GDPR compliance for Figma user data. Trigger with phrases like "figma data", "figma comments", "figma versions", "figma GDPR", "figma user data".
Best use case
figma-data-handling is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Handle Figma API data correctly: comments, versions, user data, and privacy compliance. Use when working with Figma comments API, version history, or ensuring GDPR compliance for Figma user data. Trigger with phrases like "figma data", "figma comments", "figma versions", "figma GDPR", "figma user data".
Teams using figma-data-handling should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/figma-data-handling/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How figma-data-handling Compares
| Feature / Agent | figma-data-handling | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Handle Figma API data correctly: comments, versions, user data, and privacy compliance. Use when working with Figma comments API, version history, or ensuring GDPR compliance for Figma user data. Trigger with phrases like "figma data", "figma comments", "figma versions", "figma GDPR", "figma user data".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Figma Data Handling
## Overview
Work with Figma's data APIs: comments, version history, and user information. Handle sensitive data correctly with redaction and privacy compliance.
## Prerequisites
- `FIGMA_PAT` with appropriate scopes (`file_comments:read/write`, `file_versions:read`)
- Understanding of GDPR/CCPA basics
## Instructions
### Step 1: Comments API
```typescript
const PAT = process.env.FIGMA_PAT!;
const FILE_KEY = process.env.FIGMA_FILE_KEY!;
// GET /v1/files/:key/comments -- requires file_comments:read scope
async function getComments(fileKey: string) {
const res = await fetch(
`https://api.figma.com/v1/files/${fileKey}/comments`,
{ headers: { 'X-Figma-Token': PAT } }
);
const data = await res.json();
// data.comments is an array of:
// { id, message, file_key, parent_id, user, client_meta, resolved_at, created_at, order_id }
return data.comments;
}
// GET with as_md=true to get rich-text comments as markdown
async function getCommentsAsMarkdown(fileKey: string) {
const res = await fetch(
`https://api.figma.com/v1/files/${fileKey}/comments?as_md=true`,
{ headers: { 'X-Figma-Token': PAT } }
);
return (await res.json()).comments;
}
// POST /v1/files/:key/comments -- requires file_comments:write scope
async function postComment(fileKey: string, message: string, nodeId?: string) {
const body: any = { message };
if (nodeId) {
body.client_meta = { node_id: nodeId };
}
const res = await fetch(
`https://api.figma.com/v1/files/${fileKey}/comments`,
{
method: 'POST',
headers: {
'X-Figma-Token': PAT,
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
}
);
return res.json();
}
// POST reactions to a comment -- requires file_comments:write
async function reactToComment(fileKey: string, commentId: string, emoji: string) {
return fetch(
`https://api.figma.com/v1/files/${fileKey}/comments/${commentId}/reactions`,
{
method: 'POST',
headers: {
'X-Figma-Token': PAT,
'Content-Type': 'application/json',
},
body: JSON.stringify({ emoji }),
}
).then(r => r.json());
}
```
### Step 2: Version History API
```typescript
// GET /v1/files/:key/versions -- requires file_versions:read scope
async function getVersionHistory(fileKey: string) {
const res = await fetch(
`https://api.figma.com/v1/files/${fileKey}/versions`,
{ headers: { 'X-Figma-Token': PAT } }
);
const data = await res.json();
// data.versions: array of { id, created_at, label, description, user }
// Ordered by created_at (most recent first)
return data.versions;
}
// Paginate through all versions
async function getAllVersions(fileKey: string) {
const versions: any[] = [];
let url: string | null = `https://api.figma.com/v1/files/${fileKey}/versions`;
while (url) {
const res = await fetch(url, { headers: { 'X-Figma-Token': PAT } });
const data = await res.json();
versions.push(...data.versions);
// Pagination uses cursor-based pagination
url = data.pagination?.next_page
? `https://api.figma.com/v1/files/${fileKey}/versions?before=${data.pagination.next_page}`
: null;
}
return versions;
}
```
### Step 3: User Data and Privacy
```typescript
// GET /v1/me -- returns authenticated user
interface FigmaUser {
id: string;
handle: string;
img_url: string;
email: string; // PII -- handle carefully
}
// Redact PII before logging or storing
function redactFigmaUser(user: FigmaUser): Omit<FigmaUser, 'email'> & { email: string } {
return {
...user,
email: '[REDACTED]',
img_url: '[REDACTED]',
};
}
// Data classification for Figma responses
interface DataClassification {
field: string;
sensitivity: 'public' | 'internal' | 'pii';
handling: string;
}
const figmaDataClassification: DataClassification[] = [
{ field: 'user.email', sensitivity: 'pii', handling: 'Encrypt at rest, redact in logs' },
{ field: 'user.handle', sensitivity: 'internal', handling: 'Do not expose to unauthorized users' },
{ field: 'user.img_url', sensitivity: 'pii', handling: 'Do not cache without consent' },
{ field: 'file.name', sensitivity: 'internal', handling: 'Standard handling' },
{ field: 'comment.message', sensitivity: 'internal', handling: 'May contain PII -- scan before storing' },
{ field: 'PAT token', sensitivity: 'pii', handling: 'Never log, never store in code' },
];
```
### Step 4: Data Retention
```typescript
// Figma image export URLs expire after 30 days
// Plan data retention accordingly
interface CachedFigmaData {
data: any;
fetchedAt: Date;
expiresAt: Date;
}
function createCacheEntry(data: any, ttlMs: number): CachedFigmaData {
const now = new Date();
return {
data,
fetchedAt: now,
expiresAt: new Date(now.getTime() + ttlMs),
};
}
// Cleanup expired entries
async function cleanupExpiredData(db: any) {
const now = new Date();
const deleted = await db.figmaCache.deleteMany({
expiresAt: { $lt: now },
});
console.log(`Cleaned up ${deleted.count} expired Figma cache entries`);
}
```
### Step 5: Safe Logging
```typescript
// Never log these fields from Figma responses
const REDACT_FIELDS = ['email', 'img_url', 'access_token', 'refresh_token'];
function safeFigmaLog(label: string, data: any) {
const safe = JSON.parse(JSON.stringify(data));
function redact(obj: any) {
for (const key of Object.keys(obj)) {
if (REDACT_FIELDS.includes(key)) {
obj[key] = '[REDACTED]';
} else if (typeof obj[key] === 'object' && obj[key] !== null) {
redact(obj[key]);
}
}
}
redact(safe);
console.log(`[figma] ${label}:`, JSON.stringify(safe));
}
```
## Output
- Comments fetched and posted via REST API
- Version history retrieved with pagination
- PII redacted before logging and storage
- Data retention policies applied
## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| 403 on comments | Missing `file_comments:read` scope | Regenerate PAT with scope |
| Empty version history | New file with no saved versions | Create a named version in Figma first |
| PII in logs | Missing redaction | Apply `safeFigmaLog` wrapper |
| Stale image URLs | URLs older than 30 days | Re-export images; do not cache URLs long-term |
## Resources
- [Figma Comments Endpoints](https://developers.figma.com/docs/rest-api/comments-endpoints/)
- [Figma Version History](https://developers.figma.com/docs/rest-api/version-history-endpoints/)
- [GDPR Developer Guide](https://gdpr.eu/developers/)
## Next Steps
For enterprise access control, see `figma-enterprise-rbac`.Related Skills
generating-test-data
Generate realistic test data including edge cases and boundary conditions. Use when creating realistic fixtures or edge case test data. Trigger with phrases like "generate test data", "create fixtures", or "setup test database".
managing-database-tests
Test database testing including fixtures, transactions, and rollback management. Use when performing specialized testing. Trigger with phrases like "test the database", "run database tests", or "validate data integrity".
encrypting-and-decrypting-data
Validate encryption implementations and cryptographic practices. Use when reviewing data security measures. Trigger with 'check encryption', 'validate crypto', or 'review security keys'.
scanning-for-data-privacy-issues
Scan for data privacy issues and sensitive information exposure. Use when reviewing data handling practices. Trigger with 'scan privacy issues', 'check sensitive data', or 'validate data protection'.
windsurf-data-handling
Control what code and data Windsurf AI can access and process in your workspace. Use when handling sensitive data, implementing data exclusion patterns, or ensuring compliance with privacy regulations in Windsurf environments. Trigger with phrases like "windsurf data privacy", "windsurf PII", "windsurf GDPR", "windsurf compliance", "codeium data", "windsurf telemetry".
webflow-data-handling
Implement Webflow data handling — CMS content delivery patterns, PII redaction in form submissions, GDPR/CCPA compliance for ecommerce data, and data retention policies. Trigger with phrases like "webflow data", "webflow PII", "webflow GDPR", "webflow data retention", "webflow privacy", "webflow CCPA", "webflow forms data".
vercel-data-handling
Implement data handling, PII protection, and GDPR/CCPA compliance for Vercel deployments. Use when handling sensitive data in serverless functions, implementing data redaction, or ensuring privacy compliance on Vercel. Trigger with phrases like "vercel data", "vercel PII", "vercel GDPR", "vercel data retention", "vercel privacy", "vercel compliance".
veeva-data-handling
Veeva Vault data handling for enterprise operations. Use when implementing advanced Veeva Vault patterns. Trigger: "veeva data handling".
vastai-data-handling
Manage training data and model artifacts securely on Vast.ai GPU instances. Use when transferring data to instances, managing checkpoints, or implementing secure data lifecycle on rented hardware. Trigger with phrases like "vastai data", "vastai upload data", "vastai checkpoints", "vastai data security", "vastai artifacts".
twinmind-data-handling
Handle TwinMind meeting data with GDPR compliance: transcript storage, memory vault management, data export, and deletion policies. Use when implementing data handling, or managing TwinMind meeting AI operations. Trigger with phrases like "twinmind data handling", "twinmind data handling".
supabase-data-handling
Implement GDPR/CCPA compliance with Supabase: RLS for data isolation, user deletion via auth.admin.deleteUser(), data export via SQL, PII column management, backup/restore workflows, and retention policies. Use when handling sensitive data, implementing right-to-deletion, configuring data retention, or auditing PII in Supabase database columns. Trigger: "supabase GDPR", "supabase data handling", "supabase PII", "supabase compliance", "supabase data retention", "supabase delete user", "supabase data export".
speak-data-handling
Handle student audio data, assessment records, and learning progress with GDPR/COPPA compliance. Use when implementing data handling, or managing Speak language learning platform operations. Trigger with phrases like "speak data handling", "speak data handling".