@champpaba/claude-agent-kit 3.2.0 → 3.4.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.
@@ -5,6 +5,135 @@
5
5
 
6
6
  ---
7
7
 
8
+ ## v3.4.0: Complete Pseudocode Elimination
9
+
10
+ **Problem Solved:** Agents read TypeScript/JavaScript pseudocode and interpreted it as "examples" or "reference documentation" rather than executable instructions. This caused agents to not follow the intended workflow.
11
+
12
+ **Solution:** Converted ~3,210 lines of pseudocode across all 8 command files to imperative step-by-step instructions following the pattern established in `design-validator.md`.
13
+
14
+ ### Key Changes
15
+
16
+ | File | Lines Converted | Key Sections |
17
+ |------|-----------------|--------------|
18
+ | `cdev.md` | ~300 | Steps 2-5, approval gate, page plan validation |
19
+ | `csetup.md` | ~800 | Steps 7-8, helper functions |
20
+ | `designsetup.md` | ~1,200 | Steps 5-6, data.yaml generation |
21
+ | `extract.md` | ~400 | Steps 0-6, Chrome DevTools extraction |
22
+ | `pageplan.md` | ~200 | Steps 1-5, context loading |
23
+ | `cview.md` | ~100 | Formatting helpers |
24
+ | `cstatus.md` | ~60 | Steps 1-2, infrastructure summary |
25
+ | `pstatus.md` | ~150 | Steps 1-5, YAML updates |
26
+
27
+ ### Conversion Pattern
28
+
29
+ ```markdown
30
+ # ❌ BEFORE (Pseudocode - agents ignore):
31
+ ```typescript
32
+ if (fileExists(path)) {
33
+ const data = JSON.parse(Read(path))
34
+ return data.value
35
+ }
36
+ ```
37
+
38
+ # ✅ AFTER (Imperative - agents follow):
39
+ **If the file exists:**
40
+ 1. Read the file at `{path}`
41
+ 2. Parse the content as JSON
42
+ 3. Extract and return the `value` field
43
+ ```
44
+
45
+ ### Why This Matters
46
+
47
+ **Before:**
48
+ - TypeScript code blocks treated as documentation
49
+ - Agents skipped procedural logic
50
+ - Inconsistent behavior between runs
51
+ - User had to manually guide agents
52
+
53
+ **After:**
54
+ - Clear numbered steps agents execute
55
+ - Conditional logic as "If X, then Y" blocks
56
+ - Consistent, reproducible behavior
57
+ - Agents self-navigate through workflows
58
+
59
+ ### Files Changed
60
+
61
+ | File | Change |
62
+ |------|--------|
63
+ | `.claude/commands/cdev.md` | All pseudocode → imperative |
64
+ | `.claude/commands/csetup.md` | All pseudocode → imperative |
65
+ | `.claude/commands/designsetup.md` | All pseudocode → imperative |
66
+ | `.claude/commands/extract.md` | All pseudocode → imperative |
67
+ | `.claude/commands/pageplan.md` | All pseudocode → imperative |
68
+ | `.claude/commands/cview.md` | All pseudocode → imperative |
69
+ | `.claude/commands/cstatus.md` | All pseudocode → imperative |
70
+ | `.claude/commands/pstatus.md` | All pseudocode → imperative |
71
+ | `tests/` | Removed (tests passed, cleanup) |
72
+
73
+ ---
74
+
75
+ ## v3.3.0: Design Validation System (No Pseudocode)
76
+
77
+ **Problem Solved:** Design system compliance was not enforced. uxui-frontend agents didn't read `design-system/data.yaml`, resulting in hardcoded colors, arbitrary spacing, and inconsistent animations. The validation logic was written as TypeScript pseudocode that Claude never executed.
78
+
79
+ **Solution:** Created a single source of truth (`design-validator.md`) with imperative Thai/English instructions. Converted all procedural pseudocode to step-by-step commands that Claude follows.
80
+
81
+ ### Key Changes
82
+
83
+ | Component | Before | After |
84
+ |-----------|--------|-------|
85
+ | design-validator.md | Did not exist | NEW - Single source of truth |
86
+ | cdev.md Step 2-5 | TypeScript pseudocode | Imperative instructions |
87
+ | ux-tester.md Steps 2-5 | TypeScript pseudocode | Imperative instructions |
88
+ | uxui-frontend STEP 0.5 | Brief mention | Full step-by-step protocol |
89
+
90
+ ### Design Validation Flow
91
+
92
+ ```
93
+ PREVENTION (Before Implementation)
94
+ ├── Main Claude: Pre-Flight Check before invoking uxui-frontend
95
+ └── uxui-frontend: STEP 0.5 - Read data.yaml, report tokens
96
+
97
+ DETECTION (After Implementation)
98
+ └── ux-tester: Step 5.5 - Chrome DevTools style comparison
99
+ ```
100
+
101
+ ### What Gets Validated
102
+
103
+ | Token Category | Violation Example | Expected |
104
+ |----------------|-------------------|----------|
105
+ | Colors | #3b82f6, text-blue-500 | bg-primary, text-foreground |
106
+ | Spacing | p-5, gap-7 | p-4, p-6, gap-8 (scale) |
107
+ | Animation | duration-200 | duration-150, 300, 500ms |
108
+ | Shadows | mixed sm+xl | consistent level |
109
+
110
+ ### Files Changed
111
+
112
+ | File | Change |
113
+ |------|--------|
114
+ | `.claude/lib/design-validator.md` | NEW - Single source of truth |
115
+ | `.claude/agents/02-uxui-frontend.md` | v2.1.0 - Enhanced STEP 0.5 |
116
+ | `.claude/agents/07-ux-tester.md` | v1.1.0 - Steps 2-5 rewritten |
117
+ | `.claude/commands/cdev.md` | Steps 2-5 rewritten, Step 4.0 added |
118
+ | `.claude/lib/README.md` | Added design-validator.md entry |
119
+ | `.claude/CLAUDE.md` | v3.3.0 + Design Validation section |
120
+
121
+ ### Why This Matters
122
+
123
+ **Before:**
124
+ - Logic scattered across 4 files
125
+ - TypeScript pseudocode that Claude ignored
126
+ - No enforcement of design tokens
127
+ - ux-tester couldn't validate actual CSS
128
+
129
+ **After:**
130
+ - Single source of truth (design-validator.md)
131
+ - Imperative instructions Claude follows
132
+ - Pre-flight check before visual agents
133
+ - Chrome DevTools validation of computed styles
134
+
135
+ ---
136
+
8
137
  ## v3.2.0: Consolidated Pre-Work Context
9
138
 
10
139
  **Problem Solved:** `/csetup` generated two separate pseudocode outputs (`research-checklist.md` and `INTEGRATION_RISKS.md`) that were never actually created. Agents had to discover context from multiple scattered sources.
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:** 3.2.0 - Consolidated Pre-Work Context
5
- > **Latest:** Step 2.6 generates `pre-work-context.md` - single file with all agent context
4
+ > **Template Version:** 3.4.0 - Complete Pseudocode Elimination
5
+ > **Latest:** Single Source of Truth for design compliance (prevention + detection)
6
6
 
7
7
  ---
8
8
 
@@ -128,6 +128,7 @@ Universal, framework-agnostic template for AI-assisted development.
128
128
  - `@/.claude/lib/task-analyzer.md` - **v3.1.0!** Template-free task analysis with TDD classification (Step 2.6) ✨
129
129
  - `@/.claude/lib/flags-updater.md` - Progress tracking protocol (Main Claude updates flags.json)
130
130
  - `@/.claude/lib/agent-router.md` - Mandatory agent routing rules (enforce delegation)
131
+ - `@/.claude/lib/design-validator.md` - **v3.3.0!** Design system validation (prevention + detection) ✨
131
132
  - `@/.claude/contexts/patterns/agent-discovery.md` - Shared agent discovery flow
132
133
 
133
134
  ---
@@ -212,6 +213,58 @@ Universal, framework-agnostic template for AI-assisted development.
212
213
 
213
214
  ---
214
215
 
216
+ ## 🎯 Design Validation System (v3.3.0 - NEW!)
217
+
218
+ **→ See:** `@/.claude/lib/design-validator.md` for full specification
219
+
220
+ **Problem Solved:**
221
+ - uxui-frontend agent ไม่อ่าน design-system/data.yaml → CSS ไม่ตรง design
222
+ - ux-tester อ่านแค่ code ไม่ได้เห็น actual rendered output
223
+ - Logic กระจายหลายไฟล์ → ไม่มี enforcement
224
+
225
+ **Solution: Single Source of Truth**
226
+
227
+ ```
228
+ ┌─────────────────────────────────────────────────────────────┐
229
+ │ PREVENTION (Pre-Work) │
230
+ ├─────────────────────────────────────────────────────────────┤
231
+ │ Main Claude → Pre-Flight Design Check (before /cdev) │
232
+ │ uxui-frontend → STEP 0.5: Read data.yaml (MANDATORY) │
233
+ └─────────────────────────────────────────────────────────────┘
234
+
235
+ ┌─────────────────────────────────────────────────────────────┐
236
+ │ DETECTION (Post-Work) │
237
+ ├─────────────────────────────────────────────────────────────┤
238
+ │ ux-tester → Chrome DevTools Style Comparison │
239
+ │ Compare computed styles vs data.yaml tokens │
240
+ └─────────────────────────────────────────────────────────────┘
241
+ ```
242
+
243
+ **What Gets Validated:**
244
+
245
+ | Token Category | Example Violation | Expected |
246
+ |----------------|-------------------|----------|
247
+ | Colors | #3b82f6 | bg-primary (from data.yaml) |
248
+ | Spacing | p-5, gap-7 | p-4, p-6, gap-8 (scale) |
249
+ | Animation | duration-200 | duration-150, 300, 500ms |
250
+ | Shadows | mixed sm+xl | consistent level |
251
+
252
+ **Agent Responsibilities:**
253
+
254
+ | Agent | What to Do |
255
+ |-------|------------|
256
+ | Main Claude | Pre-flight check before invoking uxui-frontend |
257
+ | uxui-frontend | STEP 0.5: Read data.yaml, report loaded tokens |
258
+ | ux-tester | Step 5.5: Chrome DevTools validation |
259
+
260
+ **Files Updated:**
261
+ - `.claude/lib/design-validator.md` (NEW - Single Source of Truth)
262
+ - `.claude/agents/02-uxui-frontend.md` (v2.1.0 - references design-validator)
263
+ - `.claude/agents/07-ux-tester.md` (v1.1.0 - Design Compliance Check)
264
+ - `.claude/commands/cdev.md` (Step 4.0 - Pre-Flight Check)
265
+
266
+ ---
267
+
215
268
  ## ⚡ Context Optimization (v2.1.0)
216
269
 
217
270
  **→ See:** `@/.claude/lib/detailed-guides/context-optimization.md` for complete guide
@@ -310,6 +363,8 @@ User: "Build login system"
310
363
  **Recent versions:**
311
364
  | Version | Key Feature |
312
365
  |---------|-------------|
366
+ | v3.4.0 | **Complete Pseudocode Elimination** (~3,210 lines → imperative instructions) |
367
+ | v3.3.0 | **Design Validation System** (prevention + detection, single source of truth) |
313
368
  | v3.2.0 | Consolidated Pre-Work Context (single `pre-work-context.md` for agents) |
314
369
  | v3.1.1 | Direct Best Practices Execution (Step 2.7 rewritten, no pseudocode) |
315
370
  | v3.1.0 | TDD Classification + Development Principles Injection |
@@ -7,8 +7,9 @@ color: blue
7
7
 
8
8
  # UX-UI Frontend Agent
9
9
 
10
- > **Version:** 2.0.0 (Claude 4.5 Optimized)
10
+ > **Version:** 2.1.0 (Design Validator Integration)
11
11
  > **Role:** Build UI components with mock data. Focus on design quality and accessibility.
12
+ > **Design Validation:** `.claude/lib/design-validator.md` (Part 2)
12
13
 
13
14
  ---
14
15
 
@@ -68,27 +69,97 @@ WHY: UI development shouldn't be blocked by backend availability. Mock data enab
68
69
 
69
70
  → See `.claude/contexts/patterns/agent-discovery.md`
70
71
 
71
- **STEP 0.5: Load Design & Content (uxui-frontend specific)**
72
+ ---
72
73
 
73
- ```bash
74
- # Check for project-specific design tokens
75
- Read: design-system/data.yaml
74
+ ## STEP 0.5: Load Design System (MANDATORY)
75
+
76
+ **Full Protocol:** `.claude/lib/design-validator.md` (Part 3)
77
+
78
+ **ก่อนเขียน CSS/Tailwind ใดๆ ต้องทำขั้นตอนนี้ก่อน:**
79
+
80
+ ### ขั้นตอนที่ 1: อ่าน design-system/data.yaml
81
+
82
+ อ่านไฟล์ `design-system/data.yaml`
83
+
84
+ **ถ้ามีไฟล์:** จดค่าต่อไปนี้:
85
+ - colors: primary, secondary, background, foreground, muted, accent (พร้อม hex values)
86
+ - spacing scale: 4, 8, 12, 16, 24, 32, 48, 64
87
+ - animation durations: **150ms, 300ms, 500ms เท่านั้น!**
88
+ - shadows: sm, md, lg, xl
89
+ - typography: font family, sizes
90
+
91
+ **ถ้าไม่มีไฟล์:**
92
+ ```
93
+ ⚠️ Design System NOT FOUND
94
+ - Path: design-system/data.yaml (missing)
95
+ - Fallback: Using .claude/contexts/design/*.md
96
+ - Recommendation: Run /designsetup to generate design system
97
+ ```
98
+ → อ่าน `.claude/contexts/design/*.md` แทน
99
+
100
+ ### ขั้นตอนที่ 2: อ่าน page-plan.md (ถ้ามี)
101
+
102
+ อ่านไฟล์ `openspec/changes/{change-id}/page-plan.md`
76
103
 
77
- # Check for page plan (from /pageplan command)
78
- Read: openspec/changes/{change-id}/page-plan.md
104
+ **ถ้ามี:**
105
+ - ดู Component reuse list, new components, animation blueprint
106
+ - ข้าม STEP 3 (component search) ไปเลย เพราะ page-plan ทำไว้แล้ว
107
+ - Implement ทุก section ใน Section 2 (Page Structure)
108
+
109
+ ### ขั้นตอนที่ 3: Report ก่อนเริ่มเขียน code
110
+
111
+ **ต้อง report นี้ก่อนเขียน CSS/Tailwind:**
112
+
113
+ ```
114
+ ✅ Design System Loaded (STEP 0.5)
115
+ - Source: design-system/data.yaml
116
+ - Colors: primary=#xxx, secondary=#xxx, background=#xxx, foreground=#xxx
117
+ - Spacing scale: 4, 8, 12, 16, 24, 32, 48, 64
118
+ - Animation durations: 150ms, 300ms, 500ms
119
+ - Shadows: sm, md, lg, xl
79
120
  ```
80
121
 
81
- **Priority order:**
82
- 1. **data.yaml** (project-specific) → Use all tokens, colors, spacing, psychology
83
- 2. **page-plan.md** (if exists) → Use component plan, content draft, animation blueprint
84
- 3. **design/*.md** (fallback) → General design principles
122
+ ### กฎการใช้ Design Tokens
85
123
 
86
- **If page-plan.md exists:**
87
- - Extract: Component reuse list, new components, content draft, animation blueprint (Section 2.6)
88
- - Skip STEP 3 (component search already done)
89
- - Implement ALL sections from Section 2 (Page Structure)
124
+ **ห้ามใช้ (NEVER):**
90
125
 
91
- WHY: page-plan.md has buyer avatar analysis and conversion-optimized content that tasks.md doesn't provide.
126
+ | ห้าม | ตัวอย่าง |
127
+ |------|---------|
128
+ | Hardcoded colors | `#3b82f6`, `rgb(59,130,246)`, `text-blue-500` |
129
+ | Arbitrary spacing | `p-5`, `gap-7`, `m-[13px]`, `p-[22px]` |
130
+ | Random duration | `duration-200`, `duration-250`, `duration-400` |
131
+ | Mixed shadow levels | ใช้ `shadow-sm` ที่หนึ่ง `shadow-xl` ที่อื่น |
132
+
133
+ **ต้องใช้ (ALWAYS):**
134
+
135
+ | ใช้ | ตัวอย่าง |
136
+ |-----|---------|
137
+ | Theme colors | `bg-primary`, `text-foreground`, `bg-muted` |
138
+ | Spacing scale | `p-4`, `p-6`, `gap-8`, `m-16` |
139
+ | Standard durations | `duration-150`, `duration-300`, `duration-500` |
140
+ | Consistent shadows | เลือก level เดียวสำหรับ cards ทั้งหมด |
141
+
142
+ ### ขั้นตอนที่ 4: Report หลังเขียน code เสร็จ
143
+
144
+ **ต้อง report การใช้ tokens ใน output:**
145
+
146
+ ```
147
+ 📊 Design Token Usage Report
148
+ Colors used: text-foreground, bg-primary, bg-muted, border-border
149
+ Spacing used: p-4, p-6, p-8, gap-4, gap-8
150
+ Animations: duration-150, duration-300
151
+ Shadows: shadow-md (consistent)
152
+
153
+ ✅ All tokens from data.yaml
154
+ ```
155
+
156
+ **ถ้ามี non-standard values ต้องบอกเหตุผล:**
157
+
158
+ ```
159
+ ⚠️ Non-standard values used:
160
+ - p-5 (reason: needed odd spacing for alignment)
161
+ - #custom-color (reason: brand requirement not in data.yaml)
162
+ ```
92
163
 
93
164
  ---
94
165
 
@@ -311,9 +382,21 @@ Design:
311
382
  - Shadows: {level}
312
383
  - Accessibility: {features}
313
384
 
385
+ 📊 Design Token Usage Report:
386
+ - Colors used: text-foreground, bg-primary, bg-muted, ...
387
+ - Spacing used: p-4, p-6, gap-8, ...
388
+ - Animations: duration-150, duration-300
389
+ - Shadows: shadow-md
390
+
391
+ ✅ All tokens from data.yaml
392
+ OR
393
+ ⚠️ Non-standard values: {list with reasons}
394
+
314
395
  Next Step: {next task or agent}
315
396
  ```
316
397
 
398
+ **IMPORTANT:** Include token usage report in final output. ux-tester will validate these against data.yaml using Chrome DevTools.
399
+
317
400
  ---
318
401
 
319
402
  ## Handoff to Frontend Agent