openspec-design
OpenSpec Design Extension
Adds design asset integration to OpenSpec's proposal stage: when the user's prompt includes Figma links or images, automatically fetch design data, save to design/, and generate a design summary document.
Updating AGENTS.md on Execution
When the user invokes this skill, read the project's openspec/AGENTS.md and make two updates:
-
Workflow step: In the "Creating Changes" workflow, between "Choose change-id" and "Scaffold", insert: "Design Extension (if Figma in prompt): If the prompt contains a Figma link, the agent MUST call
call_mcp_toolto run Figma MCP, createdesign/, and generatedesign-map.md. Do not skip." -
Design Extension section: Between "Proposal Structure" and "Spec File Format", insert the following Design Extension section. If it already exists, overwrite it.
Full Fragment to Insert into AGENTS.md
Insert the following content into openspec/AGENTS.md at the locations above:
### Design Extension (Figma & Images)
When the proposal's user prompt contains **Figma information** or **images**, the agent **MUST** use `call_mcp_tool` to actively call Figma MCP—do not merely describe it. When a Figma link is detected, **do not skip** the MCP call.
**Figma detection** (any of the following):
- Figma links (`figma.com/file/`, `figma.com/design/`), e.g. `https://www.figma.com/design/pxhnkHfGrSwHbxT1pfV0T4/xxx?node-id=2496-1199`
- Parse from URL: file key = `pxhnkHfGrSwHbxT1pfV0T4` in the path, node-id = query param `2496-1199`
**Figma MCP tools** (via call_mcp_tool):
- `parse_figma_url`: Parse URL to extract file key, node id
- `get_file`: Get file info
- `get_node`: Get node/frame details
- `export_images`: Export images (PNG/JPG/SVG)
**Extension flow**:
1. Create `design/` under `changes/[change-id]/`
2. If Figma: **MUST** call Figma MCP (parse_figma_url → get_file/get_node → export_images), save exported images to `design/`
3. If prompt has attachment images or local image paths: copy them to `design/` as context assets
4. Generate `design/design-map.md` with asset list and design summary
**Note**: `design/` is the design asset directory, distinct from sibling `design.md` (technical design doc). If Figma MCP fails, prompt the user to check MCP config; without MCP, only process local images.
Design Extension Flow Details
1. Create design/ Directory
Create design/ under changes/<change-id>/, alongside proposal.md, tasks.md, design.md, and specs/.
2. Figma MCP Call (Must Execute Explicitly)
MUST call via call_mcp_tool—do not only describe. Do not skip when a Figma link is detected.
Figma MCP tools:
parse_figma_url: Parse URL to extract file key, node idget_file: Get file infoget_node: Get node/frame detailsexport_images: Export images (PNG/JPG/SVG)
Call flow:
- Parse Figma link from prompt (e.g.
figma.com/design/pxhnkHfGrSwHbxT1pfV0T4/xxx?node-id=2496-1199) - Use
parse_figma_urlor manual parse to get file key, node-id - Call
get_file/get_nodeto fetch design details - Call
export_imagesto export images - Save exports to
design/, naming convention:figma-<node-name>-<index>.png
3. Image Asset Collection
- User-attached images: save directly to
design/ - Local paths referenced in prompt: copy to
design/ - Use semantic naming to avoid collisions
4. design-map.md Generation
Generate design-map.md under design/. Recommended structure:
# Design Map
## Asset List
| File | Source | Description |
|------|--------|-------------|
| figma-hero-1.png | Figma MCP | Homepage hero |
| screenshot-1.png | User attachment | Reference screenshot |
## Design Summary
- [Key design decisions extracted from designs/images]
design-map.md Template
# Design Map
## Asset List
| File | Source | Description |
|------|--------|-------------|
| (filename) | Figma MCP / User attachment / Local | (brief description) |
## Design Summary
- (Point 1)
- (Point 2)
Dependencies
- Figma MCP: Requires Figma MCP Server configured in the project. If not configured, the skill prompts the user to configure it, or only processes local/attached images.
More from wghust/stark-skills
google-news-seo
Google News Diagnostic Engine — audit and optimize news articles for Google News SEO. Determines Layer 1 index eligibility and Layer 2 ranking competitiveness. Includes NewsArticle Schema review, AI content compliance checks, publisher trust detection, author authority scoring, freshness analysis, topic cluster compatibility, Top Stories detection, competitor gap analysis, and Google E-E-A-T scanning with structured report generation. Use when asked about Google News SEO, why a site is not indexed in Google News, why articles don't rank, NewsArticle Schema optimization, how AI content can get into Google News, or running an EEAT scan / audit. 检查和优化新闻文章的 Google News SEO,包括双层诊断引擎(Layer 1 索引准入 / Layer 2 排名竞争)、NewsArticle Schema 审查与修复、AI 生成内容合规性检查、发布者信任度检测、作者权威性评分、新鲜度分析、话题聚类兼容性、Top Stories 检测、竞争对手差距分析,以及 Google E-E-A-T 全维度扫描。
23insight-pdf
Generates professional corporate/business report PDFs from text or Markdown via HTML. Uses ECharts for advanced visualizations (heatmaps, radar, gauge, sankey), rich design system (gradient covers, stat cards, callout boxes, progress bars, timelines), and professional typography. Use when the user wants enterprise-quality report PDFs with modern data storytelling.
16nextjs-debug
Diagnose and fix Next.js project startup, compilation, and runtime errors by analyzing logs and project source code. Use when the user reports a Next.js startup error, compilation failure, hydration mismatch, module not found, Server/Client boundary violation, environment variable issue, or port conflict. Also triggers on "next dev fails", "next build error", "Turbopack error", "use client missing", "module not found", "Cannot find module", "hydration failed". 诊断并修复 Next.js 项目启动、编译和运行时错误。当用户粘贴启动日志、描述 Next.js 报错、询问"启动失败"、"编译报错"、"模块找不到"、"Server Component 报错"、"hydration 错误"、"环境变量不生效"时使用。
14c4-interactive-html
|
13mac-wash
|
12git-intelligence
|
9