codingbuddy-rules 2.2.0 → 2.2.1
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.
|
@@ -6,6 +6,42 @@ This guide explains how to use the common AI rules (`.ai-rules/`) in Claude Code
|
|
|
6
6
|
|
|
7
7
|
Claude Code uses the `.claude/` directory for project-specific custom instructions, referencing the common rules from `.ai-rules/`.
|
|
8
8
|
|
|
9
|
+
## 🆕 Code Conventions Support
|
|
10
|
+
|
|
11
|
+
CodingBuddy now automatically enforces project code conventions from config files:
|
|
12
|
+
|
|
13
|
+
### Available MCP Tool
|
|
14
|
+
|
|
15
|
+
**`get_code_conventions`**: Parses and exposes project conventions from:
|
|
16
|
+
- `tsconfig.json` - TypeScript strict mode, compiler options
|
|
17
|
+
- `eslint.config.js` / `.eslintrc.json` - Linting rules
|
|
18
|
+
- `.prettierrc` - Formatting rules (quotes, semicolons, indentation)
|
|
19
|
+
- `.editorconfig` - Editor settings (indent style/size, line endings, charset)
|
|
20
|
+
- `.markdownlint.json` - Markdown linting rules
|
|
21
|
+
|
|
22
|
+
### When to Use
|
|
23
|
+
|
|
24
|
+
**ACT Mode**: Call `get_code_conventions` before implementing to verify code follows project conventions.
|
|
25
|
+
|
|
26
|
+
**EVAL Mode**: The `conventions` checklist domain is automatically included in code reviews.
|
|
27
|
+
|
|
28
|
+
### Example Usage
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
// In ACT mode
|
|
32
|
+
const conventions = await get_code_conventions();
|
|
33
|
+
|
|
34
|
+
// Verify TypeScript strict mode
|
|
35
|
+
if (conventions.typescript.strict) {
|
|
36
|
+
// Ensure no implicit any types
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Check Prettier formatting
|
|
40
|
+
if (conventions.prettier.singleQuote) {
|
|
41
|
+
// Use single quotes
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
9
45
|
## Integration Method
|
|
10
46
|
|
|
11
47
|
### 1. Create Claude Configuration
|
|
@@ -64,6 +64,10 @@
|
|
|
64
64
|
"rule": "Configuration changes MUST be validated (lint, typecheck, build)",
|
|
65
65
|
"verification_key": "validation"
|
|
66
66
|
},
|
|
67
|
+
"convention_compliance": {
|
|
68
|
+
"rule": "Code MUST follow project conventions from config files (tsconfig, eslint, prettier, editorconfig, markdownlint)",
|
|
69
|
+
"verification_key": "convention_compliance"
|
|
70
|
+
},
|
|
67
71
|
"language": {
|
|
68
72
|
"rule": "MUST respond in Korean as specified in communication.language",
|
|
69
73
|
"verification_key": "language"
|
|
@@ -74,6 +78,7 @@
|
|
|
74
78
|
"backward_compatible": "Check existing tests pass, verify no breaking changes to build output",
|
|
75
79
|
"documentation": "Add inline comments explaining non-obvious settings",
|
|
76
80
|
"validation": "Run yarn lint, yarn typecheck, yarn build after changes",
|
|
81
|
+
"convention_compliance": "Call get_code_conventions MCP tool and verify code follows all project conventions",
|
|
77
82
|
"language": "All response text in Korean"
|
|
78
83
|
}
|
|
79
84
|
},
|
|
@@ -114,6 +119,19 @@
|
|
|
114
119
|
"5. Test that all features still work",
|
|
115
120
|
"6. Document any breaking changes or migration steps"
|
|
116
121
|
]
|
|
122
|
+
},
|
|
123
|
+
"convention_verification": {
|
|
124
|
+
"approach": "Verify code against project config files",
|
|
125
|
+
"applies_to": "ACT mode implementation and EVAL mode review",
|
|
126
|
+
"steps": [
|
|
127
|
+
"1. Call get_code_conventions MCP tool to get project conventions",
|
|
128
|
+
"2. TypeScript: Verify strict mode, noImplicitAny, strictNullChecks compliance",
|
|
129
|
+
"3. ESLint: Check flat config usage, verify no lint errors",
|
|
130
|
+
"4. Prettier: Verify formatting (quotes, semicolons, trailing commas, indentation)",
|
|
131
|
+
"5. EditorConfig: Check indentation style/size, line endings, charset",
|
|
132
|
+
"6. Markdown: Verify markdownlint rules compliance",
|
|
133
|
+
"7. Report any convention violations with specific file/line references"
|
|
134
|
+
]
|
|
117
135
|
}
|
|
118
136
|
},
|
|
119
137
|
|
|
@@ -178,7 +196,7 @@
|
|
|
178
196
|
],
|
|
179
197
|
|
|
180
198
|
"communication": {
|
|
181
|
-
"language": "
|
|
199
|
+
"language": "ko",
|
|
182
200
|
"style": "Technical and precise, focusing on configuration details",
|
|
183
201
|
"approach": [
|
|
184
202
|
"Start by understanding the current configuration state",
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
{
|
|
2
|
+
"domain": "conventions",
|
|
3
|
+
"icon": "📐",
|
|
4
|
+
"description": "Code conventions and formatting consistency from project config files",
|
|
5
|
+
"categories": [
|
|
6
|
+
{
|
|
7
|
+
"name": "typescript",
|
|
8
|
+
"triggers": {
|
|
9
|
+
"files": ["**/*.ts", "**/*.tsx"],
|
|
10
|
+
"imports": [],
|
|
11
|
+
"patterns": []
|
|
12
|
+
},
|
|
13
|
+
"items": [
|
|
14
|
+
{
|
|
15
|
+
"id": "conv-ts-001",
|
|
16
|
+
"text": "TypeScript strict mode is enabled (tsconfig.json: strict: true)",
|
|
17
|
+
"priority": "high",
|
|
18
|
+
"reason": "Strict mode catches type errors early and improves code quality"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "conv-ts-002",
|
|
22
|
+
"text": "No implicit any is enforced (tsconfig.json: noImplicitAny: true)",
|
|
23
|
+
"priority": "high",
|
|
24
|
+
"reason": "Explicit types prevent runtime errors"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "conv-ts-003",
|
|
28
|
+
"text": "Strict null checks are enabled (tsconfig.json: strictNullChecks: true)",
|
|
29
|
+
"priority": "high",
|
|
30
|
+
"reason": "Prevents null/undefined errors at runtime"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "conv-ts-004",
|
|
34
|
+
"text": "Path aliases match tsconfig.json paths configuration",
|
|
35
|
+
"priority": "medium",
|
|
36
|
+
"reason": "Consistent import paths improve maintainability"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "eslint",
|
|
42
|
+
"triggers": {
|
|
43
|
+
"files": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
|
|
44
|
+
"imports": [],
|
|
45
|
+
"patterns": []
|
|
46
|
+
},
|
|
47
|
+
"items": [
|
|
48
|
+
{
|
|
49
|
+
"id": "conv-eslint-001",
|
|
50
|
+
"text": "Using ESLint flat config (eslint.config.js, not .eslintrc)",
|
|
51
|
+
"priority": "medium",
|
|
52
|
+
"reason": "Flat config is the new standard and more maintainable"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"id": "conv-eslint-002",
|
|
56
|
+
"text": "Code follows ESLint rules defined in project config",
|
|
57
|
+
"priority": "high",
|
|
58
|
+
"reason": "Consistent linting prevents code quality issues"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "conv-eslint-003",
|
|
62
|
+
"text": "No ESLint errors or warnings in modified files",
|
|
63
|
+
"priority": "high",
|
|
64
|
+
"reason": "Lint errors indicate code quality or style violations"
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "prettier",
|
|
70
|
+
"triggers": {
|
|
71
|
+
"files": [
|
|
72
|
+
"**/*.ts",
|
|
73
|
+
"**/*.tsx",
|
|
74
|
+
"**/*.js",
|
|
75
|
+
"**/*.jsx",
|
|
76
|
+
"**/*.json",
|
|
77
|
+
"**/*.css",
|
|
78
|
+
"**/*.scss"
|
|
79
|
+
],
|
|
80
|
+
"imports": [],
|
|
81
|
+
"patterns": []
|
|
82
|
+
},
|
|
83
|
+
"items": [
|
|
84
|
+
{
|
|
85
|
+
"id": "conv-prettier-001",
|
|
86
|
+
"text": "Code uses consistent quote style per .prettierrc (singleQuote setting)",
|
|
87
|
+
"priority": "medium",
|
|
88
|
+
"reason": "Consistent quoting improves readability"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "conv-prettier-002",
|
|
92
|
+
"text": "Semicolons match .prettierrc setting (semi: true/false)",
|
|
93
|
+
"priority": "medium",
|
|
94
|
+
"reason": "Consistent semicolon usage prevents parsing ambiguities"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"id": "conv-prettier-003",
|
|
98
|
+
"text": "Trailing commas follow .prettierrc (trailingComma setting)",
|
|
99
|
+
"priority": "low",
|
|
100
|
+
"reason": "Consistent trailing commas make diffs cleaner"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "conv-prettier-004",
|
|
104
|
+
"text": "Indentation matches .prettierrc (tabWidth setting)",
|
|
105
|
+
"priority": "medium",
|
|
106
|
+
"reason": "Consistent indentation is essential for readability"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "conv-prettier-005",
|
|
110
|
+
"text": "Arrow function parentheses match .prettierrc (arrowParens setting)",
|
|
111
|
+
"priority": "low",
|
|
112
|
+
"reason": "Consistent arrow function style"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "editorconfig",
|
|
118
|
+
"triggers": {
|
|
119
|
+
"files": [
|
|
120
|
+
"**/*.ts",
|
|
121
|
+
"**/*.tsx",
|
|
122
|
+
"**/*.js",
|
|
123
|
+
"**/*.jsx",
|
|
124
|
+
"**/*.json",
|
|
125
|
+
"**/*.css",
|
|
126
|
+
"**/*.scss",
|
|
127
|
+
"**/*.md",
|
|
128
|
+
"**/*.mdx"
|
|
129
|
+
],
|
|
130
|
+
"imports": [],
|
|
131
|
+
"patterns": []
|
|
132
|
+
},
|
|
133
|
+
"items": [
|
|
134
|
+
{
|
|
135
|
+
"id": "conv-editor-001",
|
|
136
|
+
"text": "Indentation style matches .editorconfig (indent_style: space/tab)",
|
|
137
|
+
"priority": "high",
|
|
138
|
+
"reason": "Mixed tabs and spaces cause rendering issues"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"id": "conv-editor-002",
|
|
142
|
+
"text": "Indent size matches .editorconfig (indent_size setting)",
|
|
143
|
+
"priority": "high",
|
|
144
|
+
"reason": "Consistent indentation improves code readability"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"id": "conv-editor-003",
|
|
148
|
+
"text": "Line endings match .editorconfig (end_of_line: lf/crlf)",
|
|
149
|
+
"priority": "medium",
|
|
150
|
+
"reason": "Consistent line endings prevent git conflicts"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"id": "conv-editor-004",
|
|
154
|
+
"text": "File encoding is UTF-8 per .editorconfig (charset setting)",
|
|
155
|
+
"priority": "medium",
|
|
156
|
+
"reason": "UTF-8 ensures proper character display"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"id": "conv-editor-005",
|
|
160
|
+
"text": "Trailing whitespace removed per .editorconfig",
|
|
161
|
+
"priority": "low",
|
|
162
|
+
"reason": "Trailing whitespace creates unnecessary diffs"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"id": "conv-editor-006",
|
|
166
|
+
"text": "Files end with newline per .editorconfig (insert_final_newline)",
|
|
167
|
+
"priority": "low",
|
|
168
|
+
"reason": "Final newlines are POSIX standard"
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"name": "markdown",
|
|
174
|
+
"triggers": {
|
|
175
|
+
"files": ["**/*.md", "**/*.mdx"],
|
|
176
|
+
"imports": [],
|
|
177
|
+
"patterns": []
|
|
178
|
+
},
|
|
179
|
+
"items": [
|
|
180
|
+
{
|
|
181
|
+
"id": "conv-md-001",
|
|
182
|
+
"text": "Markdown heading style follows .markdownlint.json (MD003 rule)",
|
|
183
|
+
"priority": "low",
|
|
184
|
+
"reason": "Consistent heading style improves document structure"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"id": "conv-md-002",
|
|
188
|
+
"text": "Markdown list style follows .markdownlint.json (MD004 rule)",
|
|
189
|
+
"priority": "low",
|
|
190
|
+
"reason": "Consistent list markers improve readability"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"id": "conv-md-003",
|
|
194
|
+
"text": "No markdownlint violations per .markdownlint.json rules",
|
|
195
|
+
"priority": "medium",
|
|
196
|
+
"reason": "Markdown lint rules ensure document quality"
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
}
|