AgentStack
SKILL verified MIT Self-run

Figma Annotations Strategy

skill-saralobo-skill-figma-annotations-skill-figma-annotations · by saralobo

Generate strategic Figma annotations via MCP based on PRs, tickets, or user descriptions. Use when the user wants to document a screen, flow, or component for Figma, or mentions "figma annotations", "annotation strategy".

No reviews yet
0 installs
13 views
0.0% view→install

Install

$ agentstack add skill-saralobo-skill-figma-annotations-skill-figma-annotations

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Figma Annotations Strategy? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Figma Annotations Strategy (via Figma Console MCP)

Context and goal

This skill automates the extraction and structuring of strategic context for screens, flows, or components, and attaches it directly in Figma via the figma-console MCP server. The result is the instant injection of native annotations (Figma Annotation tool, shortcut Y) onto components.

MANDATORY: Cursor/Claude MUST use Figma's native annotations. Under no circumstances should it create separate "cards" or "frames" floating on the canvas, or use the comments tool.

Activation trigger

Whenever the user requests creation of "annotations for Figma", screen documentation, or provides a link/text and asks to extract context.

Required flow

1. Context validation

Before generating annotations, validate that the provided context covers the 5 critical points:

  • Screen/flow objective: What is the user trying to accomplish?
  • Critical business rules: Restrictions, calculations, or essential logic.
  • Important states or exceptions: Loading, empty states, errors, edge cases.
  • Technical dependencies: APIs, permissions, hardware.
  • Non-obvious behaviors: Animations, transitions, conditional interactions.

If any essential information is missing, ask the user before proceeding!

2. Native category definition

Categories improve annotation scannability (native Figma colored pills).

  • Never include the category in the raw text (e.g. [Behavior]).
  • Ensure the category exists natively (Figma Annotation Categories).
  • If it does not exist in Figma, create it natively via code using figma.annotations.addAnnotationCategoryAsync({ label: 'Name', color: 'blue' }).
  • Valid Figma API colors for categories: 'yellow' | 'orange' | 'red' | 'pink' | 'violet' | 'blue' | 'teal' | 'green'.
  • The final annotation must use native categoryId and text without category prefix.

2.1 Categorization rules (required)

  • Business rules -> Business Rule
  • UX/interaction rules -> Behavior
  • Motion and transition -> Animation
  • Exceptions, fallback, unavailability -> Exception
  • Technical dependencies and limitations -> Technical Dependency
  • Future improvements and backlog -> Future Delivery

3. Direct execution in Figma (required)

You must NOT generate JSON files on disk. You MUST use the figma_execute tool (provided by the figma-console MCP server) to attach annotations.

Base script for figma_execute:

Adapt the code below by replacing the ANNOTATIONS_DATA variable with the real data you generated, referencing the correct Figma node IDs.

const ANNOTATIONS_DATA = [
  {
    id: "COMPONENT_ID",
    text: "Detailed description of the behavior, rule, or state.",
    categoryLabel: "Behavior",
    categoryColor: "blue" // 'yellow'|'orange'|'red'|'pink'|'violet'|'blue'|'teal'|'green'
  }
];

async function applyNativeAnnotations() {
  const existingCategories = await figma.annotations.getAnnotationCategoriesAsync();
  const categoryMap = new Map();
  
  // Map existing categories in the file
  for (const c of existingCategories) {
    const full = await figma.annotations.getAnnotationCategoryByIdAsync(c.id);
    categoryMap.set(full.label, full.id);
  }

  let appliedCount = 0;

  for (const item of ANNOTATIONS_DATA) {
    const node = await figma.getNodeByIdAsync(item.id);
    if (!node || !('annotations' in node)) {
      console.log(`Node ${item.id} not found or does not support annotations.`);
      continue;
    }

    // Create category if it does not exist
    let catId = categoryMap.get(item.categoryLabel);
    if (!catId) {
      try {
        const newCat = await figma.annotations.addAnnotationCategoryAsync({
          label: item.categoryLabel,
          color: item.categoryColor
        });
        catId = newCat.id;
        categoryMap.set(item.categoryLabel, catId);
      } catch (e) {
        console.error(`Error creating category ${item.categoryLabel}:`, e);
      }
    }

    // Update annotation with NATIVE category (colored pill)
    const newAnnotation = { labelMarkdown: item.text };
    if (catId) {
      newAnnotation.categoryId = catId;
    }
    
    // Do not create card/frame. Only native annotation on existing node.
    const current = node.annotations || [];
    node.annotations = [newAnnotation, ...current];
    
    appliedCount++;
  }

  figma.notify(`✅ ${appliedCount} native annotations applied successfully!`);
  return `Done. ${appliedCount} annotations inserted.`;
}

return applyNativeAnnotations();

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.