/ccw-workflow:memory:style-skill-memory [package-name] [--regenerate]from ccw-workflow
Generate SKILL memory package from style reference for easy loading and consistent design system usage
Ships in ccw-workflow. Installing the plugin adds it to Claude Code.
Purpose: Convert style reference package into SKILL memory for easy loading and context management.
Input: Style reference package at .workflow/reference_style/{package-name}/
Output: SKILL memory index at .claude/skills/style-{package-name}/SKILL.md
Use Case: Load design system context when working with UI components, analyzing design patterns, or implementing style guidelines.
Key Features:
/ccw-workflow:memory:style-skill-memory [package-name] [--regenerate]
# Arguments
package-name Style reference package name (required)
--regenerate Force regenerate SKILL.md even if it exists (optional)
# Generate SKILL memory for package
/ccw-workflow:memory:style-skill-memory main-app-style-v1
# Regenerate SKILL memory
/ccw-workflow:memory:style-skill-memory main-app-style-v1 --regenerate
# Package name from current directory or default
/ccw-workflow:memory:style-skill-memory
Input Variables:
PACKAGE_NAME: Style reference package namePACKAGE_DIR: .workflow/reference_style/${package_name}SKILL_DIR: .claude/skills/style-${package_name}REGENERATE: true if --regenerate flag, false otherwiseData Sources (Phase 2):
DESIGN_TOKENS_DATA: Complete design-tokens.json content (from Read)LAYOUT_TEMPLATES_DATA: Complete layout-templates.json content (from Read)ANIMATION_TOKENS_DATA: Complete animation-tokens.json content (from Read, if exists)Metadata (Phase 2):
COMPONENT_COUNT: Total componentsUNIVERSAL_COUNT: Universal components countSPECIALIZED_COUNT: Specialized components countUNIVERSAL_COMPONENTS: Universal component names (first 5)HAS_ANIMATIONS: Whether animation-tokens.json existsAnalysis Output (DESIGN_ANALYSIS - Phase 2):
has_colors: Colors existcolor_semantic: Has semantic naming (primary/secondary/accent)uses_oklch: Uses modern color spaces (oklch, lab, etc.)has_dark_mode: Has separate light/dark mode color tokensspacing_pattern: Pattern type ("linear", "geometric", "custom")spacing_scale: Actual scale values (e.g., [4, 8, 16, 32, 64])has_typography: Typography system existstypography_hierarchy: Has size scale for hierarchyuses_calc: Uses calc() expressions in token valueshas_radius: Border radius existsradius_style: Style characteristic ("sharp" <4px, "moderate" 4-8px, "rounded" >8px)has_shadows: Shadow system existsshadow_pattern: Elevation naming patternhas_animations: Animation tokens existanimation_range: Duration range (fast to slow)easing_variety: Types of easing functions| Error | Cause | Resolution |
|---|---|---|
| Package not found | Invalid package name or doesn't exist | Run /ccw-workflow:workflow:ui-design:codify-style first |
| SKILL already exists | SKILL.md already generated | Use --regenerate flag |
| Missing layout-templates.json | Incomplete package | Verify package integrity, re-run codify-style |
| Invalid JSON format | Corrupted package files | Regenerate package with codify-style |
TodoWrite (First Action):
[
{
"content": "Validate package exists and check SKILL status",
"activeForm": "Validating package and SKILL status",
"status": "in_progress"
},
{
"content": "Read package data and analyze design system",
"activeForm": "Reading package data and analyzing design system",
"status": "pending"
},
{
"content": "Generate SKILL.md with design principles and token values",
"activeForm": "Generating SKILL.md with design principles and token values",
"status": "pending"
}
]
Step 1: Parse Package Name
# Get package name from argument or auto-detect
bash(echo "${package_name}" || basename "$(pwd)" | sed 's/^style-//')
Step 2: Validate Package Exists
bash(test -d .workflow/reference_style/${package_name} && echo "exists" || echo "missing")
Error Handling:
if (package_not_exists) {
error("ERROR: Style reference package not found: ${package_name}")
error("HINT: Run '/ccw-workflow:workflow:ui-design:codify-style' first to create package")
error("Available packages:")
bash(ls -1 .workflow/reference_style/ 2>/dev/null || echo " (none)")
exit(1)
}
Step 3: Check SKILL Already Exists
bash(test -f .claude/skills/style-${package_name}/SKILL.md && echo "exists" || echo "missing")
Decision Logic:
if (skill_exists && !regenerate_flag) {
echo("SKILL memory already exists for: ${package_name}")
echo("Use --regenerate to force regeneration")
exit(0)
}
if (regenerate_flag && skill_exists) {
echo("Regenerating SKILL memory for: ${package_name}")
}
TodoWrite Update: Mark "Validate" as completed, "Read package data" as in_progress
Step 1: Read All JSON Files
# Read layout templates
Read(file_path=".workflow/reference_style/${package_name}/layout-templates.json")
# Read design tokens
Read(file_path=".workflow/reference_style/${package_name}/design-tokens.json")
# Read animation tokens (if exists)
bash(test -f .workflow/reference_style/${package_name}/animation-tokens.json && echo "exists" || echo "missing")
Read(file_path=".workflow/reference_style/${package_name}/animation-tokens.json") # if exists
Step 2: Extract Metadata for Description
# Count components and classify by type
bash(jq '.layout_templates | length' layout-templates.json)
bash(jq '[.layout_templates[] | select(.component_type == "universal")] | length' layout-templates.json)
bash(jq '[.layout_templates[] | select(.component_type == "specialized")] | length' layout-templates.json)
bash(jq -r '.layout_templates | to_entries[] | select(.value.component_type == "universal") | .key' layout-templates.json | head -5)
Store results in metadata variables (see Key Variables)
Step 3: Analyze Design System for Dynamic Principles
Analyze design-tokens.json to extract characteristics and patterns:
# Color system characteristics
bash(jq '.colors | keys' design-tokens.json)
bash(jq '.colors | to_entries[0:2] | map(.value)' design-tokens.json)
# Check for modern color spaces
bash(jq '.colors | to_entries[] | .value | test("oklch|lab|lch")' design-tokens.json)
# Check for dark mode variants
bash(jq '.colors | keys | map(select(contains("dark") or contains("light")))' design-tokens.json)
# → Store: has_colors, color_semantic, uses_oklch, has_dark_mode
# Spacing pattern detection
bash(jq '.spacing | to_entries | map(.value) | map(gsub("[^0-9.]"; "") | tonumber)' design-tokens.json)
# Analyze pattern: linear (4-8-12-16) vs geometric (4-8-16-32) vs custom
# → Store: spacing_pattern, spacing_scale
# Typography characteristics
bash(jq '.typography | keys | map(select(contains("family") or contains("weight")))' design-tokens.json)
bash(jq '.typography | to_entries | map(select(.key | contains("size"))) | .[].value' design-tokens.json)
# Check for calc() usage
bash(jq '. | tostring | test("calc\\(")' design-tokens.json)
# → Store: has_typography, typography_hierarchy, uses_calc
# Border radius style
bash(jq '.border_radius | to_entries | map(.value)' design-tokens.json)
# Check range: small (sharp <4px) vs moderate (4-8px) vs large (rounded >8px)
# → Store: has_radius, radius_style
# Shadow characteristics
bash(jq '.shadows | keys' design-tokens.json)
bash(jq '.shadows | to_entries[0].value' design-tokens.json)
# → Store: has_shadows, shadow_pattern
# Animations (if available)
bash(jq '.duration | to_entries | map(.value)' animation-tokens.json)
bash(jq '.easing | keys' animation-tokens.json)
# → Store: has_animations, animation_range, easing_variety
Store analysis results in DESIGN_ANALYSIS (see Key Variables)
Note: Analysis focuses on characteristics and patterns, not counts. Include technical feature detection (oklch, calc, dark mode) for Prerequisites section.
TodoWrite Update: Mark "Read package data" as completed, "Generate SKILL.md" as in_progress
Step 1: Create SKILL Directory
bash(mkdir -p .claude/skills/style-${package_name})
Step 2: Generate Intelligent Description
Format:
{package_name} project-independent design system with {universal_count} universal layout templates and interactive preview (located at .workflow/reference_style/{package_name}). Load when working with reusable UI components, design tokens, layout patterns, or implementing visual consistency. Excludes {specialized_count} project-specific components.
Step 3: Load and Process SKILL.md Template
⚠️ CRITICAL - Execute First:
bash(cat ~/.ccw/workflows/cli-templates/memory/style-skill-memory/skill-md-template.md)
Template Processing:
{variable} placeholders with actual values from Phase 2DESIGN_ANALYSIS technical features (oklch, calc, dark mode)DESIGN_ANALYSIS characteristicsDESIGN_TOKENS_DATA, ANIMATION_TOKENS_DATA and display all key-value pairs with DEFAULT annotations.claude/skills/style-{package_name}/SKILL.mdVariable Replacement Map:
{package_name} → PACKAGE_NAME{intelligent_description} → Generated description from Step 2{component_count} → COMPONENT_COUNT{universal_count} → UNIVERSAL_COUNT{specialized_count} → SPECIALIZED_COUNT{universal_components_list} → UNIVERSAL_COMPONENTS (comma-separated){has_animations} → HAS_ANIMATIONSDynamic Content Generation:
See template file for complete structure. Key dynamic sections:
Prerequisites & Tooling (based on DESIGN_ANALYSIS technical features):
postcss-oklab-function)Design Principles (based on DESIGN_ANALYSIS):
Design Token Values (iterate from read data):
DESIGN_TOKENS_DATA.colorsDESIGN_TOKENS_DATA.typographyDESIGN_TOKENS_DATA.spacingDESIGN_TOKENS_DATA.border_radius with calc() explanationsDESIGN_TOKENS_DATA.shadows with DEFAULT token annotationsANIMATION_TOKENS_DATA.duration and ANIMATION_TOKENS_DATA.easingStep 4: Verify SKILL.md Created
bash(test -f .claude/skills/style-${package_name}/SKILL.md && echo "success" || echo "failed")
TodoWrite Update: Mark all todos as completed
Display a simple completion message with key information:
✅ SKILL memory generated for style package: {package_name}
📁 Location: .claude/skills/style-{package_name}/SKILL.md
📊 Package Summary:
- {component_count} components ({universal_count} universal, {specialized_count} specialized)
- Design tokens: colors, typography, spacing, shadows{animations_note}
💡 Usage: /memory:load-skill-memory style-{package_name} "your task description"
Variables: {package_name}, {component_count}, {universal_count}, {specialized_count}, {animations_note} (", animations" if exists)
cat ~/.ccw/workflows/cli-templates/memory/style-skill-memory/{template} to load templates{variable} placeholders with actual valuesPhase 1: Validate
├─ Parse package_name
├─ Check PACKAGE_DIR exists
└─ Check SKILL_DIR exists (skip if exists and no --regenerate)
Phase 2: Read & Analyze
├─ Read design-tokens.json → DESIGN_TOKENS_DATA
├─ Read layout-templates.json → LAYOUT_TEMPLATES_DATA
├─ Read animation-tokens.json → ANIMATION_TOKENS_DATA (if exists)
├─ Extract Metadata → COMPONENT_COUNT, UNIVERSAL_COUNT, etc.
└─ Analyze Design System → DESIGN_ANALYSIS (characteristics)
Phase 3: Generate
├─ Create SKILL directory
├─ Generate intelligent description
├─ Load SKILL.md template (cat command)
├─ Replace variables and generate dynamic content
├─ Write SKILL.md
├─ Verify creation
├─ Load completion message template (cat command)
└─ Display completion message
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
38 commands in this plugin
/ccwMain workflow orchestrator - analyze intent, select workflow, execute command chain in main process/ccw-coordinatorCommand orchestration tool - analyze requirements, recommend chain, execute sequentially with state persistence/issue:convert-to-planconvert-to-planConvert planning artifacts (lite-plan, workflow session, markdown) to issue solutionsnpx claudepluginhub nx1-org/platformnex-abilities --plugin ccw-workflow2 plugins ship this exact command · first indexed Nov 17, 2026