Commit caec6243 authored by Irun's avatar Irun
Browse files

Trying out web socket workaround

parent 8655299a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
# CC Marketplace

Add to you Claude Code by `/plugin marketplace add https://repository.rollingglory.com/rollingglory/rnd/cc-marketplace.git`
Add to you Claude Code by `/plugin marketplace add https://repository.rollingglory.com/irun/cc-marketplace.git`
+4 −11
Original line number Diff line number Diff line
---
description: For extracting selected Figma page design into images, tokens json, and a markdown representation.
argument-hint: Figma plugin channel and/or page name override
description: A workaround to help the user call the actual script for this functionality
disable-model-invocation: true
model: haiku
---

Run the extract script:
Just run:

```bash
node ${CLAUDE_SKILL_DIR}/scripts/extract.js <channel> -n <page-name-override>
node ${CLAUDE_SKILL_DIR}/scripts/get-instruction.js
```

A previous channel might've been saved in a file and will be used by the script.

On success, tell the user to manually check the result, and correct it if needed. Next possible skills: `implement`, `improve`.

Pass any errors to the user.

This needs `https://www.figma.com/community/plugin/1485687494525374295/cursor-talk-to-figma-mcp-plugin` opened in a Figma file, connected to a channel, with a page/screen element selected to work. If the process takes a long time, the user might need to keep the Figma app / web page on the foreground.
This skill and script is just a workaround to give the user the exact cli command to call a script in this plugin, because the script might conflict with Claude Code's permission.
+26 −0
Original line number Diff line number Diff line
// Inside your skill's JS file
import { writeFileSync } from 'fs';
import { join, dirname } from 'path';
import { fileURLToPath } from 'url';

const __dirname = dirname(fileURLToPath(import.meta.url));
const scriptPath = join(__dirname, 'extract.js');
const command = `Command + path to extract:

\`\`\`
node ${scriptPath}
\`\`\`

node ${scriptPath} [CHANNEL] [-n = PAGE_NAME_OVERRIDE]

This needs \`https://www.figma.com/community/plugin/1485687494525374295/cursor-talk-to-figma-mcp-plugin\` opened in a Figma file, connected to a channel, with a page/screen element selected to work.

If a previous channel is saved, the script will try to use it as a fallback.

An invalid channel might fail silently!

If image export takes a long time, you might need to keep the Figma app / web page on the foreground.
`;

// Write to the project directory (cwd = the user's project when Claude Code runs)
writeFileSync(join(process.cwd(), '.figma-to-code', 'extraction.md'), command);
 No newline at end of file