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.
Files changed (32) hide show
  1. package/.ai-rules/CHANGELOG.md +117 -0
  2. package/.ai-rules/README.md +232 -0
  3. package/.ai-rules/adapters/antigravity.md +195 -0
  4. package/.ai-rules/adapters/claude-code.md +117 -0
  5. package/.ai-rules/adapters/codex.md +124 -0
  6. package/.ai-rules/adapters/cursor.md +128 -0
  7. package/.ai-rules/adapters/kiro.md +130 -0
  8. package/.ai-rules/adapters/q.md +126 -0
  9. package/.ai-rules/agents/README.md +681 -0
  10. package/.ai-rules/agents/accessibility-specialist.json +514 -0
  11. package/.ai-rules/agents/architecture-specialist.json +501 -0
  12. package/.ai-rules/agents/backend-developer.json +494 -0
  13. package/.ai-rules/agents/code-quality-specialist.json +565 -0
  14. package/.ai-rules/agents/code-reviewer.json +565 -0
  15. package/.ai-rules/agents/devops-engineer.json +277 -0
  16. package/.ai-rules/agents/documentation-specialist.json +543 -0
  17. package/.ai-rules/agents/frontend-developer.json +402 -0
  18. package/.ai-rules/agents/performance-specialist.json +528 -0
  19. package/.ai-rules/agents/security-specialist.json +464 -0
  20. package/.ai-rules/agents/seo-specialist.json +427 -0
  21. package/.ai-rules/agents/test-strategy-specialist.json +542 -0
  22. package/.ai-rules/agents/ui-ux-designer.json +513 -0
  23. package/.ai-rules/keyword-modes.json +20 -0
  24. package/.ai-rules/rules/augmented-coding.md +292 -0
  25. package/.ai-rules/rules/clarification-guide.md +138 -0
  26. package/.ai-rules/rules/core.md +1030 -0
  27. package/.ai-rules/rules/project.md +200 -0
  28. package/.ai-rules/schemas/README.md +66 -0
  29. package/.ai-rules/schemas/agent.schema.json +258 -0
  30. package/index.d.ts +4 -0
  31. package/index.js +8 -0
  32. package/package.json +32 -0
@@ -0,0 +1,200 @@
1
+ # Project Setup
2
+
3
+ ## Project Overview
4
+
5
+ Define per project. This file is a universal AI rules template.
6
+
7
+ ## Tech Stack
8
+
9
+ Refer to the project's `package.json`. AI rules do not pin specific package versions.
10
+
11
+ ## Project Structure
12
+
13
+ Define per project. Below is a layered architecture example:
14
+
15
+ ```
16
+ src/
17
+ ├── app/ # Entry point / Router
18
+ │ ├── api/ # API Routes
19
+ │ ├── (pages)/ # Page routing
20
+ │ ├── layout.tsx # Root layout
21
+ │ └── globals.css # Global styles
22
+
23
+ ├── entities/ # Domain entities (business logic)
24
+ │ └── {domain}/
25
+ │ ├── apis/ # API call functions (*.ts)
26
+ │ ├── models/ # Data models / hooks (*.ts, *.tsx)
27
+ │ ├── types.ts # Type definitions
28
+ │ └── index.ts # Public API
29
+
30
+ ├── features/ # Feature-specific UI components
31
+ │ └── {Feature}/
32
+ │ ├── {Feature}.tsx # Main component
33
+ │ ├── {Feature}.parts.tsx # Sub-components
34
+ │ ├── {Feature}.types.ts # Type definitions
35
+ │ ├── {Feature}.constants.ts # Constants
36
+ │ ├── {Feature}.unit.spec.tsx # Unit tests
37
+ │ └── index.ts # Export
38
+
39
+ ├── widgets/ # Composite widgets (multiple features combined)
40
+ │ └── {Widget}/
41
+ │ ├── {Widget}.tsx # Main widget
42
+ │ ├── {Widget}.parts.tsx # Sub-components
43
+ │ └── index.ts
44
+
45
+ └── shared/ # Common modules (used across the project)
46
+ ├── components/ # Reusable UI components
47
+ ├── hooks/ # Custom hooks
48
+ ├── providers/ # Context providers / State management
49
+ ├── utils/ # Utility functions
50
+ ├── types/ # Common type definitions
51
+ ├── constants/ # Common constants
52
+ ├── api/ # API client, error handlers
53
+ ├── auth/ # Authentication logic
54
+ └── services/ # Business services
55
+ ```
56
+
57
+ ## Development Rules
58
+
59
+ ### 1. Code Writing Rules
60
+
61
+ #### Core Principles
62
+ - **Never use mocking**: Write only real, working code
63
+ - **Type Safety**: Follow strict type checking mode
64
+ - **Latest Framework Features**: Utilize latest framework capabilities
65
+ - **Component Naming**: PascalCase, use clear names that indicate functionality
66
+ - **Type imports**: Use named imports for types (e.g., `import { type SomeType } from 'module';`)
67
+
68
+ #### File Naming Convention
69
+ - **Component**: `{Feature}.tsx`
70
+ - **Sub-components**: `{Feature}.parts.tsx`
71
+ - **Types**: `{Feature}.types.ts` or `types.ts`
72
+ - **Constants**: `{Feature}.constants.ts` or `constants.ts`
73
+ - **Utils**: `{Feature}.utils.ts`
74
+ - **Unit Tests**: `{Feature}.unit.spec.tsx` or `{Feature}.test.ts`
75
+ - **E2E Tests**: `{Feature}.e2e.ts` or `{Feature}.cy.ts`
76
+ - **Module Export**: `index.ts`
77
+
78
+ #### Import/Export Rules
79
+ - Each module exports only public API through `index.ts`
80
+ - Use absolute paths configured in the project (e.g., `@/`, `~/`)
81
+ - Layer dependency direction: `app → widgets → features → entities → shared`
82
+
83
+ ### 2. Pure vs Impure Function Separation
84
+
85
+ - **Always separate pure and impure functions into different files**
86
+ - **Pure functions**: `*.utils.ts`, `*.helpers.ts`
87
+ - **Impure functions**: `*.api.ts`, `*.service.ts`, `*.models.ts`
88
+
89
+ Example:
90
+ ```typescript
91
+ // ✅ Good: Separated
92
+ // validation.utils.ts - Pure function
93
+ export const validateEmail = (email: string) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
94
+
95
+ // user.api.ts - Impure function
96
+ export const createUser = async (data: UserData) => { /* API call */ };
97
+
98
+ // ❌ Bad: Mixed
99
+ // user.ts - Mixed together
100
+ export const validateEmail = (email: string) => { /* ... */ };
101
+ export const createUser = async (data: UserData) => { /* ... */ };
102
+ ```
103
+
104
+ ### 3. Script Commands
105
+
106
+ Refer to the project's `package.json` scripts section. Common commands:
107
+
108
+ ```bash
109
+ # Development
110
+ yarn dev # Start dev server
111
+ yarn build # Production build
112
+ yarn start # Start production server
113
+
114
+ # Code Quality
115
+ yarn lint # Linting check
116
+ yarn format # Code formatting
117
+
118
+ # Testing
119
+ yarn test # Run tests
120
+ yarn test:coverage # Run tests with coverage
121
+ ```
122
+
123
+ Actual commands may vary per project. Check the project's package.json.
124
+
125
+ ## Development Workflow
126
+
127
+ For detailed TDD workflows, testing strategies, and code quality practices, refer to **`augmented-coding.md`**.
128
+
129
+ ### Quick Reference
130
+
131
+ **Development approach:**
132
+ - Core logic (entities, shared/utils, hooks): TDD (test-first)
133
+ - UI components (features, widgets): Test-after
134
+ - Coverage goal: 90%+
135
+
136
+ ### Code Review Checklist
137
+
138
+ #### Required Checks
139
+ - [ ] **TypeScript Type Safety**: No `any` usage, all types explicitly defined
140
+ - [ ] **Test Coverage**: Maintain 90%+ coverage
141
+ - [ ] **Linting Rules**: Resolve all linting errors
142
+ - [ ] **Pure/Impure Separation**: Separate files for pure and impure functions
143
+
144
+ #### Architecture & Design
145
+ - [ ] **Layer Architecture**: Respect layer boundaries and separation of concerns
146
+ - [ ] **Dependency Direction**: app → widgets → features → entities → shared
147
+ - [ ] **Component Reusability**: DRY principle, utilize shared components
148
+ - [ ] **Code quality**: See `augmented-coding.md` for SOLID, TDD, and refactoring standards
149
+
150
+ #### Performance & Optimization
151
+ - [ ] **Framework Optimization**: Proper use of framework-specific optimization techniques
152
+ - [ ] **Image Optimization**: Use framework's Image component
153
+ - [ ] **Bundle Size**: Code splitting with dynamic imports
154
+ - [ ] **Rendering Optimization**: Prevent unnecessary re-renders
155
+
156
+ #### UX & Accessibility
157
+ - [ ] **Responsive Design**: Support mobile/tablet/desktop
158
+ - [ ] **Accessibility (a11y)**: ARIA attributes, keyboard navigation
159
+ - [ ] **Loading States**: Provide loading UI (Skeleton, Spinner, etc.)
160
+ - [ ] **Error Handling**: Utilize error boundaries
161
+
162
+ ## Important Guidelines
163
+
164
+ ### 1. Never Do ❌
165
+
166
+ - **Mock data or fake implementations**: Only real API integration allowed
167
+ - **Type `any` usage**: Explicitly define all types
168
+ - **Direct DOM manipulation**: Use framework patterns
169
+ - **Leave console.log in production code**: Development only
170
+ - **Mix pure/impure functions**: Must separate into different files
171
+ - **Reverse layer dependencies**: Lower layers cannot import upper layers
172
+
173
+ ### 2. Must Do ✅
174
+
175
+ - **Write code with real API calls** (no mocking)
176
+ - **Design reusable components**
177
+ - **Consider accessibility (a11y)**
178
+ - **Apply performance optimizations**
179
+ - **Utilize error boundaries**
180
+ - **Follow augmented coding practices** (see `augmented-coding.md`)
181
+
182
+ ### 3. Problem-Solving Priority
183
+
184
+ 1. **Find real working solutions** (no mocking)
185
+ 2. **Maintain consistency after analyzing existing code patterns**
186
+ 3. **Ensure type safety**
187
+ 4. **Consider performance impact**
188
+
189
+ ### 4. Design System Usage
190
+
191
+ Refer to the project's design system documentation. General guidelines:
192
+ - Prioritize project design system components
193
+ - Use className composition utilities as defined in project
194
+ - Maintain design token consistency
195
+ - Follow typography patterns
196
+ - Respect responsive breakpoints
197
+
198
+ ---
199
+
200
+ This guide helps AI assistants understand the project and generate consistent code.
@@ -0,0 +1,66 @@
1
+ # Codingbuddy Schemas
2
+
3
+ This directory contains JSON schemas for validating AI rule files.
4
+
5
+ ## Available Schemas
6
+
7
+ ### agent.schema.json
8
+
9
+ Validates agent definition files in `.ai-rules/agents/`.
10
+
11
+ **Required Fields:**
12
+ - `name` - Agent display name
13
+ - `description` - Brief description of expertise
14
+ - `role` - Role definition with title and expertise
15
+ - `context_files` - List of context files to load
16
+
17
+ **Agent Types:**
18
+
19
+ | Type | Key Field | Examples |
20
+ |------|-----------|----------|
21
+ | Developer | `activation` | frontend-developer, backend-developer |
22
+ | Reviewer | `activation` | code-reviewer |
23
+ | Specialist | `modes` | security-specialist, performance-specialist |
24
+ | Other | Neither | devops-engineer |
25
+
26
+ ## Usage
27
+
28
+ ### VS Code Integration
29
+
30
+ Schemas are automatically applied in VS Code via `.vscode/settings.json`:
31
+
32
+ ```json
33
+ {
34
+ "json.schemas": [
35
+ {
36
+ "fileMatch": [".ai-rules/agents/*.json"],
37
+ "url": "./.ai-rules/schemas/agent.schema.json"
38
+ }
39
+ ]
40
+ }
41
+ ```
42
+
43
+ ### CLI Validation
44
+
45
+ ```bash
46
+ # Validate all agent files
47
+ yarn validate:rules
48
+
49
+ # Validate schema only
50
+ yarn validate:rules:schema
51
+ ```
52
+
53
+ ### Manual Validation with ajv
54
+
55
+ ```bash
56
+ npx ajv validate -s .ai-rules/schemas/agent.schema.json -d ".ai-rules/agents/*.json"
57
+ ```
58
+
59
+ ## Schema Development
60
+
61
+ When modifying the schema:
62
+
63
+ 1. Update `agent.schema.json`
64
+ 2. Run validation against all existing files
65
+ 3. Fix any breaking changes or adjust schema
66
+ 4. Update this README if needed
@@ -0,0 +1,258 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://codingbuddy.dev/schemas/agent.schema.json",
4
+ "title": "Codingbuddy Agent Definition",
5
+ "description": "Schema for AI agent definition files in .ai-rules/agents/",
6
+ "type": "object",
7
+ "required": ["name", "description", "role", "context_files"],
8
+ "properties": {
9
+ "name": {
10
+ "type": "string",
11
+ "description": "Display name of the agent",
12
+ "minLength": 1,
13
+ "examples": ["Frontend Developer", "Code Reviewer", "Security Specialist"]
14
+ },
15
+ "description": {
16
+ "type": "string",
17
+ "description": "Brief description of the agent's purpose and expertise",
18
+ "minLength": 10
19
+ },
20
+ "role": {
21
+ "type": "object",
22
+ "description": "Agent's role definition including title, expertise, and responsibilities",
23
+ "required": ["title"],
24
+ "properties": {
25
+ "title": {
26
+ "type": "string",
27
+ "description": "Official role title",
28
+ "minLength": 1
29
+ },
30
+ "expertise": {
31
+ "type": "array",
32
+ "description": "List of expertise areas",
33
+ "items": { "type": "string" },
34
+ "minItems": 1
35
+ },
36
+ "responsibilities": {
37
+ "type": "array",
38
+ "description": "List of responsibilities",
39
+ "items": { "type": "string" }
40
+ },
41
+ "tech_stack_reference": {
42
+ "type": "string",
43
+ "description": "Reference to tech stack documentation"
44
+ }
45
+ },
46
+ "additionalProperties": true
47
+ },
48
+ "context_files": {
49
+ "type": "array",
50
+ "description": "List of context files to load for this agent",
51
+ "items": {
52
+ "type": "string",
53
+ "pattern": "^\\.ai-rules/.*"
54
+ },
55
+ "minItems": 1,
56
+ "examples": [[".ai-rules/rules/core.md", ".ai-rules/rules/project.md"]]
57
+ },
58
+ "activation": {
59
+ "type": "object",
60
+ "description": "Activation configuration for developer/reviewer agents",
61
+ "properties": {
62
+ "trigger": {
63
+ "type": "string",
64
+ "description": "Condition that triggers this agent"
65
+ },
66
+ "rule": {
67
+ "type": "string",
68
+ "description": "Strict rule for activation"
69
+ },
70
+ "mandatory_checklist": {
71
+ "type": "object",
72
+ "description": "Checklist items that must be followed",
73
+ "additionalProperties": true
74
+ },
75
+ "verification_guide": {
76
+ "type": "object",
77
+ "description": "Guide for verifying checklist items",
78
+ "additionalProperties": { "type": "string" }
79
+ },
80
+ "execution_order": {
81
+ "type": "object",
82
+ "description": "Order of execution for different modes",
83
+ "additionalProperties": {
84
+ "type": "array",
85
+ "items": { "type": "string" }
86
+ }
87
+ },
88
+ "workflow_integration": {
89
+ "type": "object",
90
+ "description": "How this agent integrates with workflow"
91
+ },
92
+ "planning_framework": {
93
+ "type": "object",
94
+ "description": "Framework for planning mode"
95
+ },
96
+ "implementation_framework": {
97
+ "type": "object",
98
+ "description": "Framework for implementation mode"
99
+ }
100
+ },
101
+ "additionalProperties": true
102
+ },
103
+ "modes": {
104
+ "type": "object",
105
+ "description": "Mode-specific configuration for specialist agents",
106
+ "properties": {
107
+ "planning": {
108
+ "type": "object",
109
+ "description": "Planning mode configuration"
110
+ },
111
+ "implementation": {
112
+ "type": "object",
113
+ "description": "Implementation mode configuration"
114
+ },
115
+ "evaluation": {
116
+ "type": "object",
117
+ "description": "Evaluation mode configuration"
118
+ }
119
+ },
120
+ "additionalProperties": true
121
+ },
122
+ "workflow": {
123
+ "type": "object",
124
+ "description": "Workflow configuration",
125
+ "additionalProperties": true
126
+ },
127
+ "development_philosophy": {
128
+ "type": "object",
129
+ "description": "Development philosophy and approach",
130
+ "additionalProperties": true
131
+ },
132
+ "code_quality_checklist": {
133
+ "type": "array",
134
+ "description": "Code quality checklist items",
135
+ "items": { "type": "string" }
136
+ },
137
+ "tdd_cycle": {
138
+ "type": "object",
139
+ "description": "TDD cycle configuration",
140
+ "additionalProperties": true
141
+ },
142
+ "ai_monitoring": {
143
+ "type": "object",
144
+ "description": "AI behavior monitoring configuration",
145
+ "additionalProperties": true
146
+ },
147
+ "commit_rules": {
148
+ "type": "object",
149
+ "description": "Commit rules and discipline",
150
+ "additionalProperties": true
151
+ },
152
+ "design_system": {
153
+ "type": "object",
154
+ "description": "Design system configuration",
155
+ "additionalProperties": true
156
+ },
157
+ "communication": {
158
+ "type": "object",
159
+ "description": "Communication preferences",
160
+ "properties": {
161
+ "language": {
162
+ "type": "string",
163
+ "description": "Response language preference"
164
+ },
165
+ "approach": {
166
+ "type": "array",
167
+ "items": { "type": "string" }
168
+ },
169
+ "reference_style": {
170
+ "type": "string"
171
+ },
172
+ "emphasis": {
173
+ "type": "string"
174
+ }
175
+ },
176
+ "additionalProperties": true
177
+ },
178
+ "file_naming": {
179
+ "type": "object",
180
+ "description": "File naming conventions",
181
+ "additionalProperties": true
182
+ },
183
+ "reference": {
184
+ "type": "object",
185
+ "description": "Reference links and documentation",
186
+ "additionalProperties": true
187
+ },
188
+ "shared_framework": {
189
+ "type": "object",
190
+ "description": "Shared framework configuration for specialist agents",
191
+ "additionalProperties": true
192
+ },
193
+ "persona": {
194
+ "type": "object",
195
+ "description": "Agent persona configuration",
196
+ "additionalProperties": true
197
+ },
198
+ "evaluation_framework": {
199
+ "type": "object",
200
+ "description": "Evaluation framework for reviewer agents",
201
+ "additionalProperties": true
202
+ },
203
+ "evaluation_output_format": {
204
+ "type": "object",
205
+ "description": "Output format for evaluations",
206
+ "additionalProperties": true
207
+ },
208
+ "evaluation_checklist": {
209
+ "type": "object",
210
+ "description": "Evaluation checklist",
211
+ "additionalProperties": true
212
+ },
213
+ "improvement_prioritization": {
214
+ "type": "object",
215
+ "description": "Improvement prioritization rules",
216
+ "additionalProperties": true
217
+ },
218
+ "workflow_integration": {
219
+ "type": "object",
220
+ "description": "Workflow integration configuration",
221
+ "additionalProperties": true
222
+ },
223
+ "research_requirements": {
224
+ "type": "object",
225
+ "description": "Research requirements for evidence-based recommendations",
226
+ "additionalProperties": true
227
+ },
228
+ "quality_gates": {
229
+ "type": "object",
230
+ "description": "Quality gate definitions",
231
+ "additionalProperties": true
232
+ },
233
+ "infrastructure": {
234
+ "type": "object",
235
+ "description": "Infrastructure configuration (DevOps)",
236
+ "additionalProperties": true
237
+ },
238
+ "best_practices": {
239
+ "type": "object",
240
+ "description": "Best practices guidelines",
241
+ "additionalProperties": true
242
+ },
243
+ "checklist": {
244
+ "oneOf": [
245
+ {
246
+ "type": "object",
247
+ "additionalProperties": true
248
+ },
249
+ {
250
+ "type": "array",
251
+ "items": { "type": "string" }
252
+ }
253
+ ],
254
+ "description": "General checklist (can be object or array)"
255
+ }
256
+ },
257
+ "additionalProperties": true
258
+ }
package/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Path to the .ai-rules directory
3
+ */
4
+ export const rulesPath: string;
package/index.js ADDED
@@ -0,0 +1,8 @@
1
+ const path = require('path');
2
+
3
+ /**
4
+ * Path to the .ai-rules directory
5
+ */
6
+ const rulesPath = path.resolve(__dirname, '.ai-rules');
7
+
8
+ module.exports = { rulesPath };
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "codingbuddy-rules",
3
+ "version": "0.0.0-canary.20251222065027.7844cd5",
4
+ "description": "AI coding rules for consistent practices across AI assistants",
5
+ "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "files": [
8
+ "index.js",
9
+ "index.d.ts",
10
+ ".ai-rules"
11
+ ],
12
+ "keywords": [
13
+ "ai",
14
+ "coding",
15
+ "rules",
16
+ "claude",
17
+ "cursor",
18
+ "codex",
19
+ "mcp"
20
+ ],
21
+ "author": "JeremyDev87",
22
+ "license": "MIT",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/JeremyDev87/codingbuddy",
26
+ "directory": "packages/rules"
27
+ },
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "packageManager": "yarn@4.11.0"
32
+ }