@champpaba/claude-agent-kit 2.6.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.
- package/.claude/CLAUDE.md +103 -58
- package/.claude/agents/02-uxui-frontend.md +5 -6
- package/.claude/agents/07-ux-tester.md +407 -0
- package/.claude/commands/cdev.md +113 -8
- package/.claude/commands/csetup.md +13 -13
- package/.claude/commands/cview.md +364 -364
- package/.claude/commands/designsetup.md +171 -48
- package/.claude/commands/extract.md +382 -668
- package/.claude/commands/pageplan.md +25 -27
- package/.claude/contexts/design/accessibility.md +611 -611
- package/.claude/contexts/design/box-thinking.md +4 -4
- package/.claude/contexts/design/color-theory.md +5 -5
- package/.claude/contexts/design/index.md +9 -9
- package/.claude/contexts/design/layout.md +400 -400
- package/.claude/contexts/design/responsive.md +551 -551
- package/.claude/contexts/design/shadows.md +522 -522
- package/.claude/contexts/design/spacing.md +4 -4
- package/.claude/contexts/design/typography.md +465 -465
- package/.claude/contexts/domain/README.md +164 -164
- package/.claude/contexts/patterns/agent-coordination.md +388 -388
- package/.claude/contexts/patterns/agent-discovery.md +1 -1
- package/.claude/contexts/patterns/animation-patterns.md +3 -3
- package/.claude/contexts/patterns/development-principles.md +513 -513
- package/.claude/contexts/patterns/error-handling.md +478 -478
- package/.claude/contexts/patterns/logging.md +424 -424
- package/.claude/contexts/patterns/tdd-classification.md +516 -516
- package/.claude/contexts/patterns/testing.md +413 -413
- package/.claude/contexts/patterns/ui-component-consistency.md +3 -3
- package/.claude/lib/README.md +1 -1
- package/.claude/lib/agent-executor.md +223 -0
- package/.claude/lib/context-loading-protocol.md +5 -6
- package/.claude/lib/detailed-guides/agent-system.md +4 -4
- package/.claude/lib/detailed-guides/best-practices-system.md +5 -4
- package/.claude/lib/detailed-guides/context-optimization.md +21 -22
- package/.claude/lib/detailed-guides/design-system.md +6 -5
- package/.claude/lib/detailed-guides/page-planning.md +6 -6
- package/.claude/lib/document-loader.md +32 -47
- package/.claude/lib/task-analyzer.md +194 -1
- package/.claude/lib/tdd-classifier.md +345 -345
- package/.claude/lib/validation-gates.md +484 -484
- package/.claude/settings.local.json +42 -42
- package/.claude/templates/PROJECT_STATUS.template.yml +1 -1
- package/.claude/templates/STYLE_GUIDE.template.md +7 -7
- package/.claude/templates/context-template.md +45 -45
- package/.claude/templates/design-context-template.md +22 -29
- package/.claude/templates/flags-template.json +42 -42
- package/.claude/templates/page-plan-example.md +9 -9
- package/.claude/templates/phases-sections/accessibility-test.md +17 -17
- package/.claude/templates/phases-sections/api-design.md +37 -37
- package/.claude/templates/phases-sections/backend-tests.md +16 -16
- package/.claude/templates/phases-sections/backend.md +37 -37
- package/.claude/templates/phases-sections/business-logic-validation.md +16 -16
- package/.claude/templates/phases-sections/component-tests.md +17 -17
- package/.claude/templates/phases-sections/contract-backend.md +16 -16
- package/.claude/templates/phases-sections/contract-frontend.md +16 -16
- package/.claude/templates/phases-sections/database.md +35 -35
- package/.claude/templates/phases-sections/e2e-tests.md +16 -16
- package/.claude/templates/phases-sections/fix-implementation.md +17 -17
- package/.claude/templates/phases-sections/frontend-integration.md +18 -18
- package/.claude/templates/phases-sections/manual-flow-test.md +15 -15
- package/.claude/templates/phases-sections/manual-ux-test.md +16 -16
- package/.claude/templates/phases-sections/refactor-implementation.md +17 -17
- package/.claude/templates/phases-sections/refactor.md +16 -16
- package/.claude/templates/phases-sections/regression-tests.md +15 -15
- package/.claude/templates/phases-sections/responsive-test.md +16 -16
- package/.claude/templates/phases-sections/script-implementation.md +43 -43
- package/.claude/templates/phases-sections/test-coverage.md +16 -16
- package/.claude/templates/phases-sections/user-approval.md +14 -14
- package/.claude/templates/phases-sections/ux-testing.md +164 -0
- package/LICENSE +21 -21
- package/README.md +3 -1
- package/package.json +1 -1
|
@@ -91,7 +91,7 @@ const ANIMATION_TOKENS = {
|
|
|
91
91
|
hover: {
|
|
92
92
|
properties: ['transform', 'box-shadow'], // GPU-accelerated only
|
|
93
93
|
values: ['scale(1.05)', 'shadow-lg'],
|
|
94
|
-
duration: '150ms', // From
|
|
94
|
+
duration: '150ms', // From data.yaml
|
|
95
95
|
easing: 'ease-in-out',
|
|
96
96
|
classes: 'hover:scale-105 hover:shadow-lg transition-all duration-150'
|
|
97
97
|
},
|
|
@@ -121,7 +121,7 @@ const ANIMATION_TOKENS = {
|
|
|
121
121
|
|
|
122
122
|
**Critical Rules:**
|
|
123
123
|
1. ✅ Extract animation from reference component (same as colors, spacing)
|
|
124
|
-
2. ✅ Use durations from
|
|
124
|
+
2. ✅ Use durations from data.yaml (150ms, 300ms, 500ms)
|
|
125
125
|
3. ✅ Use GPU-accelerated properties (transform, opacity) - NOT width, height, top, left
|
|
126
126
|
4. ✅ Same component type = same animation pattern (buttons scale, cards elevate shadow)
|
|
127
127
|
5. ❌ NO random durations (200ms, 250ms) - only 150/300/500ms
|
|
@@ -308,7 +308,7 @@ transition: 'transition-colors'
|
|
|
308
308
|
- [ ] Found similar reference component in codebase
|
|
309
309
|
- [ ] Extracted all design tokens (icon, spacing, colors, states, **animations**)
|
|
310
310
|
- [ ] Extracted animation tokens (hover, focus, active, durations)
|
|
311
|
-
- [ ] Verified durations match
|
|
311
|
+
- [ ] Verified durations match data.yaml (150/300/500ms)
|
|
312
312
|
- [ ] Verified animation properties are GPU-accelerated (transform, opacity)
|
|
313
313
|
- [ ] Applied tokens exactly (no guessing, no random values)
|
|
314
314
|
- [ ] Tested visual appearance in browser
|
package/.claude/lib/README.md
CHANGED
|
@@ -39,7 +39,7 @@ Standardized handoff formats for agent-to-agent communication. Includes all 15 h
|
|
|
39
39
|
Complete TDD implementation examples (Stripe integration, user auth). Used by frontend, backend, database agents.
|
|
40
40
|
|
|
41
41
|
**`document-loader.md`** - Token-efficient document loading
|
|
42
|
-
Unified pattern for loading design system files. 3-tier strategy:
|
|
42
|
+
Unified pattern for loading design system files. 3-tier strategy: data.yaml → design-context.md → README.md (fallback).
|
|
43
43
|
|
|
44
44
|
---
|
|
45
45
|
|
|
@@ -154,6 +154,7 @@ WHY: Pre-work validation ensures agents loaded context before implementing. This
|
|
|
154
154
|
| backend | Patterns Loaded ✓, Existing Endpoints Search ✓, TDD Workflow (if required) |
|
|
155
155
|
| database | Schema Analysis ✓ |
|
|
156
156
|
| test-debug | Test Infrastructure ✓ |
|
|
157
|
+
| ux-tester | Personas Generated ✓, Dev Server Found ✓, Chrome DevTools Connected ✓ |
|
|
157
158
|
|
|
158
159
|
**Validation Logic:**
|
|
159
160
|
```typescript
|
|
@@ -978,4 +979,226 @@ async function executePhase(phase: Phase, changeId: string) {
|
|
|
978
979
|
|
|
979
980
|
---
|
|
980
981
|
|
|
982
|
+
## 🛑 Approval Gate Execution (v2.7.0)
|
|
983
|
+
|
|
984
|
+
> **NEW:** Handle phases with `requires_approval: true` (e.g., ux-tester)
|
|
985
|
+
|
|
986
|
+
### Detection
|
|
987
|
+
|
|
988
|
+
```typescript
|
|
989
|
+
function isApprovalGatePhase(phase: Phase): boolean {
|
|
990
|
+
return phase.requires_approval === true ||
|
|
991
|
+
phase.metadata?.includes('approval-gate')
|
|
992
|
+
}
|
|
993
|
+
```
|
|
994
|
+
|
|
995
|
+
### Execution Flow
|
|
996
|
+
|
|
997
|
+
```typescript
|
|
998
|
+
async function executeApprovalGatePhase(phase: Phase, changeId: string): Promise<ApprovalResult> {
|
|
999
|
+
// Step 1: Execute the agent (e.g., ux-tester)
|
|
1000
|
+
const agentResult = await executeAgent(phase.agent, buildPrompt(phase))
|
|
1001
|
+
|
|
1002
|
+
// Step 2: Validate agent output
|
|
1003
|
+
if (!agentResult.success) {
|
|
1004
|
+
return { status: 'failed', error: agentResult.error }
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
// Step 3: Update flags to "awaiting_approval"
|
|
1008
|
+
updateFlags(changeId, {
|
|
1009
|
+
[`phase_${phase.number}`]: {
|
|
1010
|
+
status: 'awaiting_approval',
|
|
1011
|
+
report_path: agentResult.reportPath
|
|
1012
|
+
}
|
|
1013
|
+
})
|
|
1014
|
+
|
|
1015
|
+
// Step 4: Display report summary to user
|
|
1016
|
+
output(`
|
|
1017
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1018
|
+
🧪 ${phase.name} Complete - Awaiting Approval
|
|
1019
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1020
|
+
|
|
1021
|
+
${agentResult.summary}
|
|
1022
|
+
|
|
1023
|
+
📄 Full report: ${agentResult.reportPath}
|
|
1024
|
+
|
|
1025
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1026
|
+
|
|
1027
|
+
กรุณาตัดสินใจ:
|
|
1028
|
+
|
|
1029
|
+
✅ "approve" → ไป Phase ${getNextPhase(phase).number}
|
|
1030
|
+
❌ "reject [feedback]" → กลับ Phase ${getPreviousPhase(phase).number} แก้ไข
|
|
1031
|
+
|
|
1032
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1033
|
+
`)
|
|
1034
|
+
|
|
1035
|
+
// Step 5: PAUSE and wait for user response
|
|
1036
|
+
const userResponse = await waitForUserInput()
|
|
1037
|
+
|
|
1038
|
+
// Step 6: Handle response
|
|
1039
|
+
return handleApprovalResponse(userResponse, phase, changeId)
|
|
1040
|
+
}
|
|
1041
|
+
```
|
|
1042
|
+
|
|
1043
|
+
### Response Handling
|
|
1044
|
+
|
|
1045
|
+
```typescript
|
|
1046
|
+
function handleApprovalResponse(
|
|
1047
|
+
response: string,
|
|
1048
|
+
phase: Phase,
|
|
1049
|
+
changeId: string,
|
|
1050
|
+
allPhases: Phase[] // Added: need all phases for loop back
|
|
1051
|
+
): ApprovalResult {
|
|
1052
|
+
const normalized = response.trim().toLowerCase()
|
|
1053
|
+
|
|
1054
|
+
// Approve patterns
|
|
1055
|
+
if (normalized.match(/^(approve|approved|ok|yes|ใช่|อนุมัติ|ผ่าน|ลุย)$/)) {
|
|
1056
|
+
updateFlags(changeId, {
|
|
1057
|
+
[`phase_${phase.number}`]: {
|
|
1058
|
+
status: 'approved',
|
|
1059
|
+
approved_at: new Date().toISOString()
|
|
1060
|
+
}
|
|
1061
|
+
})
|
|
1062
|
+
|
|
1063
|
+
output(`✅ ${phase.name} approved! Continuing to next phase...`)
|
|
1064
|
+
|
|
1065
|
+
return {
|
|
1066
|
+
status: 'approved',
|
|
1067
|
+
nextAction: 'continue'
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
// Reject patterns
|
|
1072
|
+
if (normalized.startsWith('reject') || normalized.startsWith('ไม่') ||
|
|
1073
|
+
normalized.startsWith('แก้') || normalized.startsWith('no')) {
|
|
1074
|
+
|
|
1075
|
+
// Extract feedback from rejection
|
|
1076
|
+
const feedback = response.replace(/^(reject|ไม่อนุมัติ|แก้ไข|no)\s*/i, '').trim()
|
|
1077
|
+
|
|
1078
|
+
updateFlags(changeId, {
|
|
1079
|
+
[`phase_${phase.number}`]: {
|
|
1080
|
+
status: 'rejected',
|
|
1081
|
+
rejected_at: new Date().toISOString(),
|
|
1082
|
+
rejection_feedback: feedback || 'No specific feedback provided'
|
|
1083
|
+
}
|
|
1084
|
+
})
|
|
1085
|
+
|
|
1086
|
+
// Find the phase to loop back to
|
|
1087
|
+
const loopBackPhase = findLoopBackPhase(phase, allPhases)
|
|
1088
|
+
|
|
1089
|
+
updateFlags(changeId, {
|
|
1090
|
+
[`phase_${loopBackPhase.number}`]: {
|
|
1091
|
+
status: 'pending',
|
|
1092
|
+
rerun_reason: `Rejected from ${phase.name}: ${feedback}`
|
|
1093
|
+
}
|
|
1094
|
+
})
|
|
1095
|
+
|
|
1096
|
+
output(`
|
|
1097
|
+
🔄 ${phase.name} rejected
|
|
1098
|
+
|
|
1099
|
+
📝 Feedback: ${feedback || 'None provided'}
|
|
1100
|
+
🔙 Looping back to: Phase ${loopBackPhase.number} - ${loopBackPhase.name}
|
|
1101
|
+
|
|
1102
|
+
${loopBackPhase.agent} agent จะได้รับ feedback นี้เพื่อแก้ไข
|
|
1103
|
+
`)
|
|
1104
|
+
|
|
1105
|
+
return {
|
|
1106
|
+
status: 'rejected',
|
|
1107
|
+
feedback,
|
|
1108
|
+
nextAction: 'loop_back',
|
|
1109
|
+
loopBackTo: loopBackPhase
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
// Unknown response - ask again
|
|
1114
|
+
output(`
|
|
1115
|
+
⚠️ ไม่เข้าใจคำตอบ
|
|
1116
|
+
|
|
1117
|
+
กรุณาตอบ:
|
|
1118
|
+
- "approve" เพื่อดำเนินการต่อ
|
|
1119
|
+
- "reject [feedback]" เพื่อกลับไปแก้ไข
|
|
1120
|
+
`)
|
|
1121
|
+
|
|
1122
|
+
return {
|
|
1123
|
+
status: 'pending',
|
|
1124
|
+
nextAction: 'ask_again'
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
```
|
|
1128
|
+
|
|
1129
|
+
### Loop Back Logic
|
|
1130
|
+
|
|
1131
|
+
```typescript
|
|
1132
|
+
function findLoopBackPhase(currentPhase: Phase, allPhases: Phase[]): Phase {
|
|
1133
|
+
// For ux-tester (Phase 1.5), loop back to uxui-frontend (Phase 1)
|
|
1134
|
+
if (currentPhase.agent === 'ux-tester') {
|
|
1135
|
+
const uxuiFrontendPhase = allPhases.find(p => p.agent === 'uxui-frontend')
|
|
1136
|
+
if (uxuiFrontendPhase) {
|
|
1137
|
+
return uxuiFrontendPhase
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
// Default: loop back to previous phase
|
|
1142
|
+
const currentIndex = allPhases.findIndex(p => p.number === currentPhase.number)
|
|
1143
|
+
if (currentIndex > 0) {
|
|
1144
|
+
return allPhases[currentIndex - 1]
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
// Fallback: first phase
|
|
1148
|
+
return allPhases[0]
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
// Helper: Read phases from phases.md file
|
|
1152
|
+
function getPhasesFromFile(changeId: string): Phase[] {
|
|
1153
|
+
const phasesPath = `openspec/changes/${changeId}/.claude/phases.md`
|
|
1154
|
+
const content = Read(phasesPath)
|
|
1155
|
+
return parsePhasesFromMd(content)
|
|
1156
|
+
}
|
|
1157
|
+
```
|
|
1158
|
+
|
|
1159
|
+
### Rejection Loop Cycle
|
|
1160
|
+
|
|
1161
|
+
```
|
|
1162
|
+
Cycle 1:
|
|
1163
|
+
Phase 1 (uxui-frontend) → Phase 1.5 (ux-tester) → [REJECT]
|
|
1164
|
+
→ Back to Phase 1 with feedback
|
|
1165
|
+
|
|
1166
|
+
Cycle 2:
|
|
1167
|
+
Phase 1 (uxui-frontend) [with feedback] → Phase 1.5 (ux-tester) → [APPROVE]
|
|
1168
|
+
→ Continue to Phase 2
|
|
1169
|
+
|
|
1170
|
+
No limit on cycles - user decides when to stop
|
|
1171
|
+
```
|
|
1172
|
+
|
|
1173
|
+
### Feedback Injection
|
|
1174
|
+
|
|
1175
|
+
When looping back, inject rejection feedback into agent prompt:
|
|
1176
|
+
|
|
1177
|
+
```typescript
|
|
1178
|
+
function buildPromptWithFeedback(phase: Phase, changeId: string): string {
|
|
1179
|
+
const flags = readFlags(changeId)
|
|
1180
|
+
const feedback = flags[`phase_${phase.number}`]?.rerun_reason
|
|
1181
|
+
|
|
1182
|
+
let prompt = buildBasePrompt(phase)
|
|
1183
|
+
|
|
1184
|
+
if (feedback) {
|
|
1185
|
+
prompt += `
|
|
1186
|
+
|
|
1187
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1188
|
+
⚠️ REJECTION FEEDBACK FROM UX TESTING
|
|
1189
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1190
|
+
|
|
1191
|
+
${feedback}
|
|
1192
|
+
|
|
1193
|
+
Please address this feedback in your implementation.
|
|
1194
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1195
|
+
`
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
return prompt
|
|
1199
|
+
}
|
|
1200
|
+
```
|
|
1201
|
+
|
|
1202
|
+
---
|
|
1203
|
+
|
|
981
1204
|
**This incremental execution framework transforms high-risk tasks into manageable, validated steps! 🚀**
|
|
@@ -250,15 +250,14 @@ Each agent loads additional contexts based on their role.
|
|
|
250
250
|
- `@.claude/contexts/patterns/frontend-component-strategy.md` (when to create vs reuse)
|
|
251
251
|
|
|
252
252
|
**Project-specific (if exists):**
|
|
253
|
-
- `design-system/
|
|
254
|
-
- `design-system/
|
|
253
|
+
- `design-system/data.yaml` (tokens + psychology, ~500 tokens)
|
|
254
|
+
- `design-system/README.md` (human-readable summary, ~100 tokens)
|
|
255
255
|
- `openspec/changes/{change-id}/page-plan.md` (from /pageplan command)
|
|
256
256
|
|
|
257
257
|
**Loading strategy:**
|
|
258
258
|
```
|
|
259
|
-
1.
|
|
260
|
-
2.
|
|
261
|
-
3. Fall back to design/*.md if no style guide
|
|
259
|
+
1. Load data.yaml (contains all design tokens)
|
|
260
|
+
2. Fall back to design/*.md if no data.yaml
|
|
262
261
|
```
|
|
263
262
|
|
|
264
263
|
### backend Agent:
|
|
@@ -333,7 +332,7 @@ Each agent loads additional contexts based on their role.
|
|
|
333
332
|
🎨 Level 3: Agent-Specific (uxui-frontend)
|
|
334
333
|
→ Loading: design/*.md ✓
|
|
335
334
|
→ Loading: patterns/ui-component-consistency.md ✓
|
|
336
|
-
→ Loading: design-system/
|
|
335
|
+
→ Loading: design-system/data.yaml ✓
|
|
337
336
|
→ Loading: openspec/changes/landing-page/page-plan.md ✓
|
|
338
337
|
✅ Design contexts loaded
|
|
339
338
|
|
|
@@ -102,13 +102,13 @@ WHY routing matters: Specialist agents have domain-specific validation (design t
|
|
|
102
102
|
### STEP 0.5: Design Context (uxui-frontend only)
|
|
103
103
|
|
|
104
104
|
```
|
|
105
|
-
6. Check: design-system/
|
|
106
|
-
- If YES → Read
|
|
105
|
+
6. Check: design-system/data.yaml exists?
|
|
106
|
+
- If YES → Read data.yaml (project-specific tokens + psychology)
|
|
107
107
|
- If NO → Read .claude/contexts/design/*.md (fallback)
|
|
108
|
-
7. Report: "✅
|
|
108
|
+
7. Report: "✅ Design Tokens Loaded"
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
WHY:
|
|
111
|
+
WHY: data.yaml has project-specific tokens. design/*.md has universal principles.
|
|
112
112
|
|
|
113
113
|
**Fallback:** If discovery fails, suggest `/csetup` or `/designsetup`
|
|
114
114
|
|
|
@@ -85,11 +85,12 @@
|
|
|
85
85
|
- Asks: Application type (SaaS, Marketing, E-commerce, etc.)
|
|
86
86
|
- Output: Modern, best-practice style guide
|
|
87
87
|
|
|
88
|
-
### Generated
|
|
88
|
+
### Generated Files
|
|
89
89
|
|
|
90
90
|
```
|
|
91
91
|
design-system/
|
|
92
|
-
|
|
92
|
+
├── data.yaml ← Design tokens + psychology (agent reads this)
|
|
93
|
+
└── README.md ← Human-readable summary
|
|
93
94
|
```
|
|
94
95
|
|
|
95
96
|
**All 17 Sections (Complete):**
|
|
@@ -122,14 +123,14 @@ design-system/
|
|
|
122
123
|
# 2. Setup change and project (discovers style guide, auto-detects tech stack)
|
|
123
124
|
/csetup feature-login
|
|
124
125
|
|
|
125
|
-
# 3. Start development (agents use
|
|
126
|
+
# 3. Start development (agents use data.yaml)
|
|
126
127
|
/cdev feature-login
|
|
127
128
|
```
|
|
128
129
|
|
|
129
130
|
### Agent Discovery
|
|
130
131
|
|
|
131
132
|
**uxui-frontend agent automatically reads:**
|
|
132
|
-
1. `design-system/
|
|
133
|
+
1. `design-system/data.yaml` (if exists) ← **Priority #1**
|
|
133
134
|
2. `.claude/contexts/design/*.md` (general principles) ← Fallback
|
|
134
135
|
|
|
135
136
|
**Why this matters:**
|
|
@@ -10,21 +10,21 @@
|
|
|
10
10
|
|
|
11
11
|
**Before v1.2.0:**
|
|
12
12
|
```
|
|
13
|
-
/pageplan → reads
|
|
14
|
-
/csetup → reads
|
|
15
|
-
/cdev → sends
|
|
16
|
-
uxui-frontend → reads
|
|
13
|
+
/pageplan → reads data.yaml (~800 tokens)
|
|
14
|
+
/csetup → reads data.yaml (~800 tokens)
|
|
15
|
+
/cdev → sends data.yaml (~800 tokens)
|
|
16
|
+
uxui-frontend → reads data.yaml (~800 tokens)
|
|
17
17
|
────────────────────────────────────────────────
|
|
18
18
|
Total: ~20K tokens (same content read 4 times!)
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
**After v1.2.0:**
|
|
22
22
|
```
|
|
23
|
-
/designsetup → generates
|
|
24
|
-
/pageplan → reads
|
|
23
|
+
/designsetup → generates data.yaml (~500 tokens) ✅
|
|
24
|
+
/pageplan → reads data.yaml (~500 tokens) ✅
|
|
25
25
|
/csetup → validates files exist (0 tokens) ✅
|
|
26
26
|
/cdev → sends reference only (~200 tokens) ✅
|
|
27
|
-
uxui-frontend → reads
|
|
27
|
+
uxui-frontend → reads data.yaml (~800 tokens) ✅
|
|
28
28
|
────────────────────────────────────────────────
|
|
29
29
|
Total: ~4.7K tokens (70% reduction!) ✨
|
|
30
30
|
```
|
|
@@ -33,7 +33,7 @@ Total: ~4.7K tokens (70% reduction!) ✨
|
|
|
33
33
|
|
|
34
34
|
## The Solution: 3-Tier Loading
|
|
35
35
|
|
|
36
|
-
### Tier 1:
|
|
36
|
+
### Tier 1: data.yaml (500 tokens)
|
|
37
37
|
|
|
38
38
|
- Lightweight design tokens only
|
|
39
39
|
- Used by: /pageplan, /csetup, agents
|
|
@@ -49,13 +49,13 @@ Total: ~4.7K tokens (70% reduction!) ✨
|
|
|
49
49
|
|
|
50
50
|
**Purpose:** Agent orientation and file discovery
|
|
51
51
|
|
|
52
|
-
### Tier 3:
|
|
52
|
+
### Tier 3: README.md (100 tokens)
|
|
53
53
|
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
- Used by:
|
|
54
|
+
- Human-readable summary
|
|
55
|
+
- NOT for agents (use data.yaml instead)
|
|
56
|
+
- Used by: humans reviewing design
|
|
57
57
|
|
|
58
|
-
**Purpose:**
|
|
58
|
+
**Purpose:** Quick human reference
|
|
59
59
|
|
|
60
60
|
---
|
|
61
61
|
|
|
@@ -66,8 +66,8 @@ Total: ~4.7K tokens (70% reduction!) ✨
|
|
|
66
66
|
### Pattern A: Planning (/pageplan, /csetup)
|
|
67
67
|
|
|
68
68
|
```typescript
|
|
69
|
-
Read:
|
|
70
|
-
Validate:
|
|
69
|
+
Read: data.yaml (~500 tokens)
|
|
70
|
+
Validate: data.yaml exists (0 tokens)
|
|
71
71
|
Total: ~500 tokens
|
|
72
72
|
```
|
|
73
73
|
|
|
@@ -75,16 +75,15 @@ Total: ~500 tokens
|
|
|
75
75
|
|
|
76
76
|
```typescript
|
|
77
77
|
Send: Design reference (~200 tokens)
|
|
78
|
-
Agent reads:
|
|
78
|
+
Agent reads: data.yaml (~500 tokens)
|
|
79
79
|
Total: ~700 tokens
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
### Pattern C: Agent (uxui-frontend)
|
|
83
83
|
|
|
84
84
|
```typescript
|
|
85
|
-
Read:
|
|
86
|
-
|
|
87
|
-
Total: ~2.5K tokens
|
|
85
|
+
Read: data.yaml (~800 tokens)
|
|
86
|
+
Total: ~800 tokens
|
|
88
87
|
```
|
|
89
88
|
|
|
90
89
|
---
|
|
@@ -103,10 +102,10 @@ Total: ~2.5K tokens
|
|
|
103
102
|
## Generated Files
|
|
104
103
|
|
|
105
104
|
**/designsetup now creates:**
|
|
106
|
-
1. `design-system/
|
|
107
|
-
2. `design-system/
|
|
105
|
+
1. `design-system/data.yaml` (tokens + psychology, ~800 lines) **FOR AGENTS**
|
|
106
|
+
2. `design-system/README.md` (human-readable summary, ~100 lines) **FOR HUMANS**
|
|
108
107
|
|
|
109
|
-
**Agents
|
|
108
|
+
**Agents read data.yaml only!**
|
|
110
109
|
|
|
111
110
|
---
|
|
112
111
|
|
|
@@ -30,11 +30,12 @@
|
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
33
|
-
## Generated
|
|
33
|
+
## Generated Files
|
|
34
34
|
|
|
35
35
|
```
|
|
36
36
|
design-system/
|
|
37
|
-
|
|
37
|
+
├── data.yaml ← Design tokens + psychology (agent reads this)
|
|
38
|
+
└── README.md ← Human-readable summary
|
|
38
39
|
```
|
|
39
40
|
|
|
40
41
|
**All 17 Sections (Complete):**
|
|
@@ -69,7 +70,7 @@ design-system/
|
|
|
69
70
|
# 2. Setup change and project (discovers style guide, auto-detects tech stack)
|
|
70
71
|
/csetup feature-login
|
|
71
72
|
|
|
72
|
-
# 3. Start development (agents use
|
|
73
|
+
# 3. Start development (agents use data.yaml)
|
|
73
74
|
/cdev feature-login
|
|
74
75
|
```
|
|
75
76
|
|
|
@@ -78,7 +79,7 @@ design-system/
|
|
|
78
79
|
## Agent Discovery
|
|
79
80
|
|
|
80
81
|
**uxui-frontend agent automatically reads:**
|
|
81
|
-
1. `design-system/
|
|
82
|
+
1. `design-system/data.yaml` (if exists) ← **Priority #1**
|
|
82
83
|
2. `.claude/contexts/design/*.md` (general principles) ← Fallback
|
|
83
84
|
|
|
84
85
|
**Why this matters:**
|
|
@@ -92,6 +93,6 @@ design-system/
|
|
|
92
93
|
## 🔗 See Also
|
|
93
94
|
|
|
94
95
|
- `../../commands/designsetup.md` - /designsetup command (generates style guide)
|
|
95
|
-
- `context-optimization.md` - 3-tier loading strategy (
|
|
96
|
+
- `context-optimization.md` - 3-tier loading strategy (data.yaml)
|
|
96
97
|
- `../../contexts/design/index.md` - General design principles (fallback)
|
|
97
98
|
- `../../contexts/patterns/ui-component-consistency.md` - Component reuse patterns
|
|
@@ -34,7 +34,7 @@ User: /pageplan @prd.md @project_brief.md
|
|
|
34
34
|
Main Claude:
|
|
35
35
|
1. Reads user-specified files (@prd.md, @brief.md)
|
|
36
36
|
2. Reads proposal.md (technical architecture)
|
|
37
|
-
3. Reads
|
|
37
|
+
3. Reads data.yaml (design tokens)
|
|
38
38
|
4. Searches existing components (Glob/Grep)
|
|
39
39
|
5. Generates: openspec/changes/{id}/page-plan.md
|
|
40
40
|
- 🔄 Reuse: Navbar, Footer (found)
|
|
@@ -99,7 +99,7 @@ User: /cdev landing-page
|
|
|
99
99
|
|----------------------|------------------------|
|
|
100
100
|
| ❌ Agent guesses structure | ✅ Clear structure defined |
|
|
101
101
|
| ❌ Duplicate components | ✅ Reuse existing components |
|
|
102
|
-
| ❌ Inconsistent design | ✅ Sync with
|
|
102
|
+
| ❌ Inconsistent design | ✅ Sync with data.yaml |
|
|
103
103
|
| ❌ Lorem ipsum content | ✅ Real content from PRD |
|
|
104
104
|
| ❌ Missing assets | ✅ Asset checklist prepared |
|
|
105
105
|
| ❌ Agent wastes time searching | ✅ Search done once upfront (25% faster) |
|
|
@@ -124,14 +124,14 @@ User: /cdev landing-page
|
|
|
124
124
|
|
|
125
125
|
---
|
|
126
126
|
|
|
127
|
-
## Integration with
|
|
127
|
+
## Integration with data.yaml
|
|
128
128
|
|
|
129
129
|
```
|
|
130
|
-
|
|
130
|
+
data.yaml → Design tokens (colors, spacing, shadows, psychology)
|
|
131
131
|
page-plan.md → Content structure (sections, components, assets)
|
|
132
132
|
|
|
133
133
|
uxui-frontend agent combines both:
|
|
134
|
-
- Colors from
|
|
134
|
+
- Colors from data.yaml (#0d7276)
|
|
135
135
|
- Content from page-plan ("Master TOEIC...")
|
|
136
136
|
- Result: Consistent + Real content
|
|
137
137
|
```
|
|
@@ -141,7 +141,7 @@ uxui-frontend agent combines both:
|
|
|
141
141
|
## 🔗 See Also
|
|
142
142
|
|
|
143
143
|
- `../../commands/pageplan.md` - /pageplan command implementation
|
|
144
|
-
- `../../commands/designsetup.md` - /designsetup command (generates
|
|
144
|
+
- `../../commands/designsetup.md` - /designsetup command (generates data.yaml + README.md)
|
|
145
145
|
- `../../contexts/patterns/ui-component-consistency.md` - Component reuse patterns
|
|
146
146
|
- `../../contexts/patterns/frontend-component-strategy.md` - When to create vs reuse
|
|
147
147
|
- `../document-loader.md` - Token-efficient loading patterns
|