@champpaba/claude-agent-kit 1.4.1 → 1.4.2

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/README.md CHANGED
@@ -1,1278 +1,1278 @@
1
- # Claude Agent Kit
2
-
3
- > 🤖 **Multi-Agent Implementation Engine** - The perfect companion for [OpenSpec](https://github.com/Fission-AI/OpenSpec) spec-driven development
4
-
5
- [![npm version](https://badge.fury.io/js/@champpaba%2Fclaude-agent-kit.svg)](https://www.npmjs.com/package/@champpaba/claude-agent-kit)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
- [![Node.js Version](https://img.shields.io/node/v/@champpaba/claude-agent-kit)](https://nodejs.org)
8
-
9
- ---
10
-
11
- ## 🎯 What is this?
12
-
13
- **Claude Agent Kit picks up where OpenSpec planning ends.**
14
-
15
- While OpenSpec handles **alignment** (Draft Proposal → Review & Align), Claude Agent Kit handles **implementation** (Implement Tasks → Archive & Update) with specialized AI agents.
16
-
17
- ### The Complete Workflow
18
-
19
- ```
20
- ┌─────────────────────────────────────────────────────────────┐
21
- │ OpenSpec Planning │
22
- │ (Spec-Driven Development for AI Coding Assistants) │
23
- └─────────────────────────────────────────────────────────────┘
24
-
25
- Generates: proposal.md + tasks.md
26
-
27
- ┌─────────────────────────────────────────────────────────────┐
28
- │ Claude Agent Kit Implementation │
29
- │ (Multi-Agent Execution with 6 Specialists) │
30
- └─────────────────────────────────────────────────────────────┘
31
-
32
- Completes: All tasks with quality gates
33
- ```
34
-
35
- ---
36
-
37
- ## 🔄 How They Work Together
38
-
39
- | Stage | Tool | What Happens | Output |
40
- |-------|------|--------------|--------|
41
- | **1. Draft Proposal** | OpenSpec | Human requests change, AI scaffolds structure | `proposal.md` + `tasks.md` |
42
- | **2. Review & Align** | OpenSpec | Team iterates until consensus | Approved specs |
43
- | **2.5. Page Planning** | **Claude Agent Kit** | *(UI tasks only)* Generate content & component plan | `page-plan.md` |
44
- | **3. Setup Context** | **Claude Agent Kit** | Classify tasks, generate workflow | `workflow.md` |
45
- | **4. Implement Tasks** | **Claude Agent Kit** | 6 specialized agents execute work | Working code + tests |
46
- | **5. Archive & Update** | OpenSpec | Merge changes back to specs | Updated `specs/` |
47
-
48
- ### What OpenSpec Generates
49
-
50
- **proposal.md** - Business case and scope
51
- ```markdown
52
- # Change Proposal: User Authentication System
53
-
54
- ## Motivation
55
- Users need secure login functionality...
56
-
57
- ## Scope
58
- - Email/password authentication
59
- - JWT token generation
60
- - Protected routes middleware
61
- ```
62
-
63
- **tasks.md** - Implementation checklist
64
- ```markdown
65
- ## Database Setup
66
- - [ ] Create User model with email, password fields
67
- - [ ] Add unique constraint on email
68
-
69
- ## Backend Implementation
70
- - [ ] POST /api/auth/login endpoint
71
- - [ ] Password hashing with bcrypt
72
- - [ ] JWT token generation
73
-
74
- ## Frontend Implementation
75
- - [ ] Login form component
76
- - [ ] Form validation
77
- - [ ] Token storage
78
- ```
79
-
80
- ### What Claude Agent Kit Does
81
-
82
- **Input:** Reads `proposal.md` + `tasks.md` from OpenSpec
83
-
84
- **Process:**
85
- 1. `/pageplan` *(UI tasks only)* - Generate content & component reuse plan
86
- 2. `/csetup {change-id}` - Analyze tasks, classify by agent, generate workflow
87
- 3. `/cdev {change-id}` - Execute with 6 specialized agents in phases:
88
- - **Phase 1:** UI with mock data (uxui-frontend)
89
- - **Phase 2:** Real API + database (backend + database, parallel)
90
- - **Phase 2.5:** Validate contracts (integration)
91
- - **Phase 3:** Connect UI to API (frontend)
92
- - **Phase 4:** Tests + bug fixes (test-debug)
93
-
94
- **Output:** Working implementation ready for review
95
-
96
- ---
97
-
98
- ## 🎨 NEW: Page Planning for UI Tasks
99
-
100
- **Problem:** Before `/pageplan`, agents would:
101
- - ❌ Create duplicate components (3 different Navbar components!)
102
- - ❌ Use inconsistent colors (`#0d7276` on landing, `#4f46e5` on dashboard)
103
- - ❌ Generate lorem ipsum instead of real content
104
- - ❌ Waste time searching for components during implementation
105
-
106
- **Solution:** `/pageplan` command analyzes BEFORE implementing
107
-
108
- ### How It Works
109
-
110
- ```bash
111
- # Step 1: OpenSpec generates tasks
112
- User: "Build landing page for TOEIC app"
113
- → Creates: .changes/landing-page/proposal.md + tasks.md
114
-
115
- # Step 2: Generate page plan (NEW!)
116
- User: /pageplan @prd.md @project_brief.md
117
-
118
- # What it does:
119
- # 1. Reads user-specified files (PRD, brief)
120
- # 2. Reads proposal.md (technical architecture)
121
- # 3. Reads STYLE_GUIDE.md (visual design)
122
- # 4. Searches existing components (Navbar, Footer, etc.)
123
- # 5. AI drafts real content from PRD
124
- # 6. Generates: .changes/landing-page/page-plan.md
125
- ```
126
-
127
- ### page-plan.md Output
128
-
129
- ```markdown
130
- # Page Plan: Landing Page
131
-
132
- ## 1. Component Plan
133
- 🔄 Reuse: Navbar, Footer (found in codebase)
134
- ✅ New Shared: (none)
135
- ✅ New Specific: HeroSection, FeatureGrid, TestimonialCarousel
136
-
137
- ## 2. Page Structure
138
- <Layout>
139
- <Navbar /> {/* Reuse */}
140
- <HeroSection /> {/* New - see content below */}
141
- <FeatureGrid />
142
- <TestimonialCarousel />
143
- <Footer /> {/* Reuse */}
144
- </Layout>
145
-
146
- ## 3. Assets to Prepare
147
- - [ ] hero-image.jpg (1920x1080)
148
- - [ ] logo.svg (200x60)
149
- - [ ] feature-icons (3x 24x24 SVG)
150
-
151
- ## 4. Content Draft (AI-Generated - Please Review & Edit)
152
- **Headline:** "Master TOEIC with AI-Powered Tests"
153
- **Subheadline:** "Experience exam-quality questions with instant AI scoring"
154
- **CTA:** "Start Free Test"
155
-
156
- **Features:**
157
- - Real TOEIC-style questions
158
- - Instant AI scoring
159
- - Progress tracking dashboard
160
- ```
161
-
162
- ### Step 3: User Prepares
163
-
164
- - ✅ Review content draft (edit as needed)
165
- - ✅ Prepare assets (images, icons)
166
- - ✅ Approve `page-plan.md`
167
-
168
- ### Step 4: Implementation
169
-
170
- ```bash
171
- /csetup landing-page
172
- /cdev landing-page
173
-
174
- # uxui-frontend agent automatically:
175
- # - STEP 0.5: Reads page-plan.md ✅
176
- # - STEP 3: SKIP component search (already done!) ⚡ 25% faster
177
- # - Uses: Real content from page-plan
178
- # - Reuses: Navbar, Footer (no duplicates)
179
- # - Creates: HeroSection, FeatureGrid, TestimonialCarousel
180
- # - Applies: Colors/spacing from STYLE_GUIDE.md
181
- ```
182
-
183
- ### Benefits
184
-
185
- | Before (No page-plan) | After (With page-plan) |
186
- |----------------------|------------------------|
187
- | ❌ Agent searches during implementation | ✅ Search done once upfront (25% faster) |
188
- | ❌ Duplicate components created | ✅ Clear reuse plan |
189
- | ❌ Lorem ipsum content | ✅ Real content from PRD |
190
- | ❌ Missing assets mid-work | ✅ Asset checklist prepared |
191
- | ❌ Inconsistent design | ✅ Synced with STYLE_GUIDE |
192
- | ❌ Agent guesses structure | ✅ Clear component hierarchy |
193
-
194
- ### When to Use /pageplan
195
-
196
- ```
197
- ✅ Use for:
198
- - Landing pages
199
- - Dashboards
200
- - Multi-section UI pages
201
- - Any task with multiple components
202
-
203
- ❌ Skip for:
204
- - Backend API endpoints
205
- - Database schemas
206
- - Single-component tasks
207
- - Non-UI work
208
- ```
209
-
210
- ---
211
-
212
- ## 🤖 The 6 Specialized Agents
213
-
214
- | Agent | Color | Responsibility | Phase |
215
- |-------|-------|---------------|-------|
216
- | **uxui-frontend** | 🔵 Blue | Design UI components with mock data | 1 |
217
- | **backend** | 🟣 Purple | Create API endpoints with validation | 2 |
218
- | **database** | 🩷 Pink | Design schemas, migrations, queries | 2 |
219
- | **integration** | 🟠 Orange | Validate API contracts before connecting | 2.5 |
220
- | **frontend** | 🟢 Green | Connect UI to backend APIs | 3 |
221
- | **test-debug** | 🔴 Red | Run tests and fix bugs (max 3-4 iterations) | 1,3,4 |
222
-
223
- Each agent:
224
- - ✅ Auto-discovers your project context (tech stack, best practices)
225
- - ✅ Follows framework-specific patterns from Context7 MCP
226
- - ✅ Maintains design consistency across the codebase
227
- - ✅ Reports progress with detailed logging
228
- - ✅ **Smart auto-proceed:** Eliminates double confirmations when user approves workflow
229
-
230
- ---
231
-
232
- ## 📦 Installation
233
-
234
- ```bash
235
- npm install -g @champpaba/claude-agent-kit
236
- ```
237
-
238
- ### Alternative Package Managers
239
-
240
- ```bash
241
- # Using pnpm
242
- pnpm add -g @champpaba/claude-agent-kit
243
-
244
- # Using yarn
245
- yarn global add @champpaba/claude-agent-kit
246
- ```
247
-
248
- ---
249
-
250
- ## 🚀 Quick Start (with OpenSpec)
251
-
252
- ### Step 1: OpenSpec Planning
253
-
254
- ```bash
255
- # In your OpenSpec-enabled project
256
- cd my-app
257
-
258
- # Draft a change proposal (OpenSpec handles this)
259
- "I want to build a landing page for my TOEIC app"
260
- # → Generates: .changes/landing-page/proposal.md + tasks.md
261
- ```
262
-
263
- ### Step 2: Initialize Claude Agent Kit
264
-
265
- ```bash
266
- # Initialize the agent system
267
- cak init
268
-
269
- # Setup project context (detects tech stack)
270
- # In Claude Code:
271
- /psetup
272
- ```
273
-
274
- ### Step 3: Generate Page Plan (UI tasks only)
275
-
276
- ```bash
277
- # In Claude Code:
278
- /pageplan @prd.md @project_brief.md
279
-
280
- # → Generates: .changes/landing-page/page-plan.md
281
- # → Review content, prepare assets
282
- ```
283
-
284
- ### Step 4: Setup Change Context
285
-
286
- ```bash
287
- /csetup landing-page
288
- ```
289
-
290
- **What happens:**
291
- - Reads `.changes/landing-page/proposal.md` (business context)
292
- - Reads `.changes/landing-page/tasks.md` (implementation checklist)
293
- - Reads `.changes/landing-page/page-plan.md` (if exists - content plan)
294
- - Classifies tasks by agent (database, backend, frontend, etc.)
295
- - Generates `workflow.md` (execution plan)
296
-
297
- ### Step 5: Execute Implementation
298
-
299
- ```bash
300
- /cdev landing-page
301
- ```
302
-
303
- **What happens:**
304
- 1. **Phase 1:** uxui-frontend reads `page-plan.md` → creates UI with real content
305
- 2. **Phase 2:** backend + database create APIs + models (parallel, if needed)
306
- 3. **Phase 2.5:** integration validates API contracts
307
- 4. **Phase 3:** frontend connects UI to APIs (if needed)
308
- 5. **Phase 4:** test-debug runs tests, fixes bugs
309
-
310
- ### Step 6: Monitor Progress
311
-
312
- ```bash
313
- # View detailed progress
314
- /cview landing-page
315
-
316
- # Quick status check
317
- /cstatus landing-page
318
- # → Phase 1/4 - UI Implementation (100%)
319
- ```
320
-
321
- ---
322
-
323
- ## 🎯 Complete Workflow Examples
324
-
325
- ### Workflow A: UI Feature (with /pageplan)
326
-
327
- ```bash
328
- # 1. OpenSpec Planning
329
- User: "Build landing page for TOEIC app"
330
- → Creates: proposal.md + tasks.md
331
-
332
- # 2. Page Planning (NEW!)
333
- /pageplan @prd.md @project_brief.md
334
- → Creates: page-plan.md
335
- → User reviews content & prepares assets
336
-
337
- # 3. Setup Context
338
- /csetup landing-page
339
- → Reads: proposal.md, tasks.md, page-plan.md
340
- → Generates: workflow.md
341
-
342
- # 4. Implementation
343
- /cdev landing-page
344
- → uxui-frontend reads page-plan.md (STEP 0.5)
345
- → Skips redundant component search
346
- → Uses real content + reuse plan
347
- → 25% faster implementation
348
-
349
- # 5. Monitor
350
- /cview landing-page
351
- ```
352
-
353
- ### Workflow B: Backend Feature (skip /pageplan)
354
-
355
- ```bash
356
- # 1. OpenSpec Planning
357
- User: "Add payment processing API"
358
- → Creates: proposal.md + tasks.md
359
-
360
- # 2. Setup Context (skip /pageplan - not UI work)
361
- /csetup payment-api
362
-
363
- # 3. Implementation
364
- /cdev payment-api
365
- → Phase 2: backend + database agents (parallel)
366
- → Phase 2.5: integration validates contracts
367
- → Phase 3: frontend connects (if UI exists)
368
- → Phase 4: test-debug validates
369
-
370
- # 4. Monitor
371
- /cview payment-api
372
- ```
373
-
374
- ### Workflow C: Full-Stack Feature (with /pageplan)
375
-
376
- ```bash
377
- # 1. OpenSpec Planning
378
- User: "Build user authentication system"
379
- → Creates: proposal.md + tasks.md
380
-
381
- # 2. Page Planning (for login UI only)
382
- /pageplan @prd.md
383
- → Creates: page-plan.md (login form content + components)
384
-
385
- # 3. Setup Context
386
- /csetup auth-system
387
-
388
- # 4. Implementation
389
- /cdev auth-system
390
- → Phase 1: uxui-frontend (login form, reads page-plan.md)
391
- → Phase 2: backend (POST /api/auth/login) + database (User model)
392
- → Phase 2.5: integration (validate contract)
393
- → Phase 3: frontend (connect form to API)
394
- → Phase 4: test-debug (E2E tests)
395
-
396
- # 5. Monitor
397
- /cview auth-system
398
- ```
399
-
400
- ---
401
-
402
- ## 📁 Project Structure After Init
403
-
404
- ```
405
- your-project/
406
- ├── openspec/
407
- │ ├── specs/ # Source of truth (OpenSpec)
408
- │ └── changes/
409
- │ └── landing-page/
410
- │ ├── proposal.md ← OpenSpec generates
411
- │ ├── tasks.md ← OpenSpec generates
412
- │ ├── page-plan.md ← /pageplan generates (UI tasks)
413
- │ ├── workflow.md ← /csetup generates
414
- │ └── flags.json ← /cdev tracks progress
415
-
416
- ├── design-system/
417
- │ └── STYLE_GUIDE.md ← /designsetup generates
418
-
419
- └── .claude/
420
- ├── CLAUDE.md # Navigation guide
421
-
422
- ├── agents/ # 6 specialized agents
423
- │ ├── 01-integration.md
424
- │ ├── 02-uxui-frontend.md
425
- │ ├── 03-test-debug.md
426
- │ ├── 04-frontend.md
427
- │ ├── 05-backend.md
428
- │ └── 06-database.md
429
-
430
- ├── commands/ # Slash commands
431
- │ ├── designsetup.md # Generate style guide
432
- │ ├── pageplan.md # Generate page plan (NEW!)
433
- │ ├── psetup.md # Project setup
434
- │ ├── csetup.md # Change setup
435
- │ ├── cdev.md # Change development
436
- │ ├── cview.md # View progress
437
- │ └── cstatus.md # Quick status
438
-
439
- ├── contexts/
440
- │ ├── design/ # Design foundation
441
- │ ├── patterns/ # Universal patterns
442
- │ └── domain/ # Project context
443
-
444
- └── lib/ # Implementation logic
445
- ├── agent-executor.md
446
- ├── tdd-classifier.md
447
- ├── flags-updater.md
448
- └── agent-router.md
449
- ```
450
-
451
- ---
452
-
453
- ## 🎯 Why Use Claude Agent Kit?
454
-
455
- ### Without Claude Agent Kit (Manual Implementation)
456
-
457
- ```
458
- ❌ You manually interpret tasks.md
459
- ❌ You context-switch between frontend/backend/database
460
- ❌ You might forget edge cases or tests
461
- ❌ Inconsistent code patterns across features
462
- ❌ No systematic error handling
463
- ❌ Duplicate components everywhere
464
- ❌ Lorem ipsum content in UI
465
- ```
466
-
467
- ### With Claude Agent Kit
468
-
469
- ```
470
- ✅ Agents auto-classify and execute tasks
471
- ✅ Each agent focuses on its specialty
472
- ✅ Built-in validation gates (integration agent)
473
- ✅ Consistent patterns via auto-discovery
474
- ✅ Automatic retry with escalation
475
- ✅ Component reuse plan (/pageplan)
476
- ✅ Real content from PRD
477
- ✅ 25% faster UI implementation
478
- ```
479
-
480
- ---
481
-
482
- ## 📚 Key Features
483
-
484
- ### ✅ Seamless OpenSpec Integration
485
-
486
- - Reads `proposal.md` for business context
487
- - Parses `tasks.md` for implementation checklist
488
- - Generates `page-plan.md` for UI tasks (NEW!)
489
- - Tracks progress in `flags.json`
490
- - Updates completion status back to OpenSpec
491
-
492
- ### ✅ Auto-Generated Best Practices
493
-
494
- Uses Context7 MCP to fetch latest framework docs:
495
-
496
- ```bash
497
- /psetup
498
- # → Detects: Next.js 15, React 18, Prisma 6
499
- # → Generates: .claude/contexts/domain/{project}/best-practices/
500
- # - nextjs-15.md
501
- # - react-18.md
502
- # - prisma-6.md
503
- ```
504
-
505
- ### ✅ 3-Level Project Indexing
506
-
507
- Agents auto-discover context:
508
-
509
- ```
510
- 1. Read: domain/index.md → Get current project
511
- 2. Read: domain/{project}/README.md → Get tech stack
512
- 3. Read: domain/{project}/best-practices/index.md → Load patterns
513
- ```
514
-
515
- ### ✅ Design Foundation
516
-
517
- Universal design principles:
518
- - Color theory (WCAG AAA contrast)
519
- - Typography scales
520
- - 8px spacing grid (8, 16, 24, 32, 40, 48px)
521
- - 4-level shadow system
522
- - Box thinking framework
523
- - Accessibility (WCAG 2.1 AA)
524
-
525
- ### ✅ Quality Gates
526
-
527
- - **TDD for critical paths** (auth, payments, data transforms)
528
- - **Test-alongside for simple code** (CRUD, UI components)
529
- - **Max 3-4 retry iterations** before escalation
530
- - **Integration validation** before connecting UI to API
531
- - **Smart auto-proceed** (eliminate redundant confirmations, 25% faster)
532
-
533
- ---
534
-
535
- ## 🔧 CLI Commands
536
-
537
- ### `cak init`
538
- Initialize agent system in current project
539
-
540
- ```bash
541
- cak init
542
- cak init --force # Overwrite existing .claude/
543
- ```
544
-
545
- **Creates:**
546
- - `.claude/` folder with 6 agents
547
- - Slash commands (`/psetup`, `/csetup`, `/cdev`, etc.)
548
- - Universal patterns & design foundation
549
-
550
- ---
551
-
552
- ### `cak update`
553
- Update to latest agent templates
554
-
555
- ```bash
556
- cak update
557
- cak update --backup # Create .claude.backup/ first
558
- ```
559
-
560
- **What it does:**
561
- - Updates all template files to latest version
562
- - Preserves your customizations in `domain/`
563
- - Creates backup before updating (with `--backup` flag)
564
-
565
- ---
566
-
567
- ### `cak --version`
568
- Show version number
569
-
570
- ```bash
571
- cak --version
572
- # → 1.0.0
573
- ```
574
-
575
- ---
576
-
577
- ### `cak --help`
578
- Display help information
579
-
580
- ```bash
581
- cak --help
582
- ```
583
-
584
- ---
585
-
586
- ## 🔄 Workflow Commands (in Claude Code)
587
-
588
- ### `/designsetup` - Generate style guide (one-time)
589
-
590
- ```bash
591
- /designsetup
592
- ```
593
-
594
- **Auto-detects from:**
595
- 1. `reference/` folder → Extract design from HTML/screenshots
596
- 2. Existing codebase → Reverse engineer patterns
597
- 3. AI generation → Modern best practices
598
-
599
- **Creates:** `design-system/STYLE_GUIDE.md`
600
-
601
- ---
602
-
603
- ### `/pageplan` - Generate page plan (UI tasks only) 🆕
604
-
605
- ```bash
606
- /pageplan @prd.md @project_brief.md
607
- ```
608
-
609
- **What it does:**
610
- - Reads user-specified files (PRD, brief)
611
- - Reads `proposal.md` + `STYLE_GUIDE.md`
612
- - Searches existing components
613
- - AI drafts real content from PRD
614
- - Generates asset checklist
615
-
616
- **Creates:** `page-plan.md`
617
- - Component reuse plan (🔄 Reuse vs ✅ New)
618
- - Page structure (component hierarchy)
619
- - Assets to prepare (images, icons)
620
- - Content draft (headlines, descriptions)
621
-
622
- ---
623
-
624
- ### `/psetup` - Setup project (one-time)
625
-
626
- ```bash
627
- /psetup
628
- ```
629
-
630
- **What it does:**
631
- - Detects tech stack (Next.js, React, Prisma, etc.)
632
- - Creates `domain/{project}/README.md`
633
- - Generates best practices via Context7 MCP
634
-
635
- ---
636
-
637
- ### `/csetup {change-id}` - Setup change context
638
-
639
- ```bash
640
- /csetup landing-page
641
- ```
642
-
643
- **What it does:**
644
- - Reads `proposal.md` (business context)
645
- - Reads `tasks.md` (implementation checklist)
646
- - Reads `page-plan.md` (if exists - UI content plan)
647
- - Classifies tasks by agent
648
- - Generates `workflow.md` (execution plan)
649
-
650
- ---
651
-
652
- ### `/cdev {change-id}` - Execute implementation
653
-
654
- ```bash
655
- /cdev landing-page
656
-
657
- # Or with explicit approval
658
- "ลุยเลย" # Continue without confirmation prompts
659
- ```
660
-
661
- **What it does:**
662
- - Runs agents in phases (1 → 2 → 2.5 → 3 → 4)
663
- - uxui-frontend auto-reads `page-plan.md` (STEP 0.5)
664
- - **Auto-proceed:** Detects user approval ("continue", "ลุยเลย") and eliminates redundant confirmation prompts
665
- - Updates `flags.json` (progress tracking)
666
- - Reports completion status
667
-
668
- **Auto-Proceed Feature:**
669
- - When you say "continue", "proceed", "yes", or "ลุยเลย", Main Claude auto-responds to agent questions
670
- - **50-90% fewer confirmations** (1x per workflow instead of 2x per phase)
671
- - **25% faster execution** (no waiting for redundant approvals)
672
-
673
- ---
674
-
675
- ### `/cview {change-id}` - View detailed progress
676
-
677
- ```bash
678
- /cview landing-page
679
- ```
680
-
681
- **Shows:**
682
- - Completed/pending tasks
683
- - Agent activity log
684
- - Current phase
685
- - Error messages (if any)
686
-
687
- ---
688
-
689
- ### `/cstatus {change-id}` - Quick status
690
-
691
- ```bash
692
- /cstatus landing-page
693
- # → Phase 2/4 - Backend Implementation (75%)
694
- ```
695
-
696
- ---
697
-
698
- ## 🎨 Design System Integration
699
-
700
- ### Auto-Generate Style Guide
701
-
702
- ```bash
703
- /designsetup
704
- ```
705
-
706
- **Detection priority:**
707
- 1. **reference/ folder** (HTML/screenshots) → Extract design style
708
- 2. **Existing codebase** (>10 components) → Reverse engineer patterns
709
- 3. **AI generation** → Modern best practices
710
-
711
- **Output:** `design-system/STYLE_GUIDE.md`
712
-
713
- **17 Comprehensive Sections:**
714
- 1. Overview
715
- 2. Design Philosophy
716
- 3. Color Palette (HEX codes, usage, Tailwind classes)
717
- 4. Typography (headings, body, weights)
718
- 5. Spacing System (4px/8px grid)
719
- 6. Component Styles (Button, Card, Input, Badge, etc.)
720
- 7. Shadows & Elevation
721
- 8. Animations & Transitions
722
- 9. Border Styles
723
- 10. Border Radius
724
- 11. Opacity & Transparency
725
- 12. Z-Index Layers
726
- 13. Responsive Breakpoints
727
- 14. CSS Variables / Tailwind Theme (Design Tokens)
728
- 15. Layout Patterns
729
- 16. Example Component Reference (React + Tailwind code)
730
- 17. Additional Sections (Best Practices, Accessibility, Icon System)
731
-
732
- **Agents automatically use `STYLE_GUIDE.md` for:**
733
- - Color palette (no hardcoded colors)
734
- - Spacing scale (consistent gaps/padding)
735
- - Typography (font hierarchy)
736
- - Component patterns (reuse before create)
737
-
738
- ---
739
-
740
- ## 🧪 Testing Philosophy
741
-
742
- **Agents follow TDD classification:**
743
-
744
- | Code Type | Approach | Example |
745
- |-----------|----------|---------|
746
- | **Critical paths** | TDD (Red-Green-Refactor) | Auth logic, payments, calculations |
747
- | **Simple code** | Test-alongside | CRUD, UI components, config |
748
-
749
- **Test-debug agent:**
750
- - Runs tests automatically after implementation
751
- - Fixes bugs (max 3-4 iterations)
752
- - Escalates if stuck (reports to user)
753
-
754
- ---
755
-
756
- ## 🔧 Supported Tech Stacks
757
-
758
- Agents auto-detect your stack via Context7 MCP:
759
-
760
- **Frontend:**
761
- - Next.js, React, Vue, Svelte, Angular
762
-
763
- **Backend:**
764
- - FastAPI, Express, NestJS, Django, Flask, Next.js API Routes
765
-
766
- **Database:**
767
- - Prisma, SQLAlchemy, TypeORM, Drizzle
768
-
769
- **Testing:**
770
- - Vitest, Jest, Pytest, Playwright
771
-
772
- ---
773
-
774
- ## 📖 Usage Examples
775
-
776
- ### Example 1: Simple UI Task (with /pageplan)
777
-
778
- ```bash
779
- # In Claude Code
780
- "Build a user profile page with edit functionality"
781
-
782
- # If it's a UI task, optionally run:
783
- /pageplan @prd.md
784
-
785
- # Then execute:
786
- /csetup profile-page
787
- /cdev profile-page
788
- ```
789
-
790
- Claude will:
791
- 1. Read `task-classification.md`
792
- 2. Select agents: `uxui-frontend` → `backend` → `frontend` → `test-debug`
793
- 3. uxui-frontend reads `page-plan.md` (if exists)
794
- 4. Execute in sequence
795
- 5. Report completion
796
-
797
- ---
798
-
799
- ### Example 2: Complex Multi-Agent Workflow (OpenSpec)
800
-
801
- Using OpenSpec workflow:
802
-
803
- ```bash
804
- # 1. OpenSpec generates proposal + tasks
805
- "I want to add a dashboard with analytics"
806
- # → proposal.md + tasks.md created
807
-
808
- # 2. Generate page plan
809
- /pageplan @prd.md @analytics_spec.md
810
-
811
- # 3. Setup change context
812
- /csetup analytics-dashboard
813
-
814
- # 4. Start development
815
- /cdev analytics-dashboard
816
-
817
- # 5. View progress
818
- /cview analytics-dashboard
819
- ```
820
-
821
- This follows a structured 4-phase approach:
822
- 1. **Phase 1:** UI with mock data (uxui-frontend reads page-plan.md)
823
- 2. **Phase 2:** Real API + database (backend + database)
824
- 3. **Phase 2.5:** Validate contracts (integration)
825
- 4. **Phase 3:** Connect UI to API (frontend)
826
- 5. **Phase 4:** Tests + bug fixes (test-debug)
827
-
828
- ---
829
-
830
- ## 🔄 Updating to Latest Version
831
-
832
- ### Method 1: Update the npm package
833
-
834
- ```bash
835
- npm update -g @champpaba/claude-agent-kit
836
- ```
837
-
838
- ### Method 2: Update template in project
839
-
840
- ```bash
841
- cd your-project
842
- cak update --backup
843
- ```
844
-
845
- This will:
846
- - Create backup at `.claude.backup/`
847
- - Update all template files
848
- - Preserve your customizations in `domain/`
849
-
850
- ---
851
-
852
- ## 🎯 Customization
853
-
854
- ### Add Project-Specific Context
855
-
856
- After running `cak init`, add your own context files:
857
-
858
- ```bash
859
- mkdir -p .claude/contexts/domain/my-project
860
- ```
861
-
862
- **Example:** E-commerce checkout flow
863
- ```markdown
864
- <!-- .claude/contexts/domain/my-project/checkout-flow.md -->
865
- # Checkout Flow
866
-
867
- ## Steps
868
- 1. Cart review
869
- 2. Shipping address
870
- 3. Payment method
871
- 4. Order confirmation
872
-
873
- ## Business Rules
874
- - Free shipping over $50
875
- - Tax calculation by state
876
- - Inventory check before payment
877
- ```
878
-
879
- Agents will auto-discover and use these patterns.
880
-
881
- ---
882
-
883
- ## 🔗 Ecosystem
884
-
885
- **Claude Agent Kit works with:**
886
-
887
- | Tool | Purpose | Integration |
888
- |------|---------|-------------|
889
- | **OpenSpec** | Spec-driven planning | Reads `proposal.md` + `tasks.md` |
890
- | **Context7 MCP** | Always-updated docs | Auto-generates best practices |
891
- | **Claude Code** | AI coding assistant | Execution environment |
892
-
893
- ---
894
-
895
- ## 🤝 Contributing
896
-
897
- We welcome contributions!
898
-
899
- - Report bugs: [GitHub Issues](https://github.com/ChampPABA/claude-multi-agent-template/issues)
900
- - Feature requests: [Discussions](https://github.com/ChampPABA/claude-multi-agent-template/discussions)
901
- - Pull requests: Follow [CONTRIBUTING.md](CONTRIBUTING.md)
902
-
903
- ---
904
-
905
- ## 📄 License
906
-
907
- MIT License - see [LICENSE](LICENSE)
908
-
909
- ---
910
-
911
- ## 🙏 Credits
912
-
913
- Built with:
914
- - [OpenSpec](https://github.com/Fission-AI/OpenSpec) - Spec-driven development framework
915
- - [Claude Code](https://claude.com/claude-code) - AI coding assistant
916
- - [Context7 MCP](https://context7.com) - Always up-to-date library docs
917
-
918
- ---
919
-
920
- ## 🆕 What's New in v1.4.1
921
-
922
- **Feature: Intelligent Auto-Proceed - Eliminate Double Confirmations** 🚀
923
-
924
- ### Smart Approval Detection
925
-
926
- **Problem Solved:**
927
- - Before: Agent asks "Proceed?" → Main Claude asks user again (redundant!)
928
- - User frustration: "I already said 'ลุยเลย', why ask twice?"
929
-
930
- **Solution Implemented:**
931
- - ✅ Main Claude detects user approval keywords ("continue", "proceed", "yes", "ลุยเลย")
932
- - ✅ Passes approval context to agents in prompt
933
- - ✅ Auto-responds to agent questions without re-prompting user
934
- - ✅ Backward compatible: Manual approval mode still available
935
-
936
- **Results:**
937
- - **50-90% fewer confirmations** (1x per workflow vs 2x per phase)
938
- - **25% faster execution** (no waiting for redundant approvals)
939
- - **Better UX** (approve once, system handles the rest)
940
- - **Lean implementation** (80 lines, 1 file, +0.1% context)
941
-
942
- ### How It Works
943
-
944
- ```bash
945
- # Before v1.4.1 (Double confirmation ❌)
946
- User: "ลุยเลย"
947
- Main: Calls uxui-frontend agent
948
- Agent: "Pre-work done. Proceed?"
949
- Main: "Agent is asking... Proceed? (yes/no)" ← Asks user again!
950
- User: "Why ask twice?"
951
-
952
- # After v1.4.1 (Smart auto-proceed ✅)
953
- User: "ลุยเลย"
954
- Main: Detects approval → auto_proceed = true
955
- Agent: "Pre-work done. Proceed?"
956
- Main: "YES, proceed immediately" ← Answers agent directly!
957
- Agent: Continues work...
958
- ```
959
-
960
- ### Auto-Proceed Trigger Words
961
-
962
- These keywords enable auto-proceed mode:
963
- - ✅ `/cdev` command (implicit approval for all phases)
964
- - ✅ "continue", "proceed", "yes"
965
- - ✅ "ลุยเลย" (Thai: "go ahead")
966
-
967
- ---
968
-
969
- ## 🎉 What's New in v1.4.0
970
-
971
- **Major Update: Context Optimization & DRY Consolidation**
972
-
973
- ### Token Efficiency Improvements
974
-
975
- **Problem Solved:**
976
- - Before v1.4.0: Same documentation duplicated across 6 agent files + CLAUDE.md
977
- - Package Manager warnings: 360 lines duplicated 6x
978
- - Context Loading Strategy: 1,200 lines duplicated 6x
979
- - TDD Workflow examples: 1,200 lines duplicated 3x
980
- - Handoff templates: 900 lines duplicated 6x
981
- - Documentation policies: 480 lines duplicated 6x
982
- - CLAUDE.md: 890 lines mixing navigation + detailed guides
983
-
984
- **Solution Implemented:**
985
- - ✅ Created consolidated lib files (context-loading-protocol.md, handoff-protocol.md, tdd-workflow.md)
986
- - ✅ Extracted detailed guides from CLAUDE.md to lib/detailed-guides/
987
- - ✅ Applied consistent reference pattern: Brief summary + "→ See: path" + agent-specific additions
988
- - ✅ Maintained 100% content quality (all information preserved)
989
-
990
- **Results:**
991
- - **All 6 agents:** 6,796 → 4,749 lines (-2,047, -30.1% reduction)
992
- - **CLAUDE.md:** 890 → 163 lines (-727, -81.7% reduction)
993
- - **Grand Total:** 7,686 → 4,912 lines (-2,774, -36.1% reduction)
994
- - **Token savings:** ~36% reduction in total context size
995
- - **Speed improvement:** Faster agent loading and execution
996
- - **Maintainability:** Single source of truth for shared documentation
997
-
998
- ### New Consolidated Documentation Structure
999
-
1000
- **Created in v1.4.0:**
1001
- ```
1002
- .claude/lib/
1003
- ├── context-loading-protocol.md # Universal context loading strategy
1004
- ├── handoff-protocol.md # Agent handoff templates
1005
- ├── tdd-workflow.md # TDD workflow examples
1006
- └── detailed-guides/
1007
- ├── best-practices-system.md # How best practices work
1008
- ├── context-optimization.md # Token optimization strategy
1009
- ├── page-planning.md # /pageplan command guide
1010
- ├── taskmaster-analysis.md # 6-dimension task analysis
1011
- ├── design-system.md # Style guide generation
1012
- └── agent-system.md # Agent overview & workflow
1013
- ```
1014
-
1015
- ### Benefits for Users
1016
-
1017
- **For Developers:**
1018
- - ⚡ 36% faster context loading
1019
- - 📖 Cleaner, easier-to-navigate documentation
1020
- - 🎯 CLAUDE.md is now a pure navigation hub (163 lines)
1021
- - 🔍 Detailed guides are modular and focused
1022
-
1023
- **For Claude Agents:**
1024
- - 🚀 Faster startup (less context to load)
1025
- - 💾 More token budget for actual work
1026
- - 📚 Single source of truth (no conflicting info)
1027
- - 🔄 Easier maintenance (update once, apply everywhere)
1028
-
1029
- ### Migration Notes
1030
-
1031
- **No breaking changes!** All existing workflows continue to work:
1032
- - ✅ `/psetup`, `/csetup`, `/cdev` commands unchanged
1033
- - ✅ Agent behavior unchanged (same quality, faster execution)
1034
- - ✅ All features from v1.1-1.3 preserved
1035
- - ✅ Existing projects can update with `cak update`
1036
-
1037
- **New Reference Pattern:**
1038
- Agents now use lightweight references instead of duplicating full documentation:
1039
-
1040
- ```markdown
1041
- ## Context Loading Strategy
1042
-
1043
- **→ See:** `.claude/lib/context-loading-protocol.md` for complete protocol
1044
-
1045
- **Agent-Specific Additions (frontend):**
1046
- ### State Management Libraries
1047
- ...
1048
- ```
1049
-
1050
- ### Upgrading to v1.4.1
1051
-
1052
- ```bash
1053
- # Update npm package
1054
- npm update -g @champpaba/claude-agent-kit
1055
-
1056
- # Update template in your project (creates backup)
1057
- cd your-project
1058
- cak update --backup
1059
- ```
1060
-
1061
- **What's New:**
1062
- - ✅ Auto-proceed feature (eliminate double confirmations)
1063
- - ✅ 50-90% fewer approval prompts
1064
- - ✅ 25% faster workflow execution
1065
- - ✅ All v1.4.0 features (context optimization, DRY consolidation)
1066
-
1067
- All your customizations in `.claude/contexts/domain/` are preserved!
1068
-
1069
- ---
1070
-
1071
- ## 📜 Changelog
1072
-
1073
- ### v1.4.1 (2025-11-06)
1074
- **Feature: Intelligent Auto-Proceed - Eliminate Double Confirmations**
1075
-
1076
- **Added:**
1077
- - Auto-proceed approval context in agent prompts
1078
- - Smart detection of user approval keywords ("continue", "proceed", "yes", "ลุยเลย")
1079
- - Agent question handling logic (auto-respond vs ask user)
1080
- - Auto-proceed decision tree in agent-executor.md
1081
-
1082
- **Improved:**
1083
- - User experience: 50-90% fewer confirmation prompts
1084
- - Execution speed: 25% faster (no waiting for redundant approvals)
1085
- - Workflow clarity: User approves once, system handles agent interactions
1086
-
1087
- **Technical Details:**
1088
- - Modified: `.claude/lib/agent-executor.md` (+80 lines)
1089
- - Implementation: Lean solution (1 file, 0.1% context increase)
1090
- - Backward compatible: Manual approval mode still available
1091
-
1092
- **When It Activates:**
1093
- - User runs `/cdev` command (implicit approval)
1094
- - User says "continue", "proceed", "yes", "ลุยเลย" (explicit approval)
1095
-
1096
- **Before:**
1097
- ```
1098
- User approves → Agent asks → Main asks user again ❌
1099
- ```
1100
-
1101
- **After:**
1102
- ```
1103
- User approves → Agent asks → Main answers directly ✅
1104
- ```
1105
-
1106
- ### v1.4.0 (2025-11-05)
1107
- **Major: Context Optimization & DRY Consolidation**
1108
-
1109
- **Added:**
1110
- - New consolidated lib files: `context-loading-protocol.md`, `handoff-protocol.md`, `tdd-workflow.md`
1111
- - New detailed guides folder: `lib/detailed-guides/` (6 focused guides)
1112
- - Reference pattern across all agents (Brief summary → See: path → Additions)
1113
-
1114
- **Changed:**
1115
- - All 6 agents refactored: 30.1% size reduction (6,796 → 4,749 lines)
1116
- - CLAUDE.md refactored: 81.7% size reduction (890 → 163 lines, pure navigation hub)
1117
- - Documentation structure: Moved detailed content to modular lib files
1118
-
1119
- **Performance:**
1120
- - 36% total context reduction (7,686 → 4,912 lines)
1121
- - Faster agent loading and execution
1122
- - More token budget available for actual work
1123
-
1124
- **Improved:**
1125
- - Maintainability: Single source of truth for shared docs
1126
- - Discoverability: Clear navigation in CLAUDE.md
1127
- - Modularity: Detailed guides in separate files
1128
- - Consistency: Same content quality, zero duplication
1129
-
1130
- ### v1.3.0 (2025-10-30)
1131
- **Feature: TaskMaster-style Intelligent Task Analysis**
1132
-
1133
- **Added:**
1134
- - 6-dimension task analysis in `/csetup`:
1135
- - Complexity scoring (1-10)
1136
- - Dependency detection (auto-detects blocks/blocked-by)
1137
- - Risk assessment (LOW/MEDIUM/HIGH with mitigation)
1138
- - Research requirements (auto-generates queries)
1139
- - Subtask breakdown (complex tasks → smaller steps)
1140
- - Priority ranking (CRITICAL → LOW, scored 0-100)
1141
- - Task analyzer implementation: `.claude/lib/task-analyzer.md`
1142
- - Enhanced phases.md with metadata, time buffers, research phases
1143
-
1144
- **Improved:**
1145
- - Time estimates with automatic buffers (+41% average)
1146
- - Research phases auto-added for new tech/libraries
1147
- - Dependency order in workflow execution
1148
- - Risk mitigation strategies per task
1149
-
1150
- **Inspired by:** [claude-task-master](https://github.com/eyaltoledano/claude-task-master)
1151
-
1152
- ### v1.2.0 (2025-10-27)
1153
- **Feature: Context Optimization - 70% Token Reduction**
1154
-
1155
- **Added:**
1156
- - 3-tier loading strategy: STYLE_TOKENS.json (500) → design-context.md (1K) → STYLE_GUIDE.md (5K)
1157
- - Document loader protocol: `.claude/lib/document-loader.md`
1158
- - Lightweight design tokens: `design-system/STYLE_TOKENS.json`
1159
-
1160
- **Improved:**
1161
- - Token usage: ~20K → ~4.7K (70% reduction for design system)
1162
- - Speed: 3-4x faster command execution
1163
- - Consistency: Enforced design tokens, no random colors
1164
-
1165
- ### v1.1.1 (2025-10-25)
1166
- **Patch: Minor Fixes**
1167
-
1168
- **Fixed:**
1169
- - Template path correction: `template/.claude` → `.claude`
1170
- - Documentation typos and formatting
1171
-
1172
- ### v1.1.0 (2025-10-24)
1173
- **Feature: Enhanced Implementation Logic**
1174
-
1175
- **Added:**
1176
- - Implementation logic overview: `lib/README.md`
1177
- - Agent executor with retry & escalation: `lib/agent-executor.md`
1178
- - TDD classifier logic: `lib/tdd-classifier.md`
1179
- - Progress tracking protocol: `lib/flags-updater.md`
1180
- - Mandatory agent routing: `lib/agent-router.md`
1181
- - Shared agent discovery flow: `contexts/patterns/agent-discovery.md`
1182
-
1183
- ### v1.0.0 (2025-10-20)
1184
- **Initial Release: Multi-Agent Template**
1185
-
1186
- **Core Features:**
1187
- - 6 specialized agents (integration, uxui-frontend, test-debug, frontend, backend, database)
1188
- - OpenSpec integration (`/csetup`, `/cdev`, `/cview`, `/cstatus`)
1189
- - Auto-generated best practices via Context7 MCP
1190
- - 3-level project indexing (domain → project → best-practices)
1191
- - Design foundation (color theory, spacing, typography)
1192
- - `/designsetup` command (auto-generate style guide)
1193
- - `/pageplan` command (UI content & component planning)
1194
- - Universal patterns (logging, testing, error-handling, TDD)
1195
- - CLI: `cak init`, `cak update`
1196
-
1197
- ---
1198
-
1199
- ## 🔗 Links
1200
-
1201
- - **npm Package:** https://www.npmjs.com/package/@champpaba/claude-agent-kit
1202
- - **GitHub:** https://github.com/ChampPABA/claude-multi-agent-template
1203
- - **OpenSpec:** https://github.com/Fission-AI/OpenSpec
1204
- - **Issues:** https://github.com/ChampPABA/claude-multi-agent-template/issues
1205
-
1206
- ---
1207
-
1208
- ## 💡 Quick Tips
1209
-
1210
- 1. **Run `/designsetup` FIRST** - Ensures visual consistency from day 1
1211
- 2. **Use `/pageplan` for UI tasks** - 25% faster implementation, better content
1212
- 3. **Review `page-plan.md` before `/cdev`** - Edit content, prepare assets
1213
- 4. **Setup Context7 MCP** - Agents get latest framework docs automatically
1214
- 5. **Use OpenSpec for complex features** - Better alignment before implementation
1215
- 6. **Monitor with `/cview`** - See exactly what agents are doing
1216
- 7. **Always use `--backup` when updating** - Protects your customizations
1217
-
1218
- ---
1219
-
1220
- ## 📋 Complete Flow Summary
1221
-
1222
- ```
1223
- 1️⃣ OpenSpec Planning
1224
- → proposal.md + tasks.md
1225
-
1226
- 2️⃣ Generate Style Guide (one-time)
1227
- /designsetup
1228
- → STYLE_GUIDE.md
1229
-
1230
- 3️⃣ Setup Project (one-time)
1231
- /psetup
1232
- → domain/{project}/best-practices/
1233
-
1234
- 4️⃣ Generate Page Plan (UI tasks only)
1235
- /pageplan @prd.md
1236
- → page-plan.md (content + component plan)
1237
-
1238
- 5️⃣ Setup Change Context
1239
- /csetup {change-id}
1240
- → workflow.md
1241
-
1242
- 6️⃣ Execute Implementation
1243
- /cdev {change-id}
1244
- → Working code + tests
1245
-
1246
- 7️⃣ Monitor Progress
1247
- /cview {change-id}
1248
- → Detailed progress report
1249
-
1250
- 8️⃣ OpenSpec Archive & Update
1251
- → Merge to specs/
1252
- ```
1253
-
1254
- ---
1255
-
1256
- **Ready to implement with confidence?** 🚀
1257
-
1258
- ```bash
1259
- # Install globally
1260
- npm install -g @champpaba/claude-agent-kit
1261
-
1262
- # Initialize in your project
1263
- cd your-project
1264
- cak init
1265
-
1266
- # Setup project context
1267
- /psetup
1268
-
1269
- # Generate style guide (optional but recommended)
1270
- /designsetup
1271
-
1272
- # Start building (after OpenSpec planning)
1273
- /pageplan @prd.md # UI tasks only
1274
- /csetup your-feature
1275
- /cdev your-feature
1276
- ```
1277
-
1278
- Let specialized agents handle implementation while you focus on specs and architecture!
1
+ # Claude Agent Kit
2
+
3
+ > 🤖 **Multi-Agent Implementation Engine** - The perfect companion for [OpenSpec](https://github.com/Fission-AI/OpenSpec) spec-driven development
4
+
5
+ [![npm version](https://badge.fury.io/js/@champpaba%2Fclaude-agent-kit.svg)](https://www.npmjs.com/package/@champpaba/claude-agent-kit)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+ [![Node.js Version](https://img.shields.io/node/v/@champpaba/claude-agent-kit)](https://nodejs.org)
8
+
9
+ ---
10
+
11
+ ## 🎯 What is this?
12
+
13
+ **Claude Agent Kit picks up where OpenSpec planning ends.**
14
+
15
+ While OpenSpec handles **alignment** (Draft Proposal → Review & Align), Claude Agent Kit handles **implementation** (Implement Tasks → Archive & Update) with specialized AI agents.
16
+
17
+ ### The Complete Workflow
18
+
19
+ ```
20
+ ┌─────────────────────────────────────────────────────────────┐
21
+ │ OpenSpec Planning │
22
+ │ (Spec-Driven Development for AI Coding Assistants) │
23
+ └─────────────────────────────────────────────────────────────┘
24
+
25
+ Generates: proposal.md + tasks.md
26
+
27
+ ┌─────────────────────────────────────────────────────────────┐
28
+ │ Claude Agent Kit Implementation │
29
+ │ (Multi-Agent Execution with 6 Specialists) │
30
+ └─────────────────────────────────────────────────────────────┘
31
+
32
+ Completes: All tasks with quality gates
33
+ ```
34
+
35
+ ---
36
+
37
+ ## 🔄 How They Work Together
38
+
39
+ | Stage | Tool | What Happens | Output |
40
+ |-------|------|--------------|--------|
41
+ | **1. Draft Proposal** | OpenSpec | Human requests change, AI scaffolds structure | `proposal.md` + `tasks.md` |
42
+ | **2. Review & Align** | OpenSpec | Team iterates until consensus | Approved specs |
43
+ | **2.5. Page Planning** | **Claude Agent Kit** | *(UI tasks only)* Generate content & component plan | `page-plan.md` |
44
+ | **3. Setup Context** | **Claude Agent Kit** | Classify tasks, generate workflow | `workflow.md` |
45
+ | **4. Implement Tasks** | **Claude Agent Kit** | 6 specialized agents execute work | Working code + tests |
46
+ | **5. Archive & Update** | OpenSpec | Merge changes back to specs | Updated `specs/` |
47
+
48
+ ### What OpenSpec Generates
49
+
50
+ **proposal.md** - Business case and scope
51
+ ```markdown
52
+ # Change Proposal: User Authentication System
53
+
54
+ ## Motivation
55
+ Users need secure login functionality...
56
+
57
+ ## Scope
58
+ - Email/password authentication
59
+ - JWT token generation
60
+ - Protected routes middleware
61
+ ```
62
+
63
+ **tasks.md** - Implementation checklist
64
+ ```markdown
65
+ ## Database Setup
66
+ - [ ] Create User model with email, password fields
67
+ - [ ] Add unique constraint on email
68
+
69
+ ## Backend Implementation
70
+ - [ ] POST /api/auth/login endpoint
71
+ - [ ] Password hashing with bcrypt
72
+ - [ ] JWT token generation
73
+
74
+ ## Frontend Implementation
75
+ - [ ] Login form component
76
+ - [ ] Form validation
77
+ - [ ] Token storage
78
+ ```
79
+
80
+ ### What Claude Agent Kit Does
81
+
82
+ **Input:** Reads `proposal.md` + `tasks.md` from OpenSpec
83
+
84
+ **Process:**
85
+ 1. `/pageplan` *(UI tasks only)* - Generate content & component reuse plan
86
+ 2. `/csetup {change-id}` - Analyze tasks, classify by agent, generate workflow
87
+ 3. `/cdev {change-id}` - Execute with 6 specialized agents in phases:
88
+ - **Phase 1:** UI with mock data (uxui-frontend)
89
+ - **Phase 2:** Real API + database (backend + database, parallel)
90
+ - **Phase 2.5:** Validate contracts (integration)
91
+ - **Phase 3:** Connect UI to API (frontend)
92
+ - **Phase 4:** Tests + bug fixes (test-debug)
93
+
94
+ **Output:** Working implementation ready for review
95
+
96
+ ---
97
+
98
+ ## 🎨 NEW: Page Planning for UI Tasks
99
+
100
+ **Problem:** Before `/pageplan`, agents would:
101
+ - ❌ Create duplicate components (3 different Navbar components!)
102
+ - ❌ Use inconsistent colors (`#0d7276` on landing, `#4f46e5` on dashboard)
103
+ - ❌ Generate lorem ipsum instead of real content
104
+ - ❌ Waste time searching for components during implementation
105
+
106
+ **Solution:** `/pageplan` command analyzes BEFORE implementing
107
+
108
+ ### How It Works
109
+
110
+ ```bash
111
+ # Step 1: OpenSpec generates tasks
112
+ User: "Build landing page for TOEIC app"
113
+ → Creates: .changes/landing-page/proposal.md + tasks.md
114
+
115
+ # Step 2: Generate page plan (NEW!)
116
+ User: /pageplan @prd.md @project_brief.md
117
+
118
+ # What it does:
119
+ # 1. Reads user-specified files (PRD, brief)
120
+ # 2. Reads proposal.md (technical architecture)
121
+ # 3. Reads STYLE_GUIDE.md (visual design)
122
+ # 4. Searches existing components (Navbar, Footer, etc.)
123
+ # 5. AI drafts real content from PRD
124
+ # 6. Generates: .changes/landing-page/page-plan.md
125
+ ```
126
+
127
+ ### page-plan.md Output
128
+
129
+ ```markdown
130
+ # Page Plan: Landing Page
131
+
132
+ ## 1. Component Plan
133
+ 🔄 Reuse: Navbar, Footer (found in codebase)
134
+ ✅ New Shared: (none)
135
+ ✅ New Specific: HeroSection, FeatureGrid, TestimonialCarousel
136
+
137
+ ## 2. Page Structure
138
+ <Layout>
139
+ <Navbar /> {/* Reuse */}
140
+ <HeroSection /> {/* New - see content below */}
141
+ <FeatureGrid />
142
+ <TestimonialCarousel />
143
+ <Footer /> {/* Reuse */}
144
+ </Layout>
145
+
146
+ ## 3. Assets to Prepare
147
+ - [ ] hero-image.jpg (1920x1080)
148
+ - [ ] logo.svg (200x60)
149
+ - [ ] feature-icons (3x 24x24 SVG)
150
+
151
+ ## 4. Content Draft (AI-Generated - Please Review & Edit)
152
+ **Headline:** "Master TOEIC with AI-Powered Tests"
153
+ **Subheadline:** "Experience exam-quality questions with instant AI scoring"
154
+ **CTA:** "Start Free Test"
155
+
156
+ **Features:**
157
+ - Real TOEIC-style questions
158
+ - Instant AI scoring
159
+ - Progress tracking dashboard
160
+ ```
161
+
162
+ ### Step 3: User Prepares
163
+
164
+ - ✅ Review content draft (edit as needed)
165
+ - ✅ Prepare assets (images, icons)
166
+ - ✅ Approve `page-plan.md`
167
+
168
+ ### Step 4: Implementation
169
+
170
+ ```bash
171
+ /csetup landing-page
172
+ /cdev landing-page
173
+
174
+ # uxui-frontend agent automatically:
175
+ # - STEP 0.5: Reads page-plan.md ✅
176
+ # - STEP 3: SKIP component search (already done!) ⚡ 25% faster
177
+ # - Uses: Real content from page-plan
178
+ # - Reuses: Navbar, Footer (no duplicates)
179
+ # - Creates: HeroSection, FeatureGrid, TestimonialCarousel
180
+ # - Applies: Colors/spacing from STYLE_GUIDE.md
181
+ ```
182
+
183
+ ### Benefits
184
+
185
+ | Before (No page-plan) | After (With page-plan) |
186
+ |----------------------|------------------------|
187
+ | ❌ Agent searches during implementation | ✅ Search done once upfront (25% faster) |
188
+ | ❌ Duplicate components created | ✅ Clear reuse plan |
189
+ | ❌ Lorem ipsum content | ✅ Real content from PRD |
190
+ | ❌ Missing assets mid-work | ✅ Asset checklist prepared |
191
+ | ❌ Inconsistent design | ✅ Synced with STYLE_GUIDE |
192
+ | ❌ Agent guesses structure | ✅ Clear component hierarchy |
193
+
194
+ ### When to Use /pageplan
195
+
196
+ ```
197
+ ✅ Use for:
198
+ - Landing pages
199
+ - Dashboards
200
+ - Multi-section UI pages
201
+ - Any task with multiple components
202
+
203
+ ❌ Skip for:
204
+ - Backend API endpoints
205
+ - Database schemas
206
+ - Single-component tasks
207
+ - Non-UI work
208
+ ```
209
+
210
+ ---
211
+
212
+ ## 🤖 The 6 Specialized Agents
213
+
214
+ | Agent | Color | Responsibility | Phase |
215
+ |-------|-------|---------------|-------|
216
+ | **uxui-frontend** | 🔵 Blue | Design UI components with mock data | 1 |
217
+ | **backend** | 🟣 Purple | Create API endpoints with validation | 2 |
218
+ | **database** | 🩷 Pink | Design schemas, migrations, queries | 2 |
219
+ | **integration** | 🟠 Orange | Validate API contracts before connecting | 2.5 |
220
+ | **frontend** | 🟢 Green | Connect UI to backend APIs | 3 |
221
+ | **test-debug** | 🔴 Red | Run tests and fix bugs (max 3-4 iterations) | 1,3,4 |
222
+
223
+ Each agent:
224
+ - ✅ Auto-discovers your project context (tech stack, best practices)
225
+ - ✅ Follows framework-specific patterns from Context7 MCP
226
+ - ✅ Maintains design consistency across the codebase
227
+ - ✅ Reports progress with detailed logging
228
+ - ✅ **Smart auto-proceed:** Eliminates double confirmations when user approves workflow
229
+
230
+ ---
231
+
232
+ ## 📦 Installation
233
+
234
+ ```bash
235
+ npm install -g @champpaba/claude-agent-kit
236
+ ```
237
+
238
+ ### Alternative Package Managers
239
+
240
+ ```bash
241
+ # Using pnpm
242
+ pnpm add -g @champpaba/claude-agent-kit
243
+
244
+ # Using yarn
245
+ yarn global add @champpaba/claude-agent-kit
246
+ ```
247
+
248
+ ---
249
+
250
+ ## 🚀 Quick Start (with OpenSpec)
251
+
252
+ ### Step 1: OpenSpec Planning
253
+
254
+ ```bash
255
+ # In your OpenSpec-enabled project
256
+ cd my-app
257
+
258
+ # Draft a change proposal (OpenSpec handles this)
259
+ "I want to build a landing page for my TOEIC app"
260
+ # → Generates: .changes/landing-page/proposal.md + tasks.md
261
+ ```
262
+
263
+ ### Step 2: Initialize Claude Agent Kit
264
+
265
+ ```bash
266
+ # Initialize the agent system
267
+ cak init
268
+
269
+ # Setup project context (detects tech stack)
270
+ # In Claude Code:
271
+ /psetup
272
+ ```
273
+
274
+ ### Step 3: Generate Page Plan (UI tasks only)
275
+
276
+ ```bash
277
+ # In Claude Code:
278
+ /pageplan @prd.md @project_brief.md
279
+
280
+ # → Generates: .changes/landing-page/page-plan.md
281
+ # → Review content, prepare assets
282
+ ```
283
+
284
+ ### Step 4: Setup Change Context
285
+
286
+ ```bash
287
+ /csetup landing-page
288
+ ```
289
+
290
+ **What happens:**
291
+ - Reads `.changes/landing-page/proposal.md` (business context)
292
+ - Reads `.changes/landing-page/tasks.md` (implementation checklist)
293
+ - Reads `.changes/landing-page/page-plan.md` (if exists - content plan)
294
+ - Classifies tasks by agent (database, backend, frontend, etc.)
295
+ - Generates `workflow.md` (execution plan)
296
+
297
+ ### Step 5: Execute Implementation
298
+
299
+ ```bash
300
+ /cdev landing-page
301
+ ```
302
+
303
+ **What happens:**
304
+ 1. **Phase 1:** uxui-frontend reads `page-plan.md` → creates UI with real content
305
+ 2. **Phase 2:** backend + database create APIs + models (parallel, if needed)
306
+ 3. **Phase 2.5:** integration validates API contracts
307
+ 4. **Phase 3:** frontend connects UI to APIs (if needed)
308
+ 5. **Phase 4:** test-debug runs tests, fixes bugs
309
+
310
+ ### Step 6: Monitor Progress
311
+
312
+ ```bash
313
+ # View detailed progress
314
+ /cview landing-page
315
+
316
+ # Quick status check
317
+ /cstatus landing-page
318
+ # → Phase 1/4 - UI Implementation (100%)
319
+ ```
320
+
321
+ ---
322
+
323
+ ## 🎯 Complete Workflow Examples
324
+
325
+ ### Workflow A: UI Feature (with /pageplan)
326
+
327
+ ```bash
328
+ # 1. OpenSpec Planning
329
+ User: "Build landing page for TOEIC app"
330
+ → Creates: proposal.md + tasks.md
331
+
332
+ # 2. Page Planning (NEW!)
333
+ /pageplan @prd.md @project_brief.md
334
+ → Creates: page-plan.md
335
+ → User reviews content & prepares assets
336
+
337
+ # 3. Setup Context
338
+ /csetup landing-page
339
+ → Reads: proposal.md, tasks.md, page-plan.md
340
+ → Generates: workflow.md
341
+
342
+ # 4. Implementation
343
+ /cdev landing-page
344
+ → uxui-frontend reads page-plan.md (STEP 0.5)
345
+ → Skips redundant component search
346
+ → Uses real content + reuse plan
347
+ → 25% faster implementation
348
+
349
+ # 5. Monitor
350
+ /cview landing-page
351
+ ```
352
+
353
+ ### Workflow B: Backend Feature (skip /pageplan)
354
+
355
+ ```bash
356
+ # 1. OpenSpec Planning
357
+ User: "Add payment processing API"
358
+ → Creates: proposal.md + tasks.md
359
+
360
+ # 2. Setup Context (skip /pageplan - not UI work)
361
+ /csetup payment-api
362
+
363
+ # 3. Implementation
364
+ /cdev payment-api
365
+ → Phase 2: backend + database agents (parallel)
366
+ → Phase 2.5: integration validates contracts
367
+ → Phase 3: frontend connects (if UI exists)
368
+ → Phase 4: test-debug validates
369
+
370
+ # 4. Monitor
371
+ /cview payment-api
372
+ ```
373
+
374
+ ### Workflow C: Full-Stack Feature (with /pageplan)
375
+
376
+ ```bash
377
+ # 1. OpenSpec Planning
378
+ User: "Build user authentication system"
379
+ → Creates: proposal.md + tasks.md
380
+
381
+ # 2. Page Planning (for login UI only)
382
+ /pageplan @prd.md
383
+ → Creates: page-plan.md (login form content + components)
384
+
385
+ # 3. Setup Context
386
+ /csetup auth-system
387
+
388
+ # 4. Implementation
389
+ /cdev auth-system
390
+ → Phase 1: uxui-frontend (login form, reads page-plan.md)
391
+ → Phase 2: backend (POST /api/auth/login) + database (User model)
392
+ → Phase 2.5: integration (validate contract)
393
+ → Phase 3: frontend (connect form to API)
394
+ → Phase 4: test-debug (E2E tests)
395
+
396
+ # 5. Monitor
397
+ /cview auth-system
398
+ ```
399
+
400
+ ---
401
+
402
+ ## 📁 Project Structure After Init
403
+
404
+ ```
405
+ your-project/
406
+ ├── openspec/
407
+ │ ├── specs/ # Source of truth (OpenSpec)
408
+ │ └── changes/
409
+ │ └── landing-page/
410
+ │ ├── proposal.md ← OpenSpec generates
411
+ │ ├── tasks.md ← OpenSpec generates
412
+ │ ├── page-plan.md ← /pageplan generates (UI tasks)
413
+ │ ├── workflow.md ← /csetup generates
414
+ │ └── flags.json ← /cdev tracks progress
415
+
416
+ ├── design-system/
417
+ │ └── STYLE_GUIDE.md ← /designsetup generates
418
+
419
+ └── .claude/
420
+ ├── CLAUDE.md # Navigation guide
421
+
422
+ ├── agents/ # 6 specialized agents
423
+ │ ├── 01-integration.md
424
+ │ ├── 02-uxui-frontend.md
425
+ │ ├── 03-test-debug.md
426
+ │ ├── 04-frontend.md
427
+ │ ├── 05-backend.md
428
+ │ └── 06-database.md
429
+
430
+ ├── commands/ # Slash commands
431
+ │ ├── designsetup.md # Generate style guide
432
+ │ ├── pageplan.md # Generate page plan (NEW!)
433
+ │ ├── psetup.md # Project setup
434
+ │ ├── csetup.md # Change setup
435
+ │ ├── cdev.md # Change development
436
+ │ ├── cview.md # View progress
437
+ │ └── cstatus.md # Quick status
438
+
439
+ ├── contexts/
440
+ │ ├── design/ # Design foundation
441
+ │ ├── patterns/ # Universal patterns
442
+ │ └── domain/ # Project context
443
+
444
+ └── lib/ # Implementation logic
445
+ ├── agent-executor.md
446
+ ├── tdd-classifier.md
447
+ ├── flags-updater.md
448
+ └── agent-router.md
449
+ ```
450
+
451
+ ---
452
+
453
+ ## 🎯 Why Use Claude Agent Kit?
454
+
455
+ ### Without Claude Agent Kit (Manual Implementation)
456
+
457
+ ```
458
+ ❌ You manually interpret tasks.md
459
+ ❌ You context-switch between frontend/backend/database
460
+ ❌ You might forget edge cases or tests
461
+ ❌ Inconsistent code patterns across features
462
+ ❌ No systematic error handling
463
+ ❌ Duplicate components everywhere
464
+ ❌ Lorem ipsum content in UI
465
+ ```
466
+
467
+ ### With Claude Agent Kit
468
+
469
+ ```
470
+ ✅ Agents auto-classify and execute tasks
471
+ ✅ Each agent focuses on its specialty
472
+ ✅ Built-in validation gates (integration agent)
473
+ ✅ Consistent patterns via auto-discovery
474
+ ✅ Automatic retry with escalation
475
+ ✅ Component reuse plan (/pageplan)
476
+ ✅ Real content from PRD
477
+ ✅ 25% faster UI implementation
478
+ ```
479
+
480
+ ---
481
+
482
+ ## 📚 Key Features
483
+
484
+ ### ✅ Seamless OpenSpec Integration
485
+
486
+ - Reads `proposal.md` for business context
487
+ - Parses `tasks.md` for implementation checklist
488
+ - Generates `page-plan.md` for UI tasks (NEW!)
489
+ - Tracks progress in `flags.json`
490
+ - Updates completion status back to OpenSpec
491
+
492
+ ### ✅ Auto-Generated Best Practices
493
+
494
+ Uses Context7 MCP to fetch latest framework docs:
495
+
496
+ ```bash
497
+ /psetup
498
+ # → Detects: Next.js 15, React 18, Prisma 6
499
+ # → Generates: .claude/contexts/domain/{project}/best-practices/
500
+ # - nextjs-15.md
501
+ # - react-18.md
502
+ # - prisma-6.md
503
+ ```
504
+
505
+ ### ✅ 3-Level Project Indexing
506
+
507
+ Agents auto-discover context:
508
+
509
+ ```
510
+ 1. Read: domain/index.md → Get current project
511
+ 2. Read: domain/{project}/README.md → Get tech stack
512
+ 3. Read: domain/{project}/best-practices/index.md → Load patterns
513
+ ```
514
+
515
+ ### ✅ Design Foundation
516
+
517
+ Universal design principles:
518
+ - Color theory (WCAG AAA contrast)
519
+ - Typography scales
520
+ - 8px spacing grid (8, 16, 24, 32, 40, 48px)
521
+ - 4-level shadow system
522
+ - Box thinking framework
523
+ - Accessibility (WCAG 2.1 AA)
524
+
525
+ ### ✅ Quality Gates
526
+
527
+ - **TDD for critical paths** (auth, payments, data transforms)
528
+ - **Test-alongside for simple code** (CRUD, UI components)
529
+ - **Max 3-4 retry iterations** before escalation
530
+ - **Integration validation** before connecting UI to API
531
+ - **Smart auto-proceed** (eliminate redundant confirmations, 25% faster)
532
+
533
+ ---
534
+
535
+ ## 🔧 CLI Commands
536
+
537
+ ### `cak init`
538
+ Initialize agent system in current project
539
+
540
+ ```bash
541
+ cak init
542
+ cak init --force # Overwrite existing .claude/
543
+ ```
544
+
545
+ **Creates:**
546
+ - `.claude/` folder with 6 agents
547
+ - Slash commands (`/psetup`, `/csetup`, `/cdev`, etc.)
548
+ - Universal patterns & design foundation
549
+
550
+ ---
551
+
552
+ ### `cak update`
553
+ Update to latest agent templates
554
+
555
+ ```bash
556
+ cak update
557
+ cak update --backup # Create .claude.backup/ first
558
+ ```
559
+
560
+ **What it does:**
561
+ - Updates all template files to latest version
562
+ - Preserves your customizations in `domain/`
563
+ - Creates backup before updating (with `--backup` flag)
564
+
565
+ ---
566
+
567
+ ### `cak --version`
568
+ Show version number
569
+
570
+ ```bash
571
+ cak --version
572
+ # → 1.0.0
573
+ ```
574
+
575
+ ---
576
+
577
+ ### `cak --help`
578
+ Display help information
579
+
580
+ ```bash
581
+ cak --help
582
+ ```
583
+
584
+ ---
585
+
586
+ ## 🔄 Workflow Commands (in Claude Code)
587
+
588
+ ### `/designsetup` - Generate style guide (one-time)
589
+
590
+ ```bash
591
+ /designsetup
592
+ ```
593
+
594
+ **Auto-detects from:**
595
+ 1. `reference/` folder → Extract design from HTML/screenshots
596
+ 2. Existing codebase → Reverse engineer patterns
597
+ 3. AI generation → Modern best practices
598
+
599
+ **Creates:** `design-system/STYLE_GUIDE.md`
600
+
601
+ ---
602
+
603
+ ### `/pageplan` - Generate page plan (UI tasks only) 🆕
604
+
605
+ ```bash
606
+ /pageplan @prd.md @project_brief.md
607
+ ```
608
+
609
+ **What it does:**
610
+ - Reads user-specified files (PRD, brief)
611
+ - Reads `proposal.md` + `STYLE_GUIDE.md`
612
+ - Searches existing components
613
+ - AI drafts real content from PRD
614
+ - Generates asset checklist
615
+
616
+ **Creates:** `page-plan.md`
617
+ - Component reuse plan (🔄 Reuse vs ✅ New)
618
+ - Page structure (component hierarchy)
619
+ - Assets to prepare (images, icons)
620
+ - Content draft (headlines, descriptions)
621
+
622
+ ---
623
+
624
+ ### `/psetup` - Setup project (one-time)
625
+
626
+ ```bash
627
+ /psetup
628
+ ```
629
+
630
+ **What it does:**
631
+ - Detects tech stack (Next.js, React, Prisma, etc.)
632
+ - Creates `domain/{project}/README.md`
633
+ - Generates best practices via Context7 MCP
634
+
635
+ ---
636
+
637
+ ### `/csetup {change-id}` - Setup change context
638
+
639
+ ```bash
640
+ /csetup landing-page
641
+ ```
642
+
643
+ **What it does:**
644
+ - Reads `proposal.md` (business context)
645
+ - Reads `tasks.md` (implementation checklist)
646
+ - Reads `page-plan.md` (if exists - UI content plan)
647
+ - Classifies tasks by agent
648
+ - Generates `workflow.md` (execution plan)
649
+
650
+ ---
651
+
652
+ ### `/cdev {change-id}` - Execute implementation
653
+
654
+ ```bash
655
+ /cdev landing-page
656
+
657
+ # Or with explicit approval
658
+ "ลุยเลย" # Continue without confirmation prompts
659
+ ```
660
+
661
+ **What it does:**
662
+ - Runs agents in phases (1 → 2 → 2.5 → 3 → 4)
663
+ - uxui-frontend auto-reads `page-plan.md` (STEP 0.5)
664
+ - **Auto-proceed:** Detects user approval ("continue", "ลุยเลย") and eliminates redundant confirmation prompts
665
+ - Updates `flags.json` (progress tracking)
666
+ - Reports completion status
667
+
668
+ **Auto-Proceed Feature:**
669
+ - When you say "continue", "proceed", "yes", or "ลุยเลย", Main Claude auto-responds to agent questions
670
+ - **50-90% fewer confirmations** (1x per workflow instead of 2x per phase)
671
+ - **25% faster execution** (no waiting for redundant approvals)
672
+
673
+ ---
674
+
675
+ ### `/cview {change-id}` - View detailed progress
676
+
677
+ ```bash
678
+ /cview landing-page
679
+ ```
680
+
681
+ **Shows:**
682
+ - Completed/pending tasks
683
+ - Agent activity log
684
+ - Current phase
685
+ - Error messages (if any)
686
+
687
+ ---
688
+
689
+ ### `/cstatus {change-id}` - Quick status
690
+
691
+ ```bash
692
+ /cstatus landing-page
693
+ # → Phase 2/4 - Backend Implementation (75%)
694
+ ```
695
+
696
+ ---
697
+
698
+ ## 🎨 Design System Integration
699
+
700
+ ### Auto-Generate Style Guide
701
+
702
+ ```bash
703
+ /designsetup
704
+ ```
705
+
706
+ **Detection priority:**
707
+ 1. **reference/ folder** (HTML/screenshots) → Extract design style
708
+ 2. **Existing codebase** (>10 components) → Reverse engineer patterns
709
+ 3. **AI generation** → Modern best practices
710
+
711
+ **Output:** `design-system/STYLE_GUIDE.md`
712
+
713
+ **17 Comprehensive Sections:**
714
+ 1. Overview
715
+ 2. Design Philosophy
716
+ 3. Color Palette (HEX codes, usage, Tailwind classes)
717
+ 4. Typography (headings, body, weights)
718
+ 5. Spacing System (4px/8px grid)
719
+ 6. Component Styles (Button, Card, Input, Badge, etc.)
720
+ 7. Shadows & Elevation
721
+ 8. Animations & Transitions
722
+ 9. Border Styles
723
+ 10. Border Radius
724
+ 11. Opacity & Transparency
725
+ 12. Z-Index Layers
726
+ 13. Responsive Breakpoints
727
+ 14. CSS Variables / Tailwind Theme (Design Tokens)
728
+ 15. Layout Patterns
729
+ 16. Example Component Reference (React + Tailwind code)
730
+ 17. Additional Sections (Best Practices, Accessibility, Icon System)
731
+
732
+ **Agents automatically use `STYLE_GUIDE.md` for:**
733
+ - Color palette (no hardcoded colors)
734
+ - Spacing scale (consistent gaps/padding)
735
+ - Typography (font hierarchy)
736
+ - Component patterns (reuse before create)
737
+
738
+ ---
739
+
740
+ ## 🧪 Testing Philosophy
741
+
742
+ **Agents follow TDD classification:**
743
+
744
+ | Code Type | Approach | Example |
745
+ |-----------|----------|---------|
746
+ | **Critical paths** | TDD (Red-Green-Refactor) | Auth logic, payments, calculations |
747
+ | **Simple code** | Test-alongside | CRUD, UI components, config |
748
+
749
+ **Test-debug agent:**
750
+ - Runs tests automatically after implementation
751
+ - Fixes bugs (max 3-4 iterations)
752
+ - Escalates if stuck (reports to user)
753
+
754
+ ---
755
+
756
+ ## 🔧 Supported Tech Stacks
757
+
758
+ Agents auto-detect your stack via Context7 MCP:
759
+
760
+ **Frontend:**
761
+ - Next.js, React, Vue, Svelte, Angular
762
+
763
+ **Backend:**
764
+ - FastAPI, Express, NestJS, Django, Flask, Next.js API Routes
765
+
766
+ **Database:**
767
+ - Prisma, SQLAlchemy, TypeORM, Drizzle
768
+
769
+ **Testing:**
770
+ - Vitest, Jest, Pytest, Playwright
771
+
772
+ ---
773
+
774
+ ## 📖 Usage Examples
775
+
776
+ ### Example 1: Simple UI Task (with /pageplan)
777
+
778
+ ```bash
779
+ # In Claude Code
780
+ "Build a user profile page with edit functionality"
781
+
782
+ # If it's a UI task, optionally run:
783
+ /pageplan @prd.md
784
+
785
+ # Then execute:
786
+ /csetup profile-page
787
+ /cdev profile-page
788
+ ```
789
+
790
+ Claude will:
791
+ 1. Read `task-classification.md`
792
+ 2. Select agents: `uxui-frontend` → `backend` → `frontend` → `test-debug`
793
+ 3. uxui-frontend reads `page-plan.md` (if exists)
794
+ 4. Execute in sequence
795
+ 5. Report completion
796
+
797
+ ---
798
+
799
+ ### Example 2: Complex Multi-Agent Workflow (OpenSpec)
800
+
801
+ Using OpenSpec workflow:
802
+
803
+ ```bash
804
+ # 1. OpenSpec generates proposal + tasks
805
+ "I want to add a dashboard with analytics"
806
+ # → proposal.md + tasks.md created
807
+
808
+ # 2. Generate page plan
809
+ /pageplan @prd.md @analytics_spec.md
810
+
811
+ # 3. Setup change context
812
+ /csetup analytics-dashboard
813
+
814
+ # 4. Start development
815
+ /cdev analytics-dashboard
816
+
817
+ # 5. View progress
818
+ /cview analytics-dashboard
819
+ ```
820
+
821
+ This follows a structured 4-phase approach:
822
+ 1. **Phase 1:** UI with mock data (uxui-frontend reads page-plan.md)
823
+ 2. **Phase 2:** Real API + database (backend + database)
824
+ 3. **Phase 2.5:** Validate contracts (integration)
825
+ 4. **Phase 3:** Connect UI to API (frontend)
826
+ 5. **Phase 4:** Tests + bug fixes (test-debug)
827
+
828
+ ---
829
+
830
+ ## 🔄 Updating to Latest Version
831
+
832
+ ### Method 1: Update the npm package
833
+
834
+ ```bash
835
+ npm update -g @champpaba/claude-agent-kit
836
+ ```
837
+
838
+ ### Method 2: Update template in project
839
+
840
+ ```bash
841
+ cd your-project
842
+ cak update --backup
843
+ ```
844
+
845
+ This will:
846
+ - Create backup at `.claude.backup/`
847
+ - Update all template files
848
+ - Preserve your customizations in `domain/`
849
+
850
+ ---
851
+
852
+ ## 🎯 Customization
853
+
854
+ ### Add Project-Specific Context
855
+
856
+ After running `cak init`, add your own context files:
857
+
858
+ ```bash
859
+ mkdir -p .claude/contexts/domain/my-project
860
+ ```
861
+
862
+ **Example:** E-commerce checkout flow
863
+ ```markdown
864
+ <!-- .claude/contexts/domain/my-project/checkout-flow.md -->
865
+ # Checkout Flow
866
+
867
+ ## Steps
868
+ 1. Cart review
869
+ 2. Shipping address
870
+ 3. Payment method
871
+ 4. Order confirmation
872
+
873
+ ## Business Rules
874
+ - Free shipping over $50
875
+ - Tax calculation by state
876
+ - Inventory check before payment
877
+ ```
878
+
879
+ Agents will auto-discover and use these patterns.
880
+
881
+ ---
882
+
883
+ ## 🔗 Ecosystem
884
+
885
+ **Claude Agent Kit works with:**
886
+
887
+ | Tool | Purpose | Integration |
888
+ |------|---------|-------------|
889
+ | **OpenSpec** | Spec-driven planning | Reads `proposal.md` + `tasks.md` |
890
+ | **Context7 MCP** | Always-updated docs | Auto-generates best practices |
891
+ | **Claude Code** | AI coding assistant | Execution environment |
892
+
893
+ ---
894
+
895
+ ## 🤝 Contributing
896
+
897
+ We welcome contributions!
898
+
899
+ - Report bugs: [GitHub Issues](https://github.com/ChampPABA/claude-multi-agent-template/issues)
900
+ - Feature requests: [Discussions](https://github.com/ChampPABA/claude-multi-agent-template/discussions)
901
+ - Pull requests: Follow [CONTRIBUTING.md](CONTRIBUTING.md)
902
+
903
+ ---
904
+
905
+ ## 📄 License
906
+
907
+ MIT License - see [LICENSE](LICENSE)
908
+
909
+ ---
910
+
911
+ ## 🙏 Credits
912
+
913
+ Built with:
914
+ - [OpenSpec](https://github.com/Fission-AI/OpenSpec) - Spec-driven development framework
915
+ - [Claude Code](https://claude.com/claude-code) - AI coding assistant
916
+ - [Context7 MCP](https://context7.com) - Always up-to-date library docs
917
+
918
+ ---
919
+
920
+ ## 🆕 What's New in v1.4.1
921
+
922
+ **Feature: Intelligent Auto-Proceed - Eliminate Double Confirmations** 🚀
923
+
924
+ ### Smart Approval Detection
925
+
926
+ **Problem Solved:**
927
+ - Before: Agent asks "Proceed?" → Main Claude asks user again (redundant!)
928
+ - User frustration: "I already said 'ลุยเลย', why ask twice?"
929
+
930
+ **Solution Implemented:**
931
+ - ✅ Main Claude detects user approval keywords ("continue", "proceed", "yes", "ลุยเลย")
932
+ - ✅ Passes approval context to agents in prompt
933
+ - ✅ Auto-responds to agent questions without re-prompting user
934
+ - ✅ Backward compatible: Manual approval mode still available
935
+
936
+ **Results:**
937
+ - **50-90% fewer confirmations** (1x per workflow vs 2x per phase)
938
+ - **25% faster execution** (no waiting for redundant approvals)
939
+ - **Better UX** (approve once, system handles the rest)
940
+ - **Lean implementation** (80 lines, 1 file, +0.1% context)
941
+
942
+ ### How It Works
943
+
944
+ ```bash
945
+ # Before v1.4.1 (Double confirmation ❌)
946
+ User: "ลุยเลย"
947
+ Main: Calls uxui-frontend agent
948
+ Agent: "Pre-work done. Proceed?"
949
+ Main: "Agent is asking... Proceed? (yes/no)" ← Asks user again!
950
+ User: "Why ask twice?"
951
+
952
+ # After v1.4.1 (Smart auto-proceed ✅)
953
+ User: "ลุยเลย"
954
+ Main: Detects approval → auto_proceed = true
955
+ Agent: "Pre-work done. Proceed?"
956
+ Main: "YES, proceed immediately" ← Answers agent directly!
957
+ Agent: Continues work...
958
+ ```
959
+
960
+ ### Auto-Proceed Trigger Words
961
+
962
+ These keywords enable auto-proceed mode:
963
+ - ✅ `/cdev` command (implicit approval for all phases)
964
+ - ✅ "continue", "proceed", "yes"
965
+ - ✅ "ลุยเลย" (Thai: "go ahead")
966
+
967
+ ---
968
+
969
+ ## 🎉 What's New in v1.4.0
970
+
971
+ **Major Update: Context Optimization & DRY Consolidation**
972
+
973
+ ### Token Efficiency Improvements
974
+
975
+ **Problem Solved:**
976
+ - Before v1.4.0: Same documentation duplicated across 6 agent files + CLAUDE.md
977
+ - Package Manager warnings: 360 lines duplicated 6x
978
+ - Context Loading Strategy: 1,200 lines duplicated 6x
979
+ - TDD Workflow examples: 1,200 lines duplicated 3x
980
+ - Handoff templates: 900 lines duplicated 6x
981
+ - Documentation policies: 480 lines duplicated 6x
982
+ - CLAUDE.md: 890 lines mixing navigation + detailed guides
983
+
984
+ **Solution Implemented:**
985
+ - ✅ Created consolidated lib files (context-loading-protocol.md, handoff-protocol.md, tdd-workflow.md)
986
+ - ✅ Extracted detailed guides from CLAUDE.md to lib/detailed-guides/
987
+ - ✅ Applied consistent reference pattern: Brief summary + "→ See: path" + agent-specific additions
988
+ - ✅ Maintained 100% content quality (all information preserved)
989
+
990
+ **Results:**
991
+ - **All 6 agents:** 6,796 → 4,749 lines (-2,047, -30.1% reduction)
992
+ - **CLAUDE.md:** 890 → 163 lines (-727, -81.7% reduction)
993
+ - **Grand Total:** 7,686 → 4,912 lines (-2,774, -36.1% reduction)
994
+ - **Token savings:** ~36% reduction in total context size
995
+ - **Speed improvement:** Faster agent loading and execution
996
+ - **Maintainability:** Single source of truth for shared documentation
997
+
998
+ ### New Consolidated Documentation Structure
999
+
1000
+ **Created in v1.4.0:**
1001
+ ```
1002
+ .claude/lib/
1003
+ ├── context-loading-protocol.md # Universal context loading strategy
1004
+ ├── handoff-protocol.md # Agent handoff templates
1005
+ ├── tdd-workflow.md # TDD workflow examples
1006
+ └── detailed-guides/
1007
+ ├── best-practices-system.md # How best practices work
1008
+ ├── context-optimization.md # Token optimization strategy
1009
+ ├── page-planning.md # /pageplan command guide
1010
+ ├── taskmaster-analysis.md # 6-dimension task analysis
1011
+ ├── design-system.md # Style guide generation
1012
+ └── agent-system.md # Agent overview & workflow
1013
+ ```
1014
+
1015
+ ### Benefits for Users
1016
+
1017
+ **For Developers:**
1018
+ - ⚡ 36% faster context loading
1019
+ - 📖 Cleaner, easier-to-navigate documentation
1020
+ - 🎯 CLAUDE.md is now a pure navigation hub (163 lines)
1021
+ - 🔍 Detailed guides are modular and focused
1022
+
1023
+ **For Claude Agents:**
1024
+ - 🚀 Faster startup (less context to load)
1025
+ - 💾 More token budget for actual work
1026
+ - 📚 Single source of truth (no conflicting info)
1027
+ - 🔄 Easier maintenance (update once, apply everywhere)
1028
+
1029
+ ### Migration Notes
1030
+
1031
+ **No breaking changes!** All existing workflows continue to work:
1032
+ - ✅ `/psetup`, `/csetup`, `/cdev` commands unchanged
1033
+ - ✅ Agent behavior unchanged (same quality, faster execution)
1034
+ - ✅ All features from v1.1-1.3 preserved
1035
+ - ✅ Existing projects can update with `cak update`
1036
+
1037
+ **New Reference Pattern:**
1038
+ Agents now use lightweight references instead of duplicating full documentation:
1039
+
1040
+ ```markdown
1041
+ ## Context Loading Strategy
1042
+
1043
+ **→ See:** `.claude/lib/context-loading-protocol.md` for complete protocol
1044
+
1045
+ **Agent-Specific Additions (frontend):**
1046
+ ### State Management Libraries
1047
+ ...
1048
+ ```
1049
+
1050
+ ### Upgrading to v1.4.1
1051
+
1052
+ ```bash
1053
+ # Update npm package
1054
+ npm update -g @champpaba/claude-agent-kit
1055
+
1056
+ # Update template in your project (creates backup)
1057
+ cd your-project
1058
+ cak update --backup
1059
+ ```
1060
+
1061
+ **What's New:**
1062
+ - ✅ Auto-proceed feature (eliminate double confirmations)
1063
+ - ✅ 50-90% fewer approval prompts
1064
+ - ✅ 25% faster workflow execution
1065
+ - ✅ All v1.4.0 features (context optimization, DRY consolidation)
1066
+
1067
+ All your customizations in `.claude/contexts/domain/` are preserved!
1068
+
1069
+ ---
1070
+
1071
+ ## 📜 Changelog
1072
+
1073
+ ### v1.4.1 (2025-11-06)
1074
+ **Feature: Intelligent Auto-Proceed - Eliminate Double Confirmations**
1075
+
1076
+ **Added:**
1077
+ - Auto-proceed approval context in agent prompts
1078
+ - Smart detection of user approval keywords ("continue", "proceed", "yes", "ลุยเลย")
1079
+ - Agent question handling logic (auto-respond vs ask user)
1080
+ - Auto-proceed decision tree in agent-executor.md
1081
+
1082
+ **Improved:**
1083
+ - User experience: 50-90% fewer confirmation prompts
1084
+ - Execution speed: 25% faster (no waiting for redundant approvals)
1085
+ - Workflow clarity: User approves once, system handles agent interactions
1086
+
1087
+ **Technical Details:**
1088
+ - Modified: `.claude/lib/agent-executor.md` (+80 lines)
1089
+ - Implementation: Lean solution (1 file, 0.1% context increase)
1090
+ - Backward compatible: Manual approval mode still available
1091
+
1092
+ **When It Activates:**
1093
+ - User runs `/cdev` command (implicit approval)
1094
+ - User says "continue", "proceed", "yes", "ลุยเลย" (explicit approval)
1095
+
1096
+ **Before:**
1097
+ ```
1098
+ User approves → Agent asks → Main asks user again ❌
1099
+ ```
1100
+
1101
+ **After:**
1102
+ ```
1103
+ User approves → Agent asks → Main answers directly ✅
1104
+ ```
1105
+
1106
+ ### v1.4.0 (2025-11-05)
1107
+ **Major: Context Optimization & DRY Consolidation**
1108
+
1109
+ **Added:**
1110
+ - New consolidated lib files: `context-loading-protocol.md`, `handoff-protocol.md`, `tdd-workflow.md`
1111
+ - New detailed guides folder: `lib/detailed-guides/` (6 focused guides)
1112
+ - Reference pattern across all agents (Brief summary → See: path → Additions)
1113
+
1114
+ **Changed:**
1115
+ - All 6 agents refactored: 30.1% size reduction (6,796 → 4,749 lines)
1116
+ - CLAUDE.md refactored: 81.7% size reduction (890 → 163 lines, pure navigation hub)
1117
+ - Documentation structure: Moved detailed content to modular lib files
1118
+
1119
+ **Performance:**
1120
+ - 36% total context reduction (7,686 → 4,912 lines)
1121
+ - Faster agent loading and execution
1122
+ - More token budget available for actual work
1123
+
1124
+ **Improved:**
1125
+ - Maintainability: Single source of truth for shared docs
1126
+ - Discoverability: Clear navigation in CLAUDE.md
1127
+ - Modularity: Detailed guides in separate files
1128
+ - Consistency: Same content quality, zero duplication
1129
+
1130
+ ### v1.3.0 (2025-10-30)
1131
+ **Feature: TaskMaster-style Intelligent Task Analysis**
1132
+
1133
+ **Added:**
1134
+ - 6-dimension task analysis in `/csetup`:
1135
+ - Complexity scoring (1-10)
1136
+ - Dependency detection (auto-detects blocks/blocked-by)
1137
+ - Risk assessment (LOW/MEDIUM/HIGH with mitigation)
1138
+ - Research requirements (auto-generates queries)
1139
+ - Subtask breakdown (complex tasks → smaller steps)
1140
+ - Priority ranking (CRITICAL → LOW, scored 0-100)
1141
+ - Task analyzer implementation: `.claude/lib/task-analyzer.md`
1142
+ - Enhanced phases.md with metadata, time buffers, research phases
1143
+
1144
+ **Improved:**
1145
+ - Time estimates with automatic buffers (+41% average)
1146
+ - Research phases auto-added for new tech/libraries
1147
+ - Dependency order in workflow execution
1148
+ - Risk mitigation strategies per task
1149
+
1150
+ **Inspired by:** [claude-task-master](https://github.com/eyaltoledano/claude-task-master)
1151
+
1152
+ ### v1.2.0 (2025-10-27)
1153
+ **Feature: Context Optimization - 70% Token Reduction**
1154
+
1155
+ **Added:**
1156
+ - 3-tier loading strategy: STYLE_TOKENS.json (500) → design-context.md (1K) → STYLE_GUIDE.md (5K)
1157
+ - Document loader protocol: `.claude/lib/document-loader.md`
1158
+ - Lightweight design tokens: `design-system/STYLE_TOKENS.json`
1159
+
1160
+ **Improved:**
1161
+ - Token usage: ~20K → ~4.7K (70% reduction for design system)
1162
+ - Speed: 3-4x faster command execution
1163
+ - Consistency: Enforced design tokens, no random colors
1164
+
1165
+ ### v1.1.1 (2025-10-25)
1166
+ **Patch: Minor Fixes**
1167
+
1168
+ **Fixed:**
1169
+ - Template path correction: `template/.claude` → `.claude`
1170
+ - Documentation typos and formatting
1171
+
1172
+ ### v1.1.0 (2025-10-24)
1173
+ **Feature: Enhanced Implementation Logic**
1174
+
1175
+ **Added:**
1176
+ - Implementation logic overview: `lib/README.md`
1177
+ - Agent executor with retry & escalation: `lib/agent-executor.md`
1178
+ - TDD classifier logic: `lib/tdd-classifier.md`
1179
+ - Progress tracking protocol: `lib/flags-updater.md`
1180
+ - Mandatory agent routing: `lib/agent-router.md`
1181
+ - Shared agent discovery flow: `contexts/patterns/agent-discovery.md`
1182
+
1183
+ ### v1.0.0 (2025-10-20)
1184
+ **Initial Release: Multi-Agent Template**
1185
+
1186
+ **Core Features:**
1187
+ - 6 specialized agents (integration, uxui-frontend, test-debug, frontend, backend, database)
1188
+ - OpenSpec integration (`/csetup`, `/cdev`, `/cview`, `/cstatus`)
1189
+ - Auto-generated best practices via Context7 MCP
1190
+ - 3-level project indexing (domain → project → best-practices)
1191
+ - Design foundation (color theory, spacing, typography)
1192
+ - `/designsetup` command (auto-generate style guide)
1193
+ - `/pageplan` command (UI content & component planning)
1194
+ - Universal patterns (logging, testing, error-handling, TDD)
1195
+ - CLI: `cak init`, `cak update`
1196
+
1197
+ ---
1198
+
1199
+ ## 🔗 Links
1200
+
1201
+ - **npm Package:** https://www.npmjs.com/package/@champpaba/claude-agent-kit
1202
+ - **GitHub:** https://github.com/ChampPABA/claude-multi-agent-template
1203
+ - **OpenSpec:** https://github.com/Fission-AI/OpenSpec
1204
+ - **Issues:** https://github.com/ChampPABA/claude-multi-agent-template/issues
1205
+
1206
+ ---
1207
+
1208
+ ## 💡 Quick Tips
1209
+
1210
+ 1. **Run `/designsetup` FIRST** - Ensures visual consistency from day 1
1211
+ 2. **Use `/pageplan` for UI tasks** - 25% faster implementation, better content
1212
+ 3. **Review `page-plan.md` before `/cdev`** - Edit content, prepare assets
1213
+ 4. **Setup Context7 MCP** - Agents get latest framework docs automatically
1214
+ 5. **Use OpenSpec for complex features** - Better alignment before implementation
1215
+ 6. **Monitor with `/cview`** - See exactly what agents are doing
1216
+ 7. **Always use `--backup` when updating** - Protects your customizations
1217
+
1218
+ ---
1219
+
1220
+ ## 📋 Complete Flow Summary
1221
+
1222
+ ```
1223
+ 1️⃣ OpenSpec Planning
1224
+ → proposal.md + tasks.md
1225
+
1226
+ 2️⃣ Generate Style Guide (one-time)
1227
+ /designsetup
1228
+ → STYLE_GUIDE.md
1229
+
1230
+ 3️⃣ Setup Project (one-time)
1231
+ /psetup
1232
+ → domain/{project}/best-practices/
1233
+
1234
+ 4️⃣ Generate Page Plan (UI tasks only)
1235
+ /pageplan @prd.md
1236
+ → page-plan.md (content + component plan)
1237
+
1238
+ 5️⃣ Setup Change Context
1239
+ /csetup {change-id}
1240
+ → workflow.md
1241
+
1242
+ 6️⃣ Execute Implementation
1243
+ /cdev {change-id}
1244
+ → Working code + tests
1245
+
1246
+ 7️⃣ Monitor Progress
1247
+ /cview {change-id}
1248
+ → Detailed progress report
1249
+
1250
+ 8️⃣ OpenSpec Archive & Update
1251
+ → Merge to specs/
1252
+ ```
1253
+
1254
+ ---
1255
+
1256
+ **Ready to implement with confidence?** 🚀
1257
+
1258
+ ```bash
1259
+ # Install globally
1260
+ npm install -g @champpaba/claude-agent-kit
1261
+
1262
+ # Initialize in your project
1263
+ cd your-project
1264
+ cak init
1265
+
1266
+ # Setup project context
1267
+ /psetup
1268
+
1269
+ # Generate style guide (optional but recommended)
1270
+ /designsetup
1271
+
1272
+ # Start building (after OpenSpec planning)
1273
+ /pageplan @prd.md # UI tasks only
1274
+ /csetup your-feature
1275
+ /cdev your-feature
1276
+ ```
1277
+
1278
+ Let specialized agents handle implementation while you focus on specs and architecture!