Health Checks
The quality of generated code (whether via ptb implement or your own AI IDE) depends entirely on how well the component is constructed in Figma.
ptb doctor
The ptb doctor command acts as a linter for your Figma design system. It scores components across 10 distinct architectural checks.
ptb doctor # System overview
ptb doctor component Button # Deep audit of a single component
ptb doctor component . # Scorecard table for all components
ptb doctor tokens # Verify token resolution coverage
The 10-Point Grading System
The doctor evaluates the following criteria:
- Layout: Does the component use Auto Layout?
- Sizing: Are sizing rules (Hug, Fill, Fixed) deterministic?
- Token Bindings: Are fills and text colors bound to Variables, or hardcoded hexes?
- Variants: Does the component have meaningful variant axes?
- State Contract: Does it define hover/focus states?
- Prototype Interactions: Are there Figma prototype links attached?
- Render Tree: Is the layer structure clean?
- Dependencies (Critical): Are nested instances fully built and ready?
- Description: Did the designer provide a description?
- Kind: Can PTB infer if this is atomic, primitive, or a wrapper?
Grades:
- Healthy: ≥ 90%
- Warning: 60–89%
- Critical: < 60%
[!TIP] If a component receives a low doctor score, go back to Figma, apply Auto Layout, attach Variables to colors, and run
ptb scanagain!
Next Steps
Familiarize yourself with all available commands in the CLI Overview reference.