canicode 0.11.4 → 0.11.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/.claude-plugin/marketplace.json +13 -0
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +20 -3
- package/dist/cli/index.js +7 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/server.js.map +1 -1
- package/docs/CUSTOMIZATION.md +41 -0
- package/package.json +1 -1
- package/skills/canicode-roundtrip/helpers-bootstrap.js +1 -1
- package/skills/canicode-roundtrip/helpers-installer.js +1 -1
- package/skills/cursor/canicode-roundtrip/helpers-bootstrap.js +1 -1
- package/skills/cursor/canicode-roundtrip/helpers-installer.js +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "canicode",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "let-sunny"
|
|
5
|
+
},
|
|
6
|
+
"plugins": [
|
|
7
|
+
{
|
|
8
|
+
"name": "canicode",
|
|
9
|
+
"source": ".",
|
|
10
|
+
"description": "Lint Figma designs for AI code-gen and roundtrip the answers back into the file. CLI + MCP server."
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
package/README.md
CHANGED
|
@@ -90,6 +90,16 @@ claude mcp add canicode -- npx --yes --package=canicode canicode-mcp
|
|
|
90
90
|
|
|
91
91
|
Restart Claude Code or reload MCP (Cursor) so canicode tools (`analyze`, `gotcha-survey`, …) load — same cold-session requirement as the Figma MCP (#433).
|
|
92
92
|
|
|
93
|
+
**Smoke test (no Figma token needed):**
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
git clone https://github.com/let-sunny/canicode.git
|
|
97
|
+
cd canicode && pnpm install && pnpm build
|
|
98
|
+
canicode analyze ./fixtures/done/desktop-home-page
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
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.
|
|
102
|
+
|
|
93
103
|
<details>
|
|
94
104
|
<summary><strong>All channels</strong></summary>
|
|
95
105
|
|
|
@@ -128,11 +138,14 @@ Each row below is a **complete** install. Don't run more than one — they cover
|
|
|
128
138
|
|
|
129
139
|
| If you use… | Install |
|
|
130
140
|
|-------------|---------|
|
|
131
|
-
| **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. |
|
|
141
|
+
| **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 …`, so no **canicode** MCP install is needed; the **Figma** MCP is still required for the `/canicode-roundtrip` apply step — see the prereq below. |
|
|
132
142
|
| **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`. |
|
|
143
|
+
| **OpenClaw / other AgentSkills-compatible host** | Manual skill copy — see [Other agents (manual install)](docs/CUSTOMIZATION.md#other-agents-manual-install). Best-effort docs, not a support commitment. |
|
|
133
144
|
| **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`. |
|
|
134
145
|
|
|
135
|
-
> **Get your token:** Figma → Settings → Security → Personal access tokens → Generate new token
|
|
146
|
+
> **Get your token:** Figma → Settings → Security → Personal access tokens → Generate new token. [Figma's PAT docs](https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens)
|
|
147
|
+
> **Scope:** Read-only is sufficient for canicode.
|
|
148
|
+
> **Expiry:** Tokens default to 90 days; check the dropdown when generating.
|
|
136
149
|
|
|
137
150
|
> **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.
|
|
138
151
|
|
|
@@ -150,9 +163,11 @@ Drops three skills into `./.claude/skills/`:
|
|
|
150
163
|
- **canicode-gotchas** — standalone gotcha survey (use `/canicode-gotchas <figma-url>`)
|
|
151
164
|
- **canicode-roundtrip** — full analyze → gotcha → apply roundtrip (use `/canicode-roundtrip <figma-url>`)
|
|
152
165
|
|
|
166
|
+
> The install copies 7 files total — the three SKILL.md files above plus four canicode-roundtrip helper files (`helpers.js`, `helpers-bootstrap.js`, `helpers-installer.js`, `canicode-roundtrip-helpers.d.ts`) used by the roundtrip Step 4 apply path. The CLI summary's `files installed: 7` reflects this file count.
|
|
167
|
+
|
|
153
168
|
> **Explicit invocation:** the SKILL.md `description` fields advertise TRIGGER conditions so the model auto-routes Figma-URL prompts to the right skill, but routing is non-deterministic. For deterministic invocation, type `/canicode <figma-url>`, `/canicode-gotchas <figma-url>`, or `/canicode-roundtrip <figma-url>` directly — the slash command bypasses model-based routing.
|
|
154
169
|
|
|
155
|
-
The skills shell out to `npx canicode …` for analyze / gotcha-survey
|
|
170
|
+
The skills shell out to `npx canicode …` for analyze / gotcha-survey, so installing the **canicode** MCP server is optional (both paths produce the same JSON shape). The **Figma** MCP server, however, is required for the apply step (Step 4 in `/canicode-roundtrip`); see the prereq note above.
|
|
156
171
|
|
|
157
172
|
Flags: `--global` installs into `~/.claude/skills/` instead. `--cursor-skills` also installs Cursor copies under `.cursor/skills/`. `--force` overwrites existing skill files without prompting. Run `canicode docs setup` for the full setup guide.
|
|
158
173
|
|
|
@@ -184,6 +199,8 @@ For Cursor / Claude Desktop config, see [`docs/CUSTOMIZATION.md`](docs/CUSTOMIZA
|
|
|
184
199
|
npx canicode analyze "https://www.figma.com/design/ABC123/MyDesign?node-id=1-234"
|
|
185
200
|
```
|
|
186
201
|
|
|
202
|
+
> Pass `--ready-min-grade <S|A+|A|B+|B|C+|C|D|F>` to override the codegen-readiness threshold (default: A; from #483).
|
|
203
|
+
|
|
187
204
|
Setup: `npx canicode init --token figd_xxxxxxxxxxxxx` saves the token and installs the Claude Code skills into `./.claude/skills/`.
|
|
188
205
|
|
|
189
206
|
**Figma API Rate Limits** — Rate limits depend on **where the file lives**, not just your plan.
|
package/dist/cli/index.js
CHANGED
|
@@ -4245,7 +4245,7 @@ function computeApplyContext(violation, instanceContext) {
|
|
|
4245
4245
|
}
|
|
4246
4246
|
|
|
4247
4247
|
// package.json
|
|
4248
|
-
var version2 = "0.11.
|
|
4248
|
+
var version2 = "0.11.5";
|
|
4249
4249
|
|
|
4250
4250
|
// src/core/engine/scoring.ts
|
|
4251
4251
|
var GRADE_ORDER = ["S", "A+", "A", "B+", "B", "C+", "C", "D", "F"];
|
|
@@ -7268,9 +7268,9 @@ async function runInitSkillInstallSteps(options) {
|
|
|
7268
7268
|
});
|
|
7269
7269
|
console.log(`
|
|
7270
7270
|
Skills installed to: ${summary.targetDir}/`);
|
|
7271
|
-
console.log(` installed: ${summary.installed.length}`);
|
|
7272
|
-
console.log(` overwritten: ${summary.overwritten.length}`);
|
|
7273
|
-
console.log(` skipped: ${summary.skipped.length}`);
|
|
7271
|
+
console.log(` files installed: ${summary.installed.length}`);
|
|
7272
|
+
console.log(` files overwritten: ${summary.overwritten.length}`);
|
|
7273
|
+
console.log(` files skipped: ${summary.skipped.length}`);
|
|
7274
7274
|
if (summary.skipped.length > 0) {
|
|
7275
7275
|
console.log(` (Re-run with --force to overwrite skipped files.)`);
|
|
7276
7276
|
}
|
|
@@ -7294,9 +7294,9 @@ async function runInitSkillInstallSteps(options) {
|
|
|
7294
7294
|
});
|
|
7295
7295
|
console.log(`
|
|
7296
7296
|
Cursor skills installed to: ${cSummary.targetDir}/`);
|
|
7297
|
-
console.log(` installed: ${cSummary.installed.length}`);
|
|
7298
|
-
console.log(` overwritten: ${cSummary.overwritten.length}`);
|
|
7299
|
-
console.log(` skipped: ${cSummary.skipped.length}`);
|
|
7297
|
+
console.log(` files installed: ${cSummary.installed.length}`);
|
|
7298
|
+
console.log(` files overwritten: ${cSummary.overwritten.length}`);
|
|
7299
|
+
console.log(` files skipped: ${cSummary.skipped.length}`);
|
|
7300
7300
|
if (cSummary.skipped.length > 0) {
|
|
7301
7301
|
console.log(` (Re-run with --force to overwrite skipped files.)`);
|
|
7302
7302
|
}
|