@champpaba/claude-agent-kit 2.5.0 → 2.7.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 (32) hide show
  1. package/.claude/CLAUDE.md +103 -58
  2. package/.claude/agents/02-uxui-frontend.md +5 -6
  3. package/.claude/agents/07-ux-tester.md +407 -0
  4. package/.claude/commands/cdev.md +113 -8
  5. package/.claude/commands/csetup.md +86 -28
  6. package/.claude/commands/designsetup.md +171 -48
  7. package/.claude/commands/extract.md +382 -668
  8. package/.claude/commands/pageplan.md +43 -27
  9. package/.claude/contexts/design/box-thinking.md +4 -4
  10. package/.claude/contexts/design/color-theory.md +5 -5
  11. package/.claude/contexts/design/index.md +9 -9
  12. package/.claude/contexts/design/spacing.md +4 -4
  13. package/.claude/contexts/patterns/agent-discovery.md +1 -1
  14. package/.claude/contexts/patterns/animation-patterns.md +3 -3
  15. package/.claude/contexts/patterns/ui-component-consistency.md +3 -3
  16. package/.claude/lib/README.md +1 -1
  17. package/.claude/lib/agent-executor.md +223 -0
  18. package/.claude/lib/context-loading-protocol.md +5 -6
  19. package/.claude/lib/detailed-guides/agent-system.md +4 -4
  20. package/.claude/lib/detailed-guides/best-practices-system.md +5 -4
  21. package/.claude/lib/detailed-guides/context-optimization.md +21 -22
  22. package/.claude/lib/detailed-guides/design-system.md +6 -5
  23. package/.claude/lib/detailed-guides/page-planning.md +6 -6
  24. package/.claude/lib/document-loader.md +32 -47
  25. package/.claude/lib/task-analyzer.md +194 -1
  26. package/.claude/templates/PROJECT_STATUS.template.yml +1 -1
  27. package/.claude/templates/STYLE_GUIDE.template.md +7 -7
  28. package/.claude/templates/design-context-template.md +22 -29
  29. package/.claude/templates/page-plan-example.md +9 -9
  30. package/.claude/templates/phases-sections/ux-testing.md +164 -0
  31. package/README.md +3 -1
  32. package/package.json +1 -1
package/.claude/CLAUDE.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # CLAUDE.md
2
2
 
3
3
  > **Navigation Hub for AI Agents**
4
- > **Template Version:** 2.5.0 - Smart Topic Query
5
- > **Latest:** Cross-library integration detection + Integration risk summary + Proactive error prevention
4
+ > **Template Version:** 2.1.0 - Universal Multi-Agent Template
5
+ > **Latest:** Design System v2.1 - YAML-based extraction, single data.yaml output
6
6
 
7
7
  ---
8
8
 
@@ -23,8 +23,8 @@
23
23
 
24
24
  | File | Purpose | When to Read |
25
25
  |------|---------|--------------|
26
- | `STYLE_GUIDE.md` | **Visual design** (colors, typography, spacing) | UI/Frontend phases |
27
- | `tokens.json` | Design tokens with style/theme/animations (~800 tokens) | Quick UI reference |
26
+ | `README.md` | **Visual design summary** (human-readable) | UI/Frontend phases |
27
+ | `data.yaml` | Design tokens + psychology (~300 lines) | Quick UI reference |
28
28
  | `page-plan.md` | UI component layout + content strategy | uxui-frontend agent |
29
29
  | `phases.md` | Execution plan with agent assignments | All phases |
30
30
  | `flags.json` | Progress tracking | All phases |
@@ -33,14 +33,14 @@
33
33
 
34
34
  ```
35
35
  OpenSpec design.md = Technical Architecture (data flow, API structure, system design)
36
- Template STYLE_GUIDE = Visual Design (colors, fonts, spacing, component styles)
36
+ Template data.yaml = Visual Design (colors, fonts, spacing, component styles)
37
37
  ```
38
38
 
39
39
  **Agents should read BOTH when relevant:**
40
- - `uxui-frontend` → STYLE_GUIDE.md (visual) + design.md (if has UI architecture)
40
+ - `uxui-frontend` → data.yaml (visual tokens) + design.md (if has UI architecture)
41
41
  - `backend` → design.md (API/data architecture)
42
42
  - `database` → design.md (data models, relationships)
43
- - `frontend` → STYLE_GUIDE.md (visual) + design.md (API contracts)
43
+ - `frontend` → data.yaml (visual tokens) + design.md (API contracts)
44
44
 
45
45
  ---
46
46
 
@@ -49,7 +49,7 @@ Template STYLE_GUIDE = Visual Design (colors, fonts, spacing, component styles)
49
49
  Universal, framework-agnostic template for AI-assisted development.
50
50
 
51
51
  **What's Included:**
52
- - ✅ 6 Specialized Agents (integration + 5 domain specialists)
52
+ - ✅ 7 Specialized Agents (integration + ux-tester + 5 domain specialists)
53
53
  - ✅ Universal Patterns (logging, testing, error-handling, agent selection)
54
54
  - ✅ Design Foundation (color theory, spacing, typography)
55
55
  - ✅ **Auto-Generated Best Practices** (from Context7 MCP per project)
@@ -65,13 +65,12 @@ Universal, framework-agnostic template for AI-assisted development.
65
65
 
66
66
  ## 📖 Quick Navigation
67
67
 
68
- **Design/UI (v2.0.0):**
69
- - `/extract https://site.com` - Extract design from reference sites (multi-URL, style detection)
68
+ **Design/UI (v2.1.0):**
69
+ - `/extract https://site.com` - Extract design from reference sites (one site at a time, incremental)
70
70
  - `/designsetup @prd.md` - Interactive design setup (3-round loop, theme selection)
71
- - `design-system/tokens.json` - Design tokens with style/theme/animations (~800 tokens)
72
- - `design-system/patterns/*.md` - Selective code patterns (buttons, cards, forms, animations, decorations)
73
- - `design-system/STYLE_GUIDE.md` - Human-readable guide (no code, ~150 lines)
74
- - `.claude/extractions/*.json` - Extracted site data
71
+ - `design-system/extracted/*/data.yaml` - Extracted site data (full YAML with 17+ sections)
72
+ - `design-system/data.yaml` - **v2.1!** Complete design data for agents (~800 lines)
73
+ - `design-system/README.md` - Human-readable summary (~100 lines)
75
74
  - `@/.claude/lib/document-loader.md` - Token-efficient loading patterns
76
75
  - `@/.claude/contexts/design/index.md` (General design principles - fallback)
77
76
 
@@ -93,7 +92,7 @@ Universal, framework-agnostic template for AI-assisted development.
93
92
  - `/pageplan @prd.md @brief.md` - Generate page structure with auto page type detection
94
93
  - Output: `openspec/changes/{id}/page-plan.md` (component reuse, buyer avatar, conversion copy, asset checklist)
95
94
  - Auto-detects page type (landing/dashboard/auth) from proposal.md/tasks.md
96
- - Reads tokens.json for style/theme/animations
95
+ - Reads data.yaml for style/theme/animations
97
96
  - Loads patterns/*.md selectively based on page type
98
97
  - Buyer avatar analysis (Eugene Schwartz framework) for marketing pages only
99
98
  - Used by: uxui-frontend agent (auto-reads in STEP 0.5)
@@ -179,67 +178,50 @@ Universal, framework-agnostic template for AI-assisted development.
179
178
 
180
179
  ---
181
180
 
182
- ## 🎨 Design System v2.0.0 (Interactive Setup)
181
+ ## 🎨 Design System v2.1.0 (YAML-based)
183
182
 
184
183
  **→ See:** `@/.claude/lib/detailed-guides/design-system.md` for complete guide
185
184
 
186
185
  **Quick Summary:**
187
- - `/extract https://site.com` → Extracts design from reference sites (multi-URL, style detection)
186
+ - `/extract https://site.com` → Extracts design from reference site (one at a time, incremental)
188
187
  - `/designsetup @prd.md` → Interactive 3-round loop with theme selection
189
188
  - Generates:
190
- - `tokens.json` - Design tokens with style/theme/animations (~800 tokens) **FOR AGENTS**
191
- - `patterns/*.md` - Code patterns (buttons, cards, forms, animations, decorations) **SELECTIVE LOADING**
192
- - `STYLE_GUIDE.md` - Human-readable guide (no code, ~150 lines) **FOR HUMANS**
193
-
194
- **New Features in v2.0.0:**
195
- - 🎯 **Style Detection:** Neo-Brutalism, Minimalist, Glassmorphism, Modern SaaS, etc.
196
- - 🎭 **Theme Selection:** AI recommends themes based on project context
197
- - 🎬 **Animation Support:** GSAP, ScrollTrigger, Framer Motion detection
198
- - 📜 **Scroll Patterns:** stacking-cards, parallax, fade-in, slide-in
199
- - 🖼️ **Decorative Direction:** USE/AVOID elements for theme consistency
200
-
201
- **Flow (v2.4.0):**
189
+ - `data.yaml` - Complete design data (~800 lines) **FOR AGENTS**
190
+ - `README.md` - Human-readable summary (~100 lines) **FOR HUMANS**
191
+
192
+ **Features:**
193
+ - Style Detection: Neo-Brutalism, Minimalist, Glassmorphism, Modern SaaS, etc.
194
+ - Theme Selection: AI recommends themes based on project context
195
+ - Animation Support: GSAP, ScrollTrigger, Framer Motion detection
196
+ - Scroll Patterns: stacking-cards, parallax, fade-in, slide-in
197
+ - Decorative Direction: USE/AVOID elements for theme consistency
198
+
199
+ **Flow:**
202
200
  ```
203
- /extract → .claude/extractions/*.json
201
+ /extract https://site1.com design-system/extracted/site1/data.yaml
202
+ /extract https://site2.com → design-system/extracted/site2/data.yaml (incremental)
204
203
 
205
- /designsetup → tokens.json + patterns/*.md + STYLE_GUIDE.md
204
+ /designsetup @prd.md design-system/data.yaml + design-system/README.md
206
205
 
207
- /pageplan → page-plan.md (VISUAL: layout, components, animations, assets)
206
+ /pageplan → page-plan.md (reads data.yaml, auto-detects page type)
208
207
 
209
- /csetup → research-checklist.md (RESEARCH: best practices, content, UX)
210
- → best-practices/*.md (Stack: Context7)
211
- → phases.md
208
+ /csetup → phases.md (reads page-plan.md)
212
209
 
213
- /cdev → uxui-frontend reads:
214
- - tokens.json (design tokens)
215
- - patterns/*.md (code patterns)
216
- - page-plan.md (visual structure)
217
- - research-checklist.md (content & UX)
210
+ /cdev → uxui-frontend (reads data.yaml)
218
211
  ```
219
212
 
220
- **Separation of Concerns:**
221
- | Command | Focus | Output |
222
- |---------|-------|--------|
223
- | `/pageplan` | Visual (layout, wireframe, animations) | `page-plan.md` |
224
- | `/csetup` | Research (best practices, content, UX) | `research-checklist.md` |
225
-
226
213
  ---
227
214
 
228
- ## ⚡ Context Optimization (v2.0.0)
215
+ ## ⚡ Context Optimization (v2.1.0)
229
216
 
230
217
  **→ See:** `@/.claude/lib/detailed-guides/context-optimization.md` for complete guide
231
218
 
232
219
  **Quick Summary:**
233
- - **Problem:** 20K tokens wasted (STYLE_GUIDE.md read 4x by different commands/agents)
234
- - **Solution (v2.0.0):**
235
- - `tokens.json` (~800 tokens) - **PRIMARY: All agents read this**
236
- - `patterns/*.md` - **SELECTIVE: Load based on page type**
237
- - `STYLE_GUIDE.md` (~150 lines) - **HUMAN-READABLE: No code**
238
- - **Page Type Detection:**
239
- - Landing/Marketing → Full patterns (buttons, cards, scroll-animations, decorations)
240
- - Dashboard/Admin → Minimal patterns (buttons, cards, forms)
241
- - Auth → Clean patterns (buttons, forms)
242
- - **Result:** 84% token reduction (~800 tokens vs ~5000), 4x faster, theme consistency
220
+ - **Problem:** Multiple files read by different commands/agents
221
+ - **Solution (v2.1.0):**
222
+ - `data.yaml` (~800 lines) - **SINGLE SOURCE: All agents read this**
223
+ - `README.md` (~100 lines) - **HUMAN-READABLE: Summary only**
224
+ - **Result:** Single file for all design data, consistent across all agents
243
225
 
244
226
  ---
245
227
 
@@ -301,15 +283,17 @@ Universal, framework-agnostic template for AI-assisted development.
301
283
  **→ See:** `@/.claude/lib/detailed-guides/agent-system.md` for complete guide
302
284
 
303
285
  **Quick Summary:**
304
- - **6 specialist agents**: integration (validate contracts), uxui-frontend (UI with mock data), test-debug (tests/bugs), frontend (connect UI to API), backend (API endpoints), database (schemas/migrations)
286
+ - **7 specialist agents**: integration (validate contracts), uxui-frontend (UI with mock data), **ux-tester** (persona-based UX testing), test-debug (tests/bugs), frontend (connect UI to API), backend (API endpoints), database (schemas/migrations)
305
287
  - **Main Claude's role**: Orchestrator (plan, coordinate, report), NOT implementer (no writing code directly)
306
288
  - **Self-check protocol**: Checklist before ANY work (detect work type → select agent → delegate)
307
289
  - **Agent pre-work**: STEP 0 (project discovery for ALL) + STEP 1-5 (design fundamentals for uxui-frontend only)
290
+ - **Approval Gate (v2.7.0)**: ux-tester phase requires user approval before proceeding to backend
308
291
 
309
292
  **Example workflow:**
310
293
  ```
311
294
  User: "Build login system"
312
295
  → Phase 1: uxui-frontend (UI)
296
+ → Phase 1.5: ux-tester (approval gate) ← NEW!
313
297
  → Phase 2: backend + database (parallel)
314
298
  → Phase 2.5: integration (validate contracts)
315
299
  → Phase 3: frontend (connect UI to API)
@@ -318,6 +302,67 @@ User: "Build login system"
318
302
 
319
303
  ---
320
304
 
305
+ ## 🆕 v2.7.0: UX Testing Agent (Persona-Based)
306
+
307
+ **Problem Solved:** UI was approved by developers, not real users. No validation that the UI actually converts customers before spending time on backend development.
308
+
309
+ **Solution:** Auto-inject Phase 1.5 (ux-tester) after uxui-frontend with approval gate workflow.
310
+
311
+ ### How It Works
312
+
313
+ ```
314
+ Phase 1: uxui-frontend (build UI)
315
+
316
+ Phase 1.5: ux-tester (approval gate)
317
+ → Auto-generate personas from product context
318
+ → Test each persona via Chrome DevTools
319
+ → Calculate weighted conversion prediction
320
+ → Generate UX test report
321
+ → PAUSE for user approval
322
+
323
+ [User approves] → Phase 2: backend + database
324
+ [User rejects] → Loop back to Phase 1 with feedback
325
+ ```
326
+
327
+ ### Key Features
328
+
329
+ | Feature | Description |
330
+ |---------|-------------|
331
+ | **Auto-Generated Personas** | 3-5 personas with % breakdown based on product context |
332
+ | **Weighted Conversion** | Calculate purchase likelihood weighted by customer % |
333
+ | **Chrome DevTools Testing** | Screenshots, snapshots, click tests, mobile responsive |
334
+ | **Approval Gate** | PAUSE and wait for user approve/reject |
335
+ | **Rejection Loop** | Feedback passed to uxui-frontend, re-run Phase 1 → 1.5 |
336
+
337
+ ### Files Changed
338
+
339
+ | File | Change |
340
+ |------|--------|
341
+ | `.claude/agents/07-ux-tester.md` | New agent for persona-based UX testing |
342
+ | `.claude/templates/phases-sections/ux-testing.md` | Phase template with approval gate |
343
+ | `.claude/lib/task-analyzer.md` | Auto-inject Phase 1.5 after uxui-frontend |
344
+ | `.claude/lib/agent-executor.md` | Approval gate execution logic |
345
+ | `.claude/commands/cdev.md` | Step 4.6 approval gate handling |
346
+
347
+ ### UX Test Report Example
348
+
349
+ ```markdown
350
+ # UX Test Report
351
+
352
+ ## Personas Tested
353
+ | Persona | % ลูกค้า | Would Buy | Weighted |
354
+ |---------|----------|-----------|----------|
355
+ | นักศึกษา 18-24 | 40% | Maybe (50%) | +20% |
356
+ | พนักงาน 25-35 | 35% | Yes (100%) | +35% |
357
+ | ผู้สูงวัย 50-65 | 15% | No (0%) | +0% |
358
+ | ผู้ปกครอง 35-50 | 10% | Maybe (50%) | +5% |
359
+
360
+ ## Conversion Prediction: 60%
361
+ ## Potential After Fixes: 92.5%
362
+ ```
363
+
364
+ ---
365
+
321
366
  ## 🆕 v2.5.0: Smart Topic Query + Integration Risk Detection
322
367
 
323
368
  **Problem Solved:** Context7 queries used static topic "best practices" which missed adapter/integration documentation. Example: Drizzle + Auth.js requires specific column naming (snake_case) but this wasn't detected, causing runtime errors.
@@ -71,15 +71,15 @@ WHY: UI development shouldn't be blocked by backend availability. Mock data enab
71
71
  **STEP 0.5: Load Design & Content (uxui-frontend specific)**
72
72
 
73
73
  ```bash
74
- # Check for project-specific design
75
- Read: design-system/STYLE_GUIDE.md
74
+ # Check for project-specific design tokens
75
+ Read: design-system/data.yaml
76
76
 
77
77
  # Check for page plan (from /pageplan command)
78
78
  Read: openspec/changes/{change-id}/page-plan.md
79
79
  ```
80
80
 
81
81
  **Priority order:**
82
- 1. **STYLE_GUIDE.md** (project-specific) → Use all tokens, colors, spacing
82
+ 1. **data.yaml** (project-specific) → Use all tokens, colors, spacing, psychology
83
83
  2. **page-plan.md** (if exists) → Use component plan, content draft, animation blueprint
84
84
  3. **design/*.md** (fallback) → General design principles
85
85
 
@@ -141,8 +141,7 @@ Page Structure Compliance:
141
141
  | patterns/ui-component-consistency.md | Always (component reuse) |
142
142
  | patterns/animation-patterns.md | Always (animations) |
143
143
  | patterns/performance-optimization.md | Always (images, lazy loading) |
144
- | STYLE_GUIDE.md | If exists (project-specific) |
145
- | STYLE_TOKENS.json | If exists (lightweight tokens) |
144
+ | data.yaml | If exists (design tokens + psychology) |
146
145
  | page-plan.md | If exists (content plan) |
147
146
 
148
147
  **Context7 Framework Docs:**
@@ -200,7 +199,7 @@ const TOKENS = {
200
199
  }
201
200
  ```
202
201
 
203
- Use durations from STYLE_TOKENS.json (150ms, 300ms, 500ms). Random values (200ms, 250ms, 400ms) break visual consistency.
202
+ Use durations from data.yaml (150ms, 300ms, 500ms). Random values (200ms, 250ms, 400ms) break visual consistency.
204
203
 
205
204
  ### Step 5: Performance Optimization
206
205