canicode 0.10.0 → 0.10.2

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
@@ -57,7 +57,7 @@ Rule scores aren't guesswork. The calibration pipeline converts real Figma desig
57
57
 
58
58
  ```bash
59
59
  # 1. Save your Figma token AND install the /canicode-roundtrip skill
60
- canicode init --token figd_xxxxxxxxxxxxx
60
+ npx canicode init --token figd_xxxxxxxxxxxxx
61
61
 
62
62
  # 2. Run the roundtrip on a Figma URL
63
63
  /canicode-roundtrip https://www.figma.com/design/ABC123/MyDesign?node-id=1-234
@@ -116,7 +116,7 @@ Each issue is classified: **Blocking** > **Risk** > **Missing Info** > **Suggest
116
116
  npx canicode analyze "https://www.figma.com/design/ABC123/MyDesign?node-id=1-234"
117
117
  ```
118
118
 
119
- Setup: `canicode init --token figd_xxxxxxxxxxxxx` — saves the token AND installs the Claude Code skills (see below).
119
+ Setup: `npx canicode init --token figd_xxxxxxxxxxxxx` — saves the token AND installs the Claude Code skills (see below).
120
120
 
121
121
  > **Get your token:** Figma → Settings → Security → Personal access tokens → Generate new token
122
122
 
@@ -157,7 +157,7 @@ For Cursor / Claude Desktop config, see [`docs/CUSTOMIZATION.md`](docs/CUSTOMIZA
157
157
  <summary><strong>Claude Code Skills</strong> (lightweight, no MCP install)</summary>
158
158
 
159
159
  ```bash
160
- canicode init --token figd_xxxxxxxxxxxxx
160
+ npx canicode init --token figd_xxxxxxxxxxxxx
161
161
  ```
162
162
 
163
163
  Saves your Figma token AND installs three skills into `./.claude/skills/`:
@@ -166,6 +166,8 @@ Saves your Figma token AND installs three skills into `./.claude/skills/`:
166
166
  - **canicode-gotchas** — standalone gotcha survey (use `/canicode-gotchas <figma-url>`)
167
167
  - **canicode-roundtrip** — full analyze → gotcha → apply roundtrip (use `/canicode-roundtrip <figma-url>`)
168
168
 
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.
170
+
169
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.
170
172
 
171
173
  </details>
package/dist/cli/index.js CHANGED
@@ -4015,7 +4015,7 @@ function computeApplyContext(violation, instanceContext) {
4015
4015
  }
4016
4016
 
4017
4017
  // package.json
4018
- var version2 = "0.10.0";
4018
+ var version2 = "0.10.2";
4019
4019
 
4020
4020
  // src/core/engine/scoring.ts
4021
4021
  function computeTotalScorePerCategory(configs) {
@@ -6166,6 +6166,38 @@ async function promptOverwriteBatch(candidates) {
6166
6166
  }
6167
6167
 
6168
6168
  // src/cli/commands/init.ts
6169
+ function figmaMcpRegistered(cwd = process.cwd()) {
6170
+ try {
6171
+ const raw = readFileSync(join(cwd, ".mcp.json"), "utf-8");
6172
+ const parsed = JSON.parse(raw);
6173
+ const figma = parsed?.mcpServers?.["figma"];
6174
+ return typeof figma === "object" && figma !== null;
6175
+ } catch {
6176
+ return false;
6177
+ }
6178
+ }
6179
+ function formatNextSteps(opts) {
6180
+ if (!opts.skillsInstalled) {
6181
+ return `
6182
+ Next: canicode analyze "https://www.figma.com/design/..."`;
6183
+ }
6184
+ if (opts.figmaMcpPresent) {
6185
+ return [
6186
+ "",
6187
+ " Next:",
6188
+ " 1. Restart Claude Code (the newly installed skills only load on a fresh session)",
6189
+ " 2. Run /canicode-roundtrip <figma-url>"
6190
+ ].join("\n");
6191
+ }
6192
+ return [
6193
+ "",
6194
+ " Next:",
6195
+ " 1. Install Figma MCP:",
6196
+ " claude mcp add -s project -t http figma https://mcp.figma.com/mcp",
6197
+ " 2. Restart Claude Code (so the new skills + Figma MCP tools both load)",
6198
+ " 3. Run /canicode-roundtrip <figma-url>"
6199
+ ].join("\n");
6200
+ }
6169
6201
  var InitOptionsSchema = z.object({
6170
6202
  token: z.string().optional(),
6171
6203
  global: z.boolean().optional(),
@@ -6227,8 +6259,12 @@ ${msg}`);
6227
6259
  ...skillSummary ?? {}
6228
6260
  });
6229
6261
  if (skillStepOk) {
6230
- console.log(`
6231
- Next: canicode analyze "https://www.figma.com/design/..."`);
6262
+ console.log(
6263
+ formatNextSteps({
6264
+ figmaMcpPresent: figmaMcpRegistered(),
6265
+ skillsInstalled: options.skills !== false
6266
+ })
6267
+ );
6232
6268
  }
6233
6269
  return;
6234
6270
  }