|
1 | 1 | --- |
2 | | -description: Common AI Rules Import - References shared rules from packages/rules/.ai-rules/ |
| 2 | +description: codingbuddy common rules - applied to all conversations |
3 | 3 | globs: |
4 | 4 | alwaysApply: true |
5 | 5 | --- |
6 | 6 |
|
7 | | -# Common AI Rules Reference |
| 7 | +# codingbuddy Rules |
8 | 8 |
|
9 | | -This project uses shared AI coding rules from `packages/rules/.ai-rules/` directory for consistency across all AI assistants (Cursor, Claude Code, Antigravity, Codex, Q, Kiro). |
| 9 | +## Workflow |
10 | 10 |
|
11 | | -## 📚 Core Workflow Rules |
| 11 | +- **PLAN** → **ACT** → **PLAN** (default flow) |
| 12 | +- **EVAL** only on explicit request |
12 | 13 |
|
13 | | -**Source**: [packages/rules/.ai-rules/rules/core.md](../../packages/rules/.ai-rules/rules/core.md) |
| 14 | +## Required Actions |
14 | 15 |
|
15 | | -### Work Modes |
| 16 | +When `PLAN`, `ACT`, `EVAL` keywords detected → **Immediately** call `parse_mode` MCP tool |
16 | 17 |
|
17 | | -You have three modes of operation: |
| 18 | +## Core Principles |
18 | 19 |
|
19 | | -1. **PLAN mode** - Define a plan without making changes |
20 | | -2. **ACT mode** - Execute the plan and make changes |
21 | | -3. **EVAL mode** - Analyze results and propose improvements |
| 20 | +- TDD: Red → Green → Refactor |
| 21 | +- Test coverage 90%+ |
| 22 | +- TypeScript strict (no `any`) |
| 23 | +- Server Components first |
22 | 24 |
|
23 | | -**Mode Flow**: |
24 | | -- Start in PLAN mode by default |
25 | | -- Move to ACT when user types `ACT` |
26 | | -- Return to PLAN after ACT completes (automatic) |
27 | | -- Move to EVAL only when user explicitly types `EVAL` |
| 25 | +## Project Config |
28 | 26 |
|
29 | | -**Mode Indicators**: |
30 | | -- Print `# Mode: PLAN` in plan mode |
31 | | -- Print `# Mode: ACT` in act mode |
32 | | -- Print `# Mode: EVAL` in eval mode |
| 27 | +Use `get_project_config` MCP tool to retrieve project-specific settings (language, tech stack, conventions). |
33 | 28 |
|
34 | | -### Agent System |
| 29 | +## Detailed Rules |
35 | 30 |
|
36 | | -**Auto-activated Agents**: |
37 | | -- **Frontend Developer** (`packages/rules/.ai-rules/agents/frontend-developer.json`): PLAN/ACT modes |
38 | | -- **Code Reviewer** (`packages/rules/.ai-rules/agents/code-reviewer.json`): EVAL mode |
| 31 | +All details in Single Source of Truth: |
39 | 32 |
|
40 | | -**Specialist Agents** (12 available): |
41 | | -- Architecture, Test Strategy, Performance, Security |
42 | | -- Accessibility, SEO, Design System, Documentation |
43 | | -- Code Quality, DevOps Engineer |
44 | | - |
45 | | -For complete workflow details, see [packages/rules/.ai-rules/rules/core.md](../../packages/rules/.ai-rules/rules/core.md) |
46 | | - |
47 | | ---- |
48 | | - |
49 | | -## 🏗️ Project Setup |
50 | | - |
51 | | -**Source**: [packages/rules/.ai-rules/rules/project.md](../../packages/rules/.ai-rules/rules/project.md) |
52 | | - |
53 | | -### Tech Stack |
54 | | - |
55 | | -프로젝트의 `package.json`을 참조하세요. |
56 | | - |
57 | | -### Project Structure |
58 | | -``` |
59 | | -src/ |
60 | | -├── app/ # Next.js App Router |
61 | | -├── entities/ # Domain entities (business logic) |
62 | | -├── features/ # Feature-specific UI components |
63 | | -├── widgets/ # Composite widgets |
64 | | -└── shared/ # Common modules |
65 | | -``` |
66 | | - |
67 | | -### Development Rules |
68 | | -- **Layer dependency**: app → widgets → features → entities → shared |
69 | | -- **Pure/impure separation**: Separate files for pure and impure functions |
70 | | -- **Server Components**: Default, Client Components only when necessary |
71 | | -- **Test coverage**: 90%+ goal |
72 | | - |
73 | | -For complete project setup, see [packages/rules/.ai-rules/rules/project.md](../../packages/rules/.ai-rules/rules/project.md) |
74 | | - |
75 | | ---- |
76 | | - |
77 | | -## 🎯 Augmented Coding Principles |
78 | | - |
79 | | -**Source**: [packages/rules/.ai-rules/rules/augmented-coding.md](../../packages/rules/.ai-rules/rules/augmented-coding.md) |
80 | | - |
81 | | -### TDD Cycle (Strict Adherence) |
82 | | - |
83 | | -Follow the **Red → Green → Refactor** cycle: |
84 | | - |
85 | | -1. **Red**: Write a failing test that defines functionality |
86 | | -2. **Green**: Implement minimum code needed to pass |
87 | | -3. **Refactor**: Improve structure only after tests pass |
88 | | - |
89 | | -### Core Principles |
90 | | -- **TDD for core logic** (entities, shared/utils, shared/hooks) |
91 | | -- **Test-after for UI** (features, widgets) |
92 | | -- **SOLID principles** and code quality standards |
93 | | -- **90%+ test coverage** goal |
94 | | -- **No mocking** - test real behavior with actual implementations |
95 | | - |
96 | | -### Code Quality Standards |
97 | | -- TypeScript strict mode (no `any`) |
98 | | -- DRY (Don't Repeat Yourself) |
99 | | -- Keep methods small (10-20 lines max) |
100 | | -- Minimize state, prefer pure functions |
101 | | -- Tidy First: Separate structural vs behavioral changes |
102 | | - |
103 | | -For complete augmented coding guide, see [packages/rules/.ai-rules/rules/augmented-coding.md](../../packages/rules/.ai-rules/rules/augmented-coding.md) |
104 | | - |
105 | | ---- |
106 | | - |
107 | | -## 🤖 Specialist Agents |
108 | | - |
109 | | -**Source**: [packages/rules/.ai-rules/agents/](../../packages/rules/.ai-rules/agents/) |
110 | | - |
111 | | -All specialist agents are defined in `packages/rules/.ai-rules/agents/` directory: |
112 | | - |
113 | | -| Agent | Expertise | Use Cases | |
114 | | -|-------|-----------|-----------| |
115 | | -| Frontend Developer | React/Next.js, TDD, design system | Component implementation, Server Actions | |
116 | | -| Code Reviewer | Quality evaluation, architecture | Code review, production readiness | |
117 | | -| Security Specialist | OAuth 2.0, JWT, XSS/CSRF | Authentication, security audit | |
118 | | -| Accessibility Specialist | WCAG 2.1 AA, ARIA | A11y compliance, screen readers | |
119 | | -| Performance Specialist | Bundle size, Core Web Vitals | Performance tuning, optimization | |
120 | | -| +7 more specialists | Various domains | See agents README | |
121 | | - |
122 | | -For complete agent documentation, see [packages/rules/.ai-rules/agents/README.md](../../packages/rules/.ai-rules/agents/README.md) |
123 | | - |
124 | | ---- |
125 | | - |
126 | | -## 🔴 MANDATORY: Keyword Mode Detection |
127 | | - |
128 | | -<CODINGBUDDY_CRITICAL_RULE> |
129 | | - |
130 | | -**When user message starts with PLAN, ACT, or EVAL keyword (or localized: Korean 계획/실행/평가, Japanese 計画/実行/評価, Chinese 计划/执行/评估, Spanish PLANIFICAR/ACTUAR/EVALUAR):** |
131 | | - |
132 | | -1. **IMMEDIATELY** call `parse_mode` MCP tool with the user's prompt |
133 | | -2. Follow the returned `instructions` **EXACTLY** |
134 | | -3. Apply the returned `rules` as context |
135 | | -4. If `warnings` are present, inform the user |
136 | | - |
137 | | -**This is MANDATORY, not optional.** |
138 | | - |
139 | | -Failure to call `parse_mode` when these keywords are present will result in: |
140 | | -- Missed critical checklists (Devil's Advocate Analysis, Impact Radius Analysis) |
141 | | -- Incomplete evaluations |
142 | | -- Quality issues not caught before deployment |
143 | | - |
144 | | -**Red Flags** (STOP if you think these): |
145 | | -| Thought | Reality | |
146 | | -|---------|---------| |
147 | | -| "I can handle EVAL myself" | NO. Call parse_mode FIRST. | |
148 | | -| "The rules are similar anyway" | NO. Each mode has specific checklists. | |
149 | | -| "I'll save a tool call" | NO. parse_mode MUST be called FIRST. | |
150 | | -| "I already know what to do" | NO. Rules may have been updated. | |
151 | | - |
152 | | -</CODINGBUDDY_CRITICAL_RULE> |
153 | | - |
154 | | -Example: `PLAN design auth feature` → **즉시** parse_mode 호출 → PLAN 모드로 작업 |
155 | | - |
156 | | ---- |
157 | | - |
158 | | -## 💬 Communication |
159 | | - |
160 | | -- **Always respond in Korean (한국어)** |
161 | | -- User frequently modifies code directly, so **always read code and refresh information** instead of relying on memory |
162 | | -- **Start by understanding current code state** for every question |
163 | | - |
164 | | ---- |
165 | | - |
166 | | -## 📖 Full Documentation |
167 | | - |
168 | | -For comprehensive guides: |
169 | | -- **Core Rules**: [packages/rules/.ai-rules/rules/core.md](../../packages/rules/.ai-rules/rules/core.md) |
170 | | -- **Project Setup**: [packages/rules/.ai-rules/rules/project.md](../../packages/rules/.ai-rules/rules/project.md) |
171 | | -- **Augmented Coding**: [packages/rules/.ai-rules/rules/augmented-coding.md](../../packages/rules/.ai-rules/rules/augmented-coding.md) |
172 | | -- **Agents System**: [packages/rules/.ai-rules/agents/README.md](../../packages/rules/.ai-rules/agents/README.md) |
173 | | -- **Integration Guide**: [packages/rules/.ai-rules/adapters/cursor.md](../../packages/rules/.ai-rules/adapters/cursor.md) |
174 | | - |
175 | | ---- |
176 | | - |
177 | | -**Note**: This file references common AI rules from `packages/rules/.ai-rules/` directory. All AI assistants (Cursor, Claude Code, Antigravity, etc.) share the same rules for consistency. |
| 33 | +- [`packages/rules/.ai-rules/rules/core.md`](../../packages/rules/.ai-rules/rules/core.md) |
| 34 | +- [`packages/rules/.ai-rules/rules/augmented-coding.md`](../../packages/rules/.ai-rules/rules/augmented-coding.md) |
| 35 | +- [`packages/rules/.ai-rules/agents/README.md`](../../packages/rules/.ai-rules/agents/README.md) |
0 commit comments