---
name: 'step-08e-generate-catalog'
description: 'Generate or update the interactive HTML catalog showcasing all design system components'
# File References
activityWorkflowFile: '../workflow-create.md'
---
# Step 8e: Generate Catalog
## STEP GOAL:
Generate or update the interactive HTML catalog from design system data. Load template, gather project info, generate navigation, token sections, component sections, and changelog.
## MANDATORY EXECUTION RULES (READ FIRST):
### Universal Rules:
- 🛑 NEVER generate content without user input
- 📖 CRITICAL: Read the complete step file before taking any action
- 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
- 📋 YOU ARE A FACILITATOR, not a content generator
- ✅ YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
### Role Reinforcement:
- ✅ You are the Design System Architect guiding design system creation and maintenance
- ✅ If you already have been given a name, communication_style and persona, continue to use those while playing this new role
- ✅ We engage in collaborative dialogue, not command-response
- ✅ You bring design system expertise and component analysis, user brings design knowledge and project context
- ✅ Maintain systematic and analytical tone throughout
### Step-Specific Rules:
- 🎯 Focus ONLY on this step's specific goal — do not skip ahead
- 🚫 FORBIDDEN to jump to later steps before this step is complete
- 💬 Approach: Systematic execution with clear reporting
- 📋 All outputs must be documented and presented to user
## EXECUTION PROTOCOLS:
- 🎯 Execute each instruction in the sequence below
- 💾 Document all findings and decisions
- 📖 Present results to user before proceeding
- 🚫 FORBIDDEN to skip instructions or optimize the sequence
## CONTEXT BOUNDARIES:
- Available context: Previous step outputs and project configuration
- Focus: This step's specific goal only
- Limits: Do not perform actions belonging to subsequent steps
- Dependencies: Requires all previous steps to be completed
## Sequence of Instructions (Do not deviate, skip, or optimize)
## Input
**Design System Files:**
- `D-Design-System/components/*.md` - All component specifications
- `D-Design-System/design-tokens.md` - Design token definitions
- `D-Design-System/figma-mappings.md` - Figma references (if Mode B)
- `D-Design-System/component-library-config.md` - Library config (if Mode C)
**Project Config:**
- Project name
- Design system mode
- Version number
- Creation date
---
## Output
**Generated File:**
- `D-Design-System/catalog.html` - Interactive HTML catalog
**Features:**
- Fixed sidebar navigation
- Live component previews
- Interactive state toggles
- Code examples
- Design token swatches
- Changelog
- Figma links (if Mode B)
- Responsive design
---
## Step 1: Load Template
Load catalog template:
**File:** `workflows/wds-7-design-system/templates/catalog.template.html`
**Template variables:**
```
{{PROJECT_NAME}}
{{PROJECT_ICON}}
{{PROJECT_DESCRIPTION}}
{{PROJECT_OVERVIEW}}
{{VERSION}}
{{COMPONENT_COUNT}}
{{DESIGN_SYSTEM_MODE}}
{{CREATED_DATE}}
{{LAST_UPDATED}}
{{INSTALLATION_INSTRUCTIONS}}
{{USAGE_EXAMPLE}}
{{COMPONENT_NAVIGATION}}
{{DESIGN_TOKENS_CONTENT}}
{{COLOR_TOKENS}}
{{TYPOGRAPHY_TOKENS}}
{{SPACING_TOKENS}}
{{COMPONENTS_CONTENT}}
{{CHANGELOG_CONTENT}}
{{FIGMA_LINKS}}
```
---
## Step 2: Gather Project Information
Extract project metadata:
**From project config:**
```yaml
project_name: 'Dog Week'
project_icon: '🐕'
project_description: 'Family dog care coordination platform'
design_system_mode: 'custom' # or "library" or "none"
created_date: '2024-09-15'
version: '1.0.0'
```
**Calculate:**
```
component_count: Count files in D-Design-System/components/
last_updated: Current date/time
```
---
## Step 3: Generate Navigation
Build component navigation from component files:
**Scan components:**
```
D-Design-System/components/
├── button.md [btn-001]
├── input.md [inp-001]
├── card.md [crd-001]
└── ...
```
**Group by category:**
```
Interactive:
- Button [btn-001]
- Link [lnk-001]
Form:
- Input [inp-001]
- Select [sel-001]
Display:
- Card [crd-001]
- Badge [bdg-001]
```
**Generate HTML:**
```html
```
**Replace:** `{{FIGMA_LINKS}}`
---
## Step 8: Generate Installation Instructions
Create mode-specific installation instructions:
**Mode B (Custom/Figma):**
```bash
# Install dependencies
npm install
# Import design tokens
import '@/styles/design-tokens.css';
# Import components
import { Button } from '@/components/button';
```
**Mode C (Component Library):**
```bash
# Install component library
npm install shadcn-ui
# Configure library
npx shadcn-ui init
# Import components
import { Button } from '@/components/ui/button';
```
**Replace:** `{{INSTALLATION_INSTRUCTIONS}}`, `{{USAGE_EXAMPLE}}`
---
## Step 9: Write Catalog File
Save generated HTML:
**File:** `D-Design-System/catalog.html`
**Content:** Fully populated template with all sections
**Validation:**
- All template variables replaced
- Valid HTML structure
- All component sections included
- Navigation links work
- Interactive demos functional
---
## Step 10: Update Git
Version control the catalog:
**Git operations:**
```bash
git add D-Design-System/catalog.html
git commit -m "Update design system catalog - [component changes]"
```
**Commit message format:**
```
Update design system catalog - Added Button loading state
- Button [btn-001]: Added loading state variant
- Updated catalog with interactive demo
- Version: 1.0.1
```
---
## Output Format
**Success message:**
```
✅ Design system catalog generated
File: D-Design-System/catalog.html
Components: 12
Last updated: 2024-12-09 14:30
View catalog:
file:///path/to/D-Design-System/catalog.html
Changes committed to git.
```
---
## Error Handling
### Missing Template
**Error:** Catalog template not found
**Action:**
```
⚠️ Catalog template missing
Expected: workflows/wds-7-design-system/templates/catalog.template.html
Please ensure WDS is properly installed.
```
### Invalid Component Spec
**Error:** Component file has invalid format
**Action:**
```
⚠️ Invalid component specification
File: D-Design-System/components/button.md
Issue: Missing required sections
Skipping component in catalog.
Please fix component specification.
```
### No Components
**Error:** No components in design system
**Action:**
```
⚠️ No components found
Design system appears empty.
Catalog will include only foundation (tokens).
Add components to populate catalog.
```
---
## Automation
**Catalog is automatically regenerated:**
- After creating new component
- After adding variant
- After updating component
- After updating design tokens
**Manual regeneration:**
```
Agent: Regenerate design system catalog
```
---
## Best Practices
### DO ✅
- Regenerate after every component change
- Commit catalog with component changes
- Include all variants and states
- Add interactive demos
- Keep changelog updated
### DON'T ❌
- Don't manually edit catalog.html
- Don't skip catalog regeneration
- Don't forget to commit changes
- Don't remove interactive features
---
**The interactive catalog is the living documentation of your design system, always up-to-date and version controlled.**
### 11. Present MENU OPTIONS
Display: "**Select an Option:** [M] Return to Activity Menu"
#### Menu Handling Logic:
- IF M: Return to {activityWorkflowFile} activity menu
- IF Any other comments or queries: help user respond then [Redisplay Menu Options](#11-present-menu-options)
#### EXECUTION RULES:
- ALWAYS halt and wait for user input after presenting menu
- ONLY proceed to next step when user selects the appropriate option
- User can chat or ask questions — always respond and then redisplay menu options
## CRITICAL STEP COMPLETION NOTE
ONLY WHEN [M is selected and catalog is generated and saved], will you then return to the activity workflow menu.
---
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
### ✅ SUCCESS:
- Step goal achieved completely
- All instructions executed in sequence
- Results documented and presented to user
- User confirmed before proceeding
- Design log updated
### ❌ SYSTEM FAILURE:
- Skipping any instruction in the sequence
- Generating content without user input
- Jumping ahead to later steps
- Not presenting results to user
- Proceeding without user confirmation
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.