spark-create-component
Create a new SwiftUI-only component in the Modules/Components folder (core code + tests + documentation) from the Figma and Zeroheight specifications, with…
от leboncoin★ 22 звезды на GitHub
Установить spark-create-component в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Create a New Component
Overview & Prerequisites
This skill creates a complete new component: the core code, the tests and the documentation.
❗️ This skill should be used from the root of the repository ❗️
All new components are created for SwiftUI only. There is no UIKit view (
SparkUIXXX), and no UseCase, Model or ViewModel: the styling rules live in the Token (exposed throughtheme.component.xxx) and are applied by the views through private ViewModifiers. Reference implementation:Modules/Components/InputOTP. Read it before writing any code.
The skill will:
- Get the component specification from Figma and Zeroheight (through their MCPs)
- Create the component structure from the template and register it (
Package.swift,Import.swift, Demo) - Implement the core code with the dedicated skills (Enum, Token, Environment, ViewModifier, View, ...)
- Add the unit tests and the snapshot tests
- Write the DocC documentation
Input Parameters
Gather the required parameters one by one. Check if the user has already provided each piece of information. If not, ask for each parameter individually in a conversational message.
Required Parameters (ask one at a time):
Component Name (PascalCase format)
- Examples: Button, Avatar, Chip, SegmentedControl
- Ask: "What is the component name? (PascalCase format, e.g., Button, Avatar, Chip)"
Description (Brief description for the documentation)
- Examples: "A customizable button component", "User profile image component"
- Ask: "What is the component description? (Brief description for documentation)"
Figma Link (URL to the Figma design)
- Example: https://www.figma.com/design/0QchRdipAVuvVoDfTjLrgQ/Spark-Component-Specs?node-id=643-21226
- Ask: "What is the Figma link? (URL to the Figma design)"
- Used in the documentation and by the Figma MCP to get the component specification.
Zeroheight Link (URL to the Zeroheight specifications)
- Example: https://zeroheight.com/1186e1705/p/17568d-chip
- Ask: "What is the Zeroheight link? (URL to the Zeroheight specifications)"
- Used in the documentation and by the Zeroheight MCP to get the component specification.
Anatomy Image Path (Local path to the anatomy image file)
- Example: /Users/username/Desktop/anatomy.png
- Ask: "What is the anatomy image path? (Local path to the anatomy image file)"
Important:
- Do NOT use the
AskUserQuestiontool to gather these parameters - Ask for ONE parameter at a time in a conversational message
- Wait for the user to respond before asking for the next parameter
- Only proceed to the workflow once ALL parameters have been collected
Workflow
Step 1: Validate Parameters
- Component Name (PascalCase)
- Description
- Figma Link
- Zeroheight Link
- Anatomy Image Path (verify the file exists)
Step 2: Prepare Component Names
From the component name, generate:
- REMOVE SPARK MENTION: remove Spark or SparkComponent from the name ("SparkButton" -> "Button", "SparkComponentButton" -> "Button")
- COMPONENT_NAME_PASCAL: PascalCase (e.g. "SegmentedControl")
- COMPONENT_NAME_LOWER: lowercase (e.g. "segmentedcontrol")
- COMPONENT_NAME_KEBAB: kebab-case (e.g. "segmented-control")
- COMPONENT_NAME_CAMEL: camelCase (e.g. "segmentedControl"), used for
theme.component.segmentedControland the Demo case
Step 3: Get the Specification (Figma + Zeroheight MCPs)
Use the links with the related MCPs to get the full specification before writing any code:
- Figma MCP: parse the link (
fileKey+node-id, convert "-" to ":"), then get the design context, the screenshot and the variables (colors, spacings, radius, typography, sizes, states, variants). Follow the Figma skills when required (e.g.figma:figma-design-to-codebeforeget_design_context). - Zeroheight MCP: read the specification page (usage, anatomy, variants, states, behaviors, accessibility).
- If an MCP is not available or fails, tell the user and ask how to continue (do not guess the specification).
Then write a short specification summary for the user and wait for their validation:
- Public API (configuration enums, environment modifiers, initializers)
- Anatomy (sub-views)
- Token categories (colors, spacings, sizes, borders, typography, animation, ...) mapped to the theme tokens
- States (enabled, disabled, pressed, focused, error, ...)
- Accessibility
Step 4: Copy the Template
cp -r .template/component/ "Modules/Components/${COMPONENT_NAME_PASCAL}/"
Step 5: Anatomy Image
- Copy the anatomy image into
.github/assets/anatomy/ - Rename it
{component-name-kebab}.png(e.g.segmented-control.png)
Step 6: Replace All Placeholders
Replace these exact placeholders in the file contents, then rename the files with mv:
| Placeholder | Underscores | Replace Wi
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл spark-create-component?
Create a new SwiftUI-only component in the Modules/Components folder (core code + tests + documentation) from the Figma and Zeroheight specifications, with the Token + ViewModifier architecture.
Как установить скилл spark-create-component?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл spark-create-component запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…