CanICode v0.12.3 is a CLI and MCP server that lints Figma designs for AI code-generation readiness. It runs 16 deterministic rules (no AI cost) across 6 categories (Pixel Critical, Responsive, Code Quality, Token Management, Interaction, Semantic) and automatically fixes issues via Figma API, enabling a roundtrip workflow. Requires Node.js >=22. Differentiators: rule scores are ablation-validated with 94% pixel accuracy using 5× fewer tokens than raw JSON, and the calibration pipeline uses pixel-level comparison (visual-compare) against community fixtures. Supports both capture-only (gotchas) and write-to-Figma (roundtrip) modes. Released frequently (every few weeks) under active development.
npm install canicodeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows programmatic usage to analyze a Figma file and print grade, rule results, and gotchas.
Set FIGMA_TOKEN environment variable or use 'canicode init --token' to configure.
Run 'canicode init' interactively or use 'canicode token-refresh <token>' separately.
Import from '@canicode/types' instead of 'canicode' for type-only imports.
Review the annotation format; use 'allowDefinitionWrite' opt-in to propagate to component definitions.
Run 'npm install canicode' in your project and ensure node_modules contains it.
Update to v0.11.0+ with 'npm install canicode@latest'.
Generate a new personal access token with 'write' scope in Figma account settings.