canicode 0.10.2 → 0.10.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/README.md CHANGED
@@ -44,7 +44,7 @@ Rule scores aren't guesswork. The calibration pipeline converts real Figma desig
44
44
  - ✅ **scene write succeeded** — the property was written directly to the scene node or instance override.
45
45
  - 📝 **annotated the scene node** — the skill left a structured annotation instead of writing the property. This is the [ADR-012](.claude/docs/ADR.md) default for instance-child layout writes, because propagating a property to the component definition (and therefore every instance of it) is almost never what the user wants. **A summary full of 📝 markers is correct behavior, not failure.**
46
46
  - 🌐 **definition write propagated** — the property was written to the component definition and every instance inherited it. Only happens when the user opted in up front with `allowDefinitionWrite`.
47
- 4. **Re-analyze** — verify the grade improved. Repeat step 2 if new gotchas surface.
47
+ 4. **Re-analyze** — verify the gotchas were addressed (grade movement is a side-effect). Repeat step 2 if new gotchas surface.
48
48
  5. **Hand off** to `figma-implement-design` — canicode's scope ends here ([ADR-013](.claude/docs/ADR.md)). Figma's official code-generation skill takes the now-clean design and produces code.
49
49
 
50
50
  ---
@@ -72,7 +72,7 @@ npx canicode init --token figd_xxxxxxxxxxxxx
72
72
  npx canicode analyze "https://www.figma.com/design/ABC123/MyDesign?node-id=1-234"
73
73
 
74
74
  # MCP Server — works with Claude Code, Cursor, Claude Desktop
75
- claude mcp add canicode -- npx -y -p canicode canicode-mcp
75
+ claude mcp add canicode -- npx --yes --package=canicode canicode-mcp
76
76
  ```
77
77
 
78
78
  <details>
@@ -107,68 +107,73 @@ Each issue is classified: **Blocking** > **Risk** > **Missing Info** > **Suggest
107
107
 
108
108
  ---
109
109
 
110
- ## Installation
110
+ ## Installation — pick one
111
+
112
+ Each row below is a **complete** install. Don't run more than one — they cover overlapping use cases. (#367)
113
+
114
+ | If you use… | Install |
115
+ |-------------|---------|
116
+ | **Claude Code** (recommended for the roundtrip workflow) | `npx canicode init --token figd_xxxxxxxxxxxxx` — saves the token AND drops `/canicode`, `/canicode-gotchas`, `/canicode-roundtrip` skills into `./.claude/skills/`. The skills already know how to call canicode via `npx canicode …`, no MCP install needed. |
117
+ | **Cursor / Claude Desktop / other MCP host** | `claude mcp add canicode -- npx --yes --package=canicode canicode-mcp` — registers the MCP server. |
118
+ | **Just the CLI** (CI, scripts) | Nothing. `npx canicode analyze "<figma-url>"` works directly. Run `canicode init --token …` once if you want the token persisted to `~/.canicode/config.json`. |
119
+
120
+ > **Get your token:** Figma → Settings → Security → Personal access tokens → Generate new token
121
+
122
+ > **Roundtrip prerequisite:** the `/canicode-roundtrip` skill calls the Figma MCP server to read and write the design. Install it once with `claude mcp add -s project -t http figma https://mcp.figma.com/mcp` and restart Claude Code so the new MCP tools load.
111
123
 
112
124
  <details>
113
- <summary><strong>CLI</strong></summary>
125
+ <summary><strong>Claude Code Skills</strong> — install details</summary>
114
126
 
115
127
  ```bash
116
- npx canicode analyze "https://www.figma.com/design/ABC123/MyDesign?node-id=1-234"
128
+ npx canicode init --token figd_xxxxxxxxxxxxx
117
129
  ```
118
130
 
119
- Setup: `npx canicode init --token figd_xxxxxxxxxxxxx` — saves the token AND installs the Claude Code skills (see below).
120
-
121
- > **Get your token:** Figma → Settings → Security → Personal access tokens → Generate new token
131
+ Drops three skills into `./.claude/skills/`:
122
132
 
123
- **Figma API Rate Limits** — Rate limits depend on **where the file lives**, not just your plan.
133
+ - **canicode**lightweight CLI wrapper (use `/canicode <figma-url>`)
134
+ - **canicode-gotchas** — standalone gotcha survey (use `/canicode-gotchas <figma-url>`)
135
+ - **canicode-roundtrip** — full analyze → gotcha → apply roundtrip (use `/canicode-roundtrip <figma-url>`)
124
136
 
125
- | Seat | File in Starter plan | File in Pro/Org/Enterprise |
126
- |------|---------------------|---------------------------|
127
- | View, Collab | 6 req/month | 6 req/month |
128
- | Dev, Full | 6 req/month | 10–20 req/min |
137
+ The skills shell out to `npx canicode …` for analyze / gotcha-survey when the canicode MCP server is not installed — both paths produce the same JSON shape. The Figma MCP server is still required for the apply step (Step 4 in `/canicode-roundtrip`); see the prereq note above.
129
138
 
130
- Hitting 429 errors? Make sure the file is in a paid workspace. Or save a fixture once and analyze locally. [Full details](https://developers.figma.com/docs/rest-api/rate-limits/)
139
+ Flags: `--global` installs into `~/.claude/skills/` instead. `--no-skills` skips skill install (token only). `--force` overwrites existing skill files without prompting. Run `canicode docs setup` for the full setup guide.
131
140
 
132
141
  </details>
133
142
 
134
143
  <details>
135
- <summary><strong>MCP Server</strong> (Claude Code / Cursor / Claude Desktop)</summary>
144
+ <summary><strong>MCP Server</strong> install details</summary>
136
145
 
137
146
  ```bash
138
- claude mcp add canicode -- npx -y -p canicode canicode-mcp
139
- claude mcp add -s project -t http figma https://mcp.figma.com/mcp
147
+ claude mcp add canicode -- npx --yes --package=canicode canicode-mcp
140
148
  ```
141
149
 
142
150
  Then ask: *"Analyze this Figma design: https://www.figma.com/design/..."*
143
151
 
144
- canicode's rule engine analyzes the design data — the AI assistant just orchestrates the calls.
152
+ canicode's rule engine analyzes the design data — the AI assistant just orchestrates the calls. The MCP server reads `FIGMA_TOKEN` from `~/.canicode/config.json` (set via `canicode init --token …`) or from the host's environment, so passing `-e FIGMA_TOKEN=…` to `claude mcp add` is **not** required and the current parser rejects it anyway (#364).
145
153
 
146
- With a Figma API token:
147
- ```bash
148
- claude mcp add canicode -e FIGMA_TOKEN=figd_xxxxxxxxxxxxx -- npx -y -p canicode canicode-mcp
149
- ```
154
+ If you genuinely need a per-server token without using `canicode init`, export it on the calling shell instead: `export FIGMA_TOKEN=figd_xxxxxxxxxxxxx`.
150
155
 
151
156
  For Cursor / Claude Desktop config, see [`docs/CUSTOMIZATION.md`](docs/CUSTOMIZATION.md).
152
157
 
153
158
  </details>
154
159
 
155
-
156
160
  <details>
157
- <summary><strong>Claude Code Skills</strong> (lightweight, no MCP install)</summary>
161
+ <summary><strong>CLI</strong> install details</summary>
158
162
 
159
163
  ```bash
160
- npx canicode init --token figd_xxxxxxxxxxxxx
164
+ npx canicode analyze "https://www.figma.com/design/ABC123/MyDesign?node-id=1-234"
161
165
  ```
162
166
 
163
- Saves your Figma token AND installs three skills into `./.claude/skills/`:
167
+ Setup: `npx canicode init --token figd_xxxxxxxxxxxxx` saves the token (and installs the Claude Code skills as a bonus — pass `--no-skills` to skip).
164
168
 
165
- - **canicode**lightweight CLI wrapper (use `/canicode <figma-url>`)
166
- - **canicode-gotchas** — standalone gotcha survey (use `/canicode-gotchas <figma-url>`)
167
- - **canicode-roundtrip** — full analyze → gotcha → apply roundtrip (use `/canicode-roundtrip <figma-url>`)
169
+ **Figma API Rate Limits** — Rate limits depend on **where the file lives**, not just your plan.
168
170
 
169
- > **Next:** install the Figma MCP server (`claude mcp add -s project -t http figma https://mcp.figma.com/mcp`) and restart Claude Code so both the skills and the MCP tools load. See the **MCP Server** section above for context.
171
+ | Seat | File in Starter plan | File in Pro/Org/Enterprise |
172
+ |------|---------------------|---------------------------|
173
+ | View, Collab | 6 req/month | 6 req/month |
174
+ | Dev, Full | 6 req/month | 10–20 req/min |
170
175
 
171
- Flags: `--global` installs into `~/.claude/skills/` instead. `--no-skills` skips skill install (token only). `--force` overwrites existing skill files without prompting. Run `canicode docs setup` for the full setup guide.
176
+ Hitting 429 errors? Make sure the file is in a paid workspace. Or save a fixture once and analyze locally. [Full details](https://developers.figma.com/docs/rest-api/rate-limits/)
172
177
 
173
178
  </details>
174
179