Package Exports
- @champpaba/claude-agent-kit
- @champpaba/claude-agent-kit/bin/cli.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@champpaba/claude-agent-kit) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Claude Agent Kit
๐ค Multi-Agent Implementation Engine - The perfect companion for OpenSpec spec-driven development
๐ฏ What is this?
Claude Agent Kit picks up where OpenSpec planning ends.
While OpenSpec handles alignment (Draft Proposal โ Review & Align), Claude Agent Kit handles implementation (Implement Tasks โ Archive & Update) with specialized AI agents.
The Complete Workflow
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ OpenSpec Planning โ
โ (Spec-Driven Development for AI Coding Assistants) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
Generates: proposal.md + tasks.md
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Claude Agent Kit Implementation โ
โ (Multi-Agent Execution with 6 Specialists) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
Completes: All tasks with quality gates๐ How They Work Together
| Stage | Tool | What Happens | Output |
|---|---|---|---|
| 1. Draft Proposal | OpenSpec | Human requests change, AI scaffolds structure | proposal.md + tasks.md |
| 2. Review & Align | OpenSpec | Team iterates until consensus | Approved specs |
| 2.5. Page Planning | Claude Agent Kit | (UI tasks only) Generate content & component plan | page-plan.md |
| 3. Setup Context | Claude Agent Kit | Classify tasks, generate workflow | workflow.md |
| 4. Implement Tasks | Claude Agent Kit | 6 specialized agents execute work | Working code + tests |
| 5. Archive & Update | OpenSpec | Merge changes back to specs | Updated specs/ |
What OpenSpec Generates
proposal.md - Business case and scope
# Change Proposal: User Authentication System
## Motivation
Users need secure login functionality...
## Scope
- Email/password authentication
- JWT token generation
- Protected routes middlewaretasks.md - Implementation checklist
## Database Setup
- [ ] Create User model with email, password fields
- [ ] Add unique constraint on email
## Backend Implementation
- [ ] POST /api/auth/login endpoint
- [ ] Password hashing with bcrypt
- [ ] JWT token generation
## Frontend Implementation
- [ ] Login form component
- [ ] Form validation
- [ ] Token storageWhat Claude Agent Kit Does
Input: Reads proposal.md + tasks.md from OpenSpec
Process:
/pageplan(UI tasks only) - Generate content & component reuse plan/csetup {change-id}- Analyze tasks, classify by agent, generate workflow/cdev {change-id}- Execute with 6 specialized agents in phases:- Phase 1: UI with mock data (uxui-frontend)
- Phase 2: Real API + database (backend + database, parallel)
- Phase 2.5: Validate contracts (integration)
- Phase 3: Connect UI to API (frontend)
- Phase 4: Tests + bug fixes (test-debug)
Output: Working implementation ready for review
๐จ NEW: Page Planning for UI Tasks
Problem: Before /pageplan, agents would:
- โ Create duplicate components (3 different Navbar components!)
- โ Use inconsistent colors (
#0d7276on landing,#4f46e5on dashboard) - โ Generate lorem ipsum instead of real content
- โ Waste time searching for components during implementation
Solution: /pageplan command analyzes BEFORE implementing
How It Works
# Step 1: OpenSpec generates tasks
User: "Build landing page for TOEIC app"
โ Creates: .changes/landing-page/proposal.md + tasks.md
# Step 2: Generate page plan (NEW!)
User: /pageplan @prd.md @project_brief.md
# What it does:
# 1. Reads user-specified files (PRD, brief)
# 2. Reads proposal.md (technical architecture)
# 3. Reads STYLE_GUIDE.md (visual design)
# 4. Searches existing components (Navbar, Footer, etc.)
# 5. AI drafts real content from PRD
# 6. Generates: .changes/landing-page/page-plan.mdpage-plan.md Output
# Page Plan: Landing Page
## 1. Component Plan
๐ Reuse: Navbar, Footer (found in codebase)
โ
New Shared: (none)
โ
New Specific: HeroSection, FeatureGrid, TestimonialCarousel
## 2. Page Structure
<Layout>
<Navbar /> {/* Reuse */}
<HeroSection /> {/* New - see content below */}
<FeatureGrid />
<TestimonialCarousel />
<Footer /> {/* Reuse */}
</Layout>
## 3. Assets to Prepare
- [ ] hero-image.jpg (1920x1080)
- [ ] logo.svg (200x60)
- [ ] feature-icons (3x 24x24 SVG)
## 4. Content Draft (AI-Generated - Please Review & Edit)
**Headline:** "Master TOEIC with AI-Powered Tests"
**Subheadline:** "Experience exam-quality questions with instant AI scoring"
**CTA:** "Start Free Test"
**Features:**
- Real TOEIC-style questions
- Instant AI scoring
- Progress tracking dashboardStep 3: User Prepares
- โ Review content draft (edit as needed)
- โ Prepare assets (images, icons)
- โ
Approve
page-plan.md
Step 4: Implementation
/csetup landing-page
/cdev landing-page
# uxui-frontend agent automatically:
# - STEP 0.5: Reads page-plan.md โ
# - STEP 3: SKIP component search (already done!) โก 25% faster
# - Uses: Real content from page-plan
# - Reuses: Navbar, Footer (no duplicates)
# - Creates: HeroSection, FeatureGrid, TestimonialCarousel
# - Applies: Colors/spacing from STYLE_GUIDE.mdBenefits
| Before (No page-plan) | After (With page-plan) |
|---|---|
| โ Agent searches during implementation | โ Search done once upfront (25% faster) |
| โ Duplicate components created | โ Clear reuse plan |
| โ Lorem ipsum content | โ Real content from PRD |
| โ Missing assets mid-work | โ Asset checklist prepared |
| โ Inconsistent design | โ Synced with STYLE_GUIDE |
| โ Agent guesses structure | โ Clear component hierarchy |
When to Use /pageplan
โ
Use for:
- Landing pages
- Dashboards
- Multi-section UI pages
- Any task with multiple components
โ Skip for:
- Backend API endpoints
- Database schemas
- Single-component tasks
- Non-UI work๐ค The 6 Specialized Agents
| Agent | Color | Responsibility | Phase |
|---|---|---|---|
| uxui-frontend | ๐ต Blue | Design UI components with mock data | 1 |
| backend | ๐ฃ Purple | Create API endpoints with validation | 2 |
| database | ๐ฉท Pink | Design schemas, migrations, queries | 2 |
| integration | ๐ Orange | Validate API contracts before connecting | 2.5 |
| frontend | ๐ข Green | Connect UI to backend APIs | 3 |
| test-debug | ๐ด Red | Run tests and fix bugs (max 3-4 iterations) | 1,3,4 |
Each agent:
- โ Auto-discovers your project context (tech stack, best practices)
- โ Follows framework-specific patterns from Context7 MCP
- โ Maintains design consistency across the codebase
- โ Reports progress with detailed logging
๐ฆ Installation
npm install -g @champpaba/claude-agent-kitAlternative Package Managers
# Using pnpm
pnpm add -g @champpaba/claude-agent-kit
# Using yarn
yarn global add @champpaba/claude-agent-kit๐ Quick Start (with OpenSpec)
Step 1: OpenSpec Planning
# In your OpenSpec-enabled project
cd my-app
# Draft a change proposal (OpenSpec handles this)
"I want to build a landing page for my TOEIC app"
# โ Generates: .changes/landing-page/proposal.md + tasks.mdStep 2: Initialize Claude Agent Kit
# Initialize the agent system
cak init
# Setup project context (detects tech stack)
# In Claude Code:
/psetupStep 3: Generate Page Plan (UI tasks only)
# In Claude Code:
/pageplan @prd.md @project_brief.md
# โ Generates: .changes/landing-page/page-plan.md
# โ Review content, prepare assetsStep 4: Setup Change Context
/csetup landing-pageWhat happens:
- Reads
.changes/landing-page/proposal.md(business context) - Reads
.changes/landing-page/tasks.md(implementation checklist) - Reads
.changes/landing-page/page-plan.md(if exists - content plan) - Classifies tasks by agent (database, backend, frontend, etc.)
- Generates
workflow.md(execution plan)
Step 5: Execute Implementation
/cdev landing-pageWhat happens:
- Phase 1: uxui-frontend reads
page-plan.mdโ creates UI with real content - Phase 2: backend + database create APIs + models (parallel, if needed)
- Phase 2.5: integration validates API contracts
- Phase 3: frontend connects UI to APIs (if needed)
- Phase 4: test-debug runs tests, fixes bugs
Step 6: Monitor Progress
# View detailed progress
/cview landing-page
# Quick status check
/cstatus landing-page
# โ Phase 1/4 - UI Implementation (100%)๐ฏ Complete Workflow Examples
Workflow A: UI Feature (with /pageplan)
# 1. OpenSpec Planning
User: "Build landing page for TOEIC app"
โ Creates: proposal.md + tasks.md
# 2. Page Planning (NEW!)
/pageplan @prd.md @project_brief.md
โ Creates: page-plan.md
โ User reviews content & prepares assets
# 3. Setup Context
/csetup landing-page
โ Reads: proposal.md, tasks.md, page-plan.md
โ Generates: workflow.md
# 4. Implementation
/cdev landing-page
โ uxui-frontend reads page-plan.md (STEP 0.5)
โ Skips redundant component search
โ Uses real content + reuse plan
โ 25% faster implementation
# 5. Monitor
/cview landing-pageWorkflow B: Backend Feature (skip /pageplan)
# 1. OpenSpec Planning
User: "Add payment processing API"
โ Creates: proposal.md + tasks.md
# 2. Setup Context (skip /pageplan - not UI work)
/csetup payment-api
# 3. Implementation
/cdev payment-api
โ Phase 2: backend + database agents (parallel)
โ Phase 2.5: integration validates contracts
โ Phase 3: frontend connects (if UI exists)
โ Phase 4: test-debug validates
# 4. Monitor
/cview payment-apiWorkflow C: Full-Stack Feature (with /pageplan)
# 1. OpenSpec Planning
User: "Build user authentication system"
โ Creates: proposal.md + tasks.md
# 2. Page Planning (for login UI only)
/pageplan @prd.md
โ Creates: page-plan.md (login form content + components)
# 3. Setup Context
/csetup auth-system
# 4. Implementation
/cdev auth-system
โ Phase 1: uxui-frontend (login form, reads page-plan.md)
โ Phase 2: backend (POST /api/auth/login) + database (User model)
โ Phase 2.5: integration (validate contract)
โ Phase 3: frontend (connect form to API)
โ Phase 4: test-debug (E2E tests)
# 5. Monitor
/cview auth-system๐ Project Structure After Init
your-project/
โโโ openspec/
โ โโโ specs/ # Source of truth (OpenSpec)
โ โโโ changes/
โ โโโ landing-page/
โ โโโ proposal.md โ OpenSpec generates
โ โโโ tasks.md โ OpenSpec generates
โ โโโ page-plan.md โ /pageplan generates (UI tasks)
โ โโโ workflow.md โ /csetup generates
โ โโโ flags.json โ /cdev tracks progress
โ
โโโ design-system/
โ โโโ STYLE_GUIDE.md โ /designsetup generates
โ
โโโ .claude/
โโโ CLAUDE.md # Navigation guide
โ
โโโ agents/ # 6 specialized agents
โ โโโ 01-integration.md
โ โโโ 02-uxui-frontend.md
โ โโโ 03-test-debug.md
โ โโโ 04-frontend.md
โ โโโ 05-backend.md
โ โโโ 06-database.md
โ
โโโ commands/ # Slash commands
โ โโโ designsetup.md # Generate style guide
โ โโโ pageplan.md # Generate page plan (NEW!)
โ โโโ psetup.md # Project setup
โ โโโ csetup.md # Change setup
โ โโโ cdev.md # Change development
โ โโโ cview.md # View progress
โ โโโ cstatus.md # Quick status
โ
โโโ contexts/
โ โโโ design/ # Design foundation
โ โโโ patterns/ # Universal patterns
โ โโโ domain/ # Project context
โ
โโโ lib/ # Implementation logic
โโโ agent-executor.md
โโโ tdd-classifier.md
โโโ flags-updater.md
โโโ agent-router.md๐ฏ Why Use Claude Agent Kit?
Without Claude Agent Kit (Manual Implementation)
โ You manually interpret tasks.md
โ You context-switch between frontend/backend/database
โ You might forget edge cases or tests
โ Inconsistent code patterns across features
โ No systematic error handling
โ Duplicate components everywhere
โ Lorem ipsum content in UIWith Claude Agent Kit
โ
Agents auto-classify and execute tasks
โ
Each agent focuses on its specialty
โ
Built-in validation gates (integration agent)
โ
Consistent patterns via auto-discovery
โ
Automatic retry with escalation
โ
Component reuse plan (/pageplan)
โ
Real content from PRD
โ
25% faster UI implementation๐ Key Features
โ Seamless OpenSpec Integration
- Reads
proposal.mdfor business context - Parses
tasks.mdfor implementation checklist - Generates
page-plan.mdfor UI tasks (NEW!) - Tracks progress in
flags.json - Updates completion status back to OpenSpec
โ Auto-Generated Best Practices
Uses Context7 MCP to fetch latest framework docs:
/psetup
# โ Detects: Next.js 15, React 18, Prisma 6
# โ Generates: .claude/contexts/domain/{project}/best-practices/
# - nextjs-15.md
# - react-18.md
# - prisma-6.mdโ 3-Level Project Indexing
Agents auto-discover context:
1. Read: domain/index.md โ Get current project
2. Read: domain/{project}/README.md โ Get tech stack
3. Read: domain/{project}/best-practices/index.md โ Load patternsโ Design Foundation
Universal design principles:
- Color theory (WCAG AAA contrast)
- Typography scales
- 8px spacing grid (8, 16, 24, 32, 40, 48px)
- 4-level shadow system
- Box thinking framework
- Accessibility (WCAG 2.1 AA)
โ Quality Gates
- TDD for critical paths (auth, payments, data transforms)
- Test-alongside for simple code (CRUD, UI components)
- Max 3-4 retry iterations before escalation
- Integration validation before connecting UI to API
๐ง CLI Commands
cak init
Initialize agent system in current project
cak init
cak init --force # Overwrite existing .claude/Creates:
.claude/folder with 6 agents- Slash commands (
/psetup,/csetup,/cdev, etc.) - Universal patterns & design foundation
cak update
Update to latest agent templates
cak update
cak update --backup # Create .claude.backup/ firstWhat it does:
- Updates all template files to latest version
- Preserves your customizations in
domain/ - Creates backup before updating (with
--backupflag)
cak --version
Show version number
cak --version
# โ 1.0.0cak --help
Display help information
cak --help๐ Workflow Commands (in Claude Code)
/designsetup - Generate style guide (one-time)
/designsetupAuto-detects from:
reference/folder โ Extract design from HTML/screenshots- Existing codebase โ Reverse engineer patterns
- AI generation โ Modern best practices
Creates: design-system/STYLE_GUIDE.md
/pageplan - Generate page plan (UI tasks only) ๐
/pageplan @prd.md @project_brief.mdWhat it does:
- Reads user-specified files (PRD, brief)
- Reads
proposal.md+STYLE_GUIDE.md - Searches existing components
- AI drafts real content from PRD
- Generates asset checklist
Creates: page-plan.md
- Component reuse plan (๐ Reuse vs โ New)
- Page structure (component hierarchy)
- Assets to prepare (images, icons)
- Content draft (headlines, descriptions)
/psetup - Setup project (one-time)
/psetupWhat it does:
- Detects tech stack (Next.js, React, Prisma, etc.)
- Creates
domain/{project}/README.md - Generates best practices via Context7 MCP
/csetup {change-id} - Setup change context
/csetup landing-pageWhat it does:
- Reads
proposal.md(business context) - Reads
tasks.md(implementation checklist) - Reads
page-plan.md(if exists - UI content plan) - Classifies tasks by agent
- Generates
workflow.md(execution plan)
/cdev {change-id} - Execute implementation
/cdev landing-pageWhat it does:
- Runs agents in phases (1 โ 2 โ 2.5 โ 3 โ 4)
- uxui-frontend auto-reads
page-plan.md(STEP 0.5) - Updates
flags.json(progress tracking) - Reports completion status
/cview {change-id} - View detailed progress
/cview landing-pageShows:
- Completed/pending tasks
- Agent activity log
- Current phase
- Error messages (if any)
/cstatus {change-id} - Quick status
/cstatus landing-page
# โ Phase 2/4 - Backend Implementation (75%)๐จ Design System Integration
Auto-Generate Style Guide
/designsetupDetection priority:
- reference/ folder (HTML/screenshots) โ Extract design style
- Existing codebase (>10 components) โ Reverse engineer patterns
- AI generation โ Modern best practices
Output: design-system/STYLE_GUIDE.md
17 Comprehensive Sections:
- Overview
- Design Philosophy
- Color Palette (HEX codes, usage, Tailwind classes)
- Typography (headings, body, weights)
- Spacing System (4px/8px grid)
- Component Styles (Button, Card, Input, Badge, etc.)
- Shadows & Elevation
- Animations & Transitions
- Border Styles
- Border Radius
- Opacity & Transparency
- Z-Index Layers
- Responsive Breakpoints
- CSS Variables / Tailwind Theme (Design Tokens)
- Layout Patterns
- Example Component Reference (React + Tailwind code)
- Additional Sections (Best Practices, Accessibility, Icon System)
Agents automatically use STYLE_GUIDE.md for:
- Color palette (no hardcoded colors)
- Spacing scale (consistent gaps/padding)
- Typography (font hierarchy)
- Component patterns (reuse before create)
๐งช Testing Philosophy
Agents follow TDD classification:
| Code Type | Approach | Example |
|---|---|---|
| Critical paths | TDD (Red-Green-Refactor) | Auth logic, payments, calculations |
| Simple code | Test-alongside | CRUD, UI components, config |
Test-debug agent:
- Runs tests automatically after implementation
- Fixes bugs (max 3-4 iterations)
- Escalates if stuck (reports to user)
๐ง Supported Tech Stacks
Agents auto-detect your stack via Context7 MCP:
Frontend:
- Next.js, React, Vue, Svelte, Angular
Backend:
- FastAPI, Express, NestJS, Django, Flask, Next.js API Routes
Database:
- Prisma, SQLAlchemy, TypeORM, Drizzle
Testing:
- Vitest, Jest, Pytest, Playwright
๐ Usage Examples
Example 1: Simple UI Task (with /pageplan)
# In Claude Code
"Build a user profile page with edit functionality"
# If it's a UI task, optionally run:
/pageplan @prd.md
# Then execute:
/csetup profile-page
/cdev profile-pageClaude will:
- Read
task-classification.md - Select agents:
uxui-frontendโbackendโfrontendโtest-debug - uxui-frontend reads
page-plan.md(if exists) - Execute in sequence
- Report completion
Example 2: Complex Multi-Agent Workflow (OpenSpec)
Using OpenSpec workflow:
# 1. OpenSpec generates proposal + tasks
"I want to add a dashboard with analytics"
# โ proposal.md + tasks.md created
# 2. Generate page plan
/pageplan @prd.md @analytics_spec.md
# 3. Setup change context
/csetup analytics-dashboard
# 4. Start development
/cdev analytics-dashboard
# 5. View progress
/cview analytics-dashboardThis follows a structured 4-phase approach:
- Phase 1: UI with mock data (uxui-frontend reads page-plan.md)
- Phase 2: Real API + database (backend + database)
- Phase 2.5: Validate contracts (integration)
- Phase 3: Connect UI to API (frontend)
- Phase 4: Tests + bug fixes (test-debug)
๐ Updating to Latest Version
Method 1: Update the npm package
npm update -g @champpaba/claude-agent-kitMethod 2: Update template in project
cd your-project
cak update --backupThis will:
- Create backup at
.claude.backup/ - Update all template files
- Preserve your customizations in
domain/
๐ฏ Customization
Add Project-Specific Context
After running cak init, add your own context files:
mkdir -p .claude/contexts/domain/my-projectExample: E-commerce checkout flow
<!-- .claude/contexts/domain/my-project/checkout-flow.md -->
# Checkout Flow
## Steps
1. Cart review
2. Shipping address
3. Payment method
4. Order confirmation
## Business Rules
- Free shipping over $50
- Tax calculation by state
- Inventory check before paymentAgents will auto-discover and use these patterns.
๐ Ecosystem
Claude Agent Kit works with:
| Tool | Purpose | Integration |
|---|---|---|
| OpenSpec | Spec-driven planning | Reads proposal.md + tasks.md |
| Context7 MCP | Always-updated docs | Auto-generates best practices |
| Claude Code | AI coding assistant | Execution environment |
๐ค Contributing
We welcome contributions!
- Report bugs: GitHub Issues
- Feature requests: Discussions
- Pull requests: Follow CONTRIBUTING.md
๐ License
MIT License - see LICENSE
๐ Credits
Built with:
- OpenSpec - Spec-driven development framework
- Claude Code - AI coding assistant
- Context7 MCP - Always up-to-date library docs
๐ Links
- npm Package: https://www.npmjs.com/package/@champpaba/claude-agent-kit
- GitHub: https://github.com/ChampPABA/claude-multi-agent-template
- OpenSpec: https://github.com/Fission-AI/OpenSpec
- Issues: https://github.com/ChampPABA/claude-multi-agent-template/issues
๐ก Quick Tips
- Run
/designsetupFIRST - Ensures visual consistency from day 1 - Use
/pageplanfor UI tasks - 25% faster implementation, better content - Review
page-plan.mdbefore/cdev- Edit content, prepare assets - Setup Context7 MCP - Agents get latest framework docs automatically
- Use OpenSpec for complex features - Better alignment before implementation
- Monitor with
/cview- See exactly what agents are doing - Always use
--backupwhen updating - Protects your customizations
๐ Complete Flow Summary
1๏ธโฃ OpenSpec Planning
โ proposal.md + tasks.md
2๏ธโฃ Generate Style Guide (one-time)
/designsetup
โ STYLE_GUIDE.md
3๏ธโฃ Setup Project (one-time)
/psetup
โ domain/{project}/best-practices/
4๏ธโฃ Generate Page Plan (UI tasks only)
/pageplan @prd.md
โ page-plan.md (content + component plan)
5๏ธโฃ Setup Change Context
/csetup {change-id}
โ workflow.md
6๏ธโฃ Execute Implementation
/cdev {change-id}
โ Working code + tests
7๏ธโฃ Monitor Progress
/cview {change-id}
โ Detailed progress report
8๏ธโฃ OpenSpec Archive & Update
โ Merge to specs/Ready to implement with confidence? ๐
# Install globally
npm install -g @champpaba/claude-agent-kit
# Initialize in your project
cd your-project
cak init
# Setup project context
/psetup
# Generate style guide (optional but recommended)
/designsetup
# Start building (after OpenSpec planning)
/pageplan @prd.md # UI tasks only
/csetup your-feature
/cdev your-featureLet specialized agents handle implementation while you focus on specs and architecture!