Skip to content

docs(moai-design-tools): correct Figma MCP reference to match plugin v2.1.7#690

Open
gbrinan wants to merge 1 commit intomodu-ai:mainfrom
gbrinan:fix/figma-mcp-docs-v2.1.7
Open

docs(moai-design-tools): correct Figma MCP reference to match plugin v2.1.7#690
gbrinan wants to merge 1 commit intomodu-ai:mainfrom
gbrinan:fix/figma-mcp-docs-v2.1.7

Conversation

@gbrinan
Copy link
Copy Markdown

@gbrinan gbrinan commented Apr 21, 2026

Summary

The moai-design-tools skill's Figma MCP reference documentation was drifting from the actual plugin v2.1.7 schemas. Every tool's schema was loaded live in Claude Code via ToolSearch(mcp__plugin_figma_figma__*), compared line-by-line against reference/figma.md, and corrected.

Findings:

  • Prior docs listed 16 tools; plugin v2.1.7 exposes 18 (missing: get_libraries, get_context_for_code_connect)
  • 13 of 16 existing tool entries had incorrect signatures, missing required parameters, or wrong return shapes
  • add_code_connect_map was documented as accepting a mappings array — it actually maps a single node
  • generate_figma_design was documented as (url, targetFileKey?) — it's actually a multi-step capture workflow with no required initial params
  • use_figma was documented as (fileKey, operations) — it's (fileKey, code, description) where code is executable JavaScript
  • get_variable_defs, get_metadata, get_code_connect_map, get_figjam, and others were missing required nodeId parameter
  • create_design_system_rules was described as creating rules inside Figma — it actually returns a prompt for scaffolding repo-level rules
  • SKILL.md allowed-tools registered zero Figma MCP tools despite the skill claiming Figma MCP as one of three core capabilities

Changes

Files touched (both template source and self-hosted):

  • internal/template/templates/.claude/skills/moai-design-tools/SKILL.md + .claude/skills/moai-design-tools/SKILL.md
  • internal/template/templates/.claude/skills/moai-design-tools/reference/figma.md + .claude/skills/moai-design-tools/reference/figma.md
  • internal/template/templates/.claude/skills/moai-design-tools/reference/comparison.md + .claude/skills/moai-design-tools/reference/comparison.md

Per-tool corrections are detailed in the commit message. The rewrite preserves the document structure and all non-Figma sections.

Verification

  • All 18 Figma MCP tool schemas were loaded via Claude Code's ToolSearch and used as the source of truth for every signature, parameter, and return-shape correction
  • Post-edit grep across both template copies: zero stale signatures (e.g. get_variable_defs(fileKey), get_metadata(fileKey), generate_figma_design(url, use_figma(fileKey, operations)) remain; 17 matches for the new correct-signature patterns
  • Implement-design Workflow (Step 3), Design Token Extraction code blocks, and Examples 1/2/3 have been updated so tutorials no longer reference invalid calls

Test plan

  • Run moai update on a test project and confirm reference/figma.md deploys with the 18-tool reference
  • Spot-check one tool signature against plugin v2.1.7 (e.g. get_context_for_code_connect(fileKey, nodeId)) in the deployed template
  • Confirm allowed-tools in SKILL.md now includes the 18 mcp__plugin_figma_figma__* entries

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features
    • Expanded Figma integration with enhanced design reading capabilities, including library access and improved variable extraction
    • New Code Connect workflows for refined design-to-code mapping and template authoring
    • Added FigJam and diagram generation features
    • Improved design system search and file creation functionality

…v2.1.7

Verified all 18 tool signatures against live `mcp__plugin_figma_figma__*`
schemas loaded via ToolSearch in Claude Code. Prior docs only listed 16
tools and contained incorrect signatures in 13 tool entries.

Key corrections in reference/figma.md:
- get_design_context: nodeId is REQUIRED (was optional); add excludeScreenshot /
  forceCode / disableCodeConnect flags; return is {code, assets, screenshot?}
- get_variable_defs: nodeId is REQUIRED (per-node subtree, not per-file);
  return is a flat {variableName: value} map
- get_metadata: nodeId is REQUIRED; returns XML (not JSON); warn about
  Figma Make files
- get_code_connect_map / add_code_connect_map / get_code_connect_suggestions /
  send_code_connect_mappings: nodeId is REQUIRED; add_code_connect_map maps
  a SINGLE node (not an array); enumerate 16 framework label values; add
  optional template / templateDataJson parameters
- get_figjam: nodeId is REQUIRED (use "0:1" for root); add
  includeImagesOfNodes; corrected purpose (generate UI code, FigJam-only)
- generate_diagram: required params are (name, mermaidSyntax), not
  (description, fileKey); creates its own FigJam file; enumerate 6
  supported Mermaid types; surface URL as markdown link
- generate_figma_design: multi-step workflow with no required params on
  initial call; outputMode enum (newFile|existingFile|clipboard); captureId
  polling; Playwright MCP integration for external URLs
- use_figma: required params are (fileKey, code, description); code is
  JavaScript (max 50,000 chars); figma-use skill is MANDATORY prerequisite;
  Inter "Semi Bold" and figma.setCurrentPageAsync gotchas
- search_design_system: fileKey is REQUIRED; add includeLibraryKeys,
  includeComponents/Styles/Variables, disableCodeConnect
- create_new_file: required (fileName, planKey, editorType); editorType
  enum; planKey obtained from whoami()
- create_design_system_rules: returns a PROMPT for repo rules, NOT Figma-
  internal rules; no `rules` parameter

New sections added:
- get_libraries (was missing): returns {subscribed, available} lists with
  {name, key, description, sourceType}; feeds search_design_system's
  includeLibraryKeys
- get_context_for_code_connect (was missing): returns {properties, variants,
  descendantTree} for authoring .figma.ts / .figma.js Code Connect templates

Supporting corrections:
- SKILL.md: allowed-tools now registers all 18 mcp__plugin_figma_figma__*
  tools; tool count "16"→"18" in key strengths and footer
- reference/comparison.md: Tools Count 16→18
- reference/figma.md: fix signatures in implement-design Workflow Step 3,
  Design Token Extraction code blocks, and Examples 1/2/3 so that
  tutorials match the corrected tool signatures
- Footer: Last Updated 2026-04-21; Tool Version notes plugin v2.1.7
  verification

Verification: live tool schemas fetched via Claude Code ToolSearch against
plugin v2.1.7; grep confirms zero stale signatures and 17 correct-signature
matches across both copies (template source and self-hosted).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

Walkthrough

Expanded Figma MCP skill tool surface from 16 to 18 tools across moai-design-tools skill definitions and reference documentation. Updated tool signatures, workflows, and metadata to reflect node-scoped operations, Code Connect enhancements, library discovery capabilities, and design generation flows. Changes applied consistently to both primary and template skill manifests.

Changes

Cohort / File(s) Summary
Figma MCP Skill Manifest
.claude/skills/moai-design-tools/SKILL.md, internal/template/templates/.claude/skills/moai-design-tools/SKILL.md
Extended allowed-tools list with 16 new Figma MCP endpoints including library access (get_libraries), Code Connect operations (get_code_connect_map, add_code_connect_map, get_code_connect_suggestions, send_code_connect_mappings, get_context_for_code_connect), metadata/variables (get_metadata, get_variable_defs), FigJam utilities (get_figjam, generate_diagram), and design system operations. Updated Key Strengths count from 16 to 18 and added documentation subsections (Common Rationalizations, Red Flags, Verification).
Feature Comparison Matrix
.claude/skills/moai-design-tools/reference/comparison.md, internal/template/templates/.claude/skills/moai-design-tools/reference/comparison.md
Updated Figma MCP "Tools Count" from 16 to 18 in feature comparison table.
Figma MCP Tool Reference
.claude/skills/moai-design-tools/reference/figma.md, internal/template/templates/.claude/skills/moai-design-tools/reference/figma.md
Comprehensively revised tool signatures and documentation: refactored operations to be node-scoped (added nodeId parameter to multiple tools), redefined Code Connect workflows with new mapping/suggestion/context endpoints, introduced get_libraries and expanded get_metadata, updated generate_diagram and generate_figma_design for FigJam/diagram workflows, revised use_figma signature to accept code + description, expanded search_design_system with scoping toggles, and updated whoami return shape. Refined workflow examples to reflect new node-scoped token extraction and library-based patterns.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

docs, ai-generated

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating Figma MCP reference documentation to match plugin v2.1.7, including corrections to tool signatures, new tool additions, and SKILL.md configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to moai-adk-go! Thank you for your first pull request.

Our team will review your changes shortly. Before we do, please ensure:

  • All tests pass locally (go test -race ./...)
  • Code follows our coding standards (run golangci-lint run)
  • Commit messages follow Conventional Commits format
  • Templates are regenerated if modified (make build)

This project supports multiple languages for discussion. Feel free to write in your preferred language, though English is recommended for code reviews and commit messages.

Thank you for contributing!

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/skills/moai-design-tools/reference/figma.md:
- Line 67: Update the fenced code blocks in
.claude/skills/moai-design-tools/reference/figma.md to include the language
identifier "text" (e.g., change ``` to ```text) for all signature/example fences
such as the blocks containing get_design_context(...) and generate_diagram(...),
and any other unnamed fences listed (lines referenced in the review). Also
change the lowercase "markdown" instance to the proper noun "Markdown" in the
nearby IMPORTANT note (the line that currently reads "- IMPORTANT: after
calling, you MUST surface the returned URL to the user as a markdown link") so
it reads "Markdown". Ensure all occurrences in the file are updated
consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8c0c01b5-a8ec-4dfd-b9d7-10a82af17721

📥 Commits

Reviewing files that changed from the base of the PR and between 480efd1 and aa6c42f.

📒 Files selected for processing (6)
  • .claude/skills/moai-design-tools/SKILL.md
  • .claude/skills/moai-design-tools/reference/comparison.md
  • .claude/skills/moai-design-tools/reference/figma.md
  • internal/template/templates/.claude/skills/moai-design-tools/SKILL.md
  • internal/template/templates/.claude/skills/moai-design-tools/reference/comparison.md
  • internal/template/templates/.claude/skills/moai-design-tools/reference/figma.md

- Optional: `excludeScreenshot` (screenshots strongly recommended), `forceCode` (always return code even if large), `disableCodeConnect`, `clientFrameworks`, `clientLanguages`
- Returns a code string plus a JSON of asset download URLs and (by default) a screenshot

```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Address markdownlint MD040 (and “Markdown” capitalization) to keep docs lint-clean.

Multiple fenced blocks are missing language identifiers, and Line 208 should use “Markdown” as a proper noun.

Suggested patch pattern
-```
+```text
 get_design_context(fileKey, nodeId, { excludeScreenshot?, forceCode?, disableCodeConnect? }?) → { code, assets: { [assetUrl]: string }, screenshot? }

- +text
generate_diagram(name, mermaidSyntax, userIntent?) → { url, ... }


-- IMPORTANT: after calling, you MUST surface the returned URL to the user as a markdown link
+- IMPORTANT: after calling, you MUST surface the returned URL to the user as a Markdown link

Apply the same ```text convention to the other signature/example fences in this file for consistency.

Also applies to: 78-78, 90-90, 102-102, 114-114, 125-125, 138-138, 150-150, 161-161, 172-172, 184-184, 197-197, 210-210, 227-227, 250-250, 261-261, 272-272, 285-285, 429-429, 439-439, 208-208

🧰 Tools
🪛 markdownlint-cli2 (0.22.0)

[warning] 67-67: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/skills/moai-design-tools/reference/figma.md at line 67, Update the
fenced code blocks in .claude/skills/moai-design-tools/reference/figma.md to
include the language identifier "text" (e.g., change ``` to ```text) for all
signature/example fences such as the blocks containing get_design_context(...)
and generate_diagram(...), and any other unnamed fences listed (lines referenced
in the review). Also change the lowercase "markdown" instance to the proper noun
"Markdown" in the nearby IMPORTANT note (the line that currently reads "-
IMPORTANT: after calling, you MUST surface the returned URL to the user as a
markdown link") so it reads "Markdown". Ensure all occurrences in the file are
updated consistently.

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants