@champpaba/claude-agent-kit 1.1.1 โ†’ 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,150 @@
1
+ # Best Practices System
2
+
3
+ > **Detailed guide to auto-generated framework-specific best practices**
4
+ > **Source:** Extracted from CLAUDE.md (Navigation Hub)
5
+ > **Version:** 1.4.0
6
+
7
+ ---
8
+
9
+ ## ๐Ÿ“š How It Works
10
+
11
+ 1. **Run `/agentsetup`** to detect tech stack and generate best practices
12
+ 2. **Context7 queries** latest framework docs (React, Next.js, Prisma, etc.)
13
+ 3. **Best practices files** created in `domain/{project}/best-practices/`
14
+ 4. **Agents auto-discover** project via 3-level indexing
15
+ 5. **Code quality** enforced by framework-specific patterns
16
+
17
+ ---
18
+
19
+ ## Generated Files
20
+
21
+ ```
22
+ .claude/contexts/domain/
23
+ โ”œโ”€โ”€ index.md # Level 1 - Project Registry
24
+ โ””โ”€โ”€ {project}/
25
+ โ”œโ”€โ”€ README.md # Level 2 - Project Overview
26
+ โ”œโ”€โ”€ tech-stack.md # Tech details
27
+ โ””โ”€โ”€ best-practices/
28
+ โ”œโ”€โ”€ index.md # Level 3 - Best Practices Registry
29
+ โ”œโ”€โ”€ react-18.md # โœ… DO's, โŒ DON'Ts, ๐ŸŽฏ Checklist
30
+ โ”œโ”€โ”€ nextjs-15.md
31
+ โ”œโ”€โ”€ prisma-6.md
32
+ โ””โ”€โ”€ vitest-2.md
33
+ ```
34
+
35
+ ---
36
+
37
+ ## Agent Discovery Flow
38
+
39
+ **Every agent follows this sequence (STEP 0):**
40
+
41
+ ```
42
+ 1. Read: domain/index.md โ†’ Get current project name
43
+ 2. Read: domain/{project}/README.md โ†’ Get tech stack
44
+ 3. Read: domain/{project}/best-practices/index.md โ†’ Get relevant files
45
+ 4. Read: domain/{project}/best-practices/{files} โ†’ Load best practices
46
+ 5. Report: "โœ… Project Context Loaded"
47
+ ```
48
+
49
+ **Example: uxui-frontend agent**
50
+ ```
51
+ โœ… Project Context Loaded
52
+
53
+ ๐Ÿ“ Project: my-app
54
+ ๐Ÿ› ๏ธ Stack: Next.js 15, React 18, Prisma 6
55
+ ๐Ÿ“š Best Practices Loaded:
56
+ - React 18 โœ“
57
+ - Next.js 15 โœ“
58
+
59
+ ๐ŸŽฏ Ready to create UI components!
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Design System / Style Guide Generation
65
+
66
+ ### How It Works
67
+
68
+ `/designsetup` **auto-detects** your project context and generates a comprehensive style guide.
69
+
70
+ **Three Smart Paths:**
71
+
72
+ 1. **Path 1: Reference Design** (Priority 1)
73
+ - Detects: `reference/`, `design-reference/`, `designs/` folders
74
+ - Analyzes: HTML files (SingleFile exports), screenshots
75
+ - **Auto-detects design style** (Neo-Brutalism, Minimalist, Modern, etc.)
76
+ - Output: Style guide based on reference design (17 sections, always)
77
+
78
+ 2. **Path 2: Brownfield - Reverse Engineering** (Priority 2)
79
+ - Detects: Existing codebase (> 10 components)
80
+ - Extracts: Colors, spacing, typography, component patterns
81
+ - Output: Style guide reflecting current state + cleanup suggestions
82
+
83
+ 3. **Path 3: Greenfield - AI-Generated** (Priority 3)
84
+ - Detects: Empty project (< 10 components)
85
+ - Asks: Application type (SaaS, Marketing, E-commerce, etc.)
86
+ - Output: Modern, best-practice style guide
87
+
88
+ ### Generated File
89
+
90
+ ```
91
+ design-system/
92
+ โ””โ”€โ”€ STYLE_GUIDE.md โ† Comprehensive 17-section guide
93
+ ```
94
+
95
+ **All 17 Sections (Complete):**
96
+ 1. Overview
97
+ 2. Design Philosophy
98
+ 3. Color Palette (HEX codes, usage, Tailwind classes)
99
+ 4. Typography (headings, body, weights)
100
+ 5. Spacing System (4px/8px grid)
101
+ 6. Component Styles (Button, Card, Input, Badge, etc.)
102
+ 7. Shadows & Elevation
103
+ 8. Animations & Transitions
104
+ 9. Border Styles
105
+ 10. Border Radius
106
+ 11. **Opacity & Transparency** (standalone)
107
+ 12. **Z-Index Layers** (standalone)
108
+ 13. **Responsive Breakpoints** (standalone)
109
+ 14. CSS Variables / Tailwind Theme (Design Tokens in JSON)
110
+ 15. Layout Patterns
111
+ 16. Example Component Reference (React + Tailwind code)
112
+ 17. Additional Sections (Best Practices, Accessibility, Icon System)
113
+
114
+ ### Workflow
115
+
116
+ ```bash
117
+ # Recommended flow:
118
+
119
+ # 1. Generate style guide FIRST (optional but recommended)
120
+ /designsetup
121
+
122
+ # 2. Setup project (discovers style guide)
123
+ /psetup
124
+
125
+ # 3. Start development (agents use STYLE_GUIDE.md)
126
+ /csetup feature-login
127
+ /cdev feature-login
128
+ ```
129
+
130
+ ### Agent Discovery
131
+
132
+ **uxui-frontend agent automatically reads:**
133
+ 1. `design-system/STYLE_GUIDE.md` (if exists) โ† **Priority #1**
134
+ 2. `.claude/contexts/design/*.md` (general principles) โ† Fallback
135
+
136
+ **Why this matters:**
137
+ - โœ… Ensures visual consistency (no hardcoded colors, spacing)
138
+ - โœ… Prevents duplicate components
139
+ - โœ… Enforces accessibility standards
140
+ - โœ… Speeds up development (reuse patterns)
141
+
142
+ ---
143
+
144
+ ## ๐Ÿ”— See Also
145
+
146
+ - `../../commands/agentsetup.md` - /agentsetup command (generates best practices)
147
+ - `../../commands/designsetup.md` - /designsetup command (generates style guide)
148
+ - `../../commands/psetup.md` - /psetup command (one-time project setup)
149
+ - `../../contexts/patterns/agent-discovery.md` - Shared agent discovery flow
150
+ - `context-loading-protocol.md` - How agents load framework-specific context
@@ -0,0 +1,118 @@
1
+ # Context Optimization (v1.2.0)
2
+
3
+ > **Detailed guide to token-efficient loading strategies**
4
+ > **Source:** Extracted from CLAUDE.md (Navigation Hub)
5
+ > **Version:** 1.4.0
6
+
7
+ ---
8
+
9
+ ## โšก The Problem: Token Waste
10
+
11
+ **Before v1.2.0:**
12
+ ```
13
+ /pageplan โ†’ reads STYLE_GUIDE.md (~5K tokens)
14
+ /csetup โ†’ reads STYLE_GUIDE.md (~5K tokens)
15
+ /cdev โ†’ sends STYLE_GUIDE.md (~5K tokens)
16
+ uxui-frontend โ†’ reads STYLE_GUIDE.md (~5K tokens)
17
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
18
+ Total: ~20K tokens (same content read 4 times!)
19
+ ```
20
+
21
+ **After v1.2.0:**
22
+ ```
23
+ /designsetup โ†’ generates STYLE_TOKENS.json (~500 tokens) โœ…
24
+ /pageplan โ†’ reads STYLE_TOKENS.json (~500 tokens) โœ…
25
+ /csetup โ†’ validates files exist (0 tokens) โœ…
26
+ /cdev โ†’ sends reference only (~200 tokens) โœ…
27
+ uxui-frontend โ†’ reads STYLE_TOKENS.json + selective STYLE_GUIDE (~3.5K) โœ…
28
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
29
+ Total: ~4.7K tokens (70% reduction!) โœจ
30
+ ```
31
+
32
+ ---
33
+
34
+ ## The Solution: 3-Tier Loading
35
+
36
+ ### Tier 1: STYLE_TOKENS.json (500 tokens)
37
+
38
+ - Lightweight design tokens only
39
+ - Used by: /pageplan, /csetup, agents
40
+ - Contains: Colors, spacing, typography, shadows
41
+
42
+ **Purpose:** Quick reference for planning and validation
43
+
44
+ ### Tier 2: design-context.md (1K tokens)
45
+
46
+ - Project design summary
47
+ - File paths and quick reference
48
+ - Used by: agents (STEP 0.5)
49
+
50
+ **Purpose:** Agent orientation and file discovery
51
+
52
+ ### Tier 3: STYLE_GUIDE.md (5K tokens)
53
+
54
+ - Full reference with examples
55
+ - Loaded selectively (specific sections only)
56
+ - Used by: agents (when needed)
57
+
58
+ **Purpose:** Complete design system documentation
59
+
60
+ ---
61
+
62
+ ## Document Loading Pattern
63
+
64
+ **See:** `../document-loader.md` for complete unified pattern
65
+
66
+ ### Pattern A: Planning (/pageplan, /csetup)
67
+
68
+ ```typescript
69
+ Read: STYLE_TOKENS.json (~500 tokens)
70
+ Validate: STYLE_GUIDE.md exists (0 tokens)
71
+ Total: ~500 tokens
72
+ ```
73
+
74
+ ### Pattern B: Execution (/cdev)
75
+
76
+ ```typescript
77
+ Send: Design reference (~200 tokens)
78
+ Agent reads: STYLE_TOKENS.json (~500 tokens)
79
+ Total: ~700 tokens
80
+ ```
81
+
82
+ ### Pattern C: Agent (uxui-frontend)
83
+
84
+ ```typescript
85
+ Read: STYLE_TOKENS.json (~500 tokens)
86
+ Read: STYLE_GUIDE sections (~2K tokens, selective)
87
+ Total: ~2.5K tokens
88
+ ```
89
+
90
+ ---
91
+
92
+ ## Benefits
93
+
94
+ | Metric | Before | After | Improvement |
95
+ |--------|--------|-------|-------------|
96
+ | **Token Usage** | ~20K | ~4.7K | 70% reduction |
97
+ | **Speed** | Slow | Fast | 3-4x faster |
98
+ | **Consistency** | Random | Enforced | 100% |
99
+ | **Quality** | Same | Same | Maintained |
100
+
101
+ ---
102
+
103
+ ## Generated Files
104
+
105
+ **/designsetup now creates:**
106
+ 1. `design-system/STYLE_GUIDE.md` (full guide, 17 sections)
107
+ 2. `design-system/STYLE_TOKENS.json` (tokens only) **NEW!**
108
+
109
+ **Agents automatically use both!**
110
+
111
+ ---
112
+
113
+ ## ๐Ÿ”— See Also
114
+
115
+ - `../document-loader.md` - Complete unified loading pattern
116
+ - `../../commands/designsetup.md` - /designsetup command (generates both files)
117
+ - `context-loading-protocol.md` - How agents load context
118
+ - `../../contexts/patterns/ui-component-consistency.md` - Component reuse patterns
@@ -0,0 +1,98 @@
1
+ # Design System / Style Guide Generation
2
+
3
+ > **Detailed guide to auto-generated style guides**
4
+ > **Source:** Extracted from CLAUDE.md (Navigation Hub)
5
+ > **Version:** 1.4.0
6
+
7
+ ---
8
+
9
+ ## ๐ŸŽจ How It Works
10
+
11
+ `/designsetup` **auto-detects** your project context and generates a comprehensive style guide.
12
+
13
+ **Three Smart Paths:**
14
+
15
+ 1. **Path 1: Reference Design** (Priority 1)
16
+ - Detects: `reference/`, `design-reference/`, `designs/` folders
17
+ - Analyzes: HTML files (SingleFile exports), screenshots
18
+ - **Auto-detects design style** (Neo-Brutalism, Minimalist, Modern, etc.)
19
+ - Output: Style guide based on reference design (17 sections, always)
20
+
21
+ 2. **Path 2: Brownfield - Reverse Engineering** (Priority 2)
22
+ - Detects: Existing codebase (> 10 components)
23
+ - Extracts: Colors, spacing, typography, component patterns
24
+ - Output: Style guide reflecting current state + cleanup suggestions
25
+
26
+ 3. **Path 3: Greenfield - AI-Generated** (Priority 3)
27
+ - Detects: Empty project (< 10 components)
28
+ - Asks: Application type (SaaS, Marketing, E-commerce, etc.)
29
+ - Output: Modern, best-practice style guide
30
+
31
+ ---
32
+
33
+ ## Generated File
34
+
35
+ ```
36
+ design-system/
37
+ โ””โ”€โ”€ STYLE_GUIDE.md โ† Comprehensive 17-section guide
38
+ ```
39
+
40
+ **All 17 Sections (Complete):**
41
+ 1. Overview
42
+ 2. Design Philosophy
43
+ 3. Color Palette (HEX codes, usage, Tailwind classes)
44
+ 4. Typography (headings, body, weights)
45
+ 5. Spacing System (4px/8px grid)
46
+ 6. Component Styles (Button, Card, Input, Badge, etc.)
47
+ 7. Shadows & Elevation
48
+ 8. Animations & Transitions
49
+ 9. Border Styles
50
+ 10. Border Radius
51
+ 11. **Opacity & Transparency** (standalone)
52
+ 12. **Z-Index Layers** (standalone)
53
+ 13. **Responsive Breakpoints** (standalone)
54
+ 14. CSS Variables / Tailwind Theme (Design Tokens in JSON)
55
+ 15. Layout Patterns
56
+ 16. Example Component Reference (React + Tailwind code)
57
+ 17. Additional Sections (Best Practices, Accessibility, Icon System)
58
+
59
+ ---
60
+
61
+ ## Workflow
62
+
63
+ ```bash
64
+ # Recommended flow:
65
+
66
+ # 1. Generate style guide FIRST (optional but recommended)
67
+ /designsetup
68
+
69
+ # 2. Setup project (discovers style guide)
70
+ /psetup
71
+
72
+ # 3. Start development (agents use STYLE_GUIDE.md)
73
+ /csetup feature-login
74
+ /cdev feature-login
75
+ ```
76
+
77
+ ---
78
+
79
+ ## Agent Discovery
80
+
81
+ **uxui-frontend agent automatically reads:**
82
+ 1. `design-system/STYLE_GUIDE.md` (if exists) โ† **Priority #1**
83
+ 2. `.claude/contexts/design/*.md` (general principles) โ† Fallback
84
+
85
+ **Why this matters:**
86
+ - โœ… Ensures visual consistency (no hardcoded colors, spacing)
87
+ - โœ… Prevents duplicate components
88
+ - โœ… Enforces accessibility standards
89
+ - โœ… Speeds up development (reuse patterns)
90
+
91
+ ---
92
+
93
+ ## ๐Ÿ”— See Also
94
+
95
+ - `../../commands/designsetup.md` - /designsetup command (generates style guide)
96
+ - `context-optimization.md` - 3-tier loading strategy (STYLE_TOKENS.json)
97
+ - `../../contexts/design/index.md` - General design principles (fallback)
98
+ - `../../contexts/patterns/ui-component-consistency.md` - Component reuse patterns
@@ -0,0 +1,147 @@
1
+ # Page Planning System
2
+
3
+ > **Detailed guide to /pageplan command**
4
+ > **Source:** Extracted from CLAUDE.md (Navigation Hub)
5
+ > **Version:** 1.4.0
6
+
7
+ ---
8
+
9
+ ## ๐Ÿ“‹ What is /pageplan?
10
+
11
+ **Problem it solves:**
12
+ - โŒ Before: Agent creates UI without knowing existing components โ†’ duplicates Navbar 3 times
13
+ - โŒ Before: Agent uses random colors, spacing โ†’ Landing page `#0d7276`, Dashboard `#4f46e5` (inconsistent!)
14
+ - โŒ Before: Agent uses lorem ipsum โ†’ No real content
15
+
16
+ **Solution: /pageplan command**
17
+ - โœ… Searches existing components BEFORE implementing
18
+ - โœ… Generates component reuse plan (Navbar โœ… reuse, HeroSection โŒ create)
19
+ - โœ… AI drafts real content from PRD (headlines, descriptions)
20
+ - โœ… Creates asset checklist for user to prepare (images, icons)
21
+
22
+ ---
23
+
24
+ ## How It Works
25
+
26
+ ```bash
27
+ # Step 1: OpenSpec generates proposal
28
+ User: "Build landing page"
29
+ โ†’ proposal.md + tasks.md
30
+
31
+ # Step 2: Generate page plan
32
+ User: /pageplan @prd.md @project_brief.md
33
+
34
+ Main Claude:
35
+ 1. Reads user-specified files (@prd.md, @brief.md)
36
+ 2. Reads proposal.md (technical architecture)
37
+ 3. Reads STYLE_GUIDE.md (visual design)
38
+ 4. Searches existing components (Glob/Grep)
39
+ 5. Generates: .changes/{id}/page-plan.md
40
+ - ๐Ÿ”„ Reuse: Navbar, Footer (found)
41
+ - โœ… New: HeroSection, FeatureGrid (create)
42
+ - ๐Ÿ“ Content draft (AI-generated from PRD)
43
+ - ๐Ÿ“ฆ Asset checklist (user prepares)
44
+
45
+ # Step 3: User reviews & prepares
46
+ โ†’ Edit content draft
47
+ โ†’ Prepare assets (images, icons)
48
+ โ†’ Approve page-plan.md
49
+
50
+ # Step 4: Setup & implement
51
+ User: /csetup landing-page
52
+ User: /cdev landing-page
53
+
54
+ โ†’ uxui-frontend agent:
55
+ - STEP 0.5: Reads page-plan.md โœ…
56
+ - STEP 3: SKIP component search (page-plan did it!) โšก
57
+ - Implements: Reuse Navbar, create HeroSection
58
+ - Uses: Real content from page-plan
59
+ - References: Assets user prepared
60
+ ```
61
+
62
+ ---
63
+
64
+ ## page-plan.md Structure
65
+
66
+ ```markdown
67
+ # Page Plan: Landing Page
68
+
69
+ ## 1. Component Plan
70
+ ๐Ÿ”„ Reuse: Navbar, Footer (found in codebase)
71
+ โœ… New Shared: (none)
72
+ โœ… New Specific: HeroSection, FeatureGrid, TestimonialCarousel
73
+
74
+ ## 2. Page Structure
75
+ <Layout>
76
+ <Navbar /> {/* Reuse */}
77
+ <HeroSection /> {/* New - content below */}
78
+ <FeatureGrid /> {/* New - content below */}
79
+ <Footer /> {/* Reuse */}
80
+ </Layout>
81
+
82
+ ## 3. Assets to Prepare (เธ„เธธเธ“เธ•เน‰เธญเธ‡เน€เธ•เธฃเธตเธขเธก)
83
+ - [ ] hero-image.jpg (1920x1080)
84
+ - [ ] logo.svg (200x60)
85
+ - [ ] feature-icons (3x 24x24 SVG)
86
+
87
+ ## 4. Content Draft (AI-Generated - เธเธฃเธธเธ“เธฒ Review & Edit)
88
+ **Headline:** "Master TOEIC with AI-Powered Tests"
89
+ **Subheadline:** "Experience exam-quality questions..."
90
+ **CTA:** "Start Free Test"
91
+ ...
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Benefits
97
+
98
+ | Before (No page-plan) | After (With page-plan) |
99
+ |----------------------|------------------------|
100
+ | โŒ Agent guesses structure | โœ… Clear structure defined |
101
+ | โŒ Duplicate components | โœ… Reuse existing components |
102
+ | โŒ Inconsistent design | โœ… Sync with STYLE_GUIDE |
103
+ | โŒ Lorem ipsum content | โœ… Real content from PRD |
104
+ | โŒ Missing assets | โœ… Asset checklist prepared |
105
+ | โŒ Agent wastes time searching | โœ… Search done once upfront (25% faster) |
106
+
107
+ ---
108
+
109
+ ## When to Use
110
+
111
+ ```
112
+ โœ… Use /pageplan for:
113
+ - Landing pages
114
+ - Dashboards
115
+ - Multi-section UI pages
116
+ - Any task with multiple components
117
+
118
+ โŒ Skip /pageplan for:
119
+ - Backend API endpoints
120
+ - Database schemas
121
+ - Simple single-component tasks
122
+ - Non-UI work
123
+ ```
124
+
125
+ ---
126
+
127
+ ## Integration with STYLE_GUIDE
128
+
129
+ ```
130
+ STYLE_GUIDE.md โ†’ Visual design (colors, spacing, shadows)
131
+ page-plan.md โ†’ Content structure (sections, components, assets)
132
+
133
+ uxui-frontend agent combines both:
134
+ - Colors from STYLE_GUIDE (#0d7276)
135
+ - Content from page-plan ("Master TOEIC...")
136
+ - Result: Consistent + Real content
137
+ ```
138
+
139
+ ---
140
+
141
+ ## ๐Ÿ”— See Also
142
+
143
+ - `../../commands/pageplan.md` - /pageplan command implementation
144
+ - `../../commands/designsetup.md` - /designsetup command (generates STYLE_GUIDE.md)
145
+ - `../../contexts/patterns/ui-component-consistency.md` - Component reuse patterns
146
+ - `../../contexts/patterns/frontend-component-strategy.md` - When to create vs reuse
147
+ - `../document-loader.md` - Token-efficient loading patterns