cocosketch
Installation
SKILL.md
CocoSketch — Visual Artifact Generation Pipeline
Core Principle
Diagram quality requires a pipeline, not a single prompt. The AI generates XML; deterministic scripts validate and repair. Never skip validation or repair steps.
Seven-Step Pipeline (ALL modes)
Step 1: Resolve style preset
Step 2: Check draw.io CLI availability (resolve binary once, use verbatim)
Step 3: Plan layout — shapes, relationships, groups; run cocosketch/sketch-autolayout for >15 nodes
Step 4: Generate draw.io XML → run cocosketch/sketch-validate → STOP pipeline if FAIL
Step 5: Export PREVIEW PNG (NO -e flag) capped at 2000px
Step 6: Self-check preview via vision — auto-fix overlaps/clipped labels (max 2 rounds)
Step 7: Export FINAL PNG (WITH -e flag) → run cocosketch/sketch-repair → deliver to developer
NEVER skip Steps 4 or 7. NEVER add -e to Step 5. NEVER omit -e from Step 7.