canicode 0.10.4 → 0.11.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/README.md +9 -2
- package/dist/cli/index.js +559 -141
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +254 -19
- package/dist/index.js +256 -73
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.js +242 -81
- package/dist/mcp/server.js.map +1 -1
- package/docs/CUSTOMIZATION.md +39 -3
- package/package.json +1 -1
- package/skills/canicode-gotchas/SKILL.md +17 -14
- package/skills/canicode-roundtrip/SKILL.md +12 -11
- package/skills/canicode-roundtrip/helpers.js +1 -1
- package/skills/cursor/canicode/SKILL.md +76 -0
- package/skills/cursor/canicode-gotchas/SKILL.md +199 -0
- package/skills/cursor/canicode-roundtrip/SKILL.md +618 -0
- package/skills/cursor/canicode-roundtrip/helpers.js +523 -0
package/README.md
CHANGED
|
@@ -65,6 +65,12 @@ npx canicode init --token figd_xxxxxxxxxxxxx
|
|
|
65
65
|
|
|
66
66
|
> **Prerequisite:** the 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` — see the **MCP Server** install section below.
|
|
67
67
|
|
|
68
|
+
**CanICode in Cursor (no Claude Code required):**
|
|
69
|
+
|
|
70
|
+
1. Add **canicode** and **Figma** MCPs — [Cursor MCP](docs/CUSTOMIZATION.md#cursor-mcp-canicode) for `npx` → `canicode-mcp`; Figma MCP is required for **`use_figma`** if you run **roundtrip** (design writes), not for analyze-only.
|
|
71
|
+
2. `npx canicode init --token figd_xxxxxxxxxxxxx --cursor-skills` — 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.
|
|
72
|
+
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.).
|
|
73
|
+
|
|
68
74
|
**If you only want analysis (no writes back to Figma):**
|
|
69
75
|
|
|
70
76
|
```bash
|
|
@@ -114,7 +120,7 @@ Each row below is a **complete** install. Don't run more than one — they cover
|
|
|
114
120
|
| If you use… | Install |
|
|
115
121
|
|-------------|---------|
|
|
116
122
|
| **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** |
|
|
123
|
+
| **Cursor / Claude Desktop / other MCP host** | Add canicode to the host’s MCP config — see [`docs/CUSTOMIZATION.md`](docs/CUSTOMIZATION.md#cursor-mcp-canicode). Example (Cursor project file): `npx` + `canicode-mcp` via `--package=canicode`. |
|
|
118
124
|
| **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
125
|
|
|
120
126
|
> **Get your token:** Figma → Settings → Security → Personal access tokens → Generate new token
|
|
@@ -153,7 +159,7 @@ canicode's rule engine analyzes the design data — the AI assistant just orches
|
|
|
153
159
|
|
|
154
160
|
If you genuinely need a per-server token without using `canicode init`, export it on the calling shell instead: `export FIGMA_TOKEN=figd_xxxxxxxxxxxxx`.
|
|
155
161
|
|
|
156
|
-
For Cursor / Claude Desktop config, see [`docs/CUSTOMIZATION.md`](docs/CUSTOMIZATION.md).
|
|
162
|
+
For Cursor / Claude Desktop config, see [`docs/CUSTOMIZATION.md`](docs/CUSTOMIZATION.md) — especially [Cursor MCP (canicode)](docs/CUSTOMIZATION.md#cursor-mcp-canicode) and the **Manual test checklist (#407)** for verifying `gotcha-survey` end-to-end.
|
|
157
163
|
|
|
158
164
|
</details>
|
|
159
165
|
|
|
@@ -200,6 +206,7 @@ Posts analysis as a PR comment. Fails if score is below threshold. See [**canico
|
|
|
200
206
|
|------|-----|
|
|
201
207
|
| **Presets** | `--preset relaxed \| dev-friendly \| ai-ready \| strict` |
|
|
202
208
|
| **Config overrides** | `--config ./config.json` — adjust scores, severity, exclude nodes |
|
|
209
|
+
| **Analysis scope** | `--scope page \| component` — override auto-detection when a `COMPONENT`-rooted design should be analyzed as a page (or vice versa) |
|
|
203
210
|
|
|
204
211
|
See [`docs/CUSTOMIZATION.md`](docs/CUSTOMIZATION.md) for the full guide, examples, and all available options.
|
|
205
212
|
|