canicode 0.12.2 → 0.12.4
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/CHANGELOG.md +172 -0
- package/README.md +46 -65
- package/dist/cli/index.js +154 -46
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +40 -1
- package/dist/index.js +115 -44
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.js +135 -45
- package/dist/mcp/server.js.map +1 -1
- package/package.json +3 -1
- package/skills/canicode-roundtrip/SKILL.md +86 -0
- package/skills/canicode-roundtrip/helpers-bootstrap.js +1 -1
- package/skills/canicode-roundtrip/helpers-installer.js +2 -2
- package/skills/canicode-roundtrip/helpers.js +429 -0
- package/skills/cursor/canicode-roundtrip/SKILL.md +86 -0
- package/skills/cursor/canicode-roundtrip/helpers-bootstrap.js +1 -1
- package/skills/cursor/canicode-roundtrip/helpers-installer.js +2 -2
- package/skills/cursor/canicode-roundtrip/helpers.js +429 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. This project adheres
|
|
4
|
+
to [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and, once
|
|
5
|
+
published as v1, will follow [Semantic Versioning](https://semver.org/).
|
|
6
|
+
While in v0.x, minor versions may carry breaking changes — they are called
|
|
7
|
+
out explicitly in the relevant entry.
|
|
8
|
+
|
|
9
|
+
Each entry summarises the user-visible change. Per-PR detail lives in the
|
|
10
|
+
[GitHub release notes](https://github.com/let-sunny/canicode/releases) for
|
|
11
|
+
the corresponding tag, and architecture rationale lives in
|
|
12
|
+
[ADR.md](.claude/docs/ADR.md).
|
|
13
|
+
|
|
14
|
+
## [Unreleased]
|
|
15
|
+
|
|
16
|
+
## [0.12.3] - 2026-04-29
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- **Phase 3 — bootstrap a design system from screens** (Workflow 3 epic
|
|
21
|
+
[#508](https://github.com/let-sunny/canicode/issues/508)) shipped GA. After
|
|
22
|
+
upgrading, `canicode-roundtrip` performs the full **componentize+swap loop**
|
|
23
|
+
end-to-end on any Stage 3 (`missing-component:structure-repetition`) group:
|
|
24
|
+
one `yes` answer componentizes the document-order first member and swaps
|
|
25
|
+
the rest with instances of the new component. Optional Code Connect
|
|
26
|
+
registration follows automatically when prereqs are present.
|
|
27
|
+
- `applyComponentize` apply primitive — wraps `figma.createComponentFromNode`
|
|
28
|
+
with the #368 instance-child guard and the ADR-023 decision A free-form
|
|
29
|
+
parent guard. Annotate-fallback on every rejection.
|
|
30
|
+
- `applyReplaceWithInstance` apply primitive — wraps
|
|
31
|
+
`mainComponent.createInstance()` + `parent.insertChild` + `target.remove()`
|
|
32
|
+
with an independent swap-site free-form check.
|
|
33
|
+
- `applyGroupComponentize` orchestrator — drives the full loop from a
|
|
34
|
+
single user `yes` answer; aggregates per-target outcomes into a single
|
|
35
|
+
Step 4 line.
|
|
36
|
+
- `groupMembers` field on `RuleViolation` and `GotchaSurveyQuestion` —
|
|
37
|
+
every node id in a Stage 3 fingerprint group surfaces in the survey
|
|
38
|
+
output so the apply step can iterate the whole group.
|
|
39
|
+
- `RuleContext.analysisRoot` — Stage 3 (and now Stage 1/2) walks the
|
|
40
|
+
active analysis subtree instead of the full file, fixing a silent scope
|
|
41
|
+
leak under `--target-node-id` analysis.
|
|
42
|
+
- ADR-023 — Phase 3 design decisions A–E (free-form parent guard, no
|
|
43
|
+
override threshold, name-collision auto-suffix in Figma's native ` 2`
|
|
44
|
+
pattern, shared question UI for Forward/Reverse with `mode` field on the
|
|
45
|
+
answer, silent-skip Code Connect handoff).
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
|
|
49
|
+
- Stage 3 `missing-component:structure-repetition` is now **scope-wide**:
|
|
50
|
+
duplicates spread across different parents within the analysis scope
|
|
51
|
+
fold into the same fingerprint group instead of being missed by the old
|
|
52
|
+
sibling-only walk. Message wording updates from `N sibling frame(s)` to
|
|
53
|
+
`N other frame(s)`.
|
|
54
|
+
- Stage 1 (`unused-component`) and Stage 2 (`name-repetition`) now also
|
|
55
|
+
honour `analysisRoot` for the frame-name walk — fixes the same
|
|
56
|
+
silent-skip pattern when `--target-node-id` scopes the run.
|
|
57
|
+
|
|
58
|
+
### Documentation
|
|
59
|
+
|
|
60
|
+
- WORKFLOWS.md Workflow 3 promoted to ✅ Available with the new Today's
|
|
61
|
+
flow, the bundled apply primitives, and two known limits (per-member
|
|
62
|
+
opt-out, Stage 1 reverse case).
|
|
63
|
+
|
|
64
|
+
## [0.12.2] - 2026-04-28
|
|
65
|
+
|
|
66
|
+
### Fixed
|
|
67
|
+
|
|
68
|
+
- canicode-roundtrip Phase 2 live-verification follow-ups
|
|
69
|
+
([#545](https://github.com/let-sunny/canicode/issues/545),
|
|
70
|
+
[#546](https://github.com/let-sunny/canicode/issues/546),
|
|
71
|
+
[#547](https://github.com/let-sunny/canicode/issues/547),
|
|
72
|
+
[#548](https://github.com/let-sunny/canicode/issues/548)) bundled into a
|
|
73
|
+
single SKILL prose update — one batch per message pacing, output
|
|
74
|
+
language detection, grade-movement attribution, and Step 1.5 doctor
|
|
75
|
+
inconclusive handling on screen-scope FRAME URLs.
|
|
76
|
+
|
|
77
|
+
## [0.12.1] - 2026-04-28
|
|
78
|
+
|
|
79
|
+
### Added
|
|
80
|
+
|
|
81
|
+
- `canicode doctor --figma-url <url>` publish-status pre-check
|
|
82
|
+
([#532](https://github.com/let-sunny/canicode/issues/532)) — verifies
|
|
83
|
+
the target Figma component is published in a library before the
|
|
84
|
+
roundtrip's closing Code Connect mapping step asks the satisfaction
|
|
85
|
+
prompt. Surfaces inconclusive when `FIGMA_TOKEN` is not configured or
|
|
86
|
+
the URL has no node-id; failure cases print remediation hints.
|
|
87
|
+
- `unmapped-component` v1.5 — parser-driven main check
|
|
88
|
+
([#526](https://github.com/let-sunny/canicode/issues/526)) and
|
|
89
|
+
acknowledgment-channel opt-out write path
|
|
90
|
+
([#543](https://github.com/let-sunny/canicode/issues/543)) so designers
|
|
91
|
+
can mark a component "intentionally unmapped" and have the rule
|
|
92
|
+
silently skip it on subsequent roundtrips.
|
|
93
|
+
- ADR-022 — `unmapped-component` opt-out via the existing acknowledgment
|
|
94
|
+
channel + the REST private-beta annotations field gating that limits
|
|
95
|
+
standalone analyze visibility.
|
|
96
|
+
|
|
97
|
+
### Fixed
|
|
98
|
+
|
|
99
|
+
- Bridge `CanICodeRoundtrip` onto `globalThis` inside `eval`
|
|
100
|
+
([#533](https://github.com/let-sunny/canicode/issues/533)) so the
|
|
101
|
+
bundled IIFE survives Plugin API hosts that wrap the script in a
|
|
102
|
+
shadowed scope.
|
|
103
|
+
|
|
104
|
+
### Documentation
|
|
105
|
+
|
|
106
|
+
- SKILL Step 4 inline-staging guidance + Step 7d single-mapping path
|
|
107
|
+
([#531](https://github.com/let-sunny/canicode/issues/531),
|
|
108
|
+
[#534](https://github.com/let-sunny/canicode/issues/534)).
|
|
109
|
+
|
|
110
|
+
## [0.12.0] - 2026-04-27
|
|
111
|
+
|
|
112
|
+
### Added
|
|
113
|
+
|
|
114
|
+
- **Phase 1 — component-to-code mapping** roundtrip closing step
|
|
115
|
+
([#515](https://github.com/let-sunny/canicode/issues/515)): after
|
|
116
|
+
`figma-implement-design` finishes, the roundtrip prompts for
|
|
117
|
+
satisfaction and registers a Code Connect mapping
|
|
118
|
+
(`add_code_connect_map` + `send_code_connect_mappings`) so future
|
|
119
|
+
roundtrips on screens containing the same component reuse the
|
|
120
|
+
generated code instead of regenerating markup.
|
|
121
|
+
- `canicode doctor` — verifies `@figma/code-connect` install and
|
|
122
|
+
`figma.config.json` presence in the user's repo before the roundtrip
|
|
123
|
+
reaches the mapping step
|
|
124
|
+
([#512](https://github.com/let-sunny/canicode/issues/512)).
|
|
125
|
+
- `unmapped-component` analyze rule
|
|
126
|
+
([#520](https://github.com/let-sunny/canicode/issues/520)) — flags
|
|
127
|
+
Figma components that have no Code Connect mapping yet, with the
|
|
128
|
+
optional Workflow 1 onboarding pointer.
|
|
129
|
+
- New `note` severity tier (zero score impact) for annotation-primary
|
|
130
|
+
rules whose value is the nudge, not the score
|
|
131
|
+
([#519](https://github.com/let-sunny/canicode/issues/519)). Backfills
|
|
132
|
+
`missing-prototype`, `missing-interaction-state`,
|
|
133
|
+
`missing-size-constraint`, `unmapped-component`.
|
|
134
|
+
- ADR-021 — handoff carriers and conflict resolution between
|
|
135
|
+
`canicode-roundtrip` and `figma-implement-design`.
|
|
136
|
+
- WORKFLOWS.md — new 3-phase canicode bootstrap roadmap document
|
|
137
|
+
([#511](https://github.com/let-sunny/canicode/issues/511)).
|
|
138
|
+
|
|
139
|
+
### Changed
|
|
140
|
+
|
|
141
|
+
- `canicode init` split into interactive setup + a separate
|
|
142
|
+
`canicode config set-token` subcommand
|
|
143
|
+
([#506](https://github.com/let-sunny/canicode/issues/506)). Existing
|
|
144
|
+
users who relied on the old combined flow should move the token-only
|
|
145
|
+
step to `config set-token`.
|
|
146
|
+
- Stripped internal issue / ADR refs from user-facing surfaces
|
|
147
|
+
([#504](https://github.com/let-sunny/canicode/issues/504)) so the
|
|
148
|
+
README and SKILL prose read cleanly to a first-time user.
|
|
149
|
+
|
|
150
|
+
## [0.11.5] - 2026-04-25
|
|
151
|
+
|
|
152
|
+
### Added
|
|
153
|
+
|
|
154
|
+
- Claude Code marketplace manifest
|
|
155
|
+
([#497](https://github.com/let-sunny/canicode/issues/497)) so canicode
|
|
156
|
+
appears in Claude Code's plugin/skill catalogue.
|
|
157
|
+
- "Other agents" install guide for non-Claude/Cursor hosts
|
|
158
|
+
([#502](https://github.com/let-sunny/canicode/issues/502)) — manual
|
|
159
|
+
skill copy instructions for hosts that do not auto-discover skills.
|
|
160
|
+
|
|
161
|
+
### Documentation
|
|
162
|
+
|
|
163
|
+
- Polished `canicode init` path docs
|
|
164
|
+
([#499](https://github.com/let-sunny/canicode/issues/499)) following
|
|
165
|
+
user-flow testing.
|
|
166
|
+
|
|
167
|
+
[Unreleased]: https://github.com/let-sunny/canicode/compare/v0.12.3...HEAD
|
|
168
|
+
[0.12.3]: https://github.com/let-sunny/canicode/compare/v0.12.2...v0.12.3
|
|
169
|
+
[0.12.2]: https://github.com/let-sunny/canicode/compare/v0.12.1...v0.12.2
|
|
170
|
+
[0.12.1]: https://github.com/let-sunny/canicode/compare/v0.12.0...v0.12.1
|
|
171
|
+
[0.12.0]: https://github.com/let-sunny/canicode/compare/v0.11.5...v0.12.0
|
|
172
|
+
[0.11.5]: https://github.com/let-sunny/canicode/compare/v0.11.4...v0.11.5
|
package/README.md
CHANGED
|
@@ -6,11 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<a href="https://www.npmjs.com/package/canicode"><img src="https://img.shields.io/npm/v/canicode.svg" alt="npm version"></a>
|
|
9
|
+
<a href="https://www.figma.com/community/plugin/1617144221046795292/can-i-code"><img src="https://img.shields.io/badge/Figma-Plugin-F24E1E?logo=figma&logoColor=white" alt="Figma Plugin"></a>
|
|
9
10
|
<a href="https://github.com/let-sunny/canicode/actions/workflows/ci.yml"><img src="https://github.com/let-sunny/canicode/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
10
11
|
<a href="https://github.com/let-sunny/canicode/actions/workflows/release.yml"><img src="https://github.com/let-sunny/canicode/actions/workflows/release.yml/badge.svg" alt="Release"></a>
|
|
11
12
|
</p>
|
|
12
13
|
|
|
13
|
-
<p align="center"><strong>
|
|
14
|
+
<p align="center"><strong>Ship your Figma design exactly as you intended — without learning CSS.</strong></p>
|
|
14
15
|
|
|
15
16
|
<p align="center">
|
|
16
17
|
<strong><a href="https://let-sunny.github.io/canicode/">Try it in your browser</a></strong> — no install needed.
|
|
@@ -22,19 +23,41 @@
|
|
|
22
23
|
|
|
23
24
|
---
|
|
24
25
|
|
|
25
|
-
##
|
|
26
|
+
## What canicode does
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
You designed it in Figma. You know exactly how it should look and behave — but the AI codegen guesses, and half the time it guesses wrong. The cards don't stack on mobile. The hover state disappears. The padding gets normalised. *That's not what I designed.*
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
canicode is the **pre-implementation interview** between your Figma file and AI codegen. It asks the questions a developer would ask before they implement — in plain language you can answer:
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
> *"The three cards are side-by-side at desktop width — what should happen when the screen is narrow?"*
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
- **Deterministic** — no AI tokens consumed per analysis, runs in milliseconds
|
|
35
|
-
- **Ablation-validated** — [experiments](https://github.com/let-sunny/canicode/wiki) confirmed the curated design-tree achieves 94% pixel accuracy with 5× fewer tokens than raw JSON
|
|
34
|
+
You answer in plain words ("좁아지면 한 줄에 하나씩" / "stack them vertically"). canicode translates that into the exact technical spec the codegen needs, and writes it back into your Figma file as a structured annotation so the next run no longer has to guess.
|
|
36
35
|
|
|
37
|
-
|
|
36
|
+
You stay in Figma. You never type a CSS selector. The intent ships.
|
|
37
|
+
|
|
38
|
+
→ Full thesis: [docs/POSITIONING.md](docs/POSITIONING.md)
|
|
39
|
+
|
|
40
|
+
### The three layers
|
|
41
|
+
|
|
42
|
+
1. **Linter** — 17 rules surface the gaps your craft instinct senses but can't name. *"Something's off with this spacing."* → it finds the one card with 14px padding while the rest are 16px.
|
|
43
|
+
2. **Q&A scaffolding** — for every gap, canicode asks in your vocabulary, not the developer's. You answer, it spec'ifies.
|
|
44
|
+
3. **Roundtrip persistence** — answers live in the Figma file as Dev Mode annotations. Next run, next person, next codegen — they all see the intent.
|
|
45
|
+
|
|
46
|
+
The linter is deterministic (no LLM tokens consumed for the analysis itself), [ablation-validated](https://github.com/let-sunny/canicode/wiki) at 94% pixel accuracy with 5× fewer tokens than raw JSON, and [calibrated](https://github.com/let-sunny/canicode/wiki/Calibration) against real Figma designs.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Why canicode (vs Claude Design)
|
|
51
|
+
|
|
52
|
+
[Claude Design](https://www.anthropic.com/news/claude-design) launched in April 2026 and covers the **prompt → app** path beautifully — AI designs from your prompt and hands the result to Claude Code. canicode covers a different workflow:
|
|
53
|
+
|
|
54
|
+
| | Claude Design | canicode |
|
|
55
|
+
|---|---|---|
|
|
56
|
+
| Who designs | AI (from a prompt) | The designer (in Figma) |
|
|
57
|
+
|
|
58
|
+
If you want the AI to design for you, use Claude Design. If you already designed it and want it implemented exactly the way you intended, canicode is for you. The two are not in competition — they assume different things about who owns the design.
|
|
59
|
+
|
|
60
|
+
See [docs/POSITIONING.md](docs/POSITIONING.md) for the full thesis (target persona, the workflow assumption, and what canicode is **not** for).
|
|
38
61
|
|
|
39
62
|
---
|
|
40
63
|
|
|
@@ -42,7 +65,7 @@ Rule scores aren't guesswork. The calibration pipeline converts real Figma desig
|
|
|
42
65
|
|
|
43
66
|
**Skills:** **`canicode-gotchas`** = survey answers saved **locally** in SKILL.md only (memo). **`canicode-roundtrip`** = same analysis path plus **writes to Figma** (annotations / properties). Pick gotchas for capture-only; pick roundtrip when the design file should change.
|
|
44
67
|
|
|
45
|
-
1. **Analyze** — run the
|
|
68
|
+
1. **Analyze** — run the 17 rules against the Figma design (report includes grade).
|
|
46
69
|
2. **Surface gotchas** — the analyzer emits questions for design information it can't infer (missing states, unclear variants, responsive intent).
|
|
47
70
|
3. **Apply fixes to Figma** — the `/canicode-roundtrip` skill writes answers back via `use_figma`. Each write shows up in the summary with one of three outcome markers:
|
|
48
71
|
- ✅ **scene write succeeded** — the property was written directly to the scene node or instance override.
|
|
@@ -54,71 +77,27 @@ Rule scores aren't guesswork. The calibration pipeline converts real Figma desig
|
|
|
54
77
|
|
|
55
78
|
---
|
|
56
79
|
|
|
57
|
-
##
|
|
58
|
-
|
|
59
|
-
> **Token safety:** Do **not** paste your Figma token into Claude, Cursor, or other agent chats — session logs can retain it. Use `FIGMA_TOKEN=figd_… npx canicode init`, or run `npx canicode init` and enter the token **only** at the CLI prompt.
|
|
80
|
+
## Try it in 30 seconds
|
|
60
81
|
|
|
61
|
-
|
|
82
|
+
1. **[Open the web app](https://let-sunny.github.io/canicode/)** — paste any Figma URL, get a report. No install, no token, no AI cost. This is the linter view (Layer 1) — useful by itself.
|
|
83
|
+
2. Then if you want the full Q&A roundtrip, install the Claude Code skill below.
|
|
62
84
|
|
|
63
|
-
|
|
85
|
+
## Run the full roundtrip (Claude Code)
|
|
64
86
|
|
|
65
87
|
```bash
|
|
66
|
-
# 1. Save your Figma token AND install the /canicode-roundtrip skill
|
|
67
|
-
# Interactive (TTY): npx canicode init — prompts for the token
|
|
68
|
-
# Non-interactive: npx canicode init --token figd_xxxxxxxxxxxxx
|
|
69
|
-
# (never paste the token into chat — use env var, the prompt, or --token only)
|
|
70
88
|
npx canicode init
|
|
89
|
+
# saves your Figma token + installs /canicode-roundtrip
|
|
90
|
+
# (the prompt asks for the token; never paste it into agent chat)
|
|
71
91
|
|
|
72
|
-
# 2. Run the roundtrip on a Figma URL
|
|
73
92
|
/canicode-roundtrip https://www.figma.com/design/ABC123/MyDesign?node-id=1-234
|
|
93
|
+
# in your Claude Code session
|
|
74
94
|
```
|
|
75
95
|
|
|
76
|
-
|
|
96
|
+
The roundtrip calls the **Figma MCP server** to read and write your design — install it once with `claude mcp add -s project -t http figma https://mcp.figma.com/mcp` and restart Claude Code.
|
|
77
97
|
|
|
78
|
-
> **
|
|
98
|
+
> **Cursor / Claude Desktop / other MCP host:** also supported. CLI install path (`npx canicode init --cursor-skills`), bare MCP server install, GitHub Action for CI gates, and other channels are listed in the **Installation** matrix below.
|
|
79
99
|
|
|
80
|
-
**
|
|
81
|
-
|
|
82
|
-
1. Add **canicode** and **Figma** MCPs — [Cursor MCP](docs/CUSTOMIZATION.md#cursor-mcp-canicode) for `npx` → `canicode-mcp` (use **`.cursor/mcp.json`** or **`~/.cursor/mcp.json`** in Cursor, not repo-root `.mcp.json`; [why](docs/CUSTOMIZATION.md#which-mcp-file-affects-which-host)); Figma MCP is required for **`use_figma`** if you run **roundtrip** (design writes), not for analyze-only.
|
|
83
|
-
2. `npx canicode init --token figd_xxxxxxxxxxxxx --cursor-skills` (use `FIGMA_TOKEN=…` or the CLI prompt — not chat) — installs the same three skills as Claude under `.cursor/skills/` (`canicode`, `canicode-gotchas`, `canicode-roundtrip` + `helpers.js`) plus the shared `.claude/skills/canicode-gotchas/SKILL.md` answer file when needed.
|
|
84
|
-
3. In Agent chat, @-mention **canicode-gotchas** (survey) or **canicode-roundtrip** (full roundtrip) and pass a Figma URL — same tool names and JSON as Claude Code (`gotcha-survey`, `analyze`, etc.).
|
|
85
|
-
|
|
86
|
-
**If you only want analysis (no writes back to Figma):**
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
# CLI — one command
|
|
90
|
-
npx canicode analyze "https://www.figma.com/design/ABC123/MyDesign?node-id=1-234"
|
|
91
|
-
|
|
92
|
-
# MCP Server — works with Claude Code, Cursor, Claude Desktop
|
|
93
|
-
claude mcp add canicode -- npx --yes --package=canicode canicode-mcp
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
Restart Claude Code or reload MCP (Cursor) so canicode tools (`analyze`, `gotcha-survey`, …) load — same cold-session requirement as the Figma MCP.
|
|
97
|
-
|
|
98
|
-
**Smoke test (no Figma token needed):**
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
git clone https://github.com/let-sunny/canicode.git
|
|
102
|
-
cd canicode && pnpm install && pnpm build
|
|
103
|
-
canicode analyze ./fixtures/done/desktop-home-page
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
Loads a bundled fixture (no Figma API call, no token), opens the HTML report in a browser (pass `--no-open` to skip auto-launch). Use any directory under `fixtures/done/` — `desktop-*` are screen-scale, `mobile-*` are mobile viewports.
|
|
107
|
-
|
|
108
|
-
<details>
|
|
109
|
-
<summary><strong>All channels</strong></summary>
|
|
110
|
-
|
|
111
|
-
| Channel | Best for |
|
|
112
|
-
|---------|----------|
|
|
113
|
-
| **[Web App](https://let-sunny.github.io/canicode/)** | Quick check, no install |
|
|
114
|
-
| **[Figma Plugin](https://www.figma.com/community/plugin/1617144221046795292/canicode)** | Analyze inside Figma (under review) |
|
|
115
|
-
| **MCP Server** | Claude Code / Cursor / Claude Desktop integration |
|
|
116
|
-
| **`/canicode-roundtrip` Skill** | Full design-to-code roundtrip via Claude Code (analyze → fix → re-analyze → handoff) |
|
|
117
|
-
| **`/canicode` Skill** | Lightweight analyze-only skill, no MCP install |
|
|
118
|
-
| **CLI** | Full control, CI/CD, offline analysis |
|
|
119
|
-
| **[GitHub Action](https://github.com/marketplace/actions/canicode-action)** | PR gate with score threshold |
|
|
120
|
-
|
|
121
|
-
</details>
|
|
100
|
+
> **Optional — Code Connect** (for the closing Step 6 mapping): install `@figma/code-connect` and create `figma.config.json` at your repo root per [Figma's setup guide](https://www.figma.com/code-connect-docs/), then run `canicode doctor`. If you skip this, the roundtrip still works — it just does not register the mapping. It warns you up front so you can decide.
|
|
122
101
|
|
|
123
102
|
---
|
|
124
103
|
|
|
@@ -128,7 +107,7 @@ Loads a bundled fixture (no Figma API call, no token), opens the HTML report in
|
|
|
128
107
|
|----------|:-----:|------------------|
|
|
129
108
|
| **Pixel Critical** | 3 | Can AI read the layout? (Auto Layout, absolute positioning, groups) |
|
|
130
109
|
| **Responsive Critical** | 2 | Will it work at different viewports? (fixed sizing, size constraints) |
|
|
131
|
-
| **Code Quality** |
|
|
110
|
+
| **Code Quality** | 5 | Is the design efficient for AI context? (components, variants, nesting, Code Connect coverage) |
|
|
132
111
|
| **Token Management** | 2 | Can AI reproduce exact values? (raw values, spacing grid) |
|
|
133
112
|
| **Interaction** | 2 | Can AI know what happens? (state variants, prototypes) |
|
|
134
113
|
| **Semantic** | 3 | Can AI infer meaning? (semantic names, conventions) |
|
|
@@ -139,6 +118,8 @@ Each issue is classified: **Blocking** > **Risk** > **Missing Info** > **Suggest
|
|
|
139
118
|
|
|
140
119
|
## Installation — pick one
|
|
141
120
|
|
|
121
|
+
> **Token safety:** never paste your Figma token into Claude / Cursor / agent chat — session logs can retain it. Use the CLI prompt (`npx canicode init`), `--token`, or the `FIGMA_TOKEN=…` env var.
|
|
122
|
+
|
|
142
123
|
Each row below is a **complete** install. Don't run more than one — they cover overlapping use cases.
|
|
143
124
|
|
|
144
125
|
| If you use… | Install |
|