Skip to content

Commit 6682758

Browse files
jwaldripclaude
andcommitted
feat(plugin): add design asset handling, color matching, and annotation awareness
Across elaborate, builder, designer, and reviewer: - Download/export design assets for analysis when possible - Match colors to named tokens (design tokens, CSS custom properties, framework variables) instead of guessing raw hex values - Distinguish designer annotations (callouts, arrows, measurement labels, sticky notes) from actual UI elements — treat them as implementation guidance, not things to render Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent eeb965c commit 6682758

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

plugin/hats/builder.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ The Builder implements code to satisfy the Unit's Completion Criteria, using bac
3939
- You SHOULD reference spec provider for API contracts if configured (endpoint definitions, data schemas)
4040
- **Validation**: Can enumerate what needs to be built
4141

42+
#### Design Asset Handling
43+
44+
When working with designs from design tools (Figma, Sketch, Adobe XD, etc.):
45+
46+
- **Download assets when possible.** Use design tool APIs or MCP tools to export images, icons, and SVGs for analysis rather than relying on visual inspection alone.
47+
- **Match colors to named tokens, not raw values.** When extracting colors from designs, do NOT guess hex codes. Instead, match them to the project's existing color system — brand colors, design tokens, CSS custom properties, theme variables, or framework-level color names (e.g., `--color-primary`, `theme.colors.brand.500`, `text-blue-600`). Search the codebase for the color system first.
48+
- **Legacy tools requiring browser inspection**: If you must use Chrome/browser to inspect a design tool that lacks API access, take extra care with color extraction. Cross-reference every color against the project's defined palette. If a color doesn't match any existing token, flag it — don't invent a new one.
49+
- **Distinguish design annotations from UI elements.** Designers often annotate mockups with callouts, arrows, measurement labels, sticky notes, and text blocks that describe UX behavior or implementation details. These annotations are **guidance for you, not part of the design to implement.** Look for: redline measurements, numbered callouts, text outside the frame/artboard, comment threads, and annotation layers. Treat them as implementation instructions — extract and follow the guidance, but do not render them as UI elements.
50+
4251
#### Provider Sync — Ticket Status
4352
- If a `ticket` field exists in the current unit's frontmatter, **SHOULD** update the ticket status to **In Progress** using the ticketing provider's MCP tools
4453
- If the unit is completed successfully, **SHOULD** update the ticket to **Done**

plugin/hats/designer.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,16 @@ The Designer creates visual designs, UI mockups, and user experience flows. This
6464
- You SHOULD reference design tokens if available
6565
- You MUST specify accessibility requirements (contrast, labels)
6666
- You SHOULD include responsive breakpoints
67+
- You MUST reference colors by named tokens (design tokens, CSS custom properties, framework variables) — never by raw hex unless defining a new token
6768
- **Validation**: Specs sufficient for implementation
6869

70+
#### Working with External Designs
71+
72+
When exploring designs in design tools (Figma, Sketch, Adobe XD, etc.):
73+
74+
- **Download assets for analysis.** Use design tool APIs or MCP tools to export images, icons, and SVGs. Analyze downloaded assets rather than relying solely on visual inspection.
75+
- **Distinguish annotations from design.** Designers annotate mockups with callouts, arrows, measurement labels, sticky notes, and descriptive text that convey UX intent and implementation detail. These annotations are **guidance, not UI elements.** Extract the guidance (spacing rules, interaction notes, state descriptions) and incorporate it into your design specs, but do not treat annotation visuals as part of the design itself.
76+
6977
## Success Criteria
7078

7179
- [ ] User problem clearly understood

plugin/hats/reviewer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The Reviewer verifies that the Builder's implementation satisfies the Unit's Com
4444
- You MUST run verification commands, not just read code
4545
- You MUST NOT assume - verify programmatically
4646
- You SHOULD cross-reference spec provider for requirement accuracy if configured
47-
- You SHOULD cross-reference design provider for visual/UX compliance if configured
47+
- You SHOULD cross-reference design provider for visual/UX compliance if configured. When comparing implementation to designs, match colors against the project's named color tokens (design tokens, CSS custom properties, theme variables) — not raw hex values. If the design contains annotations (callouts, arrows, measurement labels, descriptive text), treat them as implementation guidance that should have been followed, not UI elements that should have been rendered.
4848
- **Validation**: Each criterion marked pass/fail with evidence
4949

5050
3. Review code quality

plugin/skills/elaborate/SKILL.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ Based on what the user described in Phase 2, identify every relevant technical s
208208
7. **Configured Providers**: If providers are configured in `.ai-dlc/settings.yml` or discovered via MCP:
209209
- **Spec providers** (Notion, Confluence, Google Docs): Search for requirements docs, PRDs, or technical specs related to the intent
210210
- **Ticketing providers** (Jira, Linear): Search for existing tickets, epics, or stories that relate to or duplicate this work
211-
- **Design providers** (Figma): Search for design files, component libraries, or mockups relevant to UI work
211+
- **Design providers** (Figma, Sketch, Adobe XD): Search for design files, component libraries, or mockups relevant to UI work. When possible, download/export assets (images, icons, SVGs) for analysis rather than relying on visual inspection alone. **Important:** Designers often annotate mockups with callouts, arrows, measurement labels, sticky notes, and descriptive text that convey UX behavior or implementation details. These annotations are **guidance, not part of the design itself** — extract the guidance (interaction notes, spacing rules, state descriptions, edge cases) and incorporate it into unit specs, but do not treat annotation visuals as UI elements to build.
212212
- **Comms providers** (Slack, Teams): Search for relevant discussions or decisions in channels
213213
Use `ToolSearch` to discover available MCP tools matching provider types, then use read-only MCP tools for research.
214214

@@ -873,6 +873,8 @@ DESIGN_TYPE=$(echo "$PROVIDERS" | jq -r '.design.type // empty')
873873

874874
If a design provider is configured (e.g., Figma), reference component names from the design system in HTML comments (e.g., `<!-- DS: ButtonPrimary -->`) but maintain low-fidelity wireframe aesthetic. Do NOT import actual design system styles.
875875

876+
If design mockups exist, download/export assets when possible for analysis. **Distinguish annotations from design elements** — designers annotate mockups with callouts, arrows, measurement labels, and descriptive text that describe UX behavior and implementation detail. Extract this guidance into the unit specs (interaction notes, edge cases, state descriptions) but do not render annotations as wireframe elements.
877+
876878
### Step 3: Create mockups directory
877879

878880
```bash

0 commit comments

Comments
 (0)