canicode 0.10.3 → 0.10.5
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 +35 -30
- package/dist/cli/index.js +358 -24
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +257 -3
- package/dist/index.js +96 -12
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.js +157 -26
- package/dist/mcp/server.js.map +1 -1
- package/package.json +2 -1
- package/skills/canicode-gotchas/SKILL.md +66 -28
- package/skills/canicode-roundtrip/SKILL.md +180 -79
- package/skills/canicode-roundtrip/helpers.js +218 -2
package/README.md
CHANGED
|
@@ -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
|
|
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>
|
|
125
|
+
<summary><strong>Claude Code Skills</strong> — install details</summary>
|
|
114
126
|
|
|
115
127
|
```bash
|
|
116
|
-
npx canicode
|
|
128
|
+
npx canicode init --token figd_xxxxxxxxxxxxx
|
|
117
129
|
```
|
|
118
130
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
> **Get your token:** Figma → Settings → Security → Personal access tokens → Generate new token
|
|
131
|
+
Drops three skills into `./.claude/skills/`:
|
|
122
132
|
|
|
123
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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>
|
|
144
|
+
<summary><strong>MCP Server</strong> — install details</summary>
|
|
136
145
|
|
|
137
146
|
```bash
|
|
138
|
-
claude mcp add canicode -- npx
|
|
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
|
-
|
|
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>
|
|
161
|
+
<summary><strong>CLI</strong> — install details</summary>
|
|
158
162
|
|
|
159
163
|
```bash
|
|
160
|
-
npx canicode
|
|
164
|
+
npx canicode analyze "https://www.figma.com/design/ABC123/MyDesign?node-id=1-234"
|
|
161
165
|
```
|
|
162
166
|
|
|
163
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|