@champpaba/claude-agent-kit 1.4.0 → 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,1179 +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
-
229
- ---
230
-
231
- ## 📦 Installation
232
-
233
- ```bash
234
- npm install -g @champpaba/claude-agent-kit
235
- ```
236
-
237
- ### Alternative Package Managers
238
-
239
- ```bash
240
- # Using pnpm
241
- pnpm add -g @champpaba/claude-agent-kit
242
-
243
- # Using yarn
244
- yarn global add @champpaba/claude-agent-kit
245
- ```
246
-
247
- ---
248
-
249
- ## 🚀 Quick Start (with OpenSpec)
250
-
251
- ### Step 1: OpenSpec Planning
252
-
253
- ```bash
254
- # In your OpenSpec-enabled project
255
- cd my-app
256
-
257
- # Draft a change proposal (OpenSpec handles this)
258
- "I want to build a landing page for my TOEIC app"
259
- # Generates: .changes/landing-page/proposal.md + tasks.md
260
- ```
261
-
262
- ### Step 2: Initialize Claude Agent Kit
263
-
264
- ```bash
265
- # Initialize the agent system
266
- cak init
267
-
268
- # Setup project context (detects tech stack)
269
- # In Claude Code:
270
- /psetup
271
- ```
272
-
273
- ### Step 3: Generate Page Plan (UI tasks only)
274
-
275
- ```bash
276
- # In Claude Code:
277
- /pageplan @prd.md @project_brief.md
278
-
279
- # → Generates: .changes/landing-page/page-plan.md
280
- # → Review content, prepare assets
281
- ```
282
-
283
- ### Step 4: Setup Change Context
284
-
285
- ```bash
286
- /csetup landing-page
287
- ```
288
-
289
- **What happens:**
290
- - Reads `.changes/landing-page/proposal.md` (business context)
291
- - Reads `.changes/landing-page/tasks.md` (implementation checklist)
292
- - Reads `.changes/landing-page/page-plan.md` (if exists - content plan)
293
- - Classifies tasks by agent (database, backend, frontend, etc.)
294
- - Generates `workflow.md` (execution plan)
295
-
296
- ### Step 5: Execute Implementation
297
-
298
- ```bash
299
- /cdev landing-page
300
- ```
301
-
302
- **What happens:**
303
- 1. **Phase 1:** uxui-frontend reads `page-plan.md` → creates UI with real content
304
- 2. **Phase 2:** backend + database create APIs + models (parallel, if needed)
305
- 3. **Phase 2.5:** integration validates API contracts
306
- 4. **Phase 3:** frontend connects UI to APIs (if needed)
307
- 5. **Phase 4:** test-debug runs tests, fixes bugs
308
-
309
- ### Step 6: Monitor Progress
310
-
311
- ```bash
312
- # View detailed progress
313
- /cview landing-page
314
-
315
- # Quick status check
316
- /cstatus landing-page
317
- # → Phase 1/4 - UI Implementation (100%)
318
- ```
319
-
320
- ---
321
-
322
- ## 🎯 Complete Workflow Examples
323
-
324
- ### Workflow A: UI Feature (with /pageplan)
325
-
326
- ```bash
327
- # 1. OpenSpec Planning
328
- User: "Build landing page for TOEIC app"
329
- → Creates: proposal.md + tasks.md
330
-
331
- # 2. Page Planning (NEW!)
332
- /pageplan @prd.md @project_brief.md
333
- Creates: page-plan.md
334
- User reviews content & prepares assets
335
-
336
- # 3. Setup Context
337
- /csetup landing-page
338
- Reads: proposal.md, tasks.md, page-plan.md
339
- Generates: workflow.md
340
-
341
- # 4. Implementation
342
- /cdev landing-page
343
- uxui-frontend reads page-plan.md (STEP 0.5)
344
- Skips redundant component search
345
- Uses real content + reuse plan
346
- 25% faster implementation
347
-
348
- # 5. Monitor
349
- /cview landing-page
350
- ```
351
-
352
- ### Workflow B: Backend Feature (skip /pageplan)
353
-
354
- ```bash
355
- # 1. OpenSpec Planning
356
- User: "Add payment processing API"
357
- → Creates: proposal.md + tasks.md
358
-
359
- # 2. Setup Context (skip /pageplan - not UI work)
360
- /csetup payment-api
361
-
362
- # 3. Implementation
363
- /cdev payment-api
364
- Phase 2: backend + database agents (parallel)
365
- → Phase 2.5: integration validates contracts
366
- → Phase 3: frontend connects (if UI exists)
367
- → Phase 4: test-debug validates
368
-
369
- # 4. Monitor
370
- /cview payment-api
371
- ```
372
-
373
- ### Workflow C: Full-Stack Feature (with /pageplan)
374
-
375
- ```bash
376
- # 1. OpenSpec Planning
377
- User: "Build user authentication system"
378
- → Creates: proposal.md + tasks.md
379
-
380
- # 2. Page Planning (for login UI only)
381
- /pageplan @prd.md
382
- Creates: page-plan.md (login form content + components)
383
-
384
- # 3. Setup Context
385
- /csetup auth-system
386
-
387
- # 4. Implementation
388
- /cdev auth-system
389
- Phase 1: uxui-frontend (login form, reads page-plan.md)
390
- → Phase 2: backend (POST /api/auth/login) + database (User model)
391
- → Phase 2.5: integration (validate contract)
392
- → Phase 3: frontend (connect form to API)
393
- → Phase 4: test-debug (E2E tests)
394
-
395
- # 5. Monitor
396
- /cview auth-system
397
- ```
398
-
399
- ---
400
-
401
- ## 📁 Project Structure After Init
402
-
403
- ```
404
- your-project/
405
- ├── openspec/
406
- ├── specs/ # Source of truth (OpenSpec)
407
- └── changes/
408
- └── landing-page/
409
- ├── proposal.md ← OpenSpec generates
410
- │ ├── tasks.md ← OpenSpec generates
411
- │ ├── page-plan.md /pageplan generates (UI tasks)
412
- │ ├── workflow.md ← /csetup generates
413
- └── flags.json ← /cdev tracks progress
414
-
415
- ├── design-system/
416
- │ └── STYLE_GUIDE.md ← /designsetup generates
417
-
418
- └── .claude/
419
- ├── CLAUDE.md # Navigation guide
420
-
421
- ├── agents/ # 6 specialized agents
422
- ├── 01-integration.md
423
- │ ├── 02-uxui-frontend.md
424
- │ ├── 03-test-debug.md
425
- │ ├── 04-frontend.md
426
- │ ├── 05-backend.md
427
- └── 06-database.md
428
-
429
- ├── commands/ # Slash commands
430
- ├── designsetup.md # Generate style guide
431
- │ ├── pageplan.md # Generate page plan (NEW!)
432
- │ ├── psetup.md # Project setup
433
- │ ├── csetup.md # Change setup
434
- │ ├── cdev.md # Change development
435
- │ ├── cview.md # View progress
436
- └── cstatus.md # Quick status
437
-
438
- ├── contexts/
439
- ├── design/ # Design foundation
440
- │ ├── patterns/ # Universal patterns
441
- └── domain/ # Project context
442
-
443
- └── lib/ # Implementation logic
444
- ├── agent-executor.md
445
- ├── tdd-classifier.md
446
- ├── flags-updater.md
447
- └── agent-router.md
448
- ```
449
-
450
- ---
451
-
452
- ## 🎯 Why Use Claude Agent Kit?
453
-
454
- ### Without Claude Agent Kit (Manual Implementation)
455
-
456
- ```
457
- ❌ You manually interpret tasks.md
458
- ❌ You context-switch between frontend/backend/database
459
- ❌ You might forget edge cases or tests
460
- Inconsistent code patterns across features
461
- No systematic error handling
462
- Duplicate components everywhere
463
- Lorem ipsum content in UI
464
- ```
465
-
466
- ### With Claude Agent Kit
467
-
468
- ```
469
- ✅ Agents auto-classify and execute tasks
470
- Each agent focuses on its specialty
471
- Built-in validation gates (integration agent)
472
- Consistent patterns via auto-discovery
473
- Automatic retry with escalation
474
- Component reuse plan (/pageplan)
475
- Real content from PRD
476
- 25% faster UI implementation
477
- ```
478
-
479
- ---
480
-
481
- ## 📚 Key Features
482
-
483
- ### ✅ Seamless OpenSpec Integration
484
-
485
- - Reads `proposal.md` for business context
486
- - Parses `tasks.md` for implementation checklist
487
- - Generates `page-plan.md` for UI tasks (NEW!)
488
- - Tracks progress in `flags.json`
489
- - Updates completion status back to OpenSpec
490
-
491
- ### ✅ Auto-Generated Best Practices
492
-
493
- Uses Context7 MCP to fetch latest framework docs:
494
-
495
- ```bash
496
- /psetup
497
- # → Detects: Next.js 15, React 18, Prisma 6
498
- # → Generates: .claude/contexts/domain/{project}/best-practices/
499
- # - nextjs-15.md
500
- # - react-18.md
501
- # - prisma-6.md
502
- ```
503
-
504
- ### ✅ 3-Level Project Indexing
505
-
506
- Agents auto-discover context:
507
-
508
- ```
509
- 1. Read: domain/index.md → Get current project
510
- 2. Read: domain/{project}/README.md → Get tech stack
511
- 3. Read: domain/{project}/best-practices/index.md → Load patterns
512
- ```
513
-
514
- ### ✅ Design Foundation
515
-
516
- Universal design principles:
517
- - Color theory (WCAG AAA contrast)
518
- - Typography scales
519
- - 8px spacing grid (8, 16, 24, 32, 40, 48px)
520
- - 4-level shadow system
521
- - Box thinking framework
522
- - Accessibility (WCAG 2.1 AA)
523
-
524
- ### ✅ Quality Gates
525
-
526
- - **TDD for critical paths** (auth, payments, data transforms)
527
- - **Test-alongside for simple code** (CRUD, UI components)
528
- - **Max 3-4 retry iterations** before escalation
529
- - **Integration validation** before connecting UI to API
530
-
531
- ---
532
-
533
- ## 🔧 CLI Commands
534
-
535
- ### `cak init`
536
- Initialize agent system in current project
537
-
538
- ```bash
539
- cak init
540
- cak init --force # Overwrite existing .claude/
541
- ```
542
-
543
- **Creates:**
544
- - `.claude/` folder with 6 agents
545
- - Slash commands (`/psetup`, `/csetup`, `/cdev`, etc.)
546
- - Universal patterns & design foundation
547
-
548
- ---
549
-
550
- ### `cak update`
551
- Update to latest agent templates
552
-
553
- ```bash
554
- cak update
555
- cak update --backup # Create .claude.backup/ first
556
- ```
557
-
558
- **What it does:**
559
- - Updates all template files to latest version
560
- - Preserves your customizations in `domain/`
561
- - Creates backup before updating (with `--backup` flag)
562
-
563
- ---
564
-
565
- ### `cak --version`
566
- Show version number
567
-
568
- ```bash
569
- cak --version
570
- # → 1.0.0
571
- ```
572
-
573
- ---
574
-
575
- ### `cak --help`
576
- Display help information
577
-
578
- ```bash
579
- cak --help
580
- ```
581
-
582
- ---
583
-
584
- ## 🔄 Workflow Commands (in Claude Code)
585
-
586
- ### `/designsetup` - Generate style guide (one-time)
587
-
588
- ```bash
589
- /designsetup
590
- ```
591
-
592
- **Auto-detects from:**
593
- 1. `reference/` folder → Extract design from HTML/screenshots
594
- 2. Existing codebase → Reverse engineer patterns
595
- 3. AI generationModern best practices
596
-
597
- **Creates:** `design-system/STYLE_GUIDE.md`
598
-
599
- ---
600
-
601
- ### `/pageplan` - Generate page plan (UI tasks only) 🆕
602
-
603
- ```bash
604
- /pageplan @prd.md @project_brief.md
605
- ```
606
-
607
- **What it does:**
608
- - Reads user-specified files (PRD, brief)
609
- - Reads `proposal.md` + `STYLE_GUIDE.md`
610
- - Searches existing components
611
- - AI drafts real content from PRD
612
- - Generates asset checklist
613
-
614
- **Creates:** `page-plan.md`
615
- - Component reuse plan (🔄 Reuse vs ✅ New)
616
- - Page structure (component hierarchy)
617
- - Assets to prepare (images, icons)
618
- - Content draft (headlines, descriptions)
619
-
620
- ---
621
-
622
- ### `/psetup` - Setup project (one-time)
623
-
624
- ```bash
625
- /psetup
626
- ```
627
-
628
- **What it does:**
629
- - Detects tech stack (Next.js, React, Prisma, etc.)
630
- - Creates `domain/{project}/README.md`
631
- - Generates best practices via Context7 MCP
632
-
633
- ---
634
-
635
- ### `/csetup {change-id}` - Setup change context
636
-
637
- ```bash
638
- /csetup landing-page
639
- ```
640
-
641
- **What it does:**
642
- - Reads `proposal.md` (business context)
643
- - Reads `tasks.md` (implementation checklist)
644
- - Reads `page-plan.md` (if exists - UI content plan)
645
- - Classifies tasks by agent
646
- - Generates `workflow.md` (execution plan)
647
-
648
- ---
649
-
650
- ### `/cdev {change-id}` - Execute implementation
651
-
652
- ```bash
653
- /cdev landing-page
654
- ```
655
-
656
- **What it does:**
657
- - Runs agents in phases (1 → 2 → 2.5 → 3 → 4)
658
- - uxui-frontend auto-reads `page-plan.md` (STEP 0.5)
659
- - Updates `flags.json` (progress tracking)
660
- - Reports completion status
661
-
662
- ---
663
-
664
- ### `/cview {change-id}` - View detailed progress
665
-
666
- ```bash
667
- /cview landing-page
668
- ```
669
-
670
- **Shows:**
671
- - Completed/pending tasks
672
- - Agent activity log
673
- - Current phase
674
- - Error messages (if any)
675
-
676
- ---
677
-
678
- ### `/cstatus {change-id}` - Quick status
679
-
680
- ```bash
681
- /cstatus landing-page
682
- # → Phase 2/4 - Backend Implementation (75%)
683
- ```
684
-
685
- ---
686
-
687
- ## 🎨 Design System Integration
688
-
689
- ### Auto-Generate Style Guide
690
-
691
- ```bash
692
- /designsetup
693
- ```
694
-
695
- **Detection priority:**
696
- 1. **reference/ folder** (HTML/screenshots) → Extract design style
697
- 2. **Existing codebase** (>10 components) → Reverse engineer patterns
698
- 3. **AI generation** Modern best practices
699
-
700
- **Output:** `design-system/STYLE_GUIDE.md`
701
-
702
- **17 Comprehensive Sections:**
703
- 1. Overview
704
- 2. Design Philosophy
705
- 3. Color Palette (HEX codes, usage, Tailwind classes)
706
- 4. Typography (headings, body, weights)
707
- 5. Spacing System (4px/8px grid)
708
- 6. Component Styles (Button, Card, Input, Badge, etc.)
709
- 7. Shadows & Elevation
710
- 8. Animations & Transitions
711
- 9. Border Styles
712
- 10. Border Radius
713
- 11. Opacity & Transparency
714
- 12. Z-Index Layers
715
- 13. Responsive Breakpoints
716
- 14. CSS Variables / Tailwind Theme (Design Tokens)
717
- 15. Layout Patterns
718
- 16. Example Component Reference (React + Tailwind code)
719
- 17. Additional Sections (Best Practices, Accessibility, Icon System)
720
-
721
- **Agents automatically use `STYLE_GUIDE.md` for:**
722
- - Color palette (no hardcoded colors)
723
- - Spacing scale (consistent gaps/padding)
724
- - Typography (font hierarchy)
725
- - Component patterns (reuse before create)
726
-
727
- ---
728
-
729
- ## 🧪 Testing Philosophy
730
-
731
- **Agents follow TDD classification:**
732
-
733
- | Code Type | Approach | Example |
734
- |-----------|----------|---------|
735
- | **Critical paths** | TDD (Red-Green-Refactor) | Auth logic, payments, calculations |
736
- | **Simple code** | Test-alongside | CRUD, UI components, config |
737
-
738
- **Test-debug agent:**
739
- - Runs tests automatically after implementation
740
- - Fixes bugs (max 3-4 iterations)
741
- - Escalates if stuck (reports to user)
742
-
743
- ---
744
-
745
- ## 🔧 Supported Tech Stacks
746
-
747
- Agents auto-detect your stack via Context7 MCP:
748
-
749
- **Frontend:**
750
- - Next.js, React, Vue, Svelte, Angular
751
-
752
- **Backend:**
753
- - FastAPI, Express, NestJS, Django, Flask, Next.js API Routes
754
-
755
- **Database:**
756
- - Prisma, SQLAlchemy, TypeORM, Drizzle
757
-
758
- **Testing:**
759
- - Vitest, Jest, Pytest, Playwright
760
-
761
- ---
762
-
763
- ## 📖 Usage Examples
764
-
765
- ### Example 1: Simple UI Task (with /pageplan)
766
-
767
- ```bash
768
- # In Claude Code
769
- "Build a user profile page with edit functionality"
770
-
771
- # If it's a UI task, optionally run:
772
- /pageplan @prd.md
773
-
774
- # Then execute:
775
- /csetup profile-page
776
- /cdev profile-page
777
- ```
778
-
779
- Claude will:
780
- 1. Read `task-classification.md`
781
- 2. Select agents: `uxui-frontend` → `backend` → `frontend` → `test-debug`
782
- 3. uxui-frontend reads `page-plan.md` (if exists)
783
- 4. Execute in sequence
784
- 5. Report completion
785
-
786
- ---
787
-
788
- ### Example 2: Complex Multi-Agent Workflow (OpenSpec)
789
-
790
- Using OpenSpec workflow:
791
-
792
- ```bash
793
- # 1. OpenSpec generates proposal + tasks
794
- "I want to add a dashboard with analytics"
795
- # → proposal.md + tasks.md created
796
-
797
- # 2. Generate page plan
798
- /pageplan @prd.md @analytics_spec.md
799
-
800
- # 3. Setup change context
801
- /csetup analytics-dashboard
802
-
803
- # 4. Start development
804
- /cdev analytics-dashboard
805
-
806
- # 5. View progress
807
- /cview analytics-dashboard
808
- ```
809
-
810
- This follows a structured 4-phase approach:
811
- 1. **Phase 1:** UI with mock data (uxui-frontend reads page-plan.md)
812
- 2. **Phase 2:** Real API + database (backend + database)
813
- 3. **Phase 2.5:** Validate contracts (integration)
814
- 4. **Phase 3:** Connect UI to API (frontend)
815
- 5. **Phase 4:** Tests + bug fixes (test-debug)
816
-
817
- ---
818
-
819
- ## 🔄 Updating to Latest Version
820
-
821
- ### Method 1: Update the npm package
822
-
823
- ```bash
824
- npm update -g @champpaba/claude-agent-kit
825
- ```
826
-
827
- ### Method 2: Update template in project
828
-
829
- ```bash
830
- cd your-project
831
- cak update --backup
832
- ```
833
-
834
- This will:
835
- - Create backup at `.claude.backup/`
836
- - Update all template files
837
- - Preserve your customizations in `domain/`
838
-
839
- ---
840
-
841
- ## 🎯 Customization
842
-
843
- ### Add Project-Specific Context
844
-
845
- After running `cak init`, add your own context files:
846
-
847
- ```bash
848
- mkdir -p .claude/contexts/domain/my-project
849
- ```
850
-
851
- **Example:** E-commerce checkout flow
852
- ```markdown
853
- <!-- .claude/contexts/domain/my-project/checkout-flow.md -->
854
- # Checkout Flow
855
-
856
- ## Steps
857
- 1. Cart review
858
- 2. Shipping address
859
- 3. Payment method
860
- 4. Order confirmation
861
-
862
- ## Business Rules
863
- - Free shipping over $50
864
- - Tax calculation by state
865
- - Inventory check before payment
866
- ```
867
-
868
- Agents will auto-discover and use these patterns.
869
-
870
- ---
871
-
872
- ## 🔗 Ecosystem
873
-
874
- **Claude Agent Kit works with:**
875
-
876
- | Tool | Purpose | Integration |
877
- |------|---------|-------------|
878
- | **OpenSpec** | Spec-driven planning | Reads `proposal.md` + `tasks.md` |
879
- | **Context7 MCP** | Always-updated docs | Auto-generates best practices |
880
- | **Claude Code** | AI coding assistant | Execution environment |
881
-
882
- ---
883
-
884
- ## 🤝 Contributing
885
-
886
- We welcome contributions!
887
-
888
- - Report bugs: [GitHub Issues](https://github.com/ChampPABA/claude-multi-agent-template/issues)
889
- - Feature requests: [Discussions](https://github.com/ChampPABA/claude-multi-agent-template/discussions)
890
- - Pull requests: Follow [CONTRIBUTING.md](CONTRIBUTING.md)
891
-
892
- ---
893
-
894
- ## 📄 License
895
-
896
- MIT License - see [LICENSE](LICENSE)
897
-
898
- ---
899
-
900
- ## 🙏 Credits
901
-
902
- Built with:
903
- - [OpenSpec](https://github.com/Fission-AI/OpenSpec) - Spec-driven development framework
904
- - [Claude Code](https://claude.com/claude-code) - AI coding assistant
905
- - [Context7 MCP](https://context7.com) - Always up-to-date library docs
906
-
907
- ---
908
-
909
- ## 🆕 What's New in v1.4.0
910
-
911
- **Major Update: Context Optimization & DRY Consolidation** 🎉
912
-
913
- ### Token Efficiency Improvements
914
-
915
- **Problem Solved:**
916
- - Before v1.4.0: Same documentation duplicated across 6 agent files + CLAUDE.md
917
- - Package Manager warnings: 360 lines duplicated 6x
918
- - Context Loading Strategy: 1,200 lines duplicated 6x
919
- - TDD Workflow examples: 1,200 lines duplicated 3x
920
- - Handoff templates: 900 lines duplicated 6x
921
- - Documentation policies: 480 lines duplicated 6x
922
- - CLAUDE.md: 890 lines mixing navigation + detailed guides
923
-
924
- **Solution Implemented:**
925
- - ✅ Created consolidated lib files (context-loading-protocol.md, handoff-protocol.md, tdd-workflow.md)
926
- - ✅ Extracted detailed guides from CLAUDE.md to lib/detailed-guides/
927
- - ✅ Applied consistent reference pattern: Brief summary + "See: path" + agent-specific additions
928
- - Maintained 100% content quality (all information preserved)
929
-
930
- **Results:**
931
- - **All 6 agents:** 6,796 4,749 lines (-2,047, -30.1% reduction)
932
- - **CLAUDE.md:** 890 163 lines (-727, -81.7% reduction)
933
- - **Grand Total:** 7,686 4,912 lines (-2,774, -36.1% reduction)
934
- - **Token savings:** ~36% reduction in total context size
935
- - **Speed improvement:** Faster agent loading and execution
936
- - **Maintainability:** Single source of truth for shared documentation
937
-
938
- ### New Consolidated Documentation Structure
939
-
940
- **Created in v1.4.0:**
941
- ```
942
- .claude/lib/
943
- ├── context-loading-protocol.md # Universal context loading strategy
944
- ├── handoff-protocol.md # Agent handoff templates
945
- ├── tdd-workflow.md # TDD workflow examples
946
- └── detailed-guides/
947
- ├── best-practices-system.md # How best practices work
948
- ├── context-optimization.md # Token optimization strategy
949
- ├── page-planning.md # /pageplan command guide
950
- ├── taskmaster-analysis.md # 6-dimension task analysis
951
- ├── design-system.md # Style guide generation
952
- └── agent-system.md # Agent overview & workflow
953
- ```
954
-
955
- ### Benefits for Users
956
-
957
- **For Developers:**
958
- - ⚡ 36% faster context loading
959
- - 📖 Cleaner, easier-to-navigate documentation
960
- - 🎯 CLAUDE.md is now a pure navigation hub (163 lines)
961
- - 🔍 Detailed guides are modular and focused
962
-
963
- **For Claude Agents:**
964
- - 🚀 Faster startup (less context to load)
965
- - 💾 More token budget for actual work
966
- - 📚 Single source of truth (no conflicting info)
967
- - 🔄 Easier maintenance (update once, apply everywhere)
968
-
969
- ### Migration Notes
970
-
971
- **No breaking changes!** All existing workflows continue to work:
972
- - ✅ `/psetup`, `/csetup`, `/cdev` commands unchanged
973
- - Agent behavior unchanged (same quality, faster execution)
974
- - ✅ All features from v1.1-1.3 preserved
975
- - ✅ Existing projects can update with `cak update`
976
-
977
- **New Reference Pattern:**
978
- Agents now use lightweight references instead of duplicating full documentation:
979
-
980
- ```markdown
981
- ## Context Loading Strategy
982
-
983
- **→ See:** `.claude/lib/context-loading-protocol.md` for complete protocol
984
-
985
- **Agent-Specific Additions (frontend):**
986
- ### State Management Libraries
987
- ...
988
- ```
989
-
990
- ### Upgrading from v1.1.1 to v1.4.0
991
-
992
- ```bash
993
- # Update npm package
994
- npm update -g @champpaba/claude-agent-kit
995
-
996
- # Update template in your project (creates backup)
997
- cd your-project
998
- cak update --backup
999
- ```
1000
-
1001
- All your customizations in `.claude/contexts/domain/` are preserved!
1002
-
1003
- ---
1004
-
1005
- ## 📜 Changelog
1006
-
1007
- ### v1.4.0 (2025-11-05)
1008
- **Major: Context Optimization & DRY Consolidation**
1009
-
1010
- **Added:**
1011
- - New consolidated lib files: `context-loading-protocol.md`, `handoff-protocol.md`, `tdd-workflow.md`
1012
- - New detailed guides folder: `lib/detailed-guides/` (6 focused guides)
1013
- - Reference pattern across all agents (Brief summary → See: path → Additions)
1014
-
1015
- **Changed:**
1016
- - All 6 agents refactored: 30.1% size reduction (6,796 → 4,749 lines)
1017
- - CLAUDE.md refactored: 81.7% size reduction (890 → 163 lines, pure navigation hub)
1018
- - Documentation structure: Moved detailed content to modular lib files
1019
-
1020
- **Performance:**
1021
- - 36% total context reduction (7,686 4,912 lines)
1022
- - Faster agent loading and execution
1023
- - More token budget available for actual work
1024
-
1025
- **Improved:**
1026
- - Maintainability: Single source of truth for shared docs
1027
- - Discoverability: Clear navigation in CLAUDE.md
1028
- - Modularity: Detailed guides in separate files
1029
- - Consistency: Same content quality, zero duplication
1030
-
1031
- ### v1.3.0 (2025-10-30)
1032
- **Feature: TaskMaster-style Intelligent Task Analysis**
1033
-
1034
- **Added:**
1035
- - 6-dimension task analysis in `/csetup`:
1036
- - Complexity scoring (1-10)
1037
- - Dependency detection (auto-detects blocks/blocked-by)
1038
- - Risk assessment (LOW/MEDIUM/HIGH with mitigation)
1039
- - Research requirements (auto-generates queries)
1040
- - Subtask breakdown (complex tasks → smaller steps)
1041
- - Priority ranking (CRITICAL → LOW, scored 0-100)
1042
- - Task analyzer implementation: `.claude/lib/task-analyzer.md`
1043
- - Enhanced phases.md with metadata, time buffers, research phases
1044
-
1045
- **Improved:**
1046
- - Time estimates with automatic buffers (+41% average)
1047
- - Research phases auto-added for new tech/libraries
1048
- - Dependency order in workflow execution
1049
- - Risk mitigation strategies per task
1050
-
1051
- **Inspired by:** [claude-task-master](https://github.com/eyaltoledano/claude-task-master)
1052
-
1053
- ### v1.2.0 (2025-10-27)
1054
- **Feature: Context Optimization - 70% Token Reduction**
1055
-
1056
- **Added:**
1057
- - 3-tier loading strategy: STYLE_TOKENS.json (500) → design-context.md (1K) → STYLE_GUIDE.md (5K)
1058
- - Document loader protocol: `.claude/lib/document-loader.md`
1059
- - Lightweight design tokens: `design-system/STYLE_TOKENS.json`
1060
-
1061
- **Improved:**
1062
- - Token usage: ~20K → ~4.7K (70% reduction for design system)
1063
- - Speed: 3-4x faster command execution
1064
- - Consistency: Enforced design tokens, no random colors
1065
-
1066
- ### v1.1.1 (2025-10-25)
1067
- **Patch: Minor Fixes**
1068
-
1069
- **Fixed:**
1070
- - Template path correction: `template/.claude` → `.claude`
1071
- - Documentation typos and formatting
1072
-
1073
- ### v1.1.0 (2025-10-24)
1074
- **Feature: Enhanced Implementation Logic**
1075
-
1076
- **Added:**
1077
- - Implementation logic overview: `lib/README.md`
1078
- - Agent executor with retry & escalation: `lib/agent-executor.md`
1079
- - TDD classifier logic: `lib/tdd-classifier.md`
1080
- - Progress tracking protocol: `lib/flags-updater.md`
1081
- - Mandatory agent routing: `lib/agent-router.md`
1082
- - Shared agent discovery flow: `contexts/patterns/agent-discovery.md`
1083
-
1084
- ### v1.0.0 (2025-10-20)
1085
- **Initial Release: Multi-Agent Template**
1086
-
1087
- **Core Features:**
1088
- - 6 specialized agents (integration, uxui-frontend, test-debug, frontend, backend, database)
1089
- - OpenSpec integration (`/csetup`, `/cdev`, `/cview`, `/cstatus`)
1090
- - Auto-generated best practices via Context7 MCP
1091
- - 3-level project indexing (domain → project → best-practices)
1092
- - Design foundation (color theory, spacing, typography)
1093
- - `/designsetup` command (auto-generate style guide)
1094
- - `/pageplan` command (UI content & component planning)
1095
- - Universal patterns (logging, testing, error-handling, TDD)
1096
- - CLI: `cak init`, `cak update`
1097
-
1098
- ---
1099
-
1100
- ## 🔗 Links
1101
-
1102
- - **npm Package:** https://www.npmjs.com/package/@champpaba/claude-agent-kit
1103
- - **GitHub:** https://github.com/ChampPABA/claude-multi-agent-template
1104
- - **OpenSpec:** https://github.com/Fission-AI/OpenSpec
1105
- - **Issues:** https://github.com/ChampPABA/claude-multi-agent-template/issues
1106
-
1107
- ---
1108
-
1109
- ## 💡 Quick Tips
1110
-
1111
- 1. **Run `/designsetup` FIRST** - Ensures visual consistency from day 1
1112
- 2. **Use `/pageplan` for UI tasks** - 25% faster implementation, better content
1113
- 3. **Review `page-plan.md` before `/cdev`** - Edit content, prepare assets
1114
- 4. **Setup Context7 MCP** - Agents get latest framework docs automatically
1115
- 5. **Use OpenSpec for complex features** - Better alignment before implementation
1116
- 6. **Monitor with `/cview`** - See exactly what agents are doing
1117
- 7. **Always use `--backup` when updating** - Protects your customizations
1118
-
1119
- ---
1120
-
1121
- ## 📋 Complete Flow Summary
1122
-
1123
- ```
1124
- 1️⃣ OpenSpec Planning
1125
- proposal.md + tasks.md
1126
-
1127
- 2️⃣ Generate Style Guide (one-time)
1128
- /designsetup
1129
- → STYLE_GUIDE.md
1130
-
1131
- 3️⃣ Setup Project (one-time)
1132
- /psetup
1133
- → domain/{project}/best-practices/
1134
-
1135
- 4️⃣ Generate Page Plan (UI tasks only)
1136
- /pageplan @prd.md
1137
- → page-plan.md (content + component plan)
1138
-
1139
- 5️⃣ Setup Change Context
1140
- /csetup {change-id}
1141
- workflow.md
1142
-
1143
- 6️⃣ Execute Implementation
1144
- /cdev {change-id}
1145
- Working code + tests
1146
-
1147
- 7️⃣ Monitor Progress
1148
- /cview {change-id}
1149
- → Detailed progress report
1150
-
1151
- 8️⃣ OpenSpec Archive & Update
1152
- Merge to specs/
1153
- ```
1154
-
1155
- ---
1156
-
1157
- **Ready to implement with confidence?** 🚀
1158
-
1159
- ```bash
1160
- # Install globally
1161
- npm install -g @champpaba/claude-agent-kit
1162
-
1163
- # Initialize in your project
1164
- cd your-project
1165
- cak init
1166
-
1167
- # Setup project context
1168
- /psetup
1169
-
1170
- # Generate style guide (optional but recommended)
1171
- /designsetup
1172
-
1173
- # Start building (after OpenSpec planning)
1174
- /pageplan @prd.md # UI tasks only
1175
- /csetup your-feature
1176
- /cdev your-feature
1177
- ```
1178
-
1179
- 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/` folderExtract 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!