Spark component token

From leboncoin/spark-ios · View interactive version

Spark component token is an AI agent skill from the GitHub repository leboncoin/spark-ios. Create or update a token file in the Token folder in Sources of a spark-ios-component-XXX and add or update unit tests.

How to use this skill

Skill file

Add Repository Skill

Overview & Prerequisites

This skill guides you to implement/update a token in spark component.

Component Selection

Parameter Handling:

Once the component is selected, all operations must be performed in Modules/Components/{component-name}/ folder.

Use the files in the template folder as reference to manage the token and the unit tests. See Modules/Components/InputOTP/Sources/Core/Token for a full real-world example.

The template uses Border, Size, Typography and Animation purely as illustrations of recurring patterns (see Rules below). A real component's token categories are whatever it actually needs — e.g. Colors, Opacity, Layout, Spacing, Icon, Animation, ... Determine the category names and count from the component's design/usage, not from the template names.

The token is exposed publicly through theme.component.xxx (ComponentToken+XXX.swift) and consumed by the SwiftUI views through EnvironmentTheme+XXXToken.swift. Theses two files are managed by the skill spark-component-migrate-token.

Rules

The Token file must respect theses rules :

Workflow

Code Conventions

Test Implementation

When to Ask for Help

If you encounter:

Use AskUserQuestion to clarify with the user before proceeding.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.