Agent skill

Figma Policy Guardrails

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Enforce security policies and coding standards for Figma API integrations.

MITAuto-check: notesDevelopment

Install Figma Policy Guardrails

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill figma-policy-guardrails -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace figma-policy-guardrails --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/figma-policy-guardrails .claude/skills/figma-policy-guardrails && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
figma-policy-guardrails
GitHub stars
2.8k
Token cost
~2k tokens
SKILL.md length
195 words
Files
7 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Enforce security policies and coding standards for Figma API integrations.

  • Works in 5 steps: Token Leak Prevention → ESLint Rules for Figma → API Usage Policies → …
  • Setting up linting rules for Figma tokens
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 4 more sections
  • Calls git; needs FIGMA_FILE_KEY

What it does

Figma Policy Guardrails is an agent skill from jeremylongshore/tons-of-skills-marketplace. Enforce security policies and coding standards for Figma API integrations. Use when setting up linting rules for Figma tokens, preventing accidental credential leaks, or enforcing API usage best practices. Trigger with phrases like "figma policy", "figma lint", "figma guardrails", "figma security rules", "figma best practices check".

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `references/api-usage-policies.md`, `references/audit-logging.md` and `references/configuration-validation.md`). Compatibility notes: Designed for Claude Code

It sits in Development, covering Linting and formatting, LLM guardrails and Third-party API integration. It works with Figma and ESLint. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Setting up linting rules for Figma tokens
  • Preventing accidental credential leaks
  • Enforcing API usage best practices
  • With phrases like figma policy

Example prompts

  • “figma policy”
  • “figma lint”
  • “figma guardrails”
  • “/figma-policy-guardrails”

Requirements

  • A credential in FIGMA_FILE_KEY
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash(npx:*)

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Token Leak Prevention
  2. ESLint Rules for Figma
  3. API Usage Policies
  4. Configuration Validation
  5. Audit Logging

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash(npx:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • developers.figma.com
    • pre-commit.com
    • eslint.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • FIGMA_FILE_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Figma Policy Guardrails loads about 2k tokens when it runs, and up to ~3.9k if it reads all its reference files. Until then it costs about 90 tokens; SKILL.md has 195 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~90
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:50
    echo "Store tokens in .env files (which should be in .gitignore)"
  • NoteMentions a .env fileSKILL.md:79
    - name: Check .env files not committed

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 195 words, ~2,017 tokens.

Download SKILL.mdSave it as .claude/skills/figma-policy-guardrails/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
figma-policy-guardrails
description
Enforce security policies and coding standards for Figma API integrations. Use when setting up linting rules for Figma tokens, preventing accidental credential leaks, or enforcing API usage best practices. Trigger with phrases like "figma policy", "figma lint", "figma guardrails", "figma security rules", "figma best practices check".
allowed-tools
Read, Write, Edit, Bash(npx:*)
compatibility
Designed for Claude Code
version
1.6.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, figma

Figma Policy & Guardrails

Overview

Automated guardrails for Figma API integrations: prevent token leaks, enforce scope minimization, validate webhook configurations, and catch common anti-patterns in CI.

Prerequisites

  • ESLint or similar linter
  • CI/CD pipeline (GitHub Actions)
  • Pre-commit hooks infrastructure

Instructions

Step 1: Token Leak Prevention
bash
# .pre-commit-config.yaml -- catch Figma tokens before commit
repos:
  - repo: local
    hooks:
      - id: no-figma-tokens
        name: Check for Figma PAT leaks
        entry: bash -c '
          if git diff --cached --diff-filter=ACM -z -- . |
             xargs -0 grep -lP "figd_[a-zA-Z0-9_-]{20,}" 2>/dev/null; then
            echo "ERROR: Figma PAT found in staged files"
            echo "Store tokens in .env files (which should be in .gitignore)"
            exit 1
          fi
        '
        language: system
        pass_filenames: false
yaml
# GitHub Actions secret scanning
# .github/workflows/figma-security.yml
name: Figma Security Check
on: [push, pull_request]

jobs:
  security:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Scan for Figma tokens
        run: |
          if grep -rP "figd_[a-zA-Z0-9_-]{20,}" \
            --include="*.ts" --include="*.js" --include="*.json" \
            --exclude-dir=node_modules .; then
            echo "::error::Figma PAT found in source code"
            exit 1
          fi

      - name: Check .env files not committed
        run: |
          if git ls-files --cached | grep -E '^\.(env|env\.local|env\.production)$'; then
            echo "::error::.env file committed to repository"
            exit 1
          fi
Step 2: ESLint Rules for Figma
javascript
// eslint-rules/no-figma-token-literal.js
module.exports = {
  meta: {
    type: 'problem',
    docs: { description: 'Disallow hardcoded Figma PATs' },
  },
  create(context) {
    return {
      Literal(node) {
        if (typeof node.value === 'string' && /^figd_[a-zA-Z0-9_-]{20,}/.test(node.value)) {
          context.report({
            node,
            message: 'Hardcoded Figma PAT detected. Use process.env.FIGMA_PAT instead.',
          });
        }
      },
      TemplateLiteral(node) {
        for (const quasi of node.quasis) {
          if (/figd_[a-zA-Z0-9_-]{20,}/.test(quasi.value.raw)) {
            context.report({
              node,
              message: 'Hardcoded Figma PAT in template literal.',
            });
          }
        }
      },
    };
  },
};
Step 3: API Usage Policies
typescript
// Runtime guardrails for Figma API usage

// Policy 1: No full-file fetches without justification
function validateFigmaRequest(path: string) {
  // Block unoptimized full file fetches
  if (path.match(/\/v1\/files\/[^/]+$/) && !path.includes('depth=')) {
    console.warn(
      '[figma-policy] Full file fetch without depth parameter. ' +
      'Use ?depth=1 or /nodes endpoint for better performance.'
    );
  }

  // Block deprecated scope indicator
  if (path.includes('files:read')) {
    throw new Error(
      '[figma-policy] files:read scope is deprecated. ' +
      'Use file_content:read instead.'
    );
  }
}

// Policy 2: Enforce timeout on all Figma calls
function validateTimeout(options: RequestInit) {
  if (!options.signal) {
    console.warn(
      '[figma-policy] Figma request without AbortSignal. ' +
      'Use AbortSignal.timeout() to prevent hung requests.'
    );
  }
}

// Policy 3: Rate limit safety margin
const MAX_REQUESTS_PER_MINUTE = 25; // Conservative limit
let requestsThisMinute = 0;
let minuteStart = Date.now();

function enforceRatePolicy() {
  if (Date.now() - minuteStart > 60_000) {
    requestsThisMinute = 0;
    minuteStart = Date.now();
  }

  requestsThisMinute++;
  if (requestsThisMinute > MAX_REQUESTS_PER_MINUTE) {
    throw new Error(
      `[figma-policy] Rate limit safety: ${requestsThisMinute} requests/min ` +
      `exceeds policy limit of ${MAX_REQUESTS_PER_MINUTE}`
    );
  }
}
Step 4: Configuration Validation
typescript
// Validate Figma config at startup, fail fast if misconfigured
function validateFigmaConfig() {
  const errors: string[] = [];

  // Token format
  const pat = process.env.FIGMA_PAT;
  if (!pat) {
    errors.push('FIGMA_PAT is not set');
  } else if (!pat.startsWith('figd_')) {
    errors.push('FIGMA_PAT does not have expected figd_ prefix');
  }

  // File key format
  const fileKey = process.env.FIGMA_FILE_KEY;
  if (!fileKey) {
    errors.push('FIGMA_FILE_KEY is not set');
  } else if (fileKey.length < 10) {
    errors.push('FIGMA_FILE_KEY seems too short');
  }

  // Webhook passcode (if webhooks are configured)
  if (process.env.FIGMA_WEBHOOK_ENABLED === 'true') {
    if (!process.env.FIGMA_WEBHOOK_PASSCODE) {
      errors.push('FIGMA_WEBHOOK_PASSCODE required when webhooks are enabled');
    } else if (process.env.FIGMA_WEBHOOK_PASSCODE.length < 16) {
      errors.push('FIGMA_WEBHOOK_PASSCODE should be at least 16 characters');
    }
  }

  if (errors.length > 0) {
    console.error('[figma-policy] Configuration errors:');
    errors.forEach(e => console.error(`  - ${e}`));
    throw new Error(`Figma configuration invalid: ${errors.length} errors`);
  }

  console.log('[figma-policy] Configuration validated');
}

// Call at startup
validateFigmaConfig();
Step 5: Audit Logging
typescript
// Log all Figma API operations for compliance
interface FigmaAuditEntry {
  timestamp: string;
  action: string;
  endpoint: string;
  fileKey?: string;
  status: number;
  userId?: string;
}

function auditFigmaCall(entry: Omit<FigmaAuditEntry, 'timestamp'>) {
  const log: FigmaAuditEntry = {
    ...entry,
    timestamp: new Date().toISOString(),
  };

  // Structured log for aggregation
  console.log(JSON.stringify({ type: 'figma_audit', ...log }));
}

Output

  • Pre-commit hooks catching token leaks
  • CI pipeline scanning for hardcoded credentials
  • Runtime policies enforcing performance best practices
  • Configuration validation at startup
  • Audit logging for compliance

Error Handling

IssueCauseSolution
False positive on token scanTest fixture contains figd_Exclude test fixtures directory
Policy blocks legitimate requestToo restrictiveAdd exception list for specific paths
Startup validation failsMissing env varsCheck deployment config
Audit log noiseToo many entriesFilter to write operations only

Examples

Catch a hardcoded Figma PAT before it reaches a commit (Step 1 pre-commit hook):

bash
echo 'const PAT = "figd_AbCdEf123456789";' > leak.ts
git add leak.ts && git commit -m "test"
# pre-commit: BLOCKED — figd_ token detected in leak.ts

Lint a violation of the API usage policy (Step 2 ESLint rule flags full-file fetches):

text
src/sync.ts
  14:3  error  Figma file fetch without depth parameter — use ?depth=1
                or /nodes?ids=... (figma/no-unbounded-file-fetch)

Policy rule catalog and the audit-log event shape: references/api-usage-policies.md and references/audit-logging.md.

Resources

Next Steps

For architecture blueprints, see figma-architecture-variants.

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (references) in skills/.curated/figma-policy-guardrails of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/api-usage-policies.md
  • references/audit-logging.md
  • references/configuration-validation.md
  • references/errors.md
  • references/eslint-rules-for-figma.md
  • references/token-leak-prevention.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Figma Policy Guardrails next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Figma Policy Guardrails compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Figma Policy Guardrails this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2kAutomated safety check: NotesMIT
LobeHub Alint Rule Set Maintenancelobehub/lobehub83k—~1.9kAutomated safety check: PassCustom licence
Existing Repoalinaqi/maggy707—~4kAutomated safety check: NotesMIT
Code Qualityredis/RedisInsight8.9k—~1.2kAutomated safety check: PassCustom licence
Obsidian Plugin Development Guidelinesgapmiss/obsidian-plugin-skill191—~4.5kAutomated safety check: PassMIT
Cb Code QualityBlkLeg/CircuitBreaker201—~1.9kAutomated safety check: PassMIT

Similar skills

  • Maintains LobeHub's model-backed alint rule set: writing rules, removing false positives against real code, deciding warn versus error and tracking token cost.

    83k GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Existing Repo

    alinaqi/maggy

    Analyze existing repositories, maintain structure, setup guardrails and best practices

    707 GitHub stars~4k tokensUpdated 17 days ago
    DevelopmentAuto-check: notes
  • Code Quality

    redis/RedisInsight

    Official

    Code-quality standards for RedisInsight: TypeScript strictness, naming conventions (camelCase, PascalCase, UPPERSNAKECASE), linting rules, no any without reason, no !important in styles, and…

    8.9k GitHub stars~1.2k tokensUpdated 6 days ago
    DevelopmentAuto-check passed
  • Obsidian Plugin Development Guidelines

    gapmiss/obsidian-plugin-skill

    Rules and references for building Obsidian plugins: ESLint rules, TypeScript practices, memory cleanup, API choices, UI standards and the community submission process.

    191 GitHub stars~4.5k tokensUpdated 16 days ago
    DevelopmentAuto-check passed
  • Cb Code Quality

    BlkLeg/CircuitBreaker

    Circuit Breaker code conventions and the quality gates that actually block a push — ruff, mypy, eslint, the pytest coverage ratchet, and the make verify tiers.

    201 GitHub stars~1.9k tokensUpdated 5 days ago
    DevelopmentAuto-check passed
  • Code Quality

    Sidiora-Labs/centra-llm-agents

    Code quality standards and best practices. An agent skill from Sidiora-Labs/centra-llm-agents.

    116 GitHub stars~1.2k tokensUpdated 23 days ago
    DevelopmentAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Questions about Figma Policy Guardrails

What does Figma Policy Guardrails do?

Enforce security policies and coding standards for Figma API integrations. Figma Policy Guardrails is an agent skill from jeremylongshore/tons-of-skills-marketplace. Enforce security policies and coding standards for Figma API integrations.

When should I use Figma Policy Guardrails?

Figma Policy Guardrails fits situations like: setting up linting rules for Figma tokens; preventing accidental credential leaks; enforcing API usage best practices; with phrases like figma policy.

How do I install Figma Policy Guardrails in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill figma-policy-guardrails -a claude-code`. Or copy the skill folder (skills/.curated/figma-policy-guardrails in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/figma-policy-guardrails in your project. Claude Code loads it when a task matches its description.

How do I install Figma Policy Guardrails in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill figma-policy-guardrails -a codex`. Or copy the skill folder (skills/.curated/figma-policy-guardrails in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/figma-policy-guardrails in your project. Codex loads it when a task matches its description.

Can I use Figma Policy Guardrails in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill figma-policy-guardrails -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/figma-policy-guardrails, .gemini/skills/figma-policy-guardrails, .github/skills/figma-policy-guardrails and .opencode/skills/figma-policy-guardrails in your project.

What does Figma Policy Guardrails need to run?

Going by SKILL.md and its folder, Figma Policy Guardrails needs the command-line tools its instructions call (git) and credentials named FIGMA_FILE_KEY. Our summary lists: A credential in FIGMA_FILE_KEY. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(npx:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Figma Policy Guardrails access the network?

SKILL.md names 3 domains. As links in the text: developers.figma.com, pre-commit.com and eslint.org. This is read from the text; nothing was executed.

Is Figma Policy Guardrails safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Figma Policy Guardrails use?

Figma Policy Guardrails is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Figma Policy Guardrails use?

About 2k tokens (SKILL.md is roughly 8.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.9k tokens, read only when the agent opens those files.

What are the alternatives to Figma Policy Guardrails?

Skills that share tags, products or a category with Figma Policy Guardrails: LobeHub Alint Rule Set Maintenance (lobehub/lobehub, 83k stars), Existing Repo (alinaqi/maggy, 707 stars), Code Quality (redis/RedisInsight, 8.9k stars) and Obsidian Plugin Development Guidelines (gapmiss/obsidian-plugin-skill, 191 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Figma Policy Guardrails?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.