code-connect
Use when Figma components should point at the project's blocks and Blade components through Code Connect - reading the existing map, proposing new mappings from the block catalog, flagging components
SKILL.mdplugins/kivo-creator/skills/code-connect/SKILL.md
GitHubCode Connect
Mapped components make matching deterministic: a section whose Figma component is mapped to a block is filled without judgment. This skill creates those mappings, carefully, because they change a shared Figma file.
When to use
- "Connect our Figma components to the code", "set up Code Connect".
figma-ingestreported components without mappings that keep appearing.- Not for ingesting a page (
figma-ingest).
Inputs required
- A Figma file or frame URL.
- The Figma MCP tools in this session (names ending in
get_metadata,get_code_connect_map,send_code_connect_mappings). - The target project root and the kivo-creator plugin root (two levels above this skill's folder).
Procedure
If the Figma tools are missing, stop with the connection steps from
figma-ingest.Call
get_metadatafor the frame and save it (for example.creator/figma-metadata.xml); callget_code_connect_mapand save it (.creator/figma-code-connect.json).Propose:
node <kivo-creator>/scripts/code-connect.mjs --metadata=.creator/figma-metadata.xml --map=.creator/figma-code-connect.json --project=. --out=.creator/code-connect.jsonShow three lists: already mapped (component and code), proposed (component, block or Blade component, score) and without a code counterpart. For each proposal, read the target's source file and drop proposals whose purpose does not match.
Ask the person to approve the exact list to send. Change nothing in Figma before that answer: end the turn with the question.
After approval (a later message), call
send_code_connect_mappingsonce with the approved mappings, built from the tool's own input schema (node id, component name, source path, label). Do not send rejected or unreviewed items.Call
get_code_connect_mapagain and report what changed. List the unmatched components as candidates for new blocks or Blade components; do not create them here.
Verification
- The map read after sending contains every approved mapping and nothing else new.
- No
send_code_connect_mappingscall happened before the approval message.
Failure modes
| Symptom | Cause | Fix |
|---|---|---|
| Send fails with a permission error | The account cannot edit the file or has no Code Connect access | Report it; the proposal file stays for someone with access |
| A proposal maps a card to a whole section block | Name similarity is not purpose | Drop it in step 4; map cards to Blade components instead |
| Everything is unmatched | Component names share no words with the code | Propose by hand from the catalog, still with approval |
| Mapped source path does not exist | The map points at a moved or deleted file | Flag it; propose the new path for approval |
Escalation
Every send needs the person's explicit approval of the list. Ask before overwriting a mapping someone else created.