codingbuddy-rules 0.0.0-canary.20251222065027.7844cd5
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/.ai-rules/CHANGELOG.md +117 -0
- package/.ai-rules/README.md +232 -0
- package/.ai-rules/adapters/antigravity.md +195 -0
- package/.ai-rules/adapters/claude-code.md +117 -0
- package/.ai-rules/adapters/codex.md +124 -0
- package/.ai-rules/adapters/cursor.md +128 -0
- package/.ai-rules/adapters/kiro.md +130 -0
- package/.ai-rules/adapters/q.md +126 -0
- package/.ai-rules/agents/README.md +681 -0
- package/.ai-rules/agents/accessibility-specialist.json +514 -0
- package/.ai-rules/agents/architecture-specialist.json +501 -0
- package/.ai-rules/agents/backend-developer.json +494 -0
- package/.ai-rules/agents/code-quality-specialist.json +565 -0
- package/.ai-rules/agents/code-reviewer.json +565 -0
- package/.ai-rules/agents/devops-engineer.json +277 -0
- package/.ai-rules/agents/documentation-specialist.json +543 -0
- package/.ai-rules/agents/frontend-developer.json +402 -0
- package/.ai-rules/agents/performance-specialist.json +528 -0
- package/.ai-rules/agents/security-specialist.json +464 -0
- package/.ai-rules/agents/seo-specialist.json +427 -0
- package/.ai-rules/agents/test-strategy-specialist.json +542 -0
- package/.ai-rules/agents/ui-ux-designer.json +513 -0
- package/.ai-rules/keyword-modes.json +20 -0
- package/.ai-rules/rules/augmented-coding.md +292 -0
- package/.ai-rules/rules/clarification-guide.md +138 -0
- package/.ai-rules/rules/core.md +1030 -0
- package/.ai-rules/rules/project.md +200 -0
- package/.ai-rules/schemas/README.md +66 -0
- package/.ai-rules/schemas/agent.schema.json +258 -0
- package/index.d.ts +4 -0
- package/index.js +8 -0
- package/package.json +32 -0
|
@@ -0,0 +1,681 @@
|
|
|
1
|
+
# Agents Directory
|
|
2
|
+
|
|
3
|
+
AI Agent definitions for specialized development roles.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Quick Reference: Which Agent?](#quick-reference-which-agent)
|
|
10
|
+
- [Available Agents](#available-agents)
|
|
11
|
+
- [Core Agents](#core-agents-auto-activated)
|
|
12
|
+
- [Domain Specialists](#domain-specialists)
|
|
13
|
+
- [Utility Agents](#utility-agents)
|
|
14
|
+
- [Agent Details](#agent-details)
|
|
15
|
+
- [Usage](#usage)
|
|
16
|
+
- [Workflow Modes](#workflow-modes)
|
|
17
|
+
- [Agent Structure](#agent-structure)
|
|
18
|
+
- [Adding New Agents](#adding-new-agents)
|
|
19
|
+
- [Best Practices](#best-practices)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Quick Reference: Which Agent?
|
|
24
|
+
|
|
25
|
+
| 작업 유형 | 추천 에이전트 | 파일 |
|
|
26
|
+
|----------|-------------|------|
|
|
27
|
+
| **React/Next.js 개발** | Frontend Developer | `frontend-developer.json` |
|
|
28
|
+
| **백엔드 API 개발** | Backend Developer | `backend-developer.json` |
|
|
29
|
+
| **코드 리뷰 (EVAL)** | Code Reviewer | `code-reviewer.json` |
|
|
30
|
+
| **아키텍처 설계** | Architecture Specialist | `architecture-specialist.json` |
|
|
31
|
+
| **테스트 전략** | Test Strategy Specialist | `test-strategy-specialist.json` |
|
|
32
|
+
| **성능 최적화** | Performance Specialist | `performance-specialist.json` |
|
|
33
|
+
| **보안 검토** | Security Specialist | `security-specialist.json` |
|
|
34
|
+
| **접근성 검토** | Accessibility Specialist | `accessibility-specialist.json` |
|
|
35
|
+
| **SEO 최적화** | SEO Specialist | `seo-specialist.json` |
|
|
36
|
+
| **UI/UX 디자인** | UI/UX Designer | `ui-ux-designer.json` |
|
|
37
|
+
| **문서화** | Documentation Specialist | `documentation-specialist.json` |
|
|
38
|
+
| **코드 품질** | Code Quality Specialist | `code-quality-specialist.json` |
|
|
39
|
+
| **인프라/배포** | DevOps Engineer | `devops-engineer.json` |
|
|
40
|
+
|
|
41
|
+
### Agent Summary
|
|
42
|
+
|
|
43
|
+
| Agent | 한 줄 설명 |
|
|
44
|
+
|-------|-----------|
|
|
45
|
+
| Frontend Developer | React/Next.js TDD 기반 프론트엔드 개발 |
|
|
46
|
+
| Backend Developer | 멀티스택 지원 백엔드 API 개발 (Node, Python, Go, Java, Rust) |
|
|
47
|
+
| Code Reviewer | EVAL 모드 자동 활성화, 다차원 코드 품질 평가 |
|
|
48
|
+
| Architecture Specialist | 레이어 경계, 의존성 방향, Clean Architecture |
|
|
49
|
+
| Test Strategy Specialist | TDD 전략, 테스트 커버리지, 테스트 품질 |
|
|
50
|
+
| Performance Specialist | Core Web Vitals, 번들 최적화, 렌더링 성능 |
|
|
51
|
+
| Security Specialist | OWASP, 인증/인가, XSS/CSRF 방어 |
|
|
52
|
+
| Accessibility Specialist | WCAG 2.1 AA, 시맨틱 HTML, 스크린 리더 |
|
|
53
|
+
| SEO Specialist | 메타데이터, JSON-LD, Open Graph |
|
|
54
|
+
| UI/UX Designer | 비주얼 계층, UX 법칙, 인터랙션 패턴 |
|
|
55
|
+
| Documentation Specialist | 코드 주석, JSDoc, 문서 품질 평가 |
|
|
56
|
+
| Code Quality Specialist | SOLID, DRY, 복잡도 분석 |
|
|
57
|
+
| DevOps Engineer | Docker, 모니터링, 배포 최적화 |
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Available Agents
|
|
62
|
+
|
|
63
|
+
### Core Agents (Auto-activated)
|
|
64
|
+
|
|
65
|
+
These agents are automatically activated based on workflow mode:
|
|
66
|
+
|
|
67
|
+
- **Primary Developer Agent**: Auto-activated in PLAN/ACT mode
|
|
68
|
+
- Example: `frontend-developer.json` (React/Next.js projects)
|
|
69
|
+
- Customize per project: `backend-developer.json`, `mobile-developer.json`, etc.
|
|
70
|
+
- **Code Reviewer** (`code-reviewer.json`): Auto-activated in EVAL mode
|
|
71
|
+
|
|
72
|
+
### Domain Specialists
|
|
73
|
+
|
|
74
|
+
Unified specialist agents organized by domain:
|
|
75
|
+
|
|
76
|
+
- **Accessibility** (`accessibility-specialist.json`)
|
|
77
|
+
- **Architecture** (`architecture-specialist.json`)
|
|
78
|
+
- **UI/UX Design** (`ui-ux-designer.json`)
|
|
79
|
+
- **Documentation** (`documentation-specialist.json`)
|
|
80
|
+
- **Performance** (`performance-specialist.json`)
|
|
81
|
+
- **Security** (`security-specialist.json`)
|
|
82
|
+
- **SEO** (`seo-specialist.json`)
|
|
83
|
+
- **Test Strategy** (`test-strategy-specialist.json`)
|
|
84
|
+
|
|
85
|
+
### Utility Agents
|
|
86
|
+
|
|
87
|
+
- **Code Quality** (`code-quality-specialist.json`): Code quality assessment
|
|
88
|
+
- **DevOps Engineer** (`devops-engineer.json`): Infrastructure and monitoring
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Agent Details
|
|
93
|
+
|
|
94
|
+
### Primary Developer Agent Example: Frontend Developer (`frontend-developer.json`)
|
|
95
|
+
|
|
96
|
+
> **Note**: This is an example Primary Developer Agent for React/Next.js projects. Create your own agent (e.g., `backend-developer.json`, `mobile-developer.json`) following this pattern for other tech stacks.
|
|
97
|
+
|
|
98
|
+
**Expertise:**
|
|
99
|
+
|
|
100
|
+
- React + Next.js (refer to project's package.json for versions)
|
|
101
|
+
- TypeScript strict mode
|
|
102
|
+
- TDD (Test-Driven Development)
|
|
103
|
+
- Augmented Coding practices
|
|
104
|
+
- Server Components & Server Actions
|
|
105
|
+
- Accessibility & SEO optimization
|
|
106
|
+
- Project design system
|
|
107
|
+
|
|
108
|
+
**Development Philosophy:**
|
|
109
|
+
|
|
110
|
+
- **Modern Approach**: Actively researches latest React/Next.js patterns
|
|
111
|
+
- **Server-First**: Defaults to Server Components, uses Client Components only when needed
|
|
112
|
+
- **Server Actions**: Prefers Server Actions over API routes for mutations
|
|
113
|
+
- **HTML/CSS First**: Solves with HTML/CSS before JavaScript
|
|
114
|
+
- **Design Principles**: Visual hierarchy, CRAP principles, UX laws
|
|
115
|
+
- **User Experience**: User flow optimization, interaction patterns
|
|
116
|
+
- **Accessibility**: WCAG AA compliance with semantic HTML
|
|
117
|
+
- **SEO**: Comprehensive metadata and structured data
|
|
118
|
+
|
|
119
|
+
**Responsibilities:**
|
|
120
|
+
|
|
121
|
+
- Develop components following TDD cycle
|
|
122
|
+
- Maintain 90%+ test coverage
|
|
123
|
+
- Follow SOLID principles
|
|
124
|
+
- Ensure type safety
|
|
125
|
+
- Optimize for Core Web Vitals
|
|
126
|
+
- Implement responsive design (mobile-first)
|
|
127
|
+
|
|
128
|
+
**Workflow:**
|
|
129
|
+
|
|
130
|
+
- **Core Logic**: Test-First TDD (entities, utils, hooks)
|
|
131
|
+
- **UI Components**: Implement-then-test (features, widgets)
|
|
132
|
+
- **Default**: Server Components → Client Components only when necessary
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
### Backend Developer (`backend-developer.json`)
|
|
137
|
+
|
|
138
|
+
> **Note**: This is a **language-agnostic** Primary Developer Agent for backend projects. Supports Node.js, Python, Go, Java, Rust, and other backend stacks. See `project.md` for your project's specific tech stack.
|
|
139
|
+
|
|
140
|
+
**Supported Stacks:**
|
|
141
|
+
|
|
142
|
+
- Node.js (NestJS, Express, Fastify)
|
|
143
|
+
- Python (FastAPI, Django, Flask)
|
|
144
|
+
- Go (Gin, Echo, Fiber)
|
|
145
|
+
- Java (Spring Boot, Quarkus)
|
|
146
|
+
- Rust (Actix, Axum)
|
|
147
|
+
|
|
148
|
+
**Expertise:**
|
|
149
|
+
|
|
150
|
+
- Backend API Development (REST, GraphQL, gRPC)
|
|
151
|
+
- Clean Architecture & Domain-Driven Design
|
|
152
|
+
- Database Design & ORM
|
|
153
|
+
- Authentication & Authorization
|
|
154
|
+
- TDD (Test-Driven Development)
|
|
155
|
+
- Augmented Coding practices
|
|
156
|
+
|
|
157
|
+
**Development Philosophy:**
|
|
158
|
+
|
|
159
|
+
- **API-First**: Define OpenAPI spec before implementation
|
|
160
|
+
- **Clean Architecture**: Controller → Service → Repository layers
|
|
161
|
+
- **Database-First**: Schema definition with proper migrations
|
|
162
|
+
- **Security-First**: Input validation, SQL injection prevention, OWASP compliance
|
|
163
|
+
- **TDD**: Test-First for Services/Repositories, Test-After for Controllers
|
|
164
|
+
|
|
165
|
+
**Responsibilities:**
|
|
166
|
+
|
|
167
|
+
- Develop REST APIs and GraphQL endpoints following TDD cycle
|
|
168
|
+
- Maintain 90%+ test coverage
|
|
169
|
+
- Follow SOLID principles and Clean Architecture
|
|
170
|
+
- Ensure type safety (TypeScript, type hints, generics as applicable)
|
|
171
|
+
- Implement secure authentication and authorization
|
|
172
|
+
- Design efficient database schemas with proper indexing
|
|
173
|
+
|
|
174
|
+
**Workflow:**
|
|
175
|
+
|
|
176
|
+
- **Core Logic**: Test-First TDD (services, repositories, utils)
|
|
177
|
+
- **API Endpoints**: Implement-then-test (controllers, middleware)
|
|
178
|
+
- **Default**: Clean Architecture with layered structure
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
### DevOps Engineer (`devops-engineer.json`)
|
|
183
|
+
|
|
184
|
+
**Expertise:**
|
|
185
|
+
|
|
186
|
+
- Docker containerization & optimization
|
|
187
|
+
- Monitoring & observability (APM, RUM, Logs)
|
|
188
|
+
- Next.js standalone deployment
|
|
189
|
+
- Build performance optimization
|
|
190
|
+
- Production debugging & troubleshooting
|
|
191
|
+
|
|
192
|
+
**Development Philosophy:**
|
|
193
|
+
|
|
194
|
+
- **Optimization First**: Minimize Docker image size and build time
|
|
195
|
+
- **Observability First**: Comprehensive monitoring with APM/RUM
|
|
196
|
+
- **Security Conscious**: No hardcoded secrets, official images only
|
|
197
|
+
- **Reliability Focus**: Health checks, graceful shutdown, error recovery
|
|
198
|
+
- **Debug Ready**: Source maps enabled, detailed error tracking
|
|
199
|
+
|
|
200
|
+
**Responsibilities:**
|
|
201
|
+
|
|
202
|
+
- Optimize Docker multi-stage builds
|
|
203
|
+
- Configure monitoring (APM, RUM, logs, metrics)
|
|
204
|
+
- Manage production builds
|
|
205
|
+
- Optimize build performance and memory usage
|
|
206
|
+
- Debug production issues with source maps
|
|
207
|
+
- Monitor and improve application performance
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
### Code Reviewer (`code-reviewer.json`)
|
|
212
|
+
|
|
213
|
+
**Expertise:**
|
|
214
|
+
|
|
215
|
+
- Multi-dimensional code quality evaluation
|
|
216
|
+
- Architecture and design pattern analysis
|
|
217
|
+
- Performance and security assessment
|
|
218
|
+
- Test strategy evaluation
|
|
219
|
+
- Risk identification and mitigation
|
|
220
|
+
- Latest best practices research and validation
|
|
221
|
+
|
|
222
|
+
**Evaluation Philosophy:**
|
|
223
|
+
|
|
224
|
+
- **Multi-Dimensional**: Evaluate code from various perspectives (code quality, architecture, performance, security, accessibility)
|
|
225
|
+
- **Evidence-Based**: Validate recommendations through web search for evidence-based approach
|
|
226
|
+
- **Honest**: Admit uncertainty, explicitly state parts that need verification
|
|
227
|
+
- **Broad Perspective**: Consider conversation context but evaluate comprehensively from a wide perspective
|
|
228
|
+
- **Practical**: Balance idealism with real-world constraints
|
|
229
|
+
|
|
230
|
+
**Responsibilities:**
|
|
231
|
+
|
|
232
|
+
- Comprehensive code quality evaluation from multiple perspectives
|
|
233
|
+
- Identify risks across various dimensions with clear prioritization
|
|
234
|
+
- Present evidence-based recommendations through web search validation
|
|
235
|
+
- Provide actionable improvement plans with clear priorities
|
|
236
|
+
- Assess production readiness and deployment blockers
|
|
237
|
+
|
|
238
|
+
**Activation:**
|
|
239
|
+
|
|
240
|
+
- **STRICT**: When user types `EVAL`, `EVALUATE`, or equivalent, this Agent **MUST** be activated automatically
|
|
241
|
+
- EVAL Mode request automatically applies this Agent's evaluation framework
|
|
242
|
+
|
|
243
|
+
**Evaluation Framework:**
|
|
244
|
+
|
|
245
|
+
**Mandatory Evaluation Perspectives:**
|
|
246
|
+
|
|
247
|
+
- Code Quality: SOLID principles, DRY, complexity (Reference: `augmented-coding.md`)
|
|
248
|
+
- Architecture: Layer boundaries, dependency direction (Reference: `project.md`)
|
|
249
|
+
- Type Safety: TypeScript usage, any type prohibition (Reference: `project.md`)
|
|
250
|
+
- Test Coverage: 90%+ goal achievement (Reference: `augmented-coding.md`)
|
|
251
|
+
- Performance: Bundle size, rendering optimization (Reference: `project.md`)
|
|
252
|
+
- Security: XSS/CSRF, authentication/authorization (Reference: `project.md`)
|
|
253
|
+
- Accessibility: WCAG 2.1 AA compliance (Reference: `project.md`)
|
|
254
|
+
- SEO: Metadata, structured data (Reference: `project.md`)
|
|
255
|
+
- UI/UX Design: Visual hierarchy, UX laws, interaction patterns (Reference: `ui-ux-designer.json`)
|
|
256
|
+
|
|
257
|
+
**Risk Assessment:**
|
|
258
|
+
|
|
259
|
+
- **Critical**: Immediate production issues, security vulnerabilities, potential data loss
|
|
260
|
+
- **High**: Significant technical debt, scalability problems, user experience degradation
|
|
261
|
+
- **Medium**: Maintainability concerns, minor performance issues
|
|
262
|
+
- **Low**: Code style, optimization opportunities
|
|
263
|
+
|
|
264
|
+
**Production Blockers:**
|
|
265
|
+
|
|
266
|
+
- Security vulnerabilities found
|
|
267
|
+
- Critical performance issues
|
|
268
|
+
- Accessibility WCAG AA non-compliance
|
|
269
|
+
- Test coverage < 90% (core logic)
|
|
270
|
+
- TypeScript any usage
|
|
271
|
+
- SOLID principles violation (architecture issues)
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Usage
|
|
276
|
+
|
|
277
|
+
### In AI Assistants
|
|
278
|
+
|
|
279
|
+
Reference your project's Primary Developer Agent in prompts:
|
|
280
|
+
|
|
281
|
+
```
|
|
282
|
+
# Frontend project example
|
|
283
|
+
@.ai-rules/agents/frontend-developer.json
|
|
284
|
+
Create a new user registration feature
|
|
285
|
+
|
|
286
|
+
# Backend project example
|
|
287
|
+
@.ai-rules/agents/backend-developer.json
|
|
288
|
+
Create a new REST API endpoint for user management
|
|
289
|
+
|
|
290
|
+
# Mobile project example
|
|
291
|
+
@.ai-rules/agents/mobile-developer.json
|
|
292
|
+
Create a new user profile screen
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### In Chat
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
# Frontend example
|
|
299
|
+
Using the Frontend Developer agent,
|
|
300
|
+
implement user authentication flow with Server Actions
|
|
301
|
+
|
|
302
|
+
# Backend example
|
|
303
|
+
Using the Backend Developer agent,
|
|
304
|
+
implement JWT authentication middleware
|
|
305
|
+
|
|
306
|
+
# Mobile example
|
|
307
|
+
Using the Mobile Developer agent,
|
|
308
|
+
implement biometric authentication
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Example Output (React/Next.js)
|
|
312
|
+
|
|
313
|
+
> The following is an example from the Frontend Developer agent. Your Primary Developer Agent will generate code following your project's tech stack and conventions.
|
|
314
|
+
|
|
315
|
+
**Server Component (Default) with Design System:**
|
|
316
|
+
|
|
317
|
+
```tsx
|
|
318
|
+
// app/{feature}/page.tsx
|
|
319
|
+
import { twJoin } from 'tailwind-merge';
|
|
320
|
+
import { submitForm } from './actions';
|
|
321
|
+
|
|
322
|
+
export default function FeaturePage() {
|
|
323
|
+
return (
|
|
324
|
+
<main
|
|
325
|
+
className={twJoin(
|
|
326
|
+
'flex min-h-screen flex-col items-center',
|
|
327
|
+
'p-4 sm:p-6 md:p-8 lg:p-12',
|
|
328
|
+
)}
|
|
329
|
+
>
|
|
330
|
+
<Typography variant="heading2" className="mb-6">
|
|
331
|
+
Feature Title
|
|
332
|
+
</Typography>
|
|
333
|
+
|
|
334
|
+
<form action={submitForm} className="w-full max-w-md">
|
|
335
|
+
<Input
|
|
336
|
+
type="email"
|
|
337
|
+
name="email"
|
|
338
|
+
placeholder="Enter your email"
|
|
339
|
+
required
|
|
340
|
+
className="mb-4"
|
|
341
|
+
/>
|
|
342
|
+
<Button type="submit" variant="primary" size="large" fullWidth>
|
|
343
|
+
Submit
|
|
344
|
+
</Button>
|
|
345
|
+
</form>
|
|
346
|
+
</main>
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
**Server Action:**
|
|
352
|
+
|
|
353
|
+
```tsx
|
|
354
|
+
// app/{feature}/actions.ts
|
|
355
|
+
'use server';
|
|
356
|
+
|
|
357
|
+
export async function submitForm(formData: FormData) {
|
|
358
|
+
const email = formData.get('email') as string;
|
|
359
|
+
|
|
360
|
+
// Server-side validation
|
|
361
|
+
if (!email || !isValidEmail(email)) {
|
|
362
|
+
return { error: 'Invalid email' };
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// Database operation
|
|
366
|
+
await db.{entity}.create({ email });
|
|
367
|
+
|
|
368
|
+
return { success: true };
|
|
369
|
+
}
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
**Key Features:**
|
|
373
|
+
|
|
374
|
+
- Uses project design system components (Button, Input, Typography)
|
|
375
|
+
- Uses twJoin for static classes, twMerge for prop className
|
|
376
|
+
- Uses design tokens (not arbitrary colors)
|
|
377
|
+
- Server Component by default
|
|
378
|
+
- Server Action for form handling
|
|
379
|
+
- Responsive with breakpoints
|
|
380
|
+
- Semantic structure and accessibility built-in
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
## Real Project Examples
|
|
385
|
+
|
|
386
|
+
### Primary Developer Agent Example: Feature Implementation (React/Next.js)
|
|
387
|
+
|
|
388
|
+
> This example shows the Frontend Developer agent pattern. Adapt the structure to your project's tech stack.
|
|
389
|
+
|
|
390
|
+
**Example project structure (core logic with TDD):**
|
|
391
|
+
|
|
392
|
+
```
|
|
393
|
+
entities/{domain}/
|
|
394
|
+
├── {feature}.api.ts # API call function
|
|
395
|
+
├── {feature}.api.unit.spec.ts # API tests
|
|
396
|
+
├── {feature}.model.ts # React Query hook
|
|
397
|
+
├── {feature}.model.unit.spec.tsx # Model tests
|
|
398
|
+
├── {feature}.types.ts # Type definitions
|
|
399
|
+
├── {feature}.constants.ts # Error messages
|
|
400
|
+
└── index.ts # Public exports
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
**TDD workflow applied:**
|
|
404
|
+
|
|
405
|
+
1. **Write tests first** (`{feature}.model.unit.spec.tsx`)
|
|
406
|
+
|
|
407
|
+
```tsx
|
|
408
|
+
describe('use{Feature}Mutation', () => {
|
|
409
|
+
it('successfully performs action with valid input', async () => {
|
|
410
|
+
// Test defines expected behavior
|
|
411
|
+
});
|
|
412
|
+
});
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
2. **Define types** (`{feature}.types.ts`)
|
|
416
|
+
|
|
417
|
+
```tsx
|
|
418
|
+
export interface {Feature}ApiResponse {
|
|
419
|
+
ok: boolean;
|
|
420
|
+
data: { ... }
|
|
421
|
+
}
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
3. **Implement API** (`{feature}.api.ts`)
|
|
425
|
+
- Pure function for API call
|
|
426
|
+
|
|
427
|
+
4. **Implement model** (`{feature}.model.ts`)
|
|
428
|
+
|
|
429
|
+
```tsx
|
|
430
|
+
export const use{Feature}Mutation = () => {
|
|
431
|
+
return useMutation<...>({ ... });
|
|
432
|
+
};
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
5. **All tests pass** → Refactor if needed
|
|
436
|
+
|
|
437
|
+
**Result:** Type-safe, tested, production-ready feature following augmented coding principles.
|
|
438
|
+
|
|
439
|
+
---
|
|
440
|
+
|
|
441
|
+
## Workflow Modes
|
|
442
|
+
|
|
443
|
+
### Default Workflow (PLAN → ACT → PLAN)
|
|
444
|
+
|
|
445
|
+
**Standard behavior - EVAL is NOT automatic:**
|
|
446
|
+
|
|
447
|
+
```
|
|
448
|
+
User: [Request]
|
|
449
|
+
AI: # Mode: PLAN
|
|
450
|
+
[Propose plan]
|
|
451
|
+
|
|
452
|
+
User: ACT
|
|
453
|
+
AI: # Mode: ACT
|
|
454
|
+
[Execute changes]
|
|
455
|
+
# Mode: PLAN (automatic return - default behavior)
|
|
456
|
+
|
|
457
|
+
(Work complete - EVAL is not triggered unless requested)
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
**When to use:**
|
|
461
|
+
|
|
462
|
+
- Simple, straightforward tasks
|
|
463
|
+
- Already satisfied with implementation
|
|
464
|
+
- Time-sensitive work
|
|
465
|
+
|
|
466
|
+
---
|
|
467
|
+
|
|
468
|
+
### Optional Evaluation Workflow (PLAN → ACT → EVAL → PLAN)
|
|
469
|
+
|
|
470
|
+
**Only when user explicitly requests EVAL (automatically activates Code Reviewer Agent):**
|
|
471
|
+
|
|
472
|
+
```
|
|
473
|
+
User: [Request]
|
|
474
|
+
AI: # Mode: PLAN
|
|
475
|
+
[Initial plan]
|
|
476
|
+
|
|
477
|
+
User: ACT
|
|
478
|
+
AI: # Mode: ACT
|
|
479
|
+
[Implement v1]
|
|
480
|
+
# Mode: PLAN (auto-return)
|
|
481
|
+
|
|
482
|
+
User: EVAL
|
|
483
|
+
AI: # Mode: EVAL
|
|
484
|
+
(Code Reviewer Agent automatically activated)
|
|
485
|
+
|
|
486
|
+
## Implementation Analysis
|
|
487
|
+
- Implemented: Feature X with Y approach
|
|
488
|
+
- Files modified: [list]
|
|
489
|
+
|
|
490
|
+
## Strengths
|
|
491
|
+
- Type-safe implementation
|
|
492
|
+
- Test coverage: 85% (goal: 90%+)
|
|
493
|
+
- Server Action used appropriately
|
|
494
|
+
|
|
495
|
+
## Improvement Opportunities
|
|
496
|
+
|
|
497
|
+
**Critical:**
|
|
498
|
+
1. **Test Coverage**: 85% → 90%+ required
|
|
499
|
+
- Missing edge cases: [specific cases]
|
|
500
|
+
- Impact: Potential bugs in production
|
|
501
|
+
|
|
502
|
+
## Improved PLAN
|
|
503
|
+
1. Add tests for missing edge cases (Critical)
|
|
504
|
+
2. Add ErrorBoundary wrapper (High)
|
|
505
|
+
3. Optimize re-renders (Medium)
|
|
506
|
+
|
|
507
|
+
User: ACT
|
|
508
|
+
AI: # Mode: ACT
|
|
509
|
+
[Implement improvements]
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
---
|
|
513
|
+
|
|
514
|
+
### When to Use EVAL Mode
|
|
515
|
+
|
|
516
|
+
**Request EVAL for:**
|
|
517
|
+
|
|
518
|
+
- Complex features with multiple approaches
|
|
519
|
+
- Production-critical implementations
|
|
520
|
+
- First-time patterns you're learning
|
|
521
|
+
- When quality is more important than speed
|
|
522
|
+
- Large refactoring that needs review
|
|
523
|
+
- Features with security or accessibility concerns
|
|
524
|
+
|
|
525
|
+
**Skip EVAL for:**
|
|
526
|
+
|
|
527
|
+
- Simple bug fixes
|
|
528
|
+
- Straightforward implementations
|
|
529
|
+
- Already meeting all quality standards
|
|
530
|
+
- Time-sensitive quick changes
|
|
531
|
+
- Minor documentation updates
|
|
532
|
+
- Configuration changes
|
|
533
|
+
|
|
534
|
+
---
|
|
535
|
+
|
|
536
|
+
## Agent Structure
|
|
537
|
+
|
|
538
|
+
### Flat Structure
|
|
539
|
+
|
|
540
|
+
All agent files are located directly in `.ai-rules/agents/` directory without subdirectories. This simplifies file access and maintains consistency.
|
|
541
|
+
|
|
542
|
+
**Rationale:**
|
|
543
|
+
|
|
544
|
+
- Each domain has only one unified specialist file
|
|
545
|
+
- File names already include domain information (e.g., `architecture-specialist.json`)
|
|
546
|
+
- Simpler path structure: `.ai-rules/agents/{domain}-specialist.json`
|
|
547
|
+
- Consistent with core agents (frontend-developer.json, code-reviewer.json)
|
|
548
|
+
|
|
549
|
+
**File Organization:**
|
|
550
|
+
|
|
551
|
+
```
|
|
552
|
+
.ai-rules/agents/
|
|
553
|
+
├── frontend-developer.json # Primary Developer Agent example (auto-activated)
|
|
554
|
+
├── backend-developer.json # Primary Developer Agent for backend (auto-activated)
|
|
555
|
+
├── code-reviewer.json # Core agent (auto-activated)
|
|
556
|
+
├── code-quality-specialist.json # Utility agent
|
|
557
|
+
├── devops-engineer.json # Utility agent
|
|
558
|
+
├── accessibility-specialist.json # Domain specialist
|
|
559
|
+
├── architecture-specialist.json # Domain specialist
|
|
560
|
+
├── ui-ux-designer.json # Domain specialist
|
|
561
|
+
├── documentation-specialist.json # Domain specialist
|
|
562
|
+
├── performance-specialist.json # Domain specialist
|
|
563
|
+
├── security-specialist.json # Domain specialist
|
|
564
|
+
├── seo-specialist.json # Domain specialist
|
|
565
|
+
└── test-strategy-specialist.json # Domain specialist
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
### Unified Specialist Pattern
|
|
569
|
+
|
|
570
|
+
Each domain has a **unified specialist** agent that supports multiple modes:
|
|
571
|
+
|
|
572
|
+
- **modes.planning**: Planning framework for PLAN mode
|
|
573
|
+
- **modes.implementation**: Implementation verification for ACT mode
|
|
574
|
+
- **modes.evaluation**: Quality assessment for EVAL mode
|
|
575
|
+
|
|
576
|
+
**Example:**
|
|
577
|
+
|
|
578
|
+
- `architecture-specialist.json` contains:
|
|
579
|
+
- `modes.planning` - Architecture planning framework
|
|
580
|
+
- `modes.implementation` - Architecture implementation verification
|
|
581
|
+
- `modes.evaluation` - Architecture quality assessment
|
|
582
|
+
|
|
583
|
+
**Usage:**
|
|
584
|
+
|
|
585
|
+
- Reference: `.ai-rules/agents/{domain}-specialist.json modes.{planning|implementation|evaluation}`
|
|
586
|
+
- Example: `.ai-rules/agents/architecture-specialist.json modes.planning`
|
|
587
|
+
|
|
588
|
+
### Agent File Structure
|
|
589
|
+
|
|
590
|
+
Each agent JSON contains:
|
|
591
|
+
|
|
592
|
+
- **name**: Agent identifier
|
|
593
|
+
- **role**: Title and expertise areas
|
|
594
|
+
- **context_files**: Rules to reference
|
|
595
|
+
- **modes**: Planning, implementation, and evaluation frameworks (for unified specialists)
|
|
596
|
+
- **workflow**: Development approach by code type
|
|
597
|
+
- **code_quality_checklist**: Standards to maintain
|
|
598
|
+
- **tdd_cycle**: Red → Green → Refactor process
|
|
599
|
+
- **ai_monitoring**: Warning signs to watch for
|
|
600
|
+
- **commit_rules**: Structural vs behavioral changes
|
|
601
|
+
- **design_system**: UI component guidelines
|
|
602
|
+
- **communication**: Response language and style
|
|
603
|
+
|
|
604
|
+
---
|
|
605
|
+
|
|
606
|
+
## Adding New Agents
|
|
607
|
+
|
|
608
|
+
### File Naming Convention
|
|
609
|
+
|
|
610
|
+
- **Primary Developer Agent**: `{stack}-developer.json` (e.g., `frontend-developer.json`, `backend-developer.json`, `mobile-developer.json`)
|
|
611
|
+
- **Core Agents**: `{purpose}-{type}.json` (e.g., `code-reviewer.json`)
|
|
612
|
+
- **Domain Specialists**: `{domain}-specialist.json` (e.g., `architecture-specialist.json`, `security-specialist.json`)
|
|
613
|
+
- **Utility Agents**: `{purpose}-{type}.json` (e.g., `code-quality-specialist.json`, `devops-engineer.json`)
|
|
614
|
+
|
|
615
|
+
**Naming Rules:**
|
|
616
|
+
|
|
617
|
+
- Use kebab-case (lowercase with hyphens)
|
|
618
|
+
- Domain names with hyphens are preserved (e.g., `test-strategy-specialist.json`)
|
|
619
|
+
- Be descriptive and consistent with existing patterns
|
|
620
|
+
|
|
621
|
+
### Agent File Structure
|
|
622
|
+
|
|
623
|
+
Create a new JSON file following this structure:
|
|
624
|
+
|
|
625
|
+
```json
|
|
626
|
+
{
|
|
627
|
+
"name": "Agent Name",
|
|
628
|
+
"description": "Brief description",
|
|
629
|
+
"role": {
|
|
630
|
+
"title": "Role Title",
|
|
631
|
+
"expertise": [],
|
|
632
|
+
"responsibilities": []
|
|
633
|
+
},
|
|
634
|
+
"context_files": ["core.md"],
|
|
635
|
+
"workflow": {},
|
|
636
|
+
"reference": {}
|
|
637
|
+
}
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
### Creating a Custom Primary Developer Agent
|
|
641
|
+
|
|
642
|
+
To create a Primary Developer Agent for your tech stack:
|
|
643
|
+
|
|
644
|
+
1. **Copy the template**: Use `frontend-developer.json` as a starting point
|
|
645
|
+
2. **Rename**: `{your-stack}-developer.json` (e.g., `backend-developer.json`)
|
|
646
|
+
3. **Customize expertise**: Update to match your tech stack
|
|
647
|
+
|
|
648
|
+
**Example customizations:**
|
|
649
|
+
|
|
650
|
+
| Tech Stack | Agent File | Key Expertise |
|
|
651
|
+
|------------|------------|---------------|
|
|
652
|
+
| React/Next.js | `frontend-developer.json` | Server Components, React Query, Tailwind |
|
|
653
|
+
| Node.js/Express | `backend-developer.json` | REST API, Middleware, Database |
|
|
654
|
+
| React Native | `mobile-developer.json` | Native modules, Navigation, Platform-specific |
|
|
655
|
+
| Python/FastAPI | `python-developer.json` | Async, Pydantic, SQLAlchemy |
|
|
656
|
+
| Go | `go-developer.json` | Concurrency, Interfaces, Testing |
|
|
657
|
+
|
|
658
|
+
**Common fields to customize:**
|
|
659
|
+
- `role.expertise`: Tech stack specific skills
|
|
660
|
+
- `workflow`: Framework-specific patterns (e.g., Server Actions vs API routes)
|
|
661
|
+
- `design_system`: UI component library for your project
|
|
662
|
+
- `communication.language`: Team's preferred language
|
|
663
|
+
|
|
664
|
+
---
|
|
665
|
+
|
|
666
|
+
## Related Documentation
|
|
667
|
+
|
|
668
|
+
- **Core Rules**: `core.md`
|
|
669
|
+
- **Project Setup**: `project.md`
|
|
670
|
+
- **Augmented Coding**: `augmented-coding.md`
|
|
671
|
+
|
|
672
|
+
---
|
|
673
|
+
|
|
674
|
+
## Best Practices
|
|
675
|
+
|
|
676
|
+
1. **Keep agents focused**: One role per agent
|
|
677
|
+
2. **Reference project rules**: Use `context_files` - no duplication, reference only
|
|
678
|
+
3. **Define clear workflows**: Specify when to use TDD vs test-after
|
|
679
|
+
4. **Include checklists**: Help maintain quality standards
|
|
680
|
+
5. **Agent activation**: Code Reviewer must be activated automatically on EVAL MODE requests
|
|
681
|
+
6. **Evidence-based**: All recommendations must be validated through web search
|