@champpaba/claude-agent-kit 1.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.
- package/LICENSE +21 -0
- package/README.md +561 -0
- package/bin/cli.js +61 -0
- package/lib/init.js +52 -0
- package/lib/update.js +73 -0
- package/package.json +47 -0
- package/template/.claude/CHANGELOG-v1.1.1.md +259 -0
- package/template/.claude/CLAUDE.md +329 -0
- package/template/.claude/agents/01-integration.md +797 -0
- package/template/.claude/agents/02-uxui-frontend.md +899 -0
- package/template/.claude/agents/03-test-debug.md +759 -0
- package/template/.claude/agents/04-frontend.md +1099 -0
- package/template/.claude/agents/05-backend.md +1217 -0
- package/template/.claude/agents/06-database.md +969 -0
- package/template/.claude/commands/agentsetup.md +1464 -0
- package/template/.claude/commands/cdev.md +327 -0
- package/template/.claude/commands/csetup.md +447 -0
- package/template/.claude/commands/cstatus.md +60 -0
- package/template/.claude/commands/cview.md +364 -0
- package/template/.claude/commands/psetup.md +101 -0
- package/template/.claude/contexts/design/accessibility.md +611 -0
- package/template/.claude/contexts/design/box-thinking.md +553 -0
- package/template/.claude/contexts/design/color-theory.md +498 -0
- package/template/.claude/contexts/design/index.md +247 -0
- package/template/.claude/contexts/design/layout.md +400 -0
- package/template/.claude/contexts/design/responsive.md +551 -0
- package/template/.claude/contexts/design/shadows.md +522 -0
- package/template/.claude/contexts/design/spacing.md +428 -0
- package/template/.claude/contexts/design/typography.md +465 -0
- package/template/.claude/contexts/domain/README.md +164 -0
- package/template/.claude/contexts/patterns/agent-coordination.md +388 -0
- package/template/.claude/contexts/patterns/agent-discovery.md +182 -0
- package/template/.claude/contexts/patterns/change-workflow.md +538 -0
- package/template/.claude/contexts/patterns/code-standards.md +515 -0
- package/template/.claude/contexts/patterns/development-principles.md +513 -0
- package/template/.claude/contexts/patterns/error-handling.md +478 -0
- package/template/.claude/contexts/patterns/error-recovery.md +365 -0
- package/template/.claude/contexts/patterns/frontend-component-strategy.md +365 -0
- package/template/.claude/contexts/patterns/git-workflow.md +207 -0
- package/template/.claude/contexts/patterns/logging.md +424 -0
- package/template/.claude/contexts/patterns/task-breakdown.md +452 -0
- package/template/.claude/contexts/patterns/task-classification.md +523 -0
- package/template/.claude/contexts/patterns/tdd-classification.md +516 -0
- package/template/.claude/contexts/patterns/testing.md +413 -0
- package/template/.claude/contexts/patterns/ui-component-consistency.md +304 -0
- package/template/.claude/contexts/patterns/validation-framework.md +776 -0
- package/template/.claude/lib/README.md +39 -0
- package/template/.claude/lib/agent-executor.md +258 -0
- package/template/.claude/lib/agent-router.md +572 -0
- package/template/.claude/lib/flags-updater.md +469 -0
- package/template/.claude/lib/tdd-classifier.md +345 -0
- package/template/.claude/lib/validation-gates.md +484 -0
- package/template/.claude/settings.local.json +42 -0
- package/template/.claude/templates/context-template.md +45 -0
- package/template/.claude/templates/flags-template.json +42 -0
- package/template/.claude/templates/phase-templates.json +124 -0
- package/template/.claude/templates/phases-sections/accessibility-test.md +17 -0
- package/template/.claude/templates/phases-sections/api-design.md +37 -0
- package/template/.claude/templates/phases-sections/backend-tests.md +16 -0
- package/template/.claude/templates/phases-sections/backend.md +37 -0
- package/template/.claude/templates/phases-sections/business-logic-validation.md +16 -0
- package/template/.claude/templates/phases-sections/component-tests.md +17 -0
- package/template/.claude/templates/phases-sections/contract-backend.md +16 -0
- package/template/.claude/templates/phases-sections/contract-frontend.md +16 -0
- package/template/.claude/templates/phases-sections/database.md +35 -0
- package/template/.claude/templates/phases-sections/documentation.md +17 -0
- package/template/.claude/templates/phases-sections/e2e-tests.md +16 -0
- package/template/.claude/templates/phases-sections/fix-implementation.md +17 -0
- package/template/.claude/templates/phases-sections/frontend-integration.md +18 -0
- package/template/.claude/templates/phases-sections/frontend-mockup.md +123 -0
- package/template/.claude/templates/phases-sections/manual-flow-test.md +15 -0
- package/template/.claude/templates/phases-sections/manual-ux-test.md +16 -0
- package/template/.claude/templates/phases-sections/refactor-implementation.md +17 -0
- package/template/.claude/templates/phases-sections/refactor.md +16 -0
- package/template/.claude/templates/phases-sections/regression-tests.md +15 -0
- package/template/.claude/templates/phases-sections/report.md +16 -0
- package/template/.claude/templates/phases-sections/responsive-test.md +16 -0
- package/template/.claude/templates/phases-sections/script-implementation.md +43 -0
- package/template/.claude/templates/phases-sections/test-coverage.md +16 -0
- package/template/.claude/templates/phases-sections/user-approval.md +14 -0
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
# Change Workflow Pattern
|
|
2
|
+
|
|
3
|
+
> **Multi-Agent Orchestration with OpenSpec Integration**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🎯 Overview
|
|
8
|
+
|
|
9
|
+
This pattern describes how the multi-agent system integrates with OpenSpec to deliver change-based development workflows.
|
|
10
|
+
|
|
11
|
+
**Key Concepts:**
|
|
12
|
+
- **Per-change context**: Each OpenSpec change has isolated `.claude/` directory
|
|
13
|
+
- **Adaptive phases**: 6 workflow templates auto-selected based on task analysis
|
|
14
|
+
- **Real-time tracking**: `flags.json` updated by agents after each phase
|
|
15
|
+
- **Progress visibility**: Terminal-based progress views (`/cview`, `/cstatus`)
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 📋 Workflow Commands
|
|
20
|
+
|
|
21
|
+
### 1. `/psetup` - Project Setup (One-Time)
|
|
22
|
+
|
|
23
|
+
**When to use:** First time setting up the project
|
|
24
|
+
|
|
25
|
+
**What it does:**
|
|
26
|
+
1. Detects tech stack from package files
|
|
27
|
+
2. Queries Context7 for best practices
|
|
28
|
+
3. Creates `domain/` structure (3-level indexing)
|
|
29
|
+
4. Generates framework-specific best practices files
|
|
30
|
+
|
|
31
|
+
**Output:**
|
|
32
|
+
```
|
|
33
|
+
.claude/contexts/domain/
|
|
34
|
+
├── index.md # Level 1 - Project Registry
|
|
35
|
+
└── {project}/
|
|
36
|
+
├── README.md # Level 2 - Project Overview
|
|
37
|
+
├── tech-stack.md # Tech details
|
|
38
|
+
└── best-practices/
|
|
39
|
+
├── index.md # Level 3 - Best Practices Registry
|
|
40
|
+
├── react-18.md
|
|
41
|
+
├── nextjs-15.md
|
|
42
|
+
├── prisma-6.md
|
|
43
|
+
└── vitest-2.md
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
### 2. `/csetup {change-id}` - Change Setup
|
|
49
|
+
|
|
50
|
+
**When to use:** After creating OpenSpec change, before development
|
|
51
|
+
|
|
52
|
+
**What it does:**
|
|
53
|
+
1. Reads `proposal.md`, `tasks.md`, `design.md`
|
|
54
|
+
2. Analyzes task types (frontend, backend, database, script, etc.)
|
|
55
|
+
3. Selects appropriate phase template (6 options)
|
|
56
|
+
4. Generates `phases.md` (agent workflow)
|
|
57
|
+
5. Generates `flags.json` (progress tracking)
|
|
58
|
+
6. Generates `context.md` (change-specific tech)
|
|
59
|
+
|
|
60
|
+
**Output:**
|
|
61
|
+
```
|
|
62
|
+
openspec/changes/CHANGE-XXX/.claude/
|
|
63
|
+
├── phases.md # Agent workflow (19 phases for full-stack)
|
|
64
|
+
├── flags.json # Progress tracking (updated by agents)
|
|
65
|
+
└── context.md # Change-specific tech & patterns
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Phase Templates:**
|
|
69
|
+
|
|
70
|
+
| Template | Phases | Use Case | Example |
|
|
71
|
+
|----------|--------|----------|---------|
|
|
72
|
+
| **full-stack** | 19 | Frontend + Backend + Database | User auth system |
|
|
73
|
+
| **frontend-only** | 11 | UI components only | Landing page |
|
|
74
|
+
| **backend-only** | 10 | API endpoints only | REST API |
|
|
75
|
+
| **script-only** | 7 | CLI tools | Data migration script |
|
|
76
|
+
| **bug-fix** | 5 | Fix existing code | Patch security bug |
|
|
77
|
+
| **refactor** | 4 | Code improvements | Extract reusable components |
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
### 3. `/cdev {change-id}` - Start/Continue Development
|
|
82
|
+
|
|
83
|
+
**When to use:** After `/csetup`, to execute agent workflow
|
|
84
|
+
|
|
85
|
+
**What it does:**
|
|
86
|
+
1. Reads current phase from `flags.json`
|
|
87
|
+
2. Gets agent assignment from `phases.md`
|
|
88
|
+
3. Invokes appropriate agent(s)
|
|
89
|
+
4. Updates progress in `flags.json`
|
|
90
|
+
5. Continues or pauses for user action
|
|
91
|
+
|
|
92
|
+
**Workflow:**
|
|
93
|
+
```
|
|
94
|
+
1. User: "/cdev CHANGE-003"
|
|
95
|
+
↓
|
|
96
|
+
2. Read flags.json → Current phase: "frontend-mockup"
|
|
97
|
+
↓
|
|
98
|
+
3. Read phases.md → Agent: "uxui-frontend"
|
|
99
|
+
↓
|
|
100
|
+
4. Invoke uxui-frontend agent with:
|
|
101
|
+
- Project context (domain/)
|
|
102
|
+
- Change context (.claude/)
|
|
103
|
+
- OpenSpec files (proposal, tasks, design)
|
|
104
|
+
- Current phase instructions
|
|
105
|
+
↓
|
|
106
|
+
5. Agent completes phase → Updates flags.json
|
|
107
|
+
↓
|
|
108
|
+
6. Check next phase:
|
|
109
|
+
- If automated → Continue?
|
|
110
|
+
- If user action → Pause
|
|
111
|
+
- If complete → Done!
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Example Session:**
|
|
115
|
+
```bash
|
|
116
|
+
$ /cdev CHANGE-003
|
|
117
|
+
|
|
118
|
+
✅ Reading change context...
|
|
119
|
+
📁 Change: CHANGE-003 Create Landing Page
|
|
120
|
+
📊 Template: frontend-only (11 phases)
|
|
121
|
+
📍 Current: Phase 1/11 Frontend Mockup
|
|
122
|
+
|
|
123
|
+
Invoking uxui-frontend agent...
|
|
124
|
+
|
|
125
|
+
[Agent executes Phase 1...]
|
|
126
|
+
|
|
127
|
+
✅ Phase 1 completed! (95 minutes)
|
|
128
|
+
|
|
129
|
+
📁 Files created:
|
|
130
|
+
- src/app/page.tsx
|
|
131
|
+
- src/components/landing/hero-section.tsx
|
|
132
|
+
- src/components/landing/features-section.tsx
|
|
133
|
+
|
|
134
|
+
📍 Next: Phase 2 Accessibility Test (test-debug)
|
|
135
|
+
|
|
136
|
+
Continue? (yes/no)
|
|
137
|
+
> yes
|
|
138
|
+
|
|
139
|
+
[Continues...]
|
|
140
|
+
|
|
141
|
+
🛑 Phase 3 requires manual testing.
|
|
142
|
+
Test visual consistency using Chrome DevTools MCP.
|
|
143
|
+
When done: /cdev CHANGE-003 --continue
|
|
144
|
+
|
|
145
|
+
$ [User tests]
|
|
146
|
+
|
|
147
|
+
$ /cdev CHANGE-003 --continue
|
|
148
|
+
|
|
149
|
+
Updating flags → Phase 3 marked completed
|
|
150
|
+
📍 Next: Phase 4 Business Logic Validation
|
|
151
|
+
Continue? (yes/no)
|
|
152
|
+
> yes
|
|
153
|
+
|
|
154
|
+
[Continues until complete...]
|
|
155
|
+
|
|
156
|
+
✅ All phases completed! (11/11)
|
|
157
|
+
Ready to archive!
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
### 4. `/cview {change-id}` - View Progress
|
|
163
|
+
|
|
164
|
+
**When to use:** Check detailed phase-by-phase progress
|
|
165
|
+
|
|
166
|
+
**Output:**
|
|
167
|
+
```
|
|
168
|
+
════════════════════════════════════════════════════════════
|
|
169
|
+
📋 CHANGE-003: Create Landing Page (frontend-only)
|
|
170
|
+
════════════════════════════════════════════════════════════
|
|
171
|
+
|
|
172
|
+
📊 Overall Progress: [████████████░░░░░░░░] 64% (7/11 phases complete)
|
|
173
|
+
|
|
174
|
+
⏱️ Time Tracking:
|
|
175
|
+
Total Spent: 2h 55min
|
|
176
|
+
Total Estimated: 3h 15min
|
|
177
|
+
Efficiency: 111% (ahead of schedule)
|
|
178
|
+
Remaining: ~35 minutes
|
|
179
|
+
|
|
180
|
+
════════════════════════════════════════════════════════════
|
|
181
|
+
✅ COMPLETED PHASES (7)
|
|
182
|
+
════════════════════════════════════════════════════════════
|
|
183
|
+
|
|
184
|
+
[1] Frontend Mockup (uxui-frontend)
|
|
185
|
+
⏱️ 2025-10-30 10:00 → 11:35 (95 min, estimated 90 min)
|
|
186
|
+
📁 Created: 4 files
|
|
187
|
+
- src/app/page.tsx
|
|
188
|
+
- src/components/landing/hero-section.tsx
|
|
189
|
+
- src/components/landing/features-section.tsx
|
|
190
|
+
- src/components/landing/cta-section.tsx
|
|
191
|
+
✓ Tasks: 1.1, 1.2, 1.3, 2.1, 2.2, 2.3, 3.1, 3.2, 3.3
|
|
192
|
+
📝 All landing page sections created. Responsive design implemented.
|
|
193
|
+
|
|
194
|
+
[2] Accessibility Test (test-debug)
|
|
195
|
+
⏱️ 2025-10-30 11:35 → 11:43 (8 min, estimated 10 min)
|
|
196
|
+
🎯 Lighthouse: 98/100
|
|
197
|
+
✓ Contrast ratio: Pass
|
|
198
|
+
✓ ARIA labels: Complete
|
|
199
|
+
📝 Minor contrast adjustment made to CTA button.
|
|
200
|
+
|
|
201
|
+
[... 5 more completed phases ...]
|
|
202
|
+
|
|
203
|
+
════════════════════════════════════════════════════════════
|
|
204
|
+
🔄 IN PROGRESS (1)
|
|
205
|
+
════════════════════════════════════════════════════════════
|
|
206
|
+
|
|
207
|
+
[8] Refactor (test-debug) ← CURRENT
|
|
208
|
+
⏱️ Started: 2025-10-30 14:15 (15 minutes ago)
|
|
209
|
+
⏱️ Estimated: 20 minutes total (~5 minutes remaining)
|
|
210
|
+
📝 Extracting reusable button component. Optimizing CSS classes.
|
|
211
|
+
|
|
212
|
+
════════════════════════════════════════════════════════════
|
|
213
|
+
⏳ PENDING (3)
|
|
214
|
+
════════════════════════════════════════════════════════════
|
|
215
|
+
|
|
216
|
+
[9] Test Coverage Report (test-debug)
|
|
217
|
+
⏱️ Estimated: 5 minutes
|
|
218
|
+
📋 Generate final coverage report
|
|
219
|
+
|
|
220
|
+
[10] Documentation (integration)
|
|
221
|
+
⏱️ Estimated: 15 minutes
|
|
222
|
+
📋 Update README, add JSDoc comments
|
|
223
|
+
|
|
224
|
+
[11] Final Report (integration)
|
|
225
|
+
⏱️ Estimated: 10 minutes
|
|
226
|
+
📋 Generate verbose report for archive
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
### 5. `/cstatus {change-id}` - Quick Status
|
|
232
|
+
|
|
233
|
+
**When to use:** Quick glance at progress
|
|
234
|
+
|
|
235
|
+
**Output:**
|
|
236
|
+
```
|
|
237
|
+
📊 CHANGE-003: feature | frontend-only
|
|
238
|
+
|
|
239
|
+
Progress: [████████░░] 64% (7/11 phases)
|
|
240
|
+
|
|
241
|
+
Current Phase: #8 Refactor (test-debug)
|
|
242
|
+
├─ Started: 14:15 (15 minutes ago)
|
|
243
|
+
├─ Estimated: 20 minutes
|
|
244
|
+
└─ Status: in_progress
|
|
245
|
+
|
|
246
|
+
✅ Completed: 7 phases
|
|
247
|
+
🔄 In Progress: 1 phase
|
|
248
|
+
⏳ Remaining: 3 phases
|
|
249
|
+
|
|
250
|
+
⏱️ Time:
|
|
251
|
+
├─ Spent: 2h 55min (estimated: 3h 15min)
|
|
252
|
+
├─ Remaining: ~35 minutes
|
|
253
|
+
└─ Efficiency: 111% (ahead of estimate)
|
|
254
|
+
|
|
255
|
+
📈 Stats:
|
|
256
|
+
├─ Tests: 12 passed, 0 failed (75% coverage)
|
|
257
|
+
├─ Issues: 2 found, 2 fixed, 0 remaining
|
|
258
|
+
└─ Files: 4 created, 2 modified
|
|
259
|
+
|
|
260
|
+
🎯 Next Steps:
|
|
261
|
+
1. Complete refactoring (20 min)
|
|
262
|
+
2. Test coverage report (5 min)
|
|
263
|
+
3. Documentation (15 min)
|
|
264
|
+
|
|
265
|
+
Commands:
|
|
266
|
+
→ Detailed view: /cview CHANGE-003
|
|
267
|
+
→ Continue dev: /cdev CHANGE-003
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## 🗺️ Agent Discovery Flow
|
|
273
|
+
|
|
274
|
+
**Every agent follows this 5-level discovery sequence:**
|
|
275
|
+
|
|
276
|
+
```
|
|
277
|
+
Level 1: Find Current Project
|
|
278
|
+
Read: .claude/contexts/domain/index.md
|
|
279
|
+
→ Extract: Current project name
|
|
280
|
+
|
|
281
|
+
Level 2: Load Project Overview
|
|
282
|
+
Read: .claude/contexts/domain/{project}/README.md
|
|
283
|
+
→ Extract: Tech stack summary, package manager
|
|
284
|
+
|
|
285
|
+
Level 3: Check Best Practices Index
|
|
286
|
+
Read: .claude/contexts/domain/{project}/best-practices/index.md
|
|
287
|
+
→ Extract: Relevant files for this agent
|
|
288
|
+
|
|
289
|
+
Level 4: Load Relevant Best Practices
|
|
290
|
+
Read: .claude/contexts/domain/{project}/best-practices/{files}
|
|
291
|
+
→ Extract: Framework-specific patterns
|
|
292
|
+
|
|
293
|
+
Level 5: Change Context (Current Task)
|
|
294
|
+
IF openspec/changes/{change-id}/.claude/ EXISTS:
|
|
295
|
+
1. Read: context.md → Change-specific tech
|
|
296
|
+
2. Read: flags.json → Current progress
|
|
297
|
+
3. Read: phases.md → Current phase instructions
|
|
298
|
+
4. Read: proposal.md, tasks.md, design.md → Requirements
|
|
299
|
+
ELSE:
|
|
300
|
+
Skip (working on general task, not OpenSpec change)
|
|
301
|
+
|
|
302
|
+
✅ Discovery Complete
|
|
303
|
+
Report: "✅ Project Context Loaded"
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## 📤 Agent Post-Work (Flags Update)
|
|
309
|
+
|
|
310
|
+
**After completing a phase, agents MUST update flags.json:**
|
|
311
|
+
|
|
312
|
+
```json
|
|
313
|
+
{
|
|
314
|
+
"phases": {
|
|
315
|
+
"frontend-mockup": {
|
|
316
|
+
"status": "completed",
|
|
317
|
+
"completed_at": "2025-10-30T11:35:00Z",
|
|
318
|
+
"actual_minutes": 95,
|
|
319
|
+
"tasks_completed": ["1.1", "1.2", "1.3"],
|
|
320
|
+
"files_created": [
|
|
321
|
+
"src/app/page.tsx",
|
|
322
|
+
"src/components/landing/hero-section.tsx"
|
|
323
|
+
],
|
|
324
|
+
"notes": "All sections created. Responsive design implemented."
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
"current_phase": "accessibility-test",
|
|
328
|
+
"updated_at": "2025-10-30T11:35:00Z"
|
|
329
|
+
}
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
**What agents MUST NOT update:**
|
|
333
|
+
- ❌ `tasks.md` (OpenSpec owns this)
|
|
334
|
+
- ❌ `phases.md` (generated once, read-only)
|
|
335
|
+
- ❌ `proposal.md` or `design.md`
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## 🔄 Phase Templates Detail
|
|
340
|
+
|
|
341
|
+
### Full-Stack (19 phases)
|
|
342
|
+
|
|
343
|
+
**Use case:** Frontend + Backend + Database
|
|
344
|
+
|
|
345
|
+
**Phases:**
|
|
346
|
+
1. Frontend Mockup (uxui-frontend, 90 min)
|
|
347
|
+
2. Accessibility Test (test-debug, 10 min)
|
|
348
|
+
3. Manual UX Test (user, 15 min)
|
|
349
|
+
4. Business Logic Validation (integration, 10 min)
|
|
350
|
+
5. User Approval (user, 5 min)
|
|
351
|
+
6. API Design (integration, 30 min)
|
|
352
|
+
7. Backend (backend, 120 min)
|
|
353
|
+
8. Database (database, 30 min) - parallel with #7
|
|
354
|
+
9. Backend Tests (test-debug, 30 min)
|
|
355
|
+
10. Contract Backend (integration, 10 min)
|
|
356
|
+
11. Frontend Integration (frontend, 60 min)
|
|
357
|
+
12. Contract Frontend (integration, 10 min)
|
|
358
|
+
13. Component Tests (test-debug, 20 min)
|
|
359
|
+
14. Responsive Test (user, 15 min)
|
|
360
|
+
15. E2E Tests (test-debug, 45 min)
|
|
361
|
+
16. Manual Flow Test (user, 30 min)
|
|
362
|
+
17. Refactor (test-debug, 20 min)
|
|
363
|
+
18. Documentation (integration, 15 min)
|
|
364
|
+
19. Final Report (integration, 10 min)
|
|
365
|
+
|
|
366
|
+
**Total: ~7 hours**
|
|
367
|
+
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
### Frontend-Only (11 phases)
|
|
371
|
+
|
|
372
|
+
**Use case:** UI components only, no backend
|
|
373
|
+
|
|
374
|
+
**Phases:**
|
|
375
|
+
1. Frontend Mockup (uxui-frontend, 90 min)
|
|
376
|
+
2. Accessibility Test (test-debug, 10 min)
|
|
377
|
+
3. Manual UX Test (user, 15 min)
|
|
378
|
+
4. Business Logic Validation (integration, 10 min)
|
|
379
|
+
5. User Approval (user, 5 min)
|
|
380
|
+
6. Component Tests (test-debug, 20 min)
|
|
381
|
+
7. Responsive Test (user, 15 min)
|
|
382
|
+
8. Refactor (test-debug, 20 min)
|
|
383
|
+
9. Test Coverage (test-debug, 5 min)
|
|
384
|
+
10. Documentation (integration, 15 min)
|
|
385
|
+
11. Final Report (integration, 10 min)
|
|
386
|
+
|
|
387
|
+
**Total: ~3.25 hours**
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
### Backend-Only (10 phases)
|
|
392
|
+
|
|
393
|
+
**Use case:** API endpoints only, no UI
|
|
394
|
+
|
|
395
|
+
**Phases:**
|
|
396
|
+
1. API Design (integration, 30 min)
|
|
397
|
+
2. Backend (backend, 120 min)
|
|
398
|
+
3. Database (database, 30 min) - parallel with #2
|
|
399
|
+
4. Backend Tests (test-debug, 30 min)
|
|
400
|
+
5. Contract Validation (integration, 10 min)
|
|
401
|
+
6. E2E API Tests (test-debug, 30 min)
|
|
402
|
+
7. Refactor (backend, 20 min)
|
|
403
|
+
8. Test Coverage (test-debug, 5 min)
|
|
404
|
+
9. Documentation (integration, 15 min)
|
|
405
|
+
10. Final Report (integration, 10 min)
|
|
406
|
+
|
|
407
|
+
**Total: ~5 hours**
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
### Script-Only (7 phases)
|
|
412
|
+
|
|
413
|
+
**Use case:** CLI tools, data migration scripts
|
|
414
|
+
|
|
415
|
+
**Phases:**
|
|
416
|
+
1. Script Implementation (backend, 60 min)
|
|
417
|
+
2. Automated Tests (test-debug, 20 min)
|
|
418
|
+
3. Manual Testing (user, 15 min)
|
|
419
|
+
4. Refactor (backend, 15 min)
|
|
420
|
+
5. Test Coverage (test-debug, 5 min)
|
|
421
|
+
6. Documentation (integration, 10 min)
|
|
422
|
+
7. Final Report (integration, 5 min)
|
|
423
|
+
|
|
424
|
+
**Total: ~2.2 hours**
|
|
425
|
+
|
|
426
|
+
---
|
|
427
|
+
|
|
428
|
+
### Bug-Fix (5 phases)
|
|
429
|
+
|
|
430
|
+
**Use case:** Fix existing bugs
|
|
431
|
+
|
|
432
|
+
**Phases:**
|
|
433
|
+
1. Fix Implementation (varies by bug location, 30 min)
|
|
434
|
+
2. Unit Tests (test-debug, 15 min)
|
|
435
|
+
3. Manual Verification (user, 10 min)
|
|
436
|
+
4. Regression Tests (test-debug, 15 min)
|
|
437
|
+
5. Final Report (integration, 5 min)
|
|
438
|
+
|
|
439
|
+
**Total: ~1.25 hours**
|
|
440
|
+
|
|
441
|
+
---
|
|
442
|
+
|
|
443
|
+
### Refactor (4 phases)
|
|
444
|
+
|
|
445
|
+
**Use case:** Code improvements, extract components
|
|
446
|
+
|
|
447
|
+
**Phases:**
|
|
448
|
+
1. Refactor Implementation (test-debug, 45 min)
|
|
449
|
+
2. Unit Tests (test-debug, 20 min)
|
|
450
|
+
3. Documentation (integration, 10 min)
|
|
451
|
+
4. Final Report (integration, 5 min)
|
|
452
|
+
|
|
453
|
+
**Total: ~1.3 hours**
|
|
454
|
+
|
|
455
|
+
---
|
|
456
|
+
|
|
457
|
+
## 📊 Template Selection Logic
|
|
458
|
+
|
|
459
|
+
**Detection keywords in `tasks.md`:**
|
|
460
|
+
|
|
461
|
+
```typescript
|
|
462
|
+
const keywords = {
|
|
463
|
+
frontend: ["component", "page", "ui", "responsive", "form", "button", ...],
|
|
464
|
+
backend: ["api", "endpoint", "route", "server", "controller", ...],
|
|
465
|
+
database: ["database", "schema", "migration", "model", "table", ...],
|
|
466
|
+
script: ["script", "cli", "command", "tool", "migrate", ...],
|
|
467
|
+
bug_fix: ["fix", "bug", "issue", "error", "crash", ...],
|
|
468
|
+
refactor: ["refactor", "extract", "improve", "optimize", ...]
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// Selection logic
|
|
472
|
+
if (isBugFix) template = 'bug-fix'
|
|
473
|
+
else if (isRefactor) template = 'refactor'
|
|
474
|
+
else if (hasScript && !hasFrontend && !hasBackend) template = 'script-only'
|
|
475
|
+
else if (hasFrontend && hasBackend) template = 'full-stack'
|
|
476
|
+
else if (hasFrontend && !hasBackend) template = 'frontend-only'
|
|
477
|
+
else if (hasBackend && !hasFrontend) template = 'backend-only'
|
|
478
|
+
else template = 'full-stack' // Safe default
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
---
|
|
482
|
+
|
|
483
|
+
## 🎯 Best Practices
|
|
484
|
+
|
|
485
|
+
### 1. Always Run `/psetup` First
|
|
486
|
+
- One-time project setup
|
|
487
|
+
- Generates framework-specific best practices
|
|
488
|
+
- Required for agent discovery
|
|
489
|
+
|
|
490
|
+
### 2. Use `/csetup` After Creating OpenSpec Change
|
|
491
|
+
- Analyzes tasks and generates workflow
|
|
492
|
+
- Creates per-change context
|
|
493
|
+
- Enables progress tracking
|
|
494
|
+
|
|
495
|
+
### 3. Use `/cdev` for Execution
|
|
496
|
+
- Orchestrates agent workflow
|
|
497
|
+
- Updates progress automatically
|
|
498
|
+
- Handles user actions
|
|
499
|
+
|
|
500
|
+
### 4. Check Progress with `/cview` or `/cstatus`
|
|
501
|
+
- `/cview` for detailed breakdown
|
|
502
|
+
- `/cstatus` for quick glance
|
|
503
|
+
- Real-time updates from `flags.json`
|
|
504
|
+
|
|
505
|
+
### 5. Agents Update `flags.json` After Each Phase
|
|
506
|
+
- Marks phase as completed
|
|
507
|
+
- Records actual time spent
|
|
508
|
+
- Lists files created
|
|
509
|
+
- Adds summary notes
|
|
510
|
+
|
|
511
|
+
---
|
|
512
|
+
|
|
513
|
+
## 🔍 Troubleshooting
|
|
514
|
+
|
|
515
|
+
**Problem:** `/cdev` says "Change not set up"
|
|
516
|
+
**Solution:** Run `/csetup {change-id}` first
|
|
517
|
+
|
|
518
|
+
**Problem:** Agent doesn't load project context
|
|
519
|
+
**Solution:** Run `/psetup` to create domain/ structure
|
|
520
|
+
|
|
521
|
+
**Problem:** Progress tracking not working
|
|
522
|
+
**Solution:** Check if `flags.json` exists and is valid JSON
|
|
523
|
+
|
|
524
|
+
**Problem:** Agent skips change context
|
|
525
|
+
**Solution:** Verify `openspec/changes/{change-id}/.claude/` exists
|
|
526
|
+
|
|
527
|
+
---
|
|
528
|
+
|
|
529
|
+
## 📚 Related Files
|
|
530
|
+
|
|
531
|
+
- Templates: `.claude/templates/`
|
|
532
|
+
- Commands: `.claude/commands/csetup.md`, `/cdev.md`, `/cview.md`, `/cstatus.md`
|
|
533
|
+
- Agents: `.claude/agents/01-06-*.md`
|
|
534
|
+
- Patterns: `.claude/contexts/patterns/`
|
|
535
|
+
|
|
536
|
+
---
|
|
537
|
+
|
|
538
|
+
**💡 Remember:** This workflow integrates OpenSpec with multi-agent orchestration for systematic, trackable, change-based development!
|