@champpaba/claude-agent-kit 2.1.1 → 2.1.3
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/.claude/agents/02-uxui-frontend.md +7 -0
- package/.claude/agents/04-frontend.md +7 -0
- package/.claude/agents/05-backend.md +7 -1
- package/.claude/agents/06-database.md +7 -1
- package/.claude/agents/_shared/pre-work-checklist.md +60 -3
- package/.claude/commands/cdev.md +56 -1
- package/README.md +6 -0
- package/package.json +1 -1
|
@@ -18,6 +18,13 @@ color: blue
|
|
|
18
18
|
|
|
19
19
|
Complete these steps before implementation:
|
|
20
20
|
|
|
21
|
+
0. **Library Requirements Check**
|
|
22
|
+
- Review `tasks.md` for "Install X", "Configure X" patterns
|
|
23
|
+
- Review `design.md` for "D1: Use X Library" decisions
|
|
24
|
+
- Use the specified libraries (WHY: team chose them for specific reasons)
|
|
25
|
+
- Example: tasks.md says "Install shadcn/ui" → Use shadcn components, follow its docs
|
|
26
|
+
|
|
27
|
+
|
|
21
28
|
1. **Context Discovery** - Load project context (STEP 0)
|
|
22
29
|
2. **Design Loading** - Load style guide or design principles (STEP 0.5)
|
|
23
30
|
3. **Component Search** - Check existing components (STEP 3)
|
|
@@ -18,6 +18,13 @@ color: green
|
|
|
18
18
|
|
|
19
19
|
Complete these steps before implementation:
|
|
20
20
|
|
|
21
|
+
0. **Library Requirements Check**
|
|
22
|
+
- Review `tasks.md` for "Install X", "Configure X" patterns
|
|
23
|
+
- Review `design.md` for "D1: Use X Library" decisions
|
|
24
|
+
- Use the specified libraries (WHY: team chose them for specific reasons)
|
|
25
|
+
- Example: tasks.md says "Install react-query" → Use react-query, follow its docs
|
|
26
|
+
|
|
27
|
+
|
|
21
28
|
1. **Pattern Loading** - Load error-handling, state management patterns
|
|
22
29
|
2. **UI Review** - Read existing UI components (from uxui-frontend)
|
|
23
30
|
3. **API Review** - Read API endpoints (from backend/integration)
|
|
@@ -7,7 +7,7 @@ color: cyan
|
|
|
7
7
|
|
|
8
8
|
# Backend Agent
|
|
9
9
|
|
|
10
|
-
> **Version:** 2.
|
|
10
|
+
> **Version:** 2.1.2 (Instruction-based Library Detection)
|
|
11
11
|
> **Role:** Create API endpoints with validation, business logic, and error handling.
|
|
12
12
|
|
|
13
13
|
---
|
|
@@ -18,6 +18,12 @@ color: cyan
|
|
|
18
18
|
|
|
19
19
|
Complete these steps before implementation:
|
|
20
20
|
|
|
21
|
+
0. **Library Requirements Check**
|
|
22
|
+
- Review `tasks.md` for "Install X", "Configure X" patterns
|
|
23
|
+
- Review `design.md` for "D1: Use X Library" decisions
|
|
24
|
+
- Use the specified libraries (WHY: team chose them for specific reasons)
|
|
25
|
+
- Example: tasks.md says "Install better-auth" → Use better-auth, follow its docs
|
|
26
|
+
|
|
21
27
|
1. **Pattern Loading** - Load error-handling, logging, testing patterns
|
|
22
28
|
2. **Endpoint Search** - Check for existing similar endpoints
|
|
23
29
|
3. **TDD Plan** - If TDD required, plan test cases first
|
|
@@ -7,7 +7,7 @@ color: pink
|
|
|
7
7
|
|
|
8
8
|
# Database Agent
|
|
9
9
|
|
|
10
|
-
> **Version:** 2.
|
|
10
|
+
> **Version:** 2.1.2 (Instruction-based Library Detection)
|
|
11
11
|
> **Role:** Design schemas, create migrations, write complex queries, optimize performance.
|
|
12
12
|
|
|
13
13
|
---
|
|
@@ -18,6 +18,12 @@ color: pink
|
|
|
18
18
|
|
|
19
19
|
Complete these steps before implementation:
|
|
20
20
|
|
|
21
|
+
0. **Library Requirements Check**
|
|
22
|
+
- Review `tasks.md` for "Install X", "Configure X" patterns
|
|
23
|
+
- Review `design.md` for "D1: Use X Library" decisions
|
|
24
|
+
- Use the specified libraries (WHY: team chose them for specific reasons)
|
|
25
|
+
- Example: design.md says "Use Drizzle ORM" → Use Drizzle, follow its docs
|
|
26
|
+
|
|
21
27
|
1. **Pattern Loading** - Load ORM patterns from Context7
|
|
22
28
|
2. **Schema Search** - Check existing models/schemas
|
|
23
29
|
3. **Design Plan** - Plan tables, relationships, indexes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Pre-Work Checklist (Shared by All Agents)
|
|
2
2
|
|
|
3
|
-
> **Version:** 2.
|
|
3
|
+
> **Version:** 2.1.3 (Design Spec Injection)
|
|
4
4
|
> **Purpose:** Single source of truth for pre-work validation
|
|
5
5
|
|
|
6
6
|
---
|
|
@@ -9,6 +9,48 @@
|
|
|
9
9
|
|
|
10
10
|
Complete these steps before implementation to ensure alignment with project standards:
|
|
11
11
|
|
|
12
|
+
### Step 0: Library Requirements Check
|
|
13
|
+
|
|
14
|
+
**Scan for required libraries before writing code:**
|
|
15
|
+
|
|
16
|
+
1. **Read `tasks.md`** - Look for these patterns:
|
|
17
|
+
- `Install X and dependencies` → Use library X
|
|
18
|
+
- `Configure X with Y adapter` → Use X with adapter Y
|
|
19
|
+
- Backtick packages like `better-auth` → Required dependency
|
|
20
|
+
|
|
21
|
+
2. **Read `design.md`** - Look for these patterns:
|
|
22
|
+
- `### D1: Use X Library` → Decision to use X
|
|
23
|
+
- `**Decision:** Use X` → Chosen library
|
|
24
|
+
- Alternatives table → Shows why X was chosen over others
|
|
25
|
+
|
|
26
|
+
3. **List required libraries** in your validation report
|
|
27
|
+
|
|
28
|
+
4. **Use the libraries specified in tasks.md/design.md**
|
|
29
|
+
- WHY: The team chose these libraries for specific reasons (compatibility, features, constraints)
|
|
30
|
+
- Custom implementations waste effort and may miss edge cases the library handles
|
|
31
|
+
|
|
32
|
+
5. **Implement according to Design Spec (not library defaults)**
|
|
33
|
+
- If design.md specifies configurations → Use those values (not library defaults)
|
|
34
|
+
- If design.md specifies custom endpoints → Implement those endpoints
|
|
35
|
+
- WHY: Design decisions were made for specific project requirements
|
|
36
|
+
|
|
37
|
+
**Example:**
|
|
38
|
+
```
|
|
39
|
+
tasks.md says: "Install better-auth and dependencies"
|
|
40
|
+
design.md says: "JWT 15min + Redis refresh token 30d"
|
|
41
|
+
|
|
42
|
+
→ Use better-auth library (from tasks.md)
|
|
43
|
+
→ Configure JWT with 15min expiry (from design.md)
|
|
44
|
+
→ Configure Redis refresh with 30d (from design.md)
|
|
45
|
+
→ Implement /api/auth/refresh endpoint (from design.md)
|
|
46
|
+
|
|
47
|
+
WHY not defaults? Design spec has project-specific security requirements.
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
### Step 1-4: Standard Checks
|
|
53
|
+
|
|
12
54
|
1. **Context Discovery** - Load project context via agent-discovery.md
|
|
13
55
|
2. **Pattern Loading** - Load relevant patterns for your agent type
|
|
14
56
|
3. **Validation Report** - Provide pre-implementation validation report
|
|
@@ -23,6 +65,18 @@ Complete these steps before implementation to ensure alignment with project stan
|
|
|
23
65
|
```markdown
|
|
24
66
|
Pre-Implementation Validation
|
|
25
67
|
|
|
68
|
+
Library Requirements: (Step 0)
|
|
69
|
+
- [ ] Scanned tasks.md for "Install X" patterns
|
|
70
|
+
- [ ] Scanned design.md for design decisions
|
|
71
|
+
- Required libraries: {list from tasks.md/design.md}
|
|
72
|
+
|
|
73
|
+
Design Spec Implementation: (Step 5)
|
|
74
|
+
- [ ] Read design.md specifications
|
|
75
|
+
- [ ] Identified custom configurations (not library defaults)
|
|
76
|
+
- Design requirements:
|
|
77
|
+
- {requirement 1 from design.md}
|
|
78
|
+
- {requirement 2 from design.md}
|
|
79
|
+
|
|
26
80
|
Project Context:
|
|
27
81
|
- Project: {name}
|
|
28
82
|
- Stack: {tech-stack}
|
|
@@ -41,7 +95,8 @@ Best Practices:
|
|
|
41
95
|
Ready to Implement:
|
|
42
96
|
- [ ] Task understood
|
|
43
97
|
- [ ] Dependencies identified
|
|
44
|
-
- [ ]
|
|
98
|
+
- [ ] Required libraries identified
|
|
99
|
+
- [ ] Approach planned (using specified libraries)
|
|
45
100
|
```
|
|
46
101
|
|
|
47
102
|
---
|
|
@@ -49,9 +104,11 @@ Ready to Implement:
|
|
|
49
104
|
## Why This Matters
|
|
50
105
|
|
|
51
106
|
Pre-work validation prevents:
|
|
107
|
+
- **Wrong library choices** - Using custom code when a library was already chosen by the team
|
|
108
|
+
- **Library defaults instead of spec** - Using default configs when design.md specifies custom values
|
|
52
109
|
- Misaligned implementations (wrong patterns, wrong style)
|
|
53
110
|
- Duplicate components (not searching existing code first)
|
|
54
111
|
- Wrong package manager usage (CI/CD breaks)
|
|
55
112
|
- Missing best practices (outdated patterns)
|
|
56
113
|
|
|
57
|
-
→ 80% of implementation issues caught at validation stage
|
|
114
|
+
→ 80% of implementation issues are caught at validation stage
|
package/.claude/commands/cdev.md
CHANGED
|
@@ -94,7 +94,7 @@ See: `.claude/lib/agent-executor.md` for full implementation
|
|
|
94
94
|
```typescript
|
|
95
95
|
// Step 4: Invoke Agent with Retry & Validation
|
|
96
96
|
|
|
97
|
-
// 4.1: Build agent prompt (with design reference + best practices -
|
|
97
|
+
// 4.1: Build agent prompt (with design reference + best practices - v2.1.2)
|
|
98
98
|
function buildAgentPrompt(phase, changeContext) {
|
|
99
99
|
let prompt = `
|
|
100
100
|
# Phase ${phase.phase_number}: ${phase.name}
|
|
@@ -105,7 +105,62 @@ ${changeContext.proposal}
|
|
|
105
105
|
## Tasks
|
|
106
106
|
${changeContext.tasks}
|
|
107
107
|
|
|
108
|
+
## Design Decisions (from design.md)
|
|
109
|
+
${changeContext.design || '(no design.md found)'}
|
|
110
|
+
|
|
108
111
|
${phase.instructions}
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 📦 Library Requirements
|
|
116
|
+
|
|
117
|
+
**Scan for required libraries before implementation:**
|
|
118
|
+
|
|
119
|
+
1. **Review tasks.md above** for these patterns:
|
|
120
|
+
- "Install X and dependencies" → Use library X
|
|
121
|
+
- "Configure X with Y adapter" → Use X with adapter Y
|
|
122
|
+
- Backtick packages like \`better-auth\` → Required dependency
|
|
123
|
+
|
|
124
|
+
2. **Review "Design Decisions" section above** for:
|
|
125
|
+
- "### D1: Use X Library" → Decision to use X
|
|
126
|
+
- "**Decision:** Use X" → Chosen library
|
|
127
|
+
- Specific configurations (e.g., "JWT 15min", "Redis refresh token 30d")
|
|
128
|
+
- Architecture decisions (e.g., "Hybrid Session Strategy")
|
|
129
|
+
|
|
130
|
+
3. **Use the specified libraries**
|
|
131
|
+
- WHY: The team chose these for compatibility, features, or constraints
|
|
132
|
+
- Custom implementations duplicate effort and miss edge cases the library handles
|
|
133
|
+
|
|
134
|
+
4. **Implement according to Design Spec (not library defaults)**
|
|
135
|
+
- If design.md specifies "JWT 15min + Redis refresh 30d" → Configure library with these values
|
|
136
|
+
- If design.md specifies custom endpoints → Implement those endpoints
|
|
137
|
+
- Library defaults are starting points, not final implementation
|
|
138
|
+
- WHY: Design decisions were made for specific project requirements
|
|
139
|
+
|
|
140
|
+
**Example:**
|
|
141
|
+
\`\`\`
|
|
142
|
+
design.md says:
|
|
143
|
+
"Hybrid Session Strategy: JWT 15min + Redis refresh 30d"
|
|
144
|
+
|
|
145
|
+
→ Use better-auth library (from tasks.md)
|
|
146
|
+
→ Configure JWT plugin with 15min expiry
|
|
147
|
+
→ Configure refresh token with 30d in Redis
|
|
148
|
+
→ Implement /api/auth/refresh endpoint
|
|
149
|
+
|
|
150
|
+
WHY not defaults? Design spec has project-specific security requirements
|
|
151
|
+
that differ from library defaults.
|
|
152
|
+
\`\`\`
|
|
153
|
+
|
|
154
|
+
**Report in validation:**
|
|
155
|
+
\`\`\`
|
|
156
|
+
Libraries: better-auth, @better-auth/drizzle, ioredis
|
|
157
|
+
Design Spec Implementation:
|
|
158
|
+
- [x] JWT access token: 15min (design.md D1)
|
|
159
|
+
- [x] Redis refresh token: 30d (design.md D2)
|
|
160
|
+
- [x] /api/auth/refresh endpoint (design.md D3)
|
|
161
|
+
\`\`\`
|
|
162
|
+
|
|
163
|
+
---
|
|
109
164
|
`
|
|
110
165
|
|
|
111
166
|
// Add best-practices reference for ALL agents
|
package/README.md
CHANGED
|
@@ -27,6 +27,12 @@ cak init
|
|
|
27
27
|
| frontend | 3 | Connect UI to API |
|
|
28
28
|
| test-debug | 4 | Tests & fixes |
|
|
29
29
|
|
|
30
|
+
## Features
|
|
31
|
+
|
|
32
|
+
- **Instruction-based Library Detection** - Agents scan `tasks.md`/`design.md` for required libraries
|
|
33
|
+
- **Cross-session Context** - `PROJECT_STATUS.yml` maintains state across sessions
|
|
34
|
+
- **Design System v2.0** - Interactive setup with theme selection
|
|
35
|
+
|
|
30
36
|
## Commands
|
|
31
37
|
|
|
32
38
|
**CLI:** `cak init` | `cak update`
|