Skip to main content Início Criadores jeremylongshore tons-of-skills-marketplace figma-data-handling
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".
Ir para a instalação Skills Marketplace Descubra e explore skills de IA criadas pela comunidade.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Copiar promptMostrar detalhes do prompt Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
npx skills add https://github.com/jeremylongshore/tons-of-skills-marketplace --skill figma-data-handlingO comando permanece em uma só linha. Role horizontalmente para revisá-lo antes de copiar.
Prefere uma cópia local? Baixe os arquivos disponíveis atualmente no SkillsMP.
Baixar Zip Baixando... Mais deste repositório langchain-deploy-integration Deploy a LangChain 1.0 / LangGraph 1.0 app to Cloud Run, Vercel, or LangServe correctly — with timeouts sized for chain length, cold-start mitigation, SSE anti-buffering headers, and Secret Manager over .env. Use when prepping a first production deploy, debugging a stream that hangs behind a proxy, or diagnosing p99 latency spikes. Trigger with "langchain deploy", "langchain cloud run", "langchain vercel python", "langchain langserve", or "langchain docker".
langchain-langgraph-agents Build a correct LangGraph 1.0 ReAct agent with create_react_agent — typed tools, error propagation, recursion caps, and stop conditions that actually stop. Use when writing a first tool-calling agent, migrating from AgentExecutor or initialize_agent, or diagnosing an agent that loops on vague prompts. Trigger with "langgraph agent", "create_react_agent", "langgraph tool calling", "AgentExecutor migration", or "agent loop cost".
langchain-langgraph-human-in-loop Build LangGraph 1.0 human-in-the-loop approval flows with interrupt_before /
interrupt_after and Command(resume=...) — JSON-serializable state, clean
resume semantics, and UI wiring for approval decisions. Use when adding an
approval gate before an expensive tool call, wiring a Slack/web UI for agent
approvals, or debugging a graph that crashes on interrupt.
Trigger with "langgraph human in loop", "langgraph interrupt_before",
"langgraph approval flow", "Command resume", "langgraph HITL".
Explorador de arquivos
7 arquivos name figma-data-handling description 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".
allowed-tools Read, Write, Edit version 1.6.0 license MIT author Jeremy Longshore <jeremy@intentsolutions.io> tags ["saas","figma"] compatibility Designed for Claude Code
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
const PAT = process.env .FIGMA_PAT !;
const FILE_KEY = process.env .FIGMA_FILE_KEY !;
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 ();
return data.comments ;
}
async function getCommentsAsMarkdown (fileKey : string ) {
const res = (
,
{ : { : } }
);
( res. ()). ;
}
( ) {
: = { message };
(nodeId) {
body. = { : nodeId };
}
res = (
,
{
: ,
: {
: ,
: ,
},
: . (body),
}
);
res. ();
}
( ) {
(
,
{
: ,
: {
: ,
: ,
},
: . ({ emoji }),
}
). ( r. ());
}
await
fetch
`https://api.figma.com/v1/files/${fileKey} /comments?as_md=true`
headers
'X-Figma-Token'
PAT
return
await
json
comments
async
function
postComment
fileKey : string , message : string , nodeId ?: string
const
body
any
if
client_meta
node_id
const
await
fetch
`https://api.figma.com/v1/files/${fileKey} /comments`
method
'POST'
headers
'X-Figma-Token'
PAT
'Content-Type'
'application/json'
body
JSON
stringify
return
json
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
then
r =>
json
Step 2: Version History API
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 ();
return data.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 );
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
interface FigmaUser {
id : string ;
handle : string ;
img_url : string ;
email : string ;
}
function redactFigmaUser (user : FigmaUser ): Omit <FigmaUser , 'email' > & { email : string } {
return {
...user,
email : '[REDACTED]' ,
img_url : '[REDACTED]' ,
};
}
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
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),
};
}
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
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
Examples Pull the latest comments as Markdown and post a reaction (Step 1 Comments API):
curl -s -H "X-Figma-Token: ${FIGMA_PAT} " \
"https://api.figma.com/v1/files/${FIGMA_FILE_KEY} /comments?as_md=true" \
| jq -r '.comments[0] | "\(.user.handle): \(.message)"'
Walk version history with pagination (Step 2):
curl -s -H "X-Figma-Token: ${FIGMA_PAT} " \
"https://api.figma.com/v1/files/${FIGMA_FILE_KEY} /versions" \
| jq '{versions: [.versions[] | {id, created_at, label}], next: .pagination.next_page}'
PII rules for what you may persist from these payloads (user handles, avatars, emails): references/user-data-and-privacy.md and references/safe-logging.md.
Resources
Next Steps For enterprise access control, see figma-enterprise-rbac.