Update the CHANGELOG.md with the description of the changes between the last released version and the new one
日本語の概要は準備中です。原文の説明を表示しています。
Create a new component in the Modules folder from template with proper documentation and placeholders replacement.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
This skill helps you create a new component in the Modules folder using the template-based approach.
❗️ This skill should be used from the root of the monorepo project ❗️
The skill will:
When executing this skill, gather the required parameters one by one. Check if the user has already provided each piece of information. If not, ask the user for each parameter individually in a conversational message.
Required Parameters (ask one at a time):
Component Name (PascalCase format)
Description (Brief description for documentation)
Figma Link (URL to the Figma design)
Zeroheight Link (URL to the Zeroheight specifications)
Anatomy Image Path (Local path to the anatomy image file)
Important:
AskUserQuestion tool for gathering these parametersConfirm you have all required parameters:
From the component name (e.g., "Button", "Avatar"), generate:
Copy the template to create the new component directory:
cp -r .template/component/ "Modules/Components/${COMPONENT_NAME_PASCAL}/"
sparkcomponent-{component_name_lower}-anatomy.pngRead Modules/Components/{ComponentName}/documentation.json and update:
title: Set to component name + "SparkComponent" in prefix (e.g., "SparkComponentButton")description: Set to the user-provided descriptionfigma: Set to the Figma linkzeroheight: Set to the Zeroheight linkimage: Set to "spark" + component name in lowercase (e.g., "sparkbutton")Read Modules/Components/{ComponentName}/Sources/Core/Documentation.docc/Documentation.md and:
TODO in Zeroheight link with actual URLTODO in Figma link with actual URLIMPORTANT: Replace these exact placeholders in all files:
__COMPONENT_NAME___ (2 underscores prefix, 3 suffix) → PascalCase name___component_name___ (3 underscores each side) → lowercase name___COMPONENT_NAME___ (3 underscores each side) → PascalCase nameFiles to process:
README.mddocumentation.jsonSources/Core/Documentation.docc/Documentation.mdSources/Core/Spark__COMPONENT_NAME___.swiftSources/Testing/Spark__COMPONENT_NAME___Testing.swiftTests/UnitTests/Spark__COMPONENT_NAME___Tests.swiftTests/SnapshotTests/Spark__COMPONENT_NAME___SnapshotsTests.swift.sourcery.ymlProcess:
mv commandAfter all replacements:
documentation.json to verify all fields are setREADME.md to confirm no placeholders remainUpdate the main Spark module to export the new component:
File: spark-ios/Spark/Sources/Core/Import.swift
@_exported import SparkComponent{ComponentName} to the file@_exported import SparkComponent{ComponentName} (with comment syntax as shown in the file)Example:
@_exported import SparkCommon
@_exported import SparkComponentAvatar
@_exported import SparkComponentBadge
@_exported import SparkComponentButton
...
@_exported import SparkTheming
Add the new component to the root Package.swift file:
File: spark-ios/Package.swift
For each new component, you need to add:
Package Dependency (in dependencies array):
.package(path: "Modules/Components/{ComponentName}") in alphabetical orderProducts (in products array, after main Spark product):
.library(
name: "SparkComponent{ComponentName}",
targets: ["SparkComponent{ComponentName}"]
),
.library(
name: "SparkComponent{ComponentName}Testing",
targets: ["SparkComponent{ComponentName}Testing"]
),
Main Spark Target Dependency (in main Spark target's dependencies array):
.product(name: "SparkComponent{ComponentName}", package: "Component{ComponentName}")Component Targets (in targets array, after core targets, before demo targets):
.target(
name: "SparkComponent{ComponentName}",
dependencies: [
"SparkCommon",
"SparkTheming",
// Add other component dependencies as needed
],
path: "Modules/Components/{ComponentName}/Sources/Core"
),
.target(
name: "SparkComponent{ComponentName}Testing",
dependencies: [
"SparkComponent{ComponentName}",
"SparkCommon",
"SparkCommonTesting",
"SparkThemingTesting",
"SparkTheme"
],
path: "Modules/Components/{ComponentName}/Sources/Testing"
),
Test Targets (in targets array, in test targets section):
.testTarget(
name: "SparkComponent{ComponentName}UnitTests",
dependencies: [
"SparkComponent{ComponentName}",
"SparkComponent{ComponentName}Testing",
"SparkCommonTesting",
"SparkThemingTesting"
],
path: "Modules/Components/{ComponentName}/Tests/UnitTests"
),
.testTarget(
name: "SparkComponent{ComponentName}SnapshotTests",
dependencies: [
"SparkComponent{ComponentName}",
"SparkComponent{ComponentName}Testing",
"SparkCommonSnapshotTesting",
],
path: "Modules/Components/{ComponentName}/Tests/SnapshotTests"
),
Important Notes:
Pay careful attention to underscores:
| Placeholder | Underscores | Replace With | Example |
|---|---|---|---|
__COMPONENT_NAME___ | 2 prefix, 3 suffix | PascalCase | SegmentedControl |
___component_name___ | 3 each side | lowercase | segmentedcontrol |
___COMPONENT_NAME___ | 3 each side | PascalCase | SegmentedControl |
User Request:
Add a new component SparkButton with:
- Description: "A customizable button component"
- Figma: "https://figma.com/design/..."
- Zeroheight: "https://zeroheight.com/..."
- Anatomy image: "./assets/button-anatomy.png"
Expected Result:
Modules/Components/Button/documentation.json populated with correct valuessparkcomponent-button-anatomy.pngSparkButton.swift, SparkButtonTests.swift, etc.If any step fails:
Before finishing:
documentation.json has all fields filled (no "TODO")Documentation.md has all fields filled (no "TODO")Import.swift updated with new component exportPackage.swift updated with:
When complete, provide the user with:
Modules/Components/{ComponentName}/Import.swift updatedPackage.swift updatedSources/Core/{ComponentName}.swiftswift package resolve to verify package configurationまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Update the CHANGELOG.md with the description of the changes between the last released version and the new one
日本語の概要は準備中です。原文の説明を表示しています。
Launch some action before create push in git
日本語の概要は準備中です。原文の説明を表示しています。
Create or update a accessibility identifier file in the AccessibilityIdentifier folder in Sources of a spark-ios-component-XXX and add or update unit tests.
日本語の概要は準備中です。原文の説明を表示しています。
Create or update a constants file in the Constants folder in Sources of a spark-ios-component-XXX and add or update unit tests.
日本語の概要は準備中です。原文の説明を表示しています。
Create or update the DocC documentation in Sources of a spark-ios-component-XXX.
日本語の概要は準備中です。原文の説明を表示しています。
Create or update an enum file in the Enum folder in Sources of a spark-ios-component-XXX and add or update unit tests.
日本語の概要は準備中です。原文の説明を表示しています。