Command Palette

Search for a command to run...

Назад к скиллам
скилл № 30911

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от 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 through theme.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:

  1. Get the component specification from Figma and Zeroheight (through their MCPs)
  2. Create the component structure from the template and register it (Package.swift, Import.swift, Demo)
  3. Implement the core code with the dedicated skills (Enum, Token, Environment, ViewModifier, View, ...)
  4. Add the unit tests and the snapshot tests
  5. 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):

  1. Component Name (PascalCase format)

    • Examples: Button, Avatar, Chip, SegmentedControl
    • Ask: "What is the component name? (PascalCase format, e.g., Button, Avatar, Chip)"
  2. 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)"
  3. Figma Link (URL to the Figma design)

  4. Zeroheight Link (URL to the Zeroheight specifications)

  5. 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 AskUserQuestion tool 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.segmentedControl and 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-code before get_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

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

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), без исполняемых скриптов.

Похожие скиллы

Сравнить spark-create-component с