From groundwork
Syncs design system documentation with codebase changes by updating design_system.md during sessions. Keeps design specs aligned with implementation decisions.
How this skill is triggered — by the user, by Claude, or both
Slash command
/groundwork:source-ux-design-from-code [files...][files...]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Keeps `{{specs_dir}}/design_system.md` synchronized with design implementation decisions made during sessions.
Keeps {{specs_dir}}/design_system.md synchronized with design implementation decisions made during sessions.
Your current effort level is {{effort_level}}.
Skip this step silently if effort is high, xhigh, or max (the scale is low < medium < high < xhigh < max, so xhigh and max are already above high) AND you are Sonnet or Opus.
If effort is low or medium (i.e. below high), you MUST show the recommendation prompt — regardless of model.
If you are not Sonnet or Opus, you MUST show the recommendation prompt - regardless of effort level.
Otherwise → use AskUserQuestion:
{
"questions": [{
"question": "Do you want to switch? Design token and pattern change categorization benefits from consistent reasoning.\n\nTo switch: cancel, run `/effort high` (and `/model sonnet` if on Haiku), then re-invoke this skill.",
"header": "Recommended: Sonnet or Opus at high effort",
"options": [
{ "label": "Continue" },
{ "label": "Cancel — I'll switch first" }
],
"multiSelect": false
}]
}
If the user selects "Cancel — I'll switch first": output the switching commands above and stop. Do not proceed with the skill.
Before loading specs, ensure project context is resolved:
.groundwork.yml exist at the repo root?
{{project_name}} non-empty?
Skill(skill="groundwork:select-project") to select a project, then restart this skill.{{project_name}}, specs at {{specs_dir}}/..groundwork.yml).AskUserQuestion:
"You're working from
<cwd>(inside [cwd-project]), but the selected Groundwork project is [selected-project] ([selected-project-path]/). What would you like to do?"
- "Switch to [cwd-project]"
- "Stay with [selected-project]" If the user switches, invoke
Skill(skill="groundwork:select-project").
{{specs_dir}}/ paths will resolve to the correct location.{{specs_dir}}/design_system.md{{specs_dir}}/design_system/ (content split across files)Detection: Check for single file first (takes precedence), then directory.
This skill should activate when:
/groundwork:source-ux-design-from-codeReview the current session for:
Token Changes:
Component Styling:
UX Pattern Implementations:
Brand Identity:
| Category | Signal | Design System Section |
|---|---|---|
| Design principle | Explicit "we should always..." statement | §1.2 Design Principles |
| Accessibility | ARIA labels, contrast fixes, focus states | §1.1 Accessibility Requirements |
| Spacing token | New spacing value, padding/margin pattern | §1.3 Token Categories (Spacing) |
| Elevation token | Shadow values, z-index decisions | §1.3 Token Categories (Elevation) |
| Border radius | Corner radius decisions | §1.3 Token Categories (Border Radius) |
| Color token | New color value, palette adjustment | §2.1 Color System |
| Typography | Font family, size, weight decisions | §2.2 Typography |
| Brand voice | UI copy patterns, tone decisions | §2.4 Brand Voice |
| Visual atmosphere | Surface treatments, textures, spatial character, tonal direction | §2.5 Visual Atmosphere |
| Navigation | Nav structure, menu patterns | §3.1 Navigation |
| Loading states | Skeleton, spinner, progress patterns | §3.2 Loading States |
| Error handling | Error display, validation feedback | §3.3 Error Handling |
| Empty states | No-data, first-run experiences | §3.4 Empty States |
| Form patterns | Input validation, form layout | §3.5 Form Patterns |
| Responsive | Breakpoint decisions, mobile adaptations | §3.6 Responsive Behavior |
| Motion | Animation timing, transitions, entrance patterns, hover signatures | §3.7 Motion & Interaction Character |
| Component | New component styling guidelines | §4 Component Guidelines |
For each detected change, propose a specific update:
## Proposed Design System Updates
### 1. New Design Principle
**Trigger:** You established that all interactive elements should have visible focus states.
**Proposed addition to §1.2 Design Principles:**
### DP-00X: Accessible Focus States
**Status:** Accepted
**Date:** [today]
**Context:** Implementing keyboard navigation revealed need for consistent focus indicators.
**Decision:** All interactive elements must have visible focus states with 3:1 contrast ratio.
**Rationale:** Supports keyboard-only users and WCAG 2.1 AA compliance.
---
### 2. New Color Token
**Trigger:** You added a new warning color for form validation.
**Proposed addition to §2.1 Color System:**
| Token | Value | Usage |
|-------|-------|-------|
| `--color-warning-light` | #FEF3C7 | Warning background |
**Proposed addition to §5 Decision Log (Brand Decisions):**
### BRD-00X: Warning Color Variant
**Status:** Accepted
**Date:** [today]
**Context:** Form validation needed softer warning background.
**Decision:** Added `--color-warning-light` (#FEF3C7) for warning backgrounds.
**Rationale:** Maintains warning semantic while providing softer background option.
---
### 3. UX Pattern Implementation
**Trigger:** You implemented skeleton loading screens for data tables.
**Proposed addition to §3.2 Loading States:**
**Data Tables:** Use skeleton rows matching table structure. Show 5 skeleton rows by default. Animate with subtle pulse.
**Proposed addition to §5 Decision Log (UX Decisions):**
### UXD-00X: Table Loading Pattern
**Status:** Accepted
**Date:** [today]
**Context:** Data tables needed loading feedback during API calls.
**Decision:** Use skeleton rows (5 default) with pulse animation for table loading states.
**Rationale:** Maintains layout stability and sets user expectations for content shape.
---
Approve these updates? (yes/no/modify)
On approval:
{{specs_dir}}/design_system.md.md files from {{specs_dir}}/design_system/{{specs_dir}}/design_system.md directly{{specs_dir}}/design_system/01-foundations.md{{specs_dir}}/design_system/01-foundations.md{{specs_dir}}/design_system/01-foundations.md{{specs_dir}}/design_system/02-brand-identity.md{{specs_dir}}/design_system/02-brand-identity.md{{specs_dir}}/design_system/02-brand-identity.md{{specs_dir}}/design_system/03-ux-patterns.md{{specs_dir}}/design_system/04-components.md{{specs_dir}}/design_system/05-decisions.md{{specs_dir}}/ux-preview.html exists, regenerate it to reflect the updated design system decisionsImportant:
Strong signals (likely design system change):
Weak signals (maybe design system change):
Focus on strong signals. For weak signals, ask: "Is this a pattern we want to establish, or a one-time implementation detail?"
At session end, provide summary:
## Design System Sync Summary
**Session Date:** [date]
### Changes Detected:
1. [Change 1] → New principle DP-00X
2. [Change 2] → New color token BRD-00X
3. [Change 3] → UX pattern UXD-00X
4. [Change 4] → No design system impact (implementation detail)
### Design System Document:
- [X] Updated with approved changes
- [ ] No changes needed
- [ ] Changes pending user review
### Decision IDs Added/Modified:
- DP-00X (new)
- BRD-00X (new)
- UXD-00X (new)
### Open Items:
- [Any unresolved design questions from session]
This skill works in concert with:
/groundwork:ux-design - For deliberate, interactive design system creation/groundwork:source-product-specs-from-code - PRD changes may affect design requirements/groundwork:source-architecture-from-code - Architecture changes may affect UX patternsWhen multiple sync commands run:
/groundwork:source-product-specs-from-code first (product drives design)/groundwork:source-ux-design-from-code second (design supports product)/groundwork:source-architecture-from-code last (architecture implements both)npx claudepluginhub etr/groundworkDocuments design decisions with a structured DESIGN.md format — rationale, visual specs, component inventory, and decision logs. Useful for design handoff, onboarding, and resolving recurring debates.
Automates design system construction from repository analysis: extracts patterns, builds OKLCH token hierarchies, implements accessible components with tests, verifies via multi-reviewer panels.
Reads a DESIGN.md file (open standard from Google Labs) and builds brand-consistent UI from its design tokens. Use when a DESIGN.md is present or user provides one.