@champpaba/claude-agent-kit 1.8.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/.claude/CHANGELOG-v1.1.1.md +259 -259
  2. package/.claude/CLAUDE.md +91 -106
  3. package/.claude/commands/csetup.md +91 -30
  4. package/.claude/commands/cstatus.md +60 -60
  5. package/.claude/commands/cview.md +364 -364
  6. package/.claude/commands/designsetup.md +1401 -336
  7. package/.claude/commands/extract.md +520 -245
  8. package/.claude/commands/pageplan.md +171 -47
  9. package/.claude/contexts/design/accessibility.md +611 -611
  10. package/.claude/contexts/design/layout.md +400 -400
  11. package/.claude/contexts/design/responsive.md +551 -551
  12. package/.claude/contexts/design/shadows.md +522 -522
  13. package/.claude/contexts/design/typography.md +465 -465
  14. package/.claude/contexts/domain/README.md +164 -164
  15. package/.claude/contexts/patterns/agent-coordination.md +388 -388
  16. package/.claude/contexts/patterns/change-workflow.md +538 -538
  17. package/.claude/contexts/patterns/development-principles.md +513 -513
  18. package/.claude/contexts/patterns/error-handling.md +478 -478
  19. package/.claude/contexts/patterns/error-recovery.md +365 -365
  20. package/.claude/contexts/patterns/logging.md +424 -424
  21. package/.claude/contexts/patterns/task-breakdown.md +452 -452
  22. package/.claude/contexts/patterns/task-classification.md +523 -523
  23. package/.claude/contexts/patterns/tdd-classification.md +516 -516
  24. package/.claude/contexts/patterns/testing.md +413 -413
  25. package/.claude/contexts/patterns/validation-framework.md +776 -776
  26. package/.claude/lib/agent-router.md +572 -572
  27. package/.claude/lib/flags-updater.md +469 -469
  28. package/.claude/lib/tdd-classifier.md +345 -345
  29. package/.claude/lib/validation-gates.md +484 -484
  30. package/.claude/settings.local.json +42 -42
  31. package/.claude/templates/context-template.md +45 -45
  32. package/.claude/templates/flags-template.json +42 -42
  33. package/.claude/templates/phases-sections/accessibility-test.md +17 -17
  34. package/.claude/templates/phases-sections/api-design.md +37 -37
  35. package/.claude/templates/phases-sections/backend-tests.md +16 -16
  36. package/.claude/templates/phases-sections/backend.md +37 -37
  37. package/.claude/templates/phases-sections/business-logic-validation.md +16 -16
  38. package/.claude/templates/phases-sections/component-tests.md +17 -17
  39. package/.claude/templates/phases-sections/contract-backend.md +16 -16
  40. package/.claude/templates/phases-sections/contract-frontend.md +16 -16
  41. package/.claude/templates/phases-sections/database.md +35 -35
  42. package/.claude/templates/phases-sections/e2e-tests.md +16 -16
  43. package/.claude/templates/phases-sections/fix-implementation.md +17 -17
  44. package/.claude/templates/phases-sections/frontend-integration.md +18 -18
  45. package/.claude/templates/phases-sections/frontend-mockup.md +123 -123
  46. package/.claude/templates/phases-sections/manual-flow-test.md +15 -15
  47. package/.claude/templates/phases-sections/manual-ux-test.md +16 -16
  48. package/.claude/templates/phases-sections/refactor-implementation.md +17 -17
  49. package/.claude/templates/phases-sections/refactor.md +16 -16
  50. package/.claude/templates/phases-sections/regression-tests.md +15 -15
  51. package/.claude/templates/phases-sections/responsive-test.md +16 -16
  52. package/.claude/templates/phases-sections/script-implementation.md +43 -43
  53. package/.claude/templates/phases-sections/test-coverage.md +16 -16
  54. package/.claude/templates/phases-sections/user-approval.md +14 -14
  55. package/LICENSE +21 -21
  56. package/README.md +148 -467
  57. package/package.json +1 -1
package/.claude/CLAUDE.md CHANGED
@@ -1,46 +1,8 @@
1
1
  # CLAUDE.md
2
2
 
3
3
  > **Navigation Hub for AI Agents**
4
- > **Template Version:** 1.8.0 - Universal Multi-Agent Template (Opus 4.5)
5
- > **Latest:** Token Optimization - Removed documentation/report phases, verbose terminal output instead
6
-
7
- ---
8
-
9
- ## 📁 File Naming Conventions (OpenSpec + Template)
10
-
11
- > **IMPORTANT:** Avoid confusion between OpenSpec files and Template files
12
-
13
- ### OpenSpec Files (from [Fission-AI/OpenSpec](https://github.com/Fission-AI/OpenSpec))
14
-
15
- | File | Purpose | When to Read |
16
- |------|---------|--------------|
17
- | `proposal.md` | WHY - Goals, scope, rationale | Phase planning |
18
- | `tasks.md` | WHAT - Implementation checklist | Task tracking |
19
- | `design.md` | **Technical/Architecture decisions** (optional) | Backend/Database phases |
20
- | `specs/` | Delta specs (ADDED/MODIFIED/REMOVED) | Requirement validation |
21
-
22
- ### Template Files (from claude-multi-agent-template)
23
-
24
- | File | Purpose | When to Read |
25
- |------|---------|--------------|
26
- | `STYLE_GUIDE.md` | **Visual design** (colors, typography, spacing) | UI/Frontend phases |
27
- | `STYLE_TOKENS.json` | Lightweight design tokens (~500 tokens) | Quick UI reference |
28
- | `page-plan.md` | UI component layout + content strategy | uxui-frontend agent |
29
- | `phases.md` | Execution plan with agent assignments | All phases |
30
- | `flags.json` | Progress tracking | All phases |
31
-
32
- ### Key Distinction
33
-
34
- ```
35
- OpenSpec design.md = Technical Architecture (data flow, API structure, system design)
36
- Template STYLE_GUIDE = Visual Design (colors, fonts, spacing, component styles)
37
- ```
38
-
39
- **Agents should read BOTH when relevant:**
40
- - `uxui-frontend` → STYLE_GUIDE.md (visual) + design.md (if has UI architecture)
41
- - `backend` → design.md (API/data architecture)
42
- - `database` → design.md (data models, relationships)
43
- - `frontend` → STYLE_GUIDE.md (visual) + design.md (API contracts)
4
+ > **Template Version:** 2.0.0 - Universal Multi-Agent Template
5
+ > **Latest:** Design System v2.0 - Interactive setup, theme selection, selective pattern loading, page type detection
44
6
 
45
7
  ---
46
8
 
@@ -57,22 +19,23 @@ Universal, framework-agnostic template for AI-assisted development.
57
19
  - ✅ Domain-Specific Support (add your business logic)
58
20
 
59
21
  **What's NOT Included:**
60
- - ❌ Framework patterns → Generated dynamically via `/csetup`
61
- - ❌ Package managers → Auto-detected by `/csetup`
22
+ - ❌ Framework patterns → Generated dynamically via `/agentsetup`
23
+ - ❌ Package managers → Detected by `/agentsetup`
62
24
  - ❌ Spec frameworks → Optional (OpenSpec, BMAD, SpecKit)
63
25
 
64
26
  ---
65
27
 
66
28
  ## 📖 Quick Navigation
67
29
 
68
- **Design/UI:**
69
- - `/designsetup` - Auto-generate style guide from reference/codebase/AI
70
- - `design-system/STYLE_TOKENS.json` - **NEW!** Lightweight design tokens (~500 tokens)
71
- - `design-system/STYLE_GUIDE.md` - Full style guide (17 sections, ~5000 tokens)
72
- - `@/.claude/lib/document-loader.md` - **NEW!** Token-efficient loading patterns
30
+ **Design/UI (v2.0.0):**
31
+ - `/extract https://site.com` - **NEW!** Extract design from reference sites (multi-URL, style detection)
32
+ - `/designsetup @prd.md` - **ENHANCED!** Interactive design setup (3-round loop, theme selection)
33
+ - `design-system/tokens.json` - **v2.0!** Design tokens with style/theme/animations (~800 tokens)
34
+ - `design-system/patterns/*.md` - **NEW!** Selective code patterns (buttons, cards, forms, animations, decorations)
35
+ - `design-system/STYLE_GUIDE.md` - Human-readable guide (no code, ~150 lines)
36
+ - `.claude/extractions/*.json` - **NEW!** Extracted site data
37
+ - `@/.claude/lib/document-loader.md` - Token-efficient loading patterns
73
38
  - `@/.claude/contexts/design/index.md` (General design principles - fallback)
74
- - `@/.claude/contexts/design/box-thinking.md` (Layout analysis)
75
- - `@/.claude/contexts/patterns/ui-component-consistency.md` (Visual consistency)
76
39
 
77
40
  **Development:**
78
41
  - `@/.claude/contexts/patterns/task-classification.md` (Agent selection guide)
@@ -84,14 +47,18 @@ Universal, framework-agnostic template for AI-assisted development.
84
47
  - `@/.claude/contexts/patterns/frontend-component-strategy.md`
85
48
 
86
49
  **Project Setup:**
87
- - `/designsetup` - Auto-generate style guide (reference → codebase → AI)
88
- - `/csetup` - **v1.8.0:** Now auto-detects tech stack + generates best practices (replaces /psetup, /agentsetup)
50
+ - `/extract https://site.com` - Extract design from reference sites
51
+ - `/designsetup @prd.md` - Interactive design system setup
52
+ - `/psetup` - One-time project setup (detect tech stack, generate best practices)
53
+ - `/agentsetup` - Auto-detect tech stack and generate best practices
89
54
 
90
- **Page Planning (UI Tasks):**
91
- - `/pageplan @prd.md @brief.md` - **ENHANCED v1.4.0!** Generate page structure & conversion-optimized content
55
+ **Page Planning (UI Tasks) - v2.0.0:**
56
+ - `/pageplan @prd.md @brief.md` - **ENHANCED v2.0.0!** Generate page structure with auto page type detection
92
57
  - Output: `openspec/changes/{id}/page-plan.md` (component reuse, buyer avatar, conversion copy, asset checklist)
93
- - **NEW:** Buyer avatar analysis (Eugene Schwartz framework) for marketing pages
94
- - **NEW:** Conversion-optimized content (pain → promise → CTA)
58
+ - **NEW v2.0.0:** Auto-detects page type (landing/dashboard/auth) from proposal.md/tasks.md
59
+ - **NEW v2.0.0:** Reads tokens.json for style/theme/animations
60
+ - **NEW v2.0.0:** Loads patterns/*.md selectively based on page type
61
+ - Buyer avatar analysis (Eugene Schwartz framework) for marketing pages only
95
62
  - Used by: uxui-frontend agent (auto-reads in STEP 0.5)
96
63
 
97
64
  **OpenSpec Multi-Agent Workflow:**
@@ -101,7 +68,7 @@ Universal, framework-agnostic template for AI-assisted development.
101
68
  - `/cstatus {change-id}` - Quick progress status for a change
102
69
 
103
70
  **Best Practices (Dynamic):**
104
- - `.claude/contexts/domain/project/best-practices/` (auto-generated by `/csetup`)
71
+ - `.claude/contexts/domain/{project}/best-practices/` (generated by `/agentsetup`)
105
72
  - Framework-specific guidelines from Context7 MCP
106
73
 
107
74
  **Indexing (3 Levels):**
@@ -109,75 +76,107 @@ Universal, framework-agnostic template for AI-assisted development.
109
76
  - Level 2: `.claude/contexts/domain/{project}/README.md` (Project Overview)
110
77
  - Level 3: `.claude/contexts/domain/{project}/best-practices/index.md` (Best Practices Registry)
111
78
 
112
- **Implementation Logic:**
79
+ **🆕 Implementation Logic (v1.1.0):**
113
80
  - `@/.claude/lib/README.md` - Implementation logic overview
114
- - `@/.claude/lib/agent-executor.md` - Agent retry & escalation logic (used by /cdev) + 🆕 Incremental testing execution (v1.6.0)
81
+ - `@/.claude/lib/agent-executor.md` - Agent retry & escalation logic (used by /cdev)
115
82
  - `@/.claude/lib/tdd-classifier.md` - TDD classification logic (used by /csetup)
116
- - `@/.claude/lib/task-analyzer.md` - 🆕 Task analysis with milestone generation (v1.6.0)
117
- - `@/.claude/lib/flags-updater.md` - Progress tracking protocol (Main Claude updates flags.json)
118
- - `@/.claude/lib/agent-router.md` - Mandatory agent routing rules (enforce delegation)
83
+ - `@/.claude/lib/flags-updater.md` - 🆕 Progress tracking protocol (Main Claude updates flags.json)
84
+ - `@/.claude/lib/agent-router.md` - 🆕 Mandatory agent routing rules (enforce delegation)
119
85
  - `@/.claude/contexts/patterns/agent-discovery.md` - Shared agent discovery flow
120
86
 
121
87
  ---
122
88
 
123
- ## 📚 Best Practices System (v1.8.0)
89
+ ## 📚 Best Practices System
124
90
 
125
- **Quick Summary:**
126
- - `/csetup` **auto-detects tech stack** from: package.json → design.md → proposal/tasks (3 sources)
127
- - **Auto-generates best practices** from Context7 MCP (React, Next.js, Prisma, etc.)
128
- - Files created in `.claude/contexts/domain/project/best-practices/`
129
- - **Agents MUST read** best practices before coding (validated by agent-executor)
130
- - `/cdev` **injects** relevant best-practices paths into agent prompts
91
+ **→ See:** `@/.claude/lib/detailed-guides/best-practices-system.md` for complete guide
131
92
 
132
- **Flow:**
133
- ```
134
- /csetup detect stack query Context7 generate best-practices
135
- /cdev → inject paths into promptagent reads validation checks
136
- ```
93
+ **Quick Summary:**
94
+ - Run `/agentsetup` → Auto-detects tech stack → Queries Context7 → Generates framework-specific best practices
95
+ - Files created in `.claude/contexts/domain/{project}/best-practices/` (React, Next.js, Prisma, etc.)
96
+ - Agents auto-discover via 3-level indexing (domain projectbest-practices)
97
+ - Enforces code quality with framework-specific patterns
137
98
 
138
99
  ---
139
100
 
140
- ## 🎨 Design System / Style Guide Generation
101
+ ## 🎨 Design System v2.0.0 (Interactive Setup)
141
102
 
142
103
  **→ See:** `@/.claude/lib/detailed-guides/design-system.md` for complete guide
143
104
 
144
105
  **Quick Summary:**
145
- - `/designsetup` auto-detects project context with **3 smart paths**: Reference design → Brownfield (reverse engineering) → Greenfield (AI-generated)
146
- - Generates comprehensive `design-system/STYLE_GUIDE.md` (17 sections: colors, typography, spacing, components, etc.)
147
- - **uxui-frontend agent** auto-reads style guide (Priority #1) or falls back to general design principles
148
- - Ensures visual consistency, prevents duplicates, enforces accessibility
106
+ - `/extract https://site.com` Extracts design from reference sites (multi-URL, style detection)
107
+ - `/designsetup @prd.md` Interactive 3-round loop with theme selection
108
+ - Generates:
109
+ - `tokens.json` - Design tokens with style/theme/animations (~800 tokens) **FOR AGENTS**
110
+ - `patterns/*.md` - Code patterns (buttons, cards, forms, animations, decorations) **SELECTIVE LOADING**
111
+ - `STYLE_GUIDE.md` - Human-readable guide (no code, ~150 lines) **FOR HUMANS**
112
+
113
+ **New Features in v2.0.0:**
114
+ - 🎯 **Style Detection:** Neo-Brutalism, Minimalist, Glassmorphism, Modern SaaS, etc.
115
+ - 🎭 **Theme Selection:** AI recommends themes based on project context
116
+ - 🎬 **Animation Support:** GSAP, ScrollTrigger, Framer Motion detection
117
+ - 📜 **Scroll Patterns:** stacking-cards, parallax, fade-in, slide-in
118
+ - 🖼️ **Decorative Direction:** USE/AVOID elements for theme consistency
119
+
120
+ **Flow:**
121
+ ```
122
+ /extract → .claude/extractions/*.json
123
+
124
+ /designsetup → tokens.json + patterns/*.md + STYLE_GUIDE.md
125
+
126
+ /pageplan → page-plan.md (reads tokens.json, auto-detects page type)
127
+
128
+ /csetup → phases.md (reads page-plan.md)
129
+
130
+ /cdev → uxui-frontend (reads tokens.json + patterns/*.md selectively)
131
+ ```
149
132
 
150
133
  ---
151
134
 
152
- ## ⚡ Context Optimization (v1.2.0)
135
+ ## ⚡ Context Optimization (v2.0.0)
153
136
 
154
137
  **→ See:** `@/.claude/lib/detailed-guides/context-optimization.md` for complete guide
155
138
 
156
139
  **Quick Summary:**
157
140
  - **Problem:** 20K tokens wasted (STYLE_GUIDE.md read 4x by different commands/agents)
158
- - **Solution:** 3-tier loading → STYLE_TOKENS.json (500 tokens) → design-context.md (1K) → STYLE_GUIDE.md (5K, selective)
159
- - **Result:** 70% token reduction (~4.7K total), 3-4x faster, maintained quality
141
+ - **Solution (v2.0.0):**
142
+ - `tokens.json` (~800 tokens) - **PRIMARY: All agents read this**
143
+ - `patterns/*.md` - **SELECTIVE: Load based on page type**
144
+ - `STYLE_GUIDE.md` (~150 lines) - **HUMAN-READABLE: No code**
145
+ - **Page Type Detection:**
146
+ - Landing/Marketing → Full patterns (buttons, cards, scroll-animations, decorations)
147
+ - Dashboard/Admin → Minimal patterns (buttons, cards, forms)
148
+ - Auth → Clean patterns (buttons, forms)
149
+ - **Result:** 84% token reduction (~800 tokens vs ~5000), 4x faster, theme consistency
160
150
 
161
151
  ---
162
152
 
163
- ## 📋 Page Planning System (v1.4.0 - Conversion-Optimized)
153
+ ## 📋 Page Planning System (v2.0.0 - Auto Page Type Detection)
164
154
 
165
155
  **→ See:** `@/.claude/lib/detailed-guides/page-planning.md` for complete guide
166
156
 
167
157
  **Quick Summary:**
168
- - **Problem:** Agents duplicate components (Navbar 3x), use random colors, lorem ipsum content, **generic copy that doesn't convert**
158
+ - **Problem:** Agents duplicate components (Navbar 3x), use random colors, lorem ipsum content, wrong decorations for page type
169
159
  - **Solution:** `/pageplan @prd.md @brief.md` → Generates `openspec/changes/{id}/page-plan.md` with:
160
+ - **Auto page type detection** 🆕 (landing/dashboard/auth from proposal.md/tasks.md)
161
+ - **tokens.json integration** 🆕 (style, theme, animations, decorative direction)
162
+ - **Selective pattern loading** 🆕 (only load patterns relevant to page type)
170
163
  - Component reuse plan ✅ (prevent duplicates)
171
- - **Buyer avatar analysis** 🆕 (Eugene Schwartz framework)
172
- - **Conversion-optimized content** 🆕 (pain → promise → CTA)
164
+ - Buyer avatar analysis (Eugene Schwartz framework) **for marketing pages only**
165
+ - Conversion-optimized content (pain → promise → CTA) **for marketing pages only**
173
166
  - Asset checklist ✅ (performance-optimized)
174
- - **Benefits:**
175
- - Prevents duplicates, ensures design consistency
176
- - **Real content from PRD with conversion psychology** 🆕
177
- - **2-5x better conversion rates** (pain-based headlines vs generic)
178
- - 25% faster (search + copy strategy done once upfront)
179
- - **Use for:** Landing pages, marketing sites, product pages (auto-detects marketing vs dashboard)
180
- - **Skips for:** Dashboards, admin panels, backend/database work (no buyer avatar needed)
167
+
168
+ **Page Type Handling:**
169
+ | Page Type | Decorations | Scroll Anims | Buyer Avatar | Patterns Loaded |
170
+ |-----------|-------------|--------------|--------------|-----------------|
171
+ | Landing/Marketing | Full | Enabled | ✅ Enabled | buttons, cards, scroll-anims, decorations |
172
+ | Dashboard/Admin | Minimal | Disabled | Skipped | buttons, cards, forms |
173
+ | Auth (Login/Register) | None | Disabled | Skipped | buttons, forms |
174
+
175
+ **Benefits:**
176
+ - Auto-detects page type from context (no manual config)
177
+ - Theme + decorations from tokens.json applied consistently
178
+ - 84% token reduction (selective pattern loading)
179
+ - Conversion-optimized only where needed (marketing pages)
181
180
 
182
181
  ---
183
182
 
@@ -193,20 +192,6 @@ Universal, framework-agnostic template for AI-assisted development.
193
192
 
194
193
  ---
195
194
 
196
- ## 🔄 Incremental Testing (v1.6.0)
197
-
198
- **→ See:** `@/.claude/lib/detailed-guides/incremental-testing.md` for complete guide
199
-
200
- **Quick Summary:**
201
- - **Problem:** All-or-nothing testing → bugs found at scale (1000 records) → hard to debug, expensive rework
202
- - **Solution:** Milestone-based validation → Test 1 record → 10 → errors → scale → catch bugs early (75% faster debug)
203
- - **3 Patterns:** Backend API (4 milestones), Complex Form (3 milestones), Database Migration (3 milestones)
204
- - **Round-based Retry:** 2 attempts → Main Claude intervention (hints vs ask human) → new round (unlimited)
205
- - **Detection:** Auto-triggered for Risk=HIGH OR (Risk=MEDIUM + Complexity≥7) OR External API OR Data-intensive (~20-30% of tasks)
206
- - **Benefits:** 60-70% rework reduction, 40-50% net speedup, 90% success rate with progressive confidence
207
-
208
- ---
209
-
210
195
  ## 🤖 Agent System
211
196
 
212
197
  **→ See:** `@/.claude/lib/detailed-guides/agent-system.md` for complete guide
@@ -44,23 +44,54 @@ Read in order:
44
44
 
45
45
  ---
46
46
 
47
- ### Step 2.5: Validate Design System (Context Optimization v1.2.0)
47
+ ### Step 2.5: Validate Design System & Page Plan (v2.0.0)
48
48
 
49
- > **New:** Validate design files exist for UI work
49
+ > **Updated v2.0.0:** Validate design files + read page-plan.md if exists
50
50
 
51
51
  ```typescript
52
52
  // Detect if change involves UI/frontend work
53
53
  const tasksContent = Read('openspec/changes/{change-id}/tasks.md')
54
54
  const hasFrontend = tasksContent.toLowerCase().match(/(ui|component|page|frontend|design|responsive)/i)
55
55
 
56
+ let tokens = null
57
+ let pagePlan = null
58
+ let pageType = 'generic'
59
+
56
60
  if (hasFrontend) {
57
61
  output(`\n🎨 UI work detected - validating design system...`)
58
62
 
59
- const tokensPath = 'design-system/STYLE_TOKENS.json'
63
+ const tokensPath = 'design-system/tokens.json' // v2.0 tokens
60
64
  const styleGuidePath = 'design-system/STYLE_GUIDE.md'
65
+ const pagePlanPath = `openspec/changes/${changeId}/page-plan.md`
61
66
 
62
67
  const hasTokens = fileExists(tokensPath)
63
68
  const hasStyleGuide = fileExists(styleGuidePath)
69
+ const hasPagePlan = fileExists(pagePlanPath)
70
+
71
+ // ========== LOAD tokens.json (v2.0 structure) ==========
72
+ if (hasTokens) {
73
+ tokens = JSON.parse(Read(tokensPath))
74
+ output(`✅ tokens.json Loaded:`)
75
+ output(` - Style: ${tokens.style.name}`)
76
+ output(` - Theme: ${tokens.theme.name}`)
77
+ output(` - Animations: ${tokens.animations.enabled ? 'Enabled' : 'Disabled'}`)
78
+ }
79
+
80
+ // ========== LOAD page-plan.md (if exists) ==========
81
+ if (hasPagePlan) {
82
+ pagePlan = Read(pagePlanPath)
83
+ output(`✅ page-plan.md Found`)
84
+
85
+ // Extract page type from page-plan.md
86
+ const pageTypeMatch = pagePlan.match(/Page Type:\*\*\s*(.*)/i)
87
+ if (pageTypeMatch) {
88
+ pageType = pageTypeMatch[1].trim().toLowerCase()
89
+ output(` - Page Type: ${pageType}`)
90
+ }
91
+ } else {
92
+ output(`ℹ️ page-plan.md not found (optional)`)
93
+ output(` → Run /pageplan first for better component planning`)
94
+ }
64
95
 
65
96
  if (!hasTokens || !hasStyleGuide) {
66
97
  warn(`
@@ -68,7 +99,8 @@ if (hasFrontend) {
68
99
 
69
100
  Found:
70
101
  ${hasStyleGuide ? '✅' : '❌'} STYLE_GUIDE.md
71
- ${hasTokens ? '✅' : '❌'} STYLE_TOKENS.json
102
+ ${hasTokens ? '✅' : '❌'} tokens.json
103
+ ${hasPagePlan ? '✅' : '❌'} page-plan.md
72
104
 
73
105
  This may result in:
74
106
  - Inconsistent colors (random hex codes)
@@ -77,7 +109,8 @@ This may result in:
77
109
 
78
110
  Recommendation:
79
111
  1. Run: /designsetup
80
- 2. Then: /csetup ${changeId}
112
+ 2. Run: /pageplan @prd.md (optional but recommended)
113
+ 3. Then: /csetup ${changeId}
81
114
 
82
115
  Continue anyway? (yes/no)
83
116
  `)
@@ -89,7 +122,8 @@ Continue anyway? (yes/no)
89
122
  } else {
90
123
  output(`✅ Design System Ready`)
91
124
  output(` - STYLE_GUIDE.md ✓`)
92
- output(` - STYLE_TOKENS.json ✓`)
125
+ output(` - tokens.json ✓`)
126
+ if (hasPagePlan) output(` - page-plan.md ✓`)
93
127
  }
94
128
  }
95
129
  ```
@@ -799,39 +833,66 @@ const projectTech = Read('.claude/contexts/domain/project/tech-stack.md')
799
833
  // Detect additional tech from proposal/tasks
800
834
  const additionalTech = detectAdditionalTech(proposalContent, tasksContent)
801
835
 
802
- // 🆕 Load design info (if UI work)
836
+ // 🆕 Load design info (if UI work) - v2.0.0
803
837
  let designInfo = ''
804
- if (hasFrontend) {
805
- const tokensPath = 'design-system/STYLE_TOKENS.json'
806
-
807
- if (fileExists(tokensPath)) {
808
- const tokens = JSON.parse(Read(tokensPath))
809
-
810
- designInfo = `
811
- ## 🎨 Design System (Context Optimization v1.2.0)
812
-
813
- **Design Files (Token-Efficient):**
814
- - STYLE_TOKENS.json: \`design-system/STYLE_TOKENS.json\` (~500 tokens)
815
- - STYLE_GUIDE.md: \`design-system/STYLE_GUIDE.md\` (~5000 tokens, load selectively)
816
-
817
- **Key Design Tokens:**
818
- - Primary Color: ${tokens.tokens.colors.primary.DEFAULT}
838
+ if (hasFrontend && tokens) {
839
+ designInfo = `
840
+ ## 🎨 Design System (v2.0.0)
841
+
842
+ **Design Files:**
843
+ - tokens.json: \`design-system/tokens.json\` (~800 tokens)
844
+ - patterns/: \`design-system/patterns/*.md\` (selective loading)
845
+ - STYLE_GUIDE.md: \`design-system/STYLE_GUIDE.md\` (human-readable, ~150 lines)
846
+ ${pagePlan ? `- page-plan.md: \`openspec/changes/${changeId}/page-plan.md\` ✅` : ''}
847
+
848
+ **Style Direction:**
849
+ - Style: ${tokens.style.name}
850
+ - Theme: ${tokens.theme.name}
851
+ - Feel: ${tokens.style.feel}
852
+
853
+ **Design Tokens:**
854
+ - Primary Color: ${tokens.colors.primary.DEFAULT}
819
855
  - Component Library: ${tokens.component_library.name}
820
- - Spacing Scale: ${tokens.tokens.spacing.scale.join(', ')}px
821
- - Shadows: ${Object.keys(tokens.tokens.shadows).slice(0, 5).join(', ')}
822
-
823
- **Agent Loading (STEP 0.5 for uxui-frontend):**
824
- 1. Read: STYLE_TOKENS.json (~500 tokens)
825
- 2. Optional: STYLE_GUIDE.md (selective sections ~2K tokens)
826
- 3. Report: Design tokens extracted
856
+ - Spacing Scale: ${tokens.spacing.scale.join(', ')}px
857
+ - Animations: ${tokens.animations.enabled ? 'Enabled' : 'Disabled'}
858
+
859
+ **Theme & Decorations:**
860
+ ${pageType.includes('landing') || pageType.includes('marketing') ? `
861
+ - Decorations: Enabled
862
+ - USE: ${tokens.theme.decorative_elements.use.slice(0, 3).join(', ')}
863
+ - AVOID: ${tokens.theme.decorative_elements.avoid.slice(0, 2).join(', ') || '(none)'}
864
+ - Scroll Animations: ✅ Enabled
865
+ ` : `
866
+ - Decorations: ❌ Disabled (${pageType} page)
867
+ - Scroll Animations: ❌ Disabled
868
+ `}
869
+
870
+ **Pattern Files to Load:**
871
+ ${pageType.includes('landing') || pageType.includes('marketing') ?
872
+ `- patterns/buttons.md ✅
873
+ - patterns/cards.md ✅
874
+ - patterns/scroll-animations.md ✅
875
+ - patterns/decorations.md ✅` :
876
+ pageType.includes('auth') ?
877
+ `- patterns/buttons.md ✅
878
+ - patterns/forms.md ✅` :
879
+ `- patterns/buttons.md ✅
880
+ - patterns/cards.md ✅
881
+ - patterns/forms.md ✅`}
882
+
883
+ **Agent Instructions (uxui-frontend STEP 0.5):**
884
+ 1. Read: tokens.json (~800 tokens) ✅
885
+ 2. Read: page-plan.md (if exists) ✅
886
+ 3. Load patterns selectively based on page type
887
+ 4. Report: Design tokens + page type extracted
827
888
 
828
889
  **Critical Rules:**
829
890
  - ❌ NO hardcoded colors (text-gray-500)
830
891
  - ✅ USE theme tokens (text-foreground/70)
831
892
  - ❌ NO arbitrary spacing (p-5)
832
893
  - ✅ USE spacing scale (p-4, p-6)
894
+ - ${pageType.includes('landing') ? '✅ Apply decorations from theme' : '❌ Skip decorations for this page type'}
833
895
  `
834
- }
835
896
  }
836
897
 
837
898
  // Replace placeholders
@@ -1,60 +1,60 @@
1
- ---
2
- name: Change Status
3
- description: Quick progress status for a change
4
- category: Multi-Agent
5
- tags: [status, progress, quick]
6
- ---
7
-
8
- ## Usage
9
-
10
- ```bash
11
- /cstatus {change-id}
12
- ```
13
-
14
- ## What It Does
15
-
16
- Shows quick progress summary:
17
- - Progress percentage with bar
18
- - Current phase
19
- - Time spent/remaining
20
- - Quick stats
21
-
22
- ## Output Format
23
-
24
- ```
25
- 📊 CHANGE-{id}: {type} | {template}
26
-
27
- Progress: [████████░░] 64% (7/11 phases)
28
-
29
- Current Phase: #8 Refactor (test-debug)
30
- ├─ Started: 14:15 (15 minutes ago)
31
- ├─ Estimated: 20 minutes
32
- └─ Status: in_progress
33
-
34
- ✅ Completed: 7 phases
35
- 🔄 In Progress: 1 phase
36
- ⏳ Remaining: 3 phases
37
-
38
- ⏱️ Time:
39
- ├─ Spent: 2h 55min (estimated: 3h 15min)
40
- ├─ Remaining: ~35 minutes
41
- └─ Efficiency: 111% (ahead of estimate)
42
-
43
- 📈 Stats:
44
- ├─ Tests: 12 passed, 0 failed (75% coverage)
45
- ├─ Issues: 2 found, 2 fixed, 0 remaining
46
- └─ Files: 4 created, 2 modified
47
-
48
- 🎯 Next Steps:
49
- 1. Complete refactoring (20 min)
50
- 2. Test coverage report (5 min)
51
- 3. Documentation (15 min)
52
-
53
- Commands:
54
- → Detailed view: /cview {change-id}
55
- → Continue dev: /cdev {change-id}
56
- ```
57
-
58
- ## Implementation
59
-
60
- Read `openspec/changes/{change-id}/.claude/flags.json` and format output using helper functions.
1
+ ---
2
+ name: Change Status
3
+ description: Quick progress status for a change
4
+ category: Multi-Agent
5
+ tags: [status, progress, quick]
6
+ ---
7
+
8
+ ## Usage
9
+
10
+ ```bash
11
+ /cstatus {change-id}
12
+ ```
13
+
14
+ ## What It Does
15
+
16
+ Shows quick progress summary:
17
+ - Progress percentage with bar
18
+ - Current phase
19
+ - Time spent/remaining
20
+ - Quick stats
21
+
22
+ ## Output Format
23
+
24
+ ```
25
+ 📊 CHANGE-{id}: {type} | {template}
26
+
27
+ Progress: [████████░░] 64% (7/11 phases)
28
+
29
+ Current Phase: #8 Refactor (test-debug)
30
+ ├─ Started: 14:15 (15 minutes ago)
31
+ ├─ Estimated: 20 minutes
32
+ └─ Status: in_progress
33
+
34
+ ✅ Completed: 7 phases
35
+ 🔄 In Progress: 1 phase
36
+ ⏳ Remaining: 3 phases
37
+
38
+ ⏱️ Time:
39
+ ├─ Spent: 2h 55min (estimated: 3h 15min)
40
+ ├─ Remaining: ~35 minutes
41
+ └─ Efficiency: 111% (ahead of estimate)
42
+
43
+ 📈 Stats:
44
+ ├─ Tests: 12 passed, 0 failed (75% coverage)
45
+ ├─ Issues: 2 found, 2 fixed, 0 remaining
46
+ └─ Files: 4 created, 2 modified
47
+
48
+ 🎯 Next Steps:
49
+ 1. Complete refactoring (20 min)
50
+ 2. Test coverage report (5 min)
51
+ 3. Documentation (15 min)
52
+
53
+ Commands:
54
+ → Detailed view: /cview {change-id}
55
+ → Continue dev: /cdev {change-id}
56
+ ```
57
+
58
+ ## Implementation
59
+
60
+ Read `openspec/changes/{change-id}/.claude/flags.json` and format output using helper functions.