360 Secure SkillHub
360 安全技能中心

Templates

通过 Figma REST API 读取指定设计 URL,或从 issue JSON 的 figma_urls 批量读取:展开节点、提取样式与 Code Connect 线索、抓取截图,并把 summary.md、manifest.json、design-properties.json、css-hints.css 等制品写入本地目录,供修复 UI 代码前参考。

分类:数据
xianyu-cursor
xianyu-cursor
热度 12.91
最近更新 2026-07-22 22:17:45

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add xianyu-cursor/templates
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
read-figma-design
description
Read Figma design context from Multica issue figma_urls without Figma MCP.

Read Figma Design

Use this skill when a Multica issue contains non-empty figma_urls.

This is a pure skill. The scripts do all deterministic work: token handling, Figma REST reads, screenshots, node expansion, style extraction, Code Connect clues, and artifact writing.

Required Workflow

Run from this skill root before repairing UI code:

node scripts/read-figma-context.mjs \
  --issue-json <repair-repo>/.multica/tmp/<issue-id>.json \
  --out <repair-repo>/.multica/figma-context \
  --repo <repair-repo>

For a single URL:

node scripts/read-figma-context.mjs \
  --url "https://www.figma.com/design/<fileKey>/<fileName>?node-id=<node-id>" \
  --out <repair-repo>/.multica/figma-context \
  --repo <repair-repo>

For a direct smoke or manual URL:

node scripts/read-figma-context.mjs \
  --url "https://www.figma.com/design/<fileKey>/<fileName>?node-id=<node-id>" \
  --out <repair-repo>/.multica/figma-context \
  --repo <repair-repo>

Then read, in this order:

  1. summary.md
  2. manifest.json
  3. urls/<ordinal>/design-properties.json
  4. urls/<ordinal>/code-connect.json
  5. urls/<ordinal>/screenshots/
  6. urls/<ordinal>/css-hints.css

Validate artifacts manually when needed:

node scripts/validate-artifact.mjs <artifact-run-dir>

Offline diagnostics:

node scripts/read-figma-context.mjs --help
node scripts/read-figma-context.mjs --version

Both commands run without reading credentials or network. --help runs without reading credentials or network. --version runs without reading credentials or network.

Run a real API smoke before declaring this skill usable in a new environment:

node scripts/smoke-figma-context.mjs \
  --url "https://www.figma.com/design/VSfJU5zJ10wSdeMu2vk1Ar/New-workflow_Sensitive-Industry--Configuration_Age-Gating?node-id=6127-21193" \
  --out <repair-repo>/.multica/figma-context \
  --repo <repair-repo> \
  --env-file ../../.env

Hard Rules

  • Do not guess design intent from the URL alone.
  • Read the generated artifacts before changing UI code.
  • Cite the Figma URL, canonical node id, and artifact path in the repair notes.
  • If parsing or Figma reading fails, report the stable error code and do not claim the design was used.
  • Code Connect is best effort by default; do not turn unavailable into unmapped.
  • Prefer local design-system components and tokens before custom CSS.
  • Do not expose tokens in logs, comments, artifacts, or repair notes.
  • Do not commit .multica/figma-context/ or .multica/tmp/.