@radicool/throughline 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +214 -0
- package/adapters/codex/AGENTS.md +29 -0
- package/adapters/codex/codex-mcp.toml +4 -0
- package/adapters/codex/prompts/component-builder.md +272 -0
- package/adapters/codex/prompts/component-pipeline.md +81 -0
- package/adapters/codex/prompts/design-system-audit.md +122 -0
- package/adapters/codex/prompts/design-system-status.md +41 -0
- package/adapters/codex/prompts/figma-environment-setup.md +456 -0
- package/adapters/codex/prompts/icon-system-builder.md +268 -0
- package/adapters/codex/prompts/new-component.md +13 -0
- package/adapters/codex/prompts/repository-builder.md +163 -0
- package/adapters/codex/prompts/retrofit-planner.md +136 -0
- package/adapters/codex/prompts/start.md +22 -0
- package/adapters/codex/prompts/storybook-chromatic-builder.md +261 -0
- package/adapters/codex/prompts/sync-figma-tokens.md +22 -0
- package/adapters/codex/prompts/token-builder.md +361 -0
- package/adapters/codex/prompts/token-crosswalk-builder.md +120 -0
- package/adapters/codex/prompts/token-sheet-builder.md +162 -0
- package/adapters/codex/prompts/token-sync-layer.md +232 -0
- package/adapters/cursor/.cursor/commands/design-system-status.md +41 -0
- package/adapters/cursor/.cursor/commands/new-component.md +13 -0
- package/adapters/cursor/.cursor/commands/start.md +22 -0
- package/adapters/cursor/.cursor/commands/sync-figma-tokens.md +22 -0
- package/adapters/cursor/.cursor/mcp.json +14 -0
- package/adapters/cursor/.cursor/rules/component-builder.mdc +276 -0
- package/adapters/cursor/.cursor/rules/component-pipeline.mdc +85 -0
- package/adapters/cursor/.cursor/rules/design-system-audit.mdc +126 -0
- package/adapters/cursor/.cursor/rules/figma-environment-setup.mdc +460 -0
- package/adapters/cursor/.cursor/rules/icon-system-builder.mdc +272 -0
- package/adapters/cursor/.cursor/rules/repository-builder.mdc +167 -0
- package/adapters/cursor/.cursor/rules/retrofit-planner.mdc +140 -0
- package/adapters/cursor/.cursor/rules/storybook-chromatic-builder.mdc +265 -0
- package/adapters/cursor/.cursor/rules/token-builder.mdc +365 -0
- package/adapters/cursor/.cursor/rules/token-crosswalk-builder.mdc +124 -0
- package/adapters/cursor/.cursor/rules/token-sheet-builder.mdc +166 -0
- package/adapters/cursor/.cursor/rules/token-sync-layer.mdc +236 -0
- package/adapters/generic/AGENTS.md +46 -0
- package/adapters/generic/commands/design-system-status.md +41 -0
- package/adapters/generic/commands/new-component.md +13 -0
- package/adapters/generic/commands/start.md +22 -0
- package/adapters/generic/commands/sync-figma-tokens.md +22 -0
- package/adapters/generic/skills/component-builder/SKILL.md +272 -0
- package/adapters/generic/skills/component-pipeline/SKILL.md +81 -0
- package/adapters/generic/skills/design-system-audit/SKILL.md +122 -0
- package/adapters/generic/skills/figma-environment-setup/SKILL.md +456 -0
- package/adapters/generic/skills/icon-system-builder/SKILL.md +268 -0
- package/adapters/generic/skills/repository-builder/SKILL.md +163 -0
- package/adapters/generic/skills/retrofit-planner/SKILL.md +136 -0
- package/adapters/generic/skills/storybook-chromatic-builder/SKILL.md +261 -0
- package/adapters/generic/skills/token-builder/SKILL.md +361 -0
- package/adapters/generic/skills/token-crosswalk-builder/SKILL.md +120 -0
- package/adapters/generic/skills/token-sheet-builder/SKILL.md +162 -0
- package/adapters/generic/skills/token-sync-layer/SKILL.md +232 -0
- package/package.json +29 -0
- package/references/brainstorm-before-build.md +139 -0
- package/references/brownfield-retrofit.md +93 -0
- package/references/coding-level.md +70 -0
- package/references/crosswalk-schema.md +113 -0
- package/references/figma-component-standards.md +532 -0
- package/references/figma-publishing.md +125 -0
- package/references/figma-scripting.md +278 -0
- package/references/manifest-schema.md +341 -0
- package/references/scaling-up-handoff.md +61 -0
- package/references/sync-adapters.md +141 -0
- package/scripts/README.md +78 -0
- package/scripts/adapters/emit-codex.mjs +58 -0
- package/scripts/adapters/emit-cursor.mjs +26 -0
- package/scripts/adapters/emit-generic.mjs +41 -0
- package/scripts/adapters/generate.mjs +73 -0
- package/scripts/adapters/read-sources.mjs +54 -0
- package/scripts/adapters/translate.mjs +51 -0
- package/scripts/build-reverse-index.mjs +56 -0
- package/scripts/crosswalk.schema.json +33 -0
- package/scripts/grep-color-usage.mjs +143 -0
- package/scripts/guard-token-removal.mjs +95 -0
- package/scripts/install.mjs +143 -0
- package/scripts/lib/crosswalk.mjs +91 -0
- package/scripts/validate-crosswalk.mjs +96 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jordan Pease
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="docs/assets/hero.png" alt="ThroughLine" width="100%" />
|
|
4
|
+
|
|
5
|
+
# ThroughLine
|
|
6
|
+
|
|
7
|
+
### Your agentic design team
|
|
8
|
+
|
|
9
|
+
**Every skill you need to launch and manage a production-grade design system in hours — not months. Built for Claude Code, and installable into Cursor, Codex, or any AGENTS.md agent.**
|
|
10
|
+
|
|
11
|
+
[](https://www.npmjs.com/package/@radicool/throughline)
|
|
12
|
+
[](LICENSE)
|
|
13
|
+
[](https://docs.claude.com/en/docs/claude-code)
|
|
14
|
+
[](#install)
|
|
15
|
+
[](https://main--6a1ee089ae3a37b70a6e4559.chromatic.com)
|
|
16
|
+
[](https://www.figma.com/design/OCiZiGpsJ4ncPD8r205BjC/Throughline-Plugin-Test?node-id=0-1&t=5ERihD6fMqMuTEXD-1)
|
|
17
|
+
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
Whether you're starting from scratch or retrofitting an existing design system, ThroughLine puts you in the driver's seat — you make the high-level decisions while your agentic team powers through the production work. You stay in control of the *what*; it handles the *how*.
|
|
21
|
+
|
|
22
|
+
**No code experience required.**
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## What ThroughLine builds
|
|
27
|
+
|
|
28
|
+
### In Figma
|
|
29
|
+
|
|
30
|
+
1. **A robust primitive + semantic token system** — color ramps, spacing, type scale, radius, and elevation, with light/dark and multi-brand modes.
|
|
31
|
+
2. **Automatic generation of all text and effect styles** — every type and shadow style, derived from your tokens.
|
|
32
|
+
3. **A visual style sheet** of every token and style for full team transparency — synced to your tokens on demand.
|
|
33
|
+
4. **A full icon component system** — Lucide, Material, or your own SVGs, imported as clean, scalable components.
|
|
34
|
+
5. **A foundational component library** — buttons, inputs, badges, cards, and more, built as proper variant matrices bound to your tokens.
|
|
35
|
+
|
|
36
|
+
### In code
|
|
37
|
+
|
|
38
|
+
1. **A pnpm + Turborepo monorepo** on GitHub, scaffolded for you.
|
|
39
|
+
2. **A sync adapter** that syncs your Figma tokens and components to the code framework of your choice.
|
|
40
|
+
3. **Storybook** configured to house all synced components and their documentation.
|
|
41
|
+
4. **CI via Chromatic** for visual regression testing on every push.
|
|
42
|
+
|
|
43
|
+
### Daily workflow
|
|
44
|
+
|
|
45
|
+
1. **`/sync-figma-tokens`** — resync changes from Figma to code, landed as a reviewable PR.
|
|
46
|
+
2. **`/new-component`** — ship a new component in Figma, then sync and publish it to code.
|
|
47
|
+
|
|
48
|
+
## Already have a design system? Retrofit it.
|
|
49
|
+
|
|
50
|
+
Most teams aren't starting from a blank file — they have a mature codebase with hundreds of hard-coded colors and a Figma file that's drifted from it over the years. ThroughLine treats that as a first-class path, not an afterthought, and it moves *carefully*: it never asserts what's in your files without reading them first, and it never deletes an old token until it's proven nothing still uses it.
|
|
51
|
+
|
|
52
|
+
1. **Audit before anything changes.** `design-system-audit` sizes both sides of your system — it greps your codebase to measure the real color surface and inventories your Figma file with verified, per-class reads — then tells you how big the migration actually is and how semantic your system already is.
|
|
53
|
+
2. **A crosswalk that guarantees nothing shifts.** `token-crosswalk-builder` maps every new token to its old Figma variable and old code value, then installs a `tokens:validate` gate that fails unless every resolved new value matches the old one (N/N). A zero-reference guard blocks removing an old token while any code still references it.
|
|
54
|
+
3. **A gated, reversible migration.** `retrofit-planner` walks the safe seven-phase sequence — audit → refine variables in place → rebind → sync → capture a visual baseline → retrofit the code → remove the old tokens — pausing for your confirmation between every phase, with an optional decision journal recording each call.
|
|
55
|
+
|
|
56
|
+
The payoff: your live product looks identical at every step, and you can prove it with a Chromatic baseline captured before the first change.
|
|
57
|
+
|
|
58
|
+
## See a real end-to-end system built with it
|
|
59
|
+
|
|
60
|
+
<img src="docs/assets/case-study.png" alt="A complete ThroughLine design system — Foundations, Button variants, Icons, and Figma variables" width="100%" />
|
|
61
|
+
|
|
62
|
+
| | |
|
|
63
|
+
|---|---|
|
|
64
|
+
| 🧩 **[Sample repo](https://github.com/jrpease/throughline-sample)** | The full monorepo — tokens, 14 components, Storybook, CI |
|
|
65
|
+
| 📚 **[Live Storybook](https://main--6a1ee089ae3a37b70a6e4559.chromatic.com)** | Every component, all props, auto-generated docs |
|
|
66
|
+
| 🎨 **[Public Figma file](https://www.figma.com/design/OCiZiGpsJ4ncPD8r205BjC/Throughline-Plugin-Test?node-id=0-1&t=5ERihD6fMqMuTEXD-1)** | The design source of truth it was generated from |
|
|
67
|
+
|
|
68
|
+
Everything above was created during a single working session and synced directly from Figma to a production-ready codebase.
|
|
69
|
+
|
|
70
|
+
## Getting started
|
|
71
|
+
|
|
72
|
+
### Requirements
|
|
73
|
+
|
|
74
|
+
| | |
|
|
75
|
+
|---|---|
|
|
76
|
+
| **A supported agent** | Required — [Claude Code](https://docs.claude.com/en/docs/claude-code) (native plugin), or **Cursor**, **Codex**, or any **AGENTS.md**-aware agent via `npx @radicool/throughline init`. |
|
|
77
|
+
| **Figma** | Required, **desktop app** (the browser version causes connection errors). **Professional plan or higher recommended** — multi-mode variables (Light/Dark, brand themes) need it. |
|
|
78
|
+
| **Figma access token** | Required — read/write your file. The setup skill walks you through it; your token stays yours and is never shared in chat. |
|
|
79
|
+
| **GitHub** (or similar) | Optional — only when you're ready to graduate to a real remote repo with PRs and CI. |
|
|
80
|
+
|
|
81
|
+
### Install
|
|
82
|
+
|
|
83
|
+
ThroughLine is authored as a Claude Code plugin and generated into adapters for other agents. Pick your tool:
|
|
84
|
+
|
|
85
|
+
#### Claude Code
|
|
86
|
+
|
|
87
|
+
Install from this repo's plugin marketplace:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
/plugin marketplace add jrpease/throughline
|
|
91
|
+
/plugin install throughline@throughline-marketplace
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Then start with:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
/throughline:start
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
This is the reliable entry point — it runs environment setup first, ahead of anything else. (You can also just say *"let's set up my design system"*, but if you have other plugins installed that grab "let's build…" style phrases, the slash command guarantees ThroughLine takes the wheel.)
|
|
101
|
+
|
|
102
|
+
Update anytime with `/plugin marketplace update throughline-marketplace`.
|
|
103
|
+
|
|
104
|
+
#### Cursor, Codex, or a generic AGENTS.md agent
|
|
105
|
+
|
|
106
|
+
Run the installer in your project — it stamps in the skills, the reference docs, the scripts, and the Figma MCP config for your tool:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
npx @radicool/throughline init --target=cursor # → .cursor/rules + .cursor/mcp.json
|
|
110
|
+
npx @radicool/throughline init --target=codex # → prompts/ + AGENTS.md index + codex-mcp.toml
|
|
111
|
+
npx @radicool/throughline init --target=generic # → skills/ + AGENTS.md index
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
It's safe to re-run (it merges `AGENTS.md` and `.cursor/mcp.json` non-destructively) and stages everything the skills read into `.throughline/`. Then open the `figma-environment-setup` skill/rule/prompt for your tool to begin. For Codex, add the printed `codex-mcp.toml` block to your Codex config to enable Figma access.
|
|
115
|
+
|
|
116
|
+
## Architecture
|
|
117
|
+
|
|
118
|
+
ThroughLine is more than a pile of skills — it's a small system designed to stay consistent across dozens of generation steps. Four layers work together:
|
|
119
|
+
|
|
120
|
+
**🛠 Twelve skills — the steps.** Each owns one stage of the journey, from connecting Figma to retrofitting an existing system to standing up CI. They're sequenced, and each knows its prerequisites.
|
|
121
|
+
|
|
122
|
+
**📐 Ten reference docs — the constitution.** Shared standards every skill obeys: Figma component rules (auto-layout-on-everything, slot contracts, naming-as-contract, a required post-build audit), the brainstorm-before-build protocol, the sync-adapter specs, the manifest schema, coding-level adaptivity, the publishing flow, and the brownfield-retrofit discipline (read-before-assert, the safe migration sequence, the crosswalk contract). This is *why* two different runs produce the same structure — the rules live in one place, not scattered per skill.
|
|
123
|
+
|
|
124
|
+
**🧭 An orchestration layer — the memory.** A `design-system.json` manifest in your project records exactly what's set up, with a versioned schema and immutability rules. Every skill reads it, tells you what it's about to do, and offers to run anything missing first. Run **`/design-system-status`** anytime for a plain-language picture of where you stand.
|
|
125
|
+
|
|
126
|
+
**🔌 An adapter layer — the bridge.** A Style Dictionary pipeline that translates your Figma variables into whatever code framework you target — and re-translates on every change, so design and code never drift.
|
|
127
|
+
|
|
128
|
+
### The skills
|
|
129
|
+
|
|
130
|
+
| Skill | What it does |
|
|
131
|
+
|---|---|
|
|
132
|
+
| **figma-environment-setup** | Create your working folder, connect Claude to Figma, scan what already exists. **Start here.** |
|
|
133
|
+
| **design-system-audit** | Measure an existing system *before* retrofitting — size the code-side color surface and inventory the Figma file with verified reads. The brownfield front door. |
|
|
134
|
+
| **token-builder** | A two-tier (primitive + semantic) token system as Figma variables, plus text/effect styles. Generative, descriptive, or import-your-own. |
|
|
135
|
+
| **token-sheet-builder** | A beautiful, on-brand **Foundations** page visualizing every token, live-bound to the variables. |
|
|
136
|
+
| **icon-system-builder** | An **Icons** page with your chosen library (Lucide, Material, or custom) as clean components — the cheap, fast way. |
|
|
137
|
+
| **component-builder** | Your foundational components (button, input, card, modal…) with full variant matrices, slots, and token bindings. |
|
|
138
|
+
| **repository-builder** | Graduate your folder into a pnpm + Turborepo monorepo — folder → local git → GitHub, one gentle step at a time. |
|
|
139
|
+
| **token-sync-layer** | Sync Figma variables to framework-specific code via Style Dictionary, landed as a reviewable PR. Installs `/sync-figma-tokens`. |
|
|
140
|
+
| **token-crosswalk-builder** | Map new tokens to their old Figma variables and old code values, and install the `tokens:validate` gate that proves no value changed during a retrofit. |
|
|
141
|
+
| **storybook-chromatic-builder** | Storybook, component stories, Chromatic visual testing, and Code Connect (where your Figma plan supports it). |
|
|
142
|
+
| **component-pipeline** | Add one new component end to end: Figma → tokens → code + stories. Installs `/new-component`. |
|
|
143
|
+
| **retrofit-planner** | Orchestrate a full retrofit through the safe, gated seven-phase sequence — with a human checkpoint at every phase. |
|
|
144
|
+
|
|
145
|
+
## The nitty gritty
|
|
146
|
+
|
|
147
|
+
For the technically curious — how the machine actually runs.
|
|
148
|
+
|
|
149
|
+
**The sync layer.** Figma variables are extracted to **DTCG-format** JSON (the W3C design-tokens standard), run through **Style Dictionary**, and shaped by a framework **adapter** into the exact output your stack expects — shadcn CSS variables, a Tailwind theme, MUI theme objects, Swift/Kotlin constants, or plain CSS. Because the code is *generated* from the extract, design and code can't drift: you never hand-edit outputs, you change Figma and re-run. The sync lands as a **pull request**, so every design change is reviewable, diffable, and CI-checked before it merges.
|
|
150
|
+
|
|
151
|
+
**The monorepo.** A **pnpm + Turborepo** workspace: `packages/` holds the generated tokens and the component library; `apps/` is where you build the actual product against your own design system. ThroughLine grows it in stages — plain folder → local git → GitHub remote with PRs and CI — introducing each concept only when its payoff is concrete, so you're never dropped into the deep end.
|
|
152
|
+
|
|
153
|
+
**The manifest.** `design-system.json` is the single source of truth for *state*: a versioned schema, canonical per-skill flags, an immutable record of how your project began (greenfield vs. existing repo), and a snapshot of tooling detected at setup. Skills read it to know what's done and what's safe to do next — which is how the system stays coherent across many sessions.
|
|
154
|
+
|
|
155
|
+
**Modes, within Figma's limits.** Light/Dark lives on the semantic collections; brand variants live on the primitive palette. Splitting the two axes across two collections keeps each one under Figma's 4-modes-per-collection cap on the Professional plan while still resolving correctly (`bg/default` → `{gray/50}` → the active brand's gray).
|
|
156
|
+
|
|
157
|
+
**Model routing.** Setup runs on **Haiku** automatically to keep first-run costs low. Everyday work runs on whatever model your session is set to — **Sonnet** is a sensible default. For the heaviest authoring (large token systems, intricate variant matrices), **Opus** gives the best results: `/model opus`, then back to `/model sonnet`. Nothing forces an expensive model on you.
|
|
158
|
+
|
|
159
|
+
## Who it's for
|
|
160
|
+
|
|
161
|
+
1. **Solo designers** who spend a lot of time building and managing design systems.
|
|
162
|
+
2. **Agencies** consistently spinning up new design systems for clients.
|
|
163
|
+
3. **Design teams** constantly fighting to keep their Figma and code systems in sync.
|
|
164
|
+
4. **Non-designer vibe coders** who want a stronger design-system backbone on their projects.
|
|
165
|
+
5. **Engineers** looking to bridge their code and design ecosystems.
|
|
166
|
+
|
|
167
|
+
## Why I built it
|
|
168
|
+
|
|
169
|
+
I'm a designer who got tired of the handoff. Design systems live in two places that never quite agree — the Figma file and the codebase — and keeping them in sync is a full-time job nobody wants. ThroughLine is the tool I wished existed: it lets a designer drive the whole pipeline, learn the engineering one concept at a time, and end up with a real, shippable system instead of a pile of redlines. If you're a designer who's becoming a developer, this was built for you.
|
|
170
|
+
|
|
171
|
+
## Works well with
|
|
172
|
+
|
|
173
|
+
**[Superpowers](https://github.com/obra/superpowers)** — a great planning and engineering partner for the moments that grow bigger than a single skill. ThroughLine owns the design-system line; Superpowers owns the heavier, open-ended engineering work — and the two hand off cleanly.
|
|
174
|
+
|
|
175
|
+
- **Big, ambiguous changes mid-build.** When a step turns into a real project, ThroughLine lays out the risks and major pieces and switches into brainstorm-and-plan mode before building — handing off to Superpowers when it's installed, or planning natively when it isn't (the recognition is ThroughLine's; Superpowers is an upgrade, not a requirement). Real example: on [radicool.studio](https://radicool.studio), an existing vanilla-React app with a full custom motion layer — custom cursors, magnetic buttons — was retrofitted onto shadcn to make it formal and ready to scale.
|
|
176
|
+
- **Building the app itself.** Once your system is synced to code and you're building in `apps/`, Superpowers' subagent-driven development methodology is a natural next step.
|
|
177
|
+
|
|
178
|
+
It's never required to use ThroughLine.
|
|
179
|
+
|
|
180
|
+
## Show it off
|
|
181
|
+
|
|
182
|
+
Built your own system with ThroughLine? Add the badge so others can find it:
|
|
183
|
+
|
|
184
|
+
```markdown
|
|
185
|
+
[](https://github.com/jrpease/throughline)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
[](https://github.com/jrpease/throughline)
|
|
189
|
+
|
|
190
|
+
## Contributing
|
|
191
|
+
|
|
192
|
+
ThroughLine is open source and contributions are welcome. Found a bug or have an idea? **[Open an issue](https://github.com/jrpease/throughline/issues)**. Want to improve a skill or reference doc? PRs are encouraged — the skills are Markdown, so they're approachable to edit.
|
|
193
|
+
|
|
194
|
+
A couple of ground rules:
|
|
195
|
+
- **Figma is the source of truth.** Generated code files are build artifacts — never hand-edited; change things in Figma and re-sync.
|
|
196
|
+
- **Secrets stay yours.** Tokens and keys are never sent through chat or committed to code.
|
|
197
|
+
- **The plugin validates itself.** Every PR runs CI (`.github/workflows/ci.yml`) — the full test suite plus zero-dependency structural validators that check `plugin.json`, the marketplace manifest, and every skill/command's frontmatter. Run them locally with `node --test` and `node ci/validate-plugin.mjs` / `node ci/validate-skills.mjs`.
|
|
198
|
+
|
|
199
|
+
## Roadmap
|
|
200
|
+
|
|
201
|
+
Future improvements and planned capabilities. Have a request? **[Open an issue](https://github.com/jrpease/throughline/issues)** — the roadmap is shaped by what people actually build.
|
|
202
|
+
|
|
203
|
+
- **More framework adapters** — broaden the Style Dictionary output targets beyond the current set.
|
|
204
|
+
- **Deeper Code Connect coverage** — richer Figma-to-code mappings as more plans support it.
|
|
205
|
+
- **Expanded component starters** — a larger foundational kit out of the box.
|
|
206
|
+
- **Richer status & auditing** — more from `/design-system-status`, including drift detection between Figma and code.
|
|
207
|
+
- **Built-in accessibility checks** — automatic a11y validation when tokens and components are created, so modes can't be built with poor color contrast and components can't ship with accessibility gaps. Catches issues at creation time rather than in review.
|
|
208
|
+
- **One library, many platforms** — support a single Figma token library that syncs to multiple platforms at once (React, Android, iOS), with a component lifecycle flexible enough to target per platform — every platform, or native-only components that don't need a React counterpart.
|
|
209
|
+
|
|
210
|
+
Versioning follows [Semantic Versioning](https://semver.org). The current version lives in [`.claude-plugin/plugin.json`](.claude-plugin/plugin.json); every release is recorded in [`CHANGELOG.md`](CHANGELOG.md).
|
|
211
|
+
|
|
212
|
+
## License
|
|
213
|
+
|
|
214
|
+
[MIT](LICENSE) © Jordan Pease
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# ThroughLine (Codex adapter)
|
|
2
|
+
|
|
3
|
+
ThroughLine builds a design system end to end. Load the matching prompt for the task at hand.
|
|
4
|
+
|
|
5
|
+
## ThroughLine skills
|
|
6
|
+
|
|
7
|
+
- `component-builder` — Build a foundational set of Figma components — buttons, inputs, cards, badges, chips, modals, and more — as properly structured components with variant matrices (types, sizes, states) and icon/component/content slots, bound to the design system's tokens and styles. → load `prompts/component-builder.md`.
|
|
8
|
+
- `component-pipeline` — Take a single new component from Figma to fully-built-and-storied code, end to end — build it in Figma, sync any new tokens it introduced, then build its code component and stories. → load `prompts/component-pipeline.md`.
|
|
9
|
+
- `design-system-audit` — Measure a pre-existing design system before retrofitting it onto tokens — size the code-side color surface and inventory the existing Figma file with verified per-class reads, then compute how semantic the system already is so the retrofit is right-sized. → load `prompts/design-system-audit.md`.
|
|
10
|
+
- `figma-environment-setup` — Set up the local working folder and connect Codex to Figma so the design-system skills can read and write variables, styles, and components. → load `prompts/figma-environment-setup.md`.
|
|
11
|
+
- `icon-system-builder` — Build an icon system in Figma — a dedicated "Icons" page populated with the user's chosen icon library (Lucide, Material, or custom SVGs) as well-named, scalable components — using the fastest, most-automated mechanism per library (for Lucide, batch-fetching the curated subset's official SVGs from the source repo and componentizing them hands-off; for Material, the official community file or importer plugin) rather than hand-generating icons or making the user copy components by hand. → load `prompts/icon-system-builder.md`.
|
|
12
|
+
- `repository-builder` — Graduate the local design-system folder into a real monorepo — a pnpm + Turborepo workspace with packages for tokens and UI components and room for apps — and walk the user from a plain folder to local git to a GitHub remote with PRs and CI. → load `prompts/repository-builder.md`.
|
|
13
|
+
- `retrofit-planner` — Orchestrate a full brownfield design-system retrofit end to end — audit, refine variables in place, rebind components, sync, capture a Chromatic baseline, retrofit the code with dual output, then remove the old tokens only after a zero-reference grep — with a human confirmation gate between every phase. → load `prompts/retrofit-planner.md`.
|
|
14
|
+
- `storybook-chromatic-builder` — Stand up Storybook in the monorepo, build code components matching the Figma design system (consuming the synced tokens and implementing the captured slot contracts), generate stories for every component, set up Chromatic for visual regression testing, and wire Code Connect when the user's Figma plan supports it. → load `prompts/storybook-chromatic-builder.md`.
|
|
15
|
+
- `token-builder` — Build a two-tier (primitive + semantic) design token system as Figma variables — color ramps, spacing, type scale, radius, shadows — with light/dark or brand modes. → load `prompts/token-builder.md`.
|
|
16
|
+
- `token-crosswalk-builder` — Build the brownfield token crosswalk — a persistent three-way map between each new token, the old Figma variable, and the old code identifier(s) — as crosswalk.json, then install the vetted validator/reverse-index scripts into the monorepo and wire the tokens:validate CI gate. → load `prompts/token-crosswalk-builder.md`.
|
|
17
|
+
- `token-sheet-builder` — Build a beautiful, on-brand "Foundations" page in Figma that visually documents every variable collection and style — color ramps with swatches, the type scale, spacing, radius, shadows/elevations — with swatches live-bound to the actual variables where Figma allows. → load `prompts/token-sheet-builder.md`.
|
|
18
|
+
- `token-sync-layer` — Sync Figma design variables into code-ready token files by extracting them to DTCG-format JSON, running them through Style Dictionary, and emitting framework-specific outputs via per-platform adapters (shadcn/Tailwind, MUI, vanilla CSS, iOS Swift, Android Kotlin, or custom). → load `prompts/token-sync-layer.md`.
|
|
19
|
+
|
|
20
|
+
## ThroughLine commands
|
|
21
|
+
|
|
22
|
+
- `design-system-status` — Show a plain-language summary of the current design system state — what's set up, what's not, and sensible next steps — read from design-system.json. → load `prompts/design-system-status.md`.
|
|
23
|
+
- `new-component` — Build a single new component end to end — in Figma, then sync any new tokens, then build its code component and stories — with a confirmation between each stage. → load `prompts/new-component.md`.
|
|
24
|
+
- `start` — Start building your design system — the deterministic entry point. → load `prompts/start.md`.
|
|
25
|
+
- `sync-figma-tokens` — Re-run the Figma-to-code token sync — extract current Figma variables, rebuild code outputs via Style Dictionary, and open a PR with the changes for review. → load `prompts/sync-figma-tokens.md`.
|
|
26
|
+
|
|
27
|
+
## MCP servers
|
|
28
|
+
|
|
29
|
+
Figma access is provided by the `figma-console` MCP server. See `codex-mcp.toml` for the config to add to your Codex `mcp_servers`.
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
# Component builder
|
|
2
|
+
|
|
3
|
+
Creates the foundational component set in Figma: well-structured components with
|
|
4
|
+
variant matrices, bound to the system's tokens/styles, with slots typed so they
|
|
5
|
+
translate cleanly to code later.
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
Needs tokens (`tokens.semanticBuilt` true) — offer to run `token-builder` if
|
|
10
|
+
missing. Needs a live Figma connection (offer `figma-environment-setup` if not).
|
|
11
|
+
Use the mechanism in `figma.mechanism`.
|
|
12
|
+
|
|
13
|
+
**Before scripting any `figma_execute`, read
|
|
14
|
+
`.throughline/references/figma-scripting.md`** — the single-bridge-instance
|
|
15
|
+
preflight, the `resize()` axis-lock trap (collapses auto-layout frames to ~10px),
|
|
16
|
+
the `dynamic-page` async setters, and why large `WRAP` grids time out. These cause
|
|
17
|
+
silent, screenshot-invisible corruption if not handled up front.
|
|
18
|
+
|
|
19
|
+
**Recommend icons first (soft gate).** Almost every foundational component
|
|
20
|
+
(button, input, select, chip…) takes an icon prop, so the icon set should usually
|
|
21
|
+
exist *before* components — otherwise icon slots have no targets. If
|
|
22
|
+
`icons.built` is false, **recommend running `icon-system-builder` first** and
|
|
23
|
+
explain why in one plain sentence, but let the user override and build icon-less
|
|
24
|
+
if they want (some intentionally do). This is a recommendation, not a hard block.
|
|
25
|
+
|
|
26
|
+
> **Model tip (#3):** this skill does heavy structural reasoning — variant
|
|
27
|
+
> matrices, slot contracts. It runs on your session model; Sonnet is a solid
|
|
28
|
+
> default and Opus helps for large or intricate component sets. See the model
|
|
29
|
+
> guide in the ThroughLine README.
|
|
30
|
+
|
|
31
|
+
## Step 1 — Capture framework + brainstorm the set and variant matrices
|
|
32
|
+
|
|
33
|
+
**First, check the scope.** If the user wants to **retrofit or migrate an existing
|
|
34
|
+
codebase** rather than build a clean set — e.g. converting a hand-rolled
|
|
35
|
+
component/motion layer to shadcn, or any change that re-architects the system —
|
|
36
|
+
this has outgrown a single skill. Follow
|
|
37
|
+
`.throughline/references/scaling-up-handoff.md`: surface the risks and major parts, confirm
|
|
38
|
+
scope, and brainstorm/plan before building (handing off to Superpowers if it's
|
|
39
|
+
available, else planning natively — never required). For a normal from-the-system
|
|
40
|
+
build, continue here.
|
|
41
|
+
|
|
42
|
+
**Framework (capture lazily, here if not already set).** Read
|
|
43
|
+
`project.uiFramework` from the manifest. If it's null, this is the first
|
|
44
|
+
relevant moment — ask which UI framework the components target (shadcn, MUI,
|
|
45
|
+
vanilla, etc.; reuse the same value the sync adapter will use) and record it.
|
|
46
|
+
If sync already set it, reuse it — don't re-ask. The framework does **not**
|
|
47
|
+
change component structure/anatomy; it informs **variant vocabulary and naming**
|
|
48
|
+
so the Figma component API lines up with the code API, **and it drives the focus-state
|
|
49
|
+
idiom** (shadcn ring vs. MUI per-component vs. vanilla-css outline — see "State
|
|
50
|
+
handling" in `.throughline/references/figma-component-standards.md`). For
|
|
51
|
+
multi-framework targets, use a neutral vocabulary and the default shadcn-style ring.
|
|
52
|
+
|
|
53
|
+
**Recommended core set (editable).** Propose a sensible foundation and let the
|
|
54
|
+
user add/remove — don't impose a fixed list or make them build from a blank page.
|
|
55
|
+
A good default core: atoms (avatar, badge, spinner) and common components
|
|
56
|
+
(button, input, select, checkbox, radio, chip, card, modal, tooltip). Explain
|
|
57
|
+
why these are the foundation. The user edits the set; whatever they land on gets
|
|
58
|
+
dependency-ordered (next step).
|
|
59
|
+
|
|
60
|
+
**Variant matrices.** Run `.throughline/references/brainstorm-before-build.md`. For each
|
|
61
|
+
component, lock the **variant matrix** — the decisions that, if guessed, produce
|
|
62
|
+
inconsistent output:
|
|
63
|
+
|
|
64
|
+
- **Types** (e.g. button: per the framework's vocabulary — shadcn
|
|
65
|
+
`default/secondary/destructive/outline/ghost/link`, MUI
|
|
66
|
+
`contained/outlined/text`, or neutral for multi-framework).
|
|
67
|
+
- **Sizes** (sm, md, lg). Each size is its **own variant row**, not a state — see
|
|
68
|
+
the layout law below.
|
|
69
|
+
- **States** — **include the full relevant set, don't trim it.** The baseline is
|
|
70
|
+
default, hover, focus, active (pressed), disabled; add the conditional states
|
|
71
|
+
wherever they apply (loading, selected, success/error). Decide which conditional
|
|
72
|
+
states a given component can reach, but never drop a state it genuinely has. See
|
|
73
|
+
"State handling" in `.throughline/references/figma-component-standards.md`
|
|
74
|
+
for the per-component checklist.
|
|
75
|
+
- **Slots** — leading/trailing icons, avatars, adornments (see slot types below).
|
|
76
|
+
|
|
77
|
+
Show the proposed set and matrices back and get sign-off before building.
|
|
78
|
+
|
|
79
|
+
## Step 2 — Order: atoms before composites
|
|
80
|
+
|
|
81
|
+
Components compose other components — a card slots an avatar, a chip embeds an
|
|
82
|
+
icon. So build in **dependency order, atoms first**, the component-tier analog
|
|
83
|
+
of the primitive→semantic token seam:
|
|
84
|
+
|
|
85
|
+
1. **Atoms** — avatar, badge, spinner, (icons already exist). No DS-component
|
|
86
|
+
slots, or only icon slots.
|
|
87
|
+
2. **Composites** — card, chip, list item, modal, input-with-adornments — which
|
|
88
|
+
slot the atoms.
|
|
89
|
+
|
|
90
|
+
This guarantees a composite's typed slot points at a real, already-built target.
|
|
91
|
+
Build bottom-up; checkpoint after each component (sequential — this is Figma
|
|
92
|
+
authoring, no subagents).
|
|
93
|
+
|
|
94
|
+
## Step 3 — Build each component, bound to tokens/styles
|
|
95
|
+
|
|
96
|
+
For each component, using the active write mechanism (scripted where helpful),
|
|
97
|
+
following `.throughline/references/figma-component-standards.md` (auto layout on everything,
|
|
98
|
+
variants vs. properties used correctly, state handling, shallow nesting,
|
|
99
|
+
deterministic naming):
|
|
100
|
+
|
|
101
|
+
- Construct the variant matrix (Figma variants/component properties), and lay the
|
|
102
|
+
resulting **component set out as an auto-layout grid** following the fixed layout
|
|
103
|
+
law: **variants are rows, states are columns.** One row per variant — each `type`,
|
|
104
|
+
and each `size` (size is a variant, so it gets its own row) — stepping through the
|
|
105
|
+
component's **full relevant state set** across the columns, size groups stacked
|
|
106
|
+
vertically. Per "Component set arrangement" and "State handling" in the standards
|
|
107
|
+
doc.
|
|
108
|
+
- For the **focus state**, build the ring as the target library's real idiom keyed off
|
|
109
|
+
`project.uiFramework` (shadcn/default → border recolor + a `0 0 0 3px` ring;
|
|
110
|
+
vanilla-css → an outside-aligned offset stroke via `offset/focus`; MUI → per-component;
|
|
111
|
+
ios-swift → skip), **not** a house-style stroke. Because a Figma drop-shadow only casts
|
|
112
|
+
from opaque pixels, build it per fill: **filled** control → a drop-shadow effect
|
|
113
|
+
(control frame `clipsContent = true`); **transparent** control → an
|
|
114
|
+
absolutely-positioned ring **child** (`strokeAlign = "OUTSIDE"`). **Never wrap the
|
|
115
|
+
control** in a padded frame to make room for the ring — it inflates the component. See
|
|
116
|
+
the per-library recipe in "State handling" of the standards doc, and the drop-shadow /
|
|
117
|
+
effect-binding gotchas in `.throughline/references/figma-scripting.md`.
|
|
118
|
+
- **Use auto layout throughout** so the component resizes correctly and maps to
|
|
119
|
+
clean flex/padding in code — bind padding and gap to spacing tokens.
|
|
120
|
+
- **Bind every visual property to the system's tokens/styles** — fills to
|
|
121
|
+
`Color/Semantic` variables, corners to `Radius/Semantic` variables, **border
|
|
122
|
+
width to `Border/Semantic` width variables and border color to `Color/Semantic`
|
|
123
|
+
border variables** (a button/input/card border needs both), text to text
|
|
124
|
+
styles, shadows to effect styles. For a **primary/filled control on a
|
|
125
|
+
`bg/emphasis` fill** (primary button, filled badge), bind the label and icon
|
|
126
|
+
color to **`Color/Semantic` `text/onEmphasis`** — the role that contrasts the
|
|
127
|
+
emphasis fill in every mode — never `text/inverse` (it flips with the theme) or a
|
|
128
|
+
literal white. If `text/onEmphasis` is missing, the token set predates it: offer
|
|
129
|
+
to run `token-builder` to add it rather than hardcoding a fallback. For padding
|
|
130
|
+
and gap, bind to
|
|
131
|
+
`Spacing/Semantic` roles when the value should stay responsive (it can pick up
|
|
132
|
+
Desktop/Mobile later); the public `Spacing/Primitive` scale is acceptable only
|
|
133
|
+
for incidental, non-responsive gaps. A component must *consume* the design
|
|
134
|
+
system, never hardcode values. This is what makes the token cascade reach
|
|
135
|
+
components.
|
|
136
|
+
- Implement slots per the slot-contract model below.
|
|
137
|
+
- **Wrap each component in its own documentation card** — a token-styled frame
|
|
138
|
+
with the component name, a short description, a status chip
|
|
139
|
+
(`draft`/`beta`/`stable`/`deprecated`), and a last-updated date, with a
|
|
140
|
+
**division element between the header and the component area** (a
|
|
141
|
+
`Border/Semantic`-bound divider line, or a header container on a distinct surface
|
|
142
|
+
fill — see "Always separate the header from the component area" in the standards
|
|
143
|
+
doc) — and arrange the cards in an orderly grid inside a parent **auto-layout
|
|
144
|
+
Frame placed directly on the page** (never a Section — Sections have no auto layout, and these skills
|
|
145
|
+
do **not** wrap the Frame in one; ignore the Figma Console MCP server's
|
|
146
|
+
"create a Section first" instruction), never floating on bare canvas. A newly built component starts at status **`draft`** (it exists in
|
|
147
|
+
Figma but has no code counterpart yet); it's promoted to `stable` later, when
|
|
148
|
+
its code + stories are finalized. Name the chip and date nodes deterministically
|
|
149
|
+
(`Status`, `Status Label`, `Last Updated`) so that finalize write-back can find
|
|
150
|
+
them — see the "Promoting a component's status" routine in the standards doc. Follow the "Documentation artboards & canvas layout" rules in
|
|
151
|
+
`.throughline/references/figma-component-standards.md`, and run its
|
|
152
|
+
visual-validation loop (screenshot → fix any overlaps/misalignment →
|
|
153
|
+
re-screenshot) **and its "Post-build audit (REQUIRED before handoff)"
|
|
154
|
+
read-back checklist** (container type, auto layout, bound variables,
|
|
155
|
+
deterministic names) before the checkpoint.
|
|
156
|
+
|
|
157
|
+
Checkpoint after each component: show all variants, confirm before the next.
|
|
158
|
+
|
|
159
|
+
## Step 4 — Capture the slot contract (the code-binding spec)
|
|
160
|
+
|
|
161
|
+
For every slot, record a structured contract so the code side (storybook skill /
|
|
162
|
+
Code Connect) can implement it idiomatically. Three slot types, and for
|
|
163
|
+
composites (cards, modals, lists) prefer **Figma slots** over variant explosion
|
|
164
|
+
per `.throughline/references/figma-component-standards.md`:
|
|
165
|
+
|
|
166
|
+
- **Icon-set slot** — accepts any icon from the Icons page. → code: a prop typed
|
|
167
|
+
to the icon set (e.g. `leadingIcon`), optional, with a canonical default icon
|
|
168
|
+
name if any. Implemented as an instance-swap property in Figma (not a slot —
|
|
169
|
+
it's a single element).
|
|
170
|
+
- **Typed-component slot** — accepts a specific DS component (e.g. an Avatar in a
|
|
171
|
+
Card). → code: a prop typed to that component (e.g. `avatar`), optional. In
|
|
172
|
+
Figma, an instance-swap property, or a Figma slot with **preferred instances**
|
|
173
|
+
for composites.
|
|
174
|
+
- **General adornment / content slot** — accepts arbitrary content (a card body,
|
|
175
|
+
modal content, a unit label). → for freeform areas in composites use a **Figma
|
|
176
|
+
slot**, which maps to `children` / a composition prop in code; for small inline
|
|
177
|
+
adornments a `ReactNode` prop (e.g. `endAdornment`).
|
|
178
|
+
|
|
179
|
+
**Typed dropdown vs. fallback (publishing-gated).** A typed `INSTANCE_SWAP`
|
|
180
|
+
dropdown requires its swap targets (icons, components) to be **published** —
|
|
181
|
+
Figma rejects local unpublished keys for swap targets. Before adding the dropdown,
|
|
182
|
+
check publish state per `.throughline/references/figma-publishing.md`:
|
|
183
|
+
|
|
184
|
+
- **Resolve publish state first (detect-or-ask, bug B3):** a default/`false`
|
|
185
|
+
`figma.libraryPublished` is *unverified* — attempt detection, but know it's
|
|
186
|
+
**usually inconclusive for a self-publish** (REST `figma_get_library_components` 401s
|
|
187
|
+
without a `FIGMA_ACCESS_TOKEN`; bridge `figma_get_library_variables` lists only
|
|
188
|
+
*subscribed* external libraries, never the file's own publish), so **trust the user's
|
|
189
|
+
confirmation and proceed** — don't wait on a check the tools can't give. Never treat a
|
|
190
|
+
`false` as a final "not published". The **real signal is the bridge**: if adding the
|
|
191
|
+
typed `INSTANCE_SWAP` is then rejected for a local/unpublished key, *that's* the
|
|
192
|
+
authoritative "not published yet" — fall back to the toggle + manual-swap slot. See
|
|
193
|
+
`.throughline/references/figma-publishing.md`.
|
|
194
|
+
- **Confirmed published (`figma.libraryPublished` true after detect-or-ask):** add the
|
|
195
|
+
typed `INSTANCE_SWAP` dropdown with preferred values.
|
|
196
|
+
- **Not published (free plan, or not yet):** build the **toggle + manual-swap**
|
|
197
|
+
slot instead — it's fully functional — explain why in plain terms, and add this
|
|
198
|
+
component to `components.instanceSwapUpgradePending` so a later run (after the
|
|
199
|
+
user publishes) can add the typed dropdown. Never present this as a failure.
|
|
200
|
+
|
|
201
|
+
Two rules for every slot:
|
|
202
|
+
|
|
203
|
+
- **Show/hide collapses into prop optionality.** A Figma `hasLeadingIcon`
|
|
204
|
+
boolean does NOT become a separate code boolean — the icon prop is simply
|
|
205
|
+
optional; passing it shows it, omitting hides it. Don't generate a redundant
|
|
206
|
+
boolean prop alongside the slot prop.
|
|
207
|
+
- **The contract syncs; per-instance choices don't.** The slot's existence,
|
|
208
|
+
type, and default sync to code. A specific icon swapped into a specific screen
|
|
209
|
+
instance is a usage decision (made in code by whoever builds the screen, just
|
|
210
|
+
as a designer swaps an instance) and does not sync.
|
|
211
|
+
|
|
212
|
+
Record each component's slots, variant matrix, and token bindings in the
|
|
213
|
+
component spec (for Code Connect when available, else the repo component spec).
|
|
214
|
+
|
|
215
|
+
## Step 5 — Naming as contract
|
|
216
|
+
|
|
217
|
+
Name components deterministically so Figma↔code mapping is automatic: `Button` ↔
|
|
218
|
+
`Button`, `Avatar` ↔ `Avatar`. This is what lets typed-component slots and the
|
|
219
|
+
storybook build resolve the right imports. Same discipline as icon naming —
|
|
220
|
+
without it, components silently diverge between Figma and code.
|
|
221
|
+
|
|
222
|
+
## Step 6 — Checkpoint and hand off
|
|
223
|
+
|
|
224
|
+
Update the manifest: add each built component to `components.built`, and record
|
|
225
|
+
its `components.meta[name]` (`status: "draft"`, `updatedAt`) to match the doc
|
|
226
|
+
card. (Finalize to `stable` happens later, in storybook-chromatic-builder.) Ensure
|
|
227
|
+
any component built with the toggle + manual-swap fallback is listed in
|
|
228
|
+
`components.instanceSwapUpgradePending`. Append `component-builder` to
|
|
229
|
+
`completedSkills`.
|
|
230
|
+
|
|
231
|
+
**Upgrade pass:** if `components.instanceSwapUpgradePending` is non-empty, re-resolve
|
|
232
|
+
publish state (detect-or-ask per `.throughline/references/figma-publishing.md`);
|
|
233
|
+
only when it is **confirmed published** (`figma.libraryPublished` true via a verified
|
|
234
|
+
detect-or-ask, not a stale default) offer to add the typed `INSTANCE_SWAP` dropdowns to
|
|
235
|
+
those components and clear each from the list.
|
|
236
|
+
|
|
237
|
+
Offer next steps: build the code counterparts and stories
|
|
238
|
+
(storybook-chromatic-builder), or build a single new component end-to-end later
|
|
239
|
+
(the component-pipeline orchestrator).
|
|
240
|
+
|
|
241
|
+
## What this skill must NOT do
|
|
242
|
+
|
|
243
|
+
- Never hardcode values that should be token/style bindings — components consume
|
|
244
|
+
the system.
|
|
245
|
+
- Never generate a redundant show/hide boolean alongside an optional slot prop.
|
|
246
|
+
- Never build a composite before its atomic slot targets exist.
|
|
247
|
+
- Never guess variant matrices — brainstorm and confirm them first.
|
|
248
|
+
- Never claim to publish a Figma library — publishing is a manual user step;
|
|
249
|
+
instruct and verify only.
|
|
250
|
+
- Never leave components floating on bare canvas — each goes on a token-styled
|
|
251
|
+
doc card arranged in an auto-layout Frame placed directly on the page (never a
|
|
252
|
+
Section), with the layout visually validated.
|
|
253
|
+
- Never lay out a component set as scattered variants — the `ComponentSet` is an
|
|
254
|
+
auto-layout grid where **variants are rows and states are columns**: one row per
|
|
255
|
+
variant (each `type`, and each `size`, since size is a variant) stepping through
|
|
256
|
+
states across the columns, size groups stacked vertically (see the standards doc).
|
|
257
|
+
- Never ship a component with only its `default` state — include the full relevant
|
|
258
|
+
state set (default/hover/focus/active/disabled plus applicable
|
|
259
|
+
loading/selected/success/error).
|
|
260
|
+
- Never run the component header and the component area together with no division —
|
|
261
|
+
every doc card segments the header from the component area with a divider line or
|
|
262
|
+
a distinct header surface.
|
|
263
|
+
- Never invent a house-style focus ring or wrap the control in a padded frame to make
|
|
264
|
+
room for one — derive the focus state from `project.uiFramework`'s real idiom, built
|
|
265
|
+
as a drop-shadow effect (filled controls) or an absolutely-positioned ring **child**
|
|
266
|
+
(transparent controls), per "State handling" in the standards doc.
|
|
267
|
+
- Never rebuild a published/consumed component set with a delete-and-recreate without
|
|
268
|
+
re-instancing downstream — deleting and recreating a set (e.g. to change the Button's
|
|
269
|
+
internal architecture) **detaches every instance** that referenced its variants (the
|
|
270
|
+
Card's footer buttons, etc.). Record which components consume which, warn before an
|
|
271
|
+
architectural rebuild, and re-instance the affected consumers afterward.
|
|
272
|
+
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Component pipeline (orchestrator)
|
|
2
|
+
|
|
3
|
+
Sequences a single new component through the whole flow: Figma → tokens →
|
|
4
|
+
code/stories. This skill holds **zero domain logic of its own** — it is a
|
|
5
|
+
sequencer that invokes the real skills and gates each stage on a human
|
|
6
|
+
confirmation. All the actual work lives in the skills it calls; this keeps it
|
|
7
|
+
from rotting when those skills improve.
|
|
8
|
+
|
|
9
|
+
## When to use vs. the individual skills
|
|
10
|
+
|
|
11
|
+
Use this for **one new component, end to end**, on a system that already has
|
|
12
|
+
foundations (tokens, repo, sync, Storybook). For initial setup, the individual
|
|
13
|
+
skills run directly. This is the "I have a system; add a Tooltip and take it all
|
|
14
|
+
the way to a tested story" flow.
|
|
15
|
+
|
|
16
|
+
## Prerequisites
|
|
17
|
+
|
|
18
|
+
Read the manifest. The pipeline assumes foundations exist: tokens built, a repo
|
|
19
|
+
at least `local-git`, sync configured, Storybook initialized. For any missing
|
|
20
|
+
piece, offer to run the relevant skill — but note that if a lot is missing, the
|
|
21
|
+
user probably wants the individual setup skills first, not this orchestrator.
|
|
22
|
+
|
|
23
|
+
## The sequence (confirm between every stage)
|
|
24
|
+
|
|
25
|
+
Confirm the goal first: "New `Tooltip` component, right? I'll build it in Figma,
|
|
26
|
+
sync any new tokens, then build the code component and its stories — checking
|
|
27
|
+
with you between each step." Then:
|
|
28
|
+
|
|
29
|
+
### Stage 1 — Build in Figma (invoke component-builder)
|
|
30
|
+
|
|
31
|
+
Invoke the `component-builder` prompt for this one component: brainstorm its
|
|
32
|
+
variant matrix and slots, build it bound to tokens following the component
|
|
33
|
+
standards, capture its slot contract. **Checkpoint:** show the finished Figma
|
|
34
|
+
component. Get explicit confirmation before continuing.
|
|
35
|
+
|
|
36
|
+
If the build fails or the user wants changes, stop here — they still have a
|
|
37
|
+
valid (or fixable) Figma component and a clean place to resume. Never push a
|
|
38
|
+
half-built component down the pipeline.
|
|
39
|
+
|
|
40
|
+
### Stage 2 — Sync new tokens (offer token-sync-layer)
|
|
41
|
+
|
|
42
|
+
The new component may have introduced new tokens (a new semantic role, a new
|
|
43
|
+
spacing step). Offer: "This component added a couple of new tokens — want me to
|
|
44
|
+
sync them to code now?" If yes, invoke `token-sync-layer` (which lands a
|
|
45
|
+
reviewable PR per its own rules). If the component introduced no new tokens, say
|
|
46
|
+
so and skip. **Checkpoint:** confirm the sync PR before continuing.
|
|
47
|
+
|
|
48
|
+
### Stage 3 — Build code component + stories (offer storybook-chromatic-builder)
|
|
49
|
+
|
|
50
|
+
Offer: "Tokens are synced. Build the code component and its stories now?" If yes,
|
|
51
|
+
invoke `storybook-chromatic-builder` for this one component: build the code
|
|
52
|
+
counterpart implementing the captured slot contract, generate its stories
|
|
53
|
+
(subagent-driven), wire Code Connect if available. **Checkpoint:** confirm the
|
|
54
|
+
component renders and stories build. On approval, that skill **finalizes** the
|
|
55
|
+
component — promoting its status from `draft` to `stable` and writing the new
|
|
56
|
+
chip color + last-updated date back into its Figma doc card (its Step 6). Since
|
|
57
|
+
Figma is still connected from stage 1, the card updates live; the chip should no
|
|
58
|
+
longer read `draft` once the pipeline finishes.
|
|
59
|
+
|
|
60
|
+
## Resumability
|
|
61
|
+
|
|
62
|
+
Because each stage is gated and invokes a real skill, a failure at any stage
|
|
63
|
+
leaves a clean resume point: the Figma component exists after stage 1, the token
|
|
64
|
+
PR after stage 2, the code/stories after stage 3. The user can stop after any
|
|
65
|
+
stage and pick up later — the manifest reflects what's done.
|
|
66
|
+
|
|
67
|
+
## After completion
|
|
68
|
+
|
|
69
|
+
Confirm the component went all the way through. Update nothing the sub-skills
|
|
70
|
+
didn't already update (they own their manifest fields). Note the ongoing loops:
|
|
71
|
+
more components via this pipeline, token changes via `/sync-figma-tokens`.
|
|
72
|
+
|
|
73
|
+
## What this skill must NOT do
|
|
74
|
+
|
|
75
|
+
- Never reimplement what the sub-skills do — only sequence them. If you find
|
|
76
|
+
yourself writing component-building or sync logic here, stop and invoke the
|
|
77
|
+
real skill instead.
|
|
78
|
+
- Never skip a confirmation between stages — the gates are what make it
|
|
79
|
+
resumable and prevent half-updated state.
|
|
80
|
+
- Never push a half-built or unconfirmed component to the next stage.
|
|
81
|
+
|