codingbuddy-rules 0.2.6 → 1.0.0

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.
@@ -10,7 +10,8 @@
10
10
  "Code refactoring patterns",
11
11
  "Design patterns (React/Next.js best practices)",
12
12
  "Code readability and maintainability",
13
- "Function/method size optimization"
13
+ "Function/method size optimization",
14
+ "Naming conventions (variables, functions, components, severity-based evaluation)"
14
15
  ],
15
16
  "responsibilities": [
16
17
  "Plan and verify SOLID principles compliance",
@@ -19,6 +20,7 @@
19
20
  "Plan and verify design patterns application",
20
21
  "Assess code readability and maintainability",
21
22
  "Plan and verify function/method size optimization",
23
+ "Plan and verify naming conventions compliance",
22
24
  "Ensure code follows project quality standards"
23
25
  ]
24
26
  },
@@ -62,7 +64,7 @@
62
64
  "verification_key": "design_patterns_plan"
63
65
  },
64
66
  "🔴 naming_plan": {
65
- "rule": "MUST plan naming conventions (clear intent naming)",
67
+ "rule": "MUST plan naming conventions per shared_framework.naming_conventions - See severity_levels for violation criteria",
66
68
  "verification_key": "naming_plan"
67
69
  },
68
70
  "🔴 language": {
@@ -76,7 +78,7 @@
76
78
  "complexity_plan": "Plan function size targets (10-20 lines max), plan nested conditional limits (3-4 levels), plan complexity reduction strategy, plan complex logic breakdown",
77
79
  "function_size_plan": "Plan single responsibility per function, plan function focus and cohesion, plan long function breakdown strategy, plan related function grouping",
78
80
  "design_patterns_plan": "Plan React 19/Next.js 16 patterns (Server Components, Server Actions), plan hooks usage, plan component composition, plan state management approach",
79
- "naming_plan": "Plan clear intent naming conventions, plan consistent naming patterns, plan names that match their purpose, avoid abbreviations",
81
+ "naming_plan": "Plan naming conventions per shared_framework.naming_conventions: variables (boolean: isX/hasX, arrays: plural nouns, objects: singular nouns, constants: SCREAMING_SNAKE_CASE), functions (handlers: handleX, getters: getX, validators: validateX/isValidX, transformers: toX/formatX/parseX), components (PascalCase, role-based). Avoid meaningless names (data, info, temp). See allowed_abbreviations for acceptable short forms.",
80
82
  "language": "Verify all response text is in Korean, check error messages and comments are in Korean"
81
83
  },
82
84
  "execution_order": {
@@ -129,19 +131,22 @@
129
131
  "No SOLID principles plan",
130
132
  "No DRY strategy plan",
131
133
  "Complexity target not set",
132
- "Function size target not defined"
134
+ "Function size target not defined",
135
+ "Meaningless names planned (data, info, temp, result)"
133
136
  ],
134
137
  "high": [
135
138
  "Weak SOLID principles plan",
136
139
  "Incomplete DRY strategy",
137
140
  "Ambiguous complexity targets",
138
- "Missing design patterns plan"
141
+ "Missing design patterns plan",
142
+ "Inconsistent naming patterns planned (onClick vs handleSubmit mixed)"
139
143
  ],
140
144
  "medium": [
141
145
  "Could benefit from better SOLID planning",
142
146
  "DRY strategy could be more comprehensive",
143
147
  "Complexity targets could be refined",
144
- "Design patterns plan could be improved"
148
+ "Design patterns plan could be improved",
149
+ "Unnecessary abbreviations in naming plan (btn, msg, ctx)"
145
150
  ],
146
151
  "low": [
147
152
  "Minor code quality improvements",
@@ -184,7 +189,7 @@
184
189
  "verification_key": "design_patterns_verification"
185
190
  },
186
191
  "🔴 naming_verification": {
187
- "rule": "MUST verify clear intent naming is used",
192
+ "rule": "MUST verify naming conventions per shared_framework.naming_conventions - Reject meaningless names (data, info, temp)",
188
193
  "verification_key": "naming_verification"
189
194
  },
190
195
  "🔴 language": {
@@ -198,7 +203,7 @@
198
203
  "complexity_verification": "Verify functions are 10-20 lines max, nested conditionals are minimal, cyclomatic complexity is low, complex logic is broken into smaller functions",
199
204
  "function_size_verification": "Verify functions have single responsibility, functions are focused and cohesive, long functions are broken down, related functions are grouped",
200
205
  "design_patterns_verification": "Verify React 19/Next.js 16 patterns are used (Server Components, Server Actions), hooks are used appropriately, component composition is correct, state management follows best practices",
201
- "naming_verification": "Verify names clearly express intent, avoid abbreviations, use consistent naming conventions, names match their purpose",
206
+ "naming_verification": "Verify naming conventions per shared_framework.naming_conventions: variables (boolean: isX/hasX, arrays: plural nouns, objects: singular nouns, constants: SCREAMING_SNAKE_CASE), functions (handlers: handleX, getters: getX, validators: validateX/isValidX, transformers: toX/formatX/parseX), components (PascalCase, role-based). Reject meaningless names (data, info, temp). Only allowed_abbreviations are acceptable.",
202
207
  "language": "Verify all response text is in Korean, check error messages and comments are in Korean"
203
208
  },
204
209
  "execution_order": {
@@ -252,27 +257,33 @@
252
257
  "Extensive code duplication found",
253
258
  "Very high complexity (>20) detected",
254
259
  "Function size >50 lines",
255
- "Nesting depth >5 levels"
260
+ "Nesting depth >5 levels",
261
+ "Meaningless names used (data, info, temp, result, item, value)",
262
+ "Misleading names (name doesn't match behavior)"
256
263
  ],
257
264
  "high": [
258
265
  "Significant SOLID violations",
259
266
  "Medium code duplication",
260
267
  "High complexity (15-20)",
261
268
  "Function size 30-50 lines",
262
- "Nesting depth 4-5 levels"
269
+ "Nesting depth 4-5 levels",
270
+ "Inconsistent naming patterns (onClick vs handleSubmit mixed)",
271
+ "Boolean without prefix (active vs isActive mixed)"
263
272
  ],
264
273
  "medium": [
265
274
  "Minor SOLID violations",
266
275
  "Small code duplication",
267
276
  "Acceptable complexity",
268
277
  "Function size up to 30 lines",
269
- "Nesting depth 3-4 levels"
278
+ "Nesting depth 3-4 levels",
279
+ "Unnecessary abbreviations (btn, msg, ctx, usr)",
280
+ "Overly long names reducing readability"
270
281
  ],
271
282
  "low": [
272
283
  "Code style improvements",
273
284
  "Minor optimizations",
274
285
  "Optional refactoring",
275
- "Naming improvements"
286
+ "Better naming alternative exists"
276
287
  ]
277
288
  }
278
289
  }
@@ -303,7 +314,7 @@
303
314
  "verification_key": "complexity"
304
315
  },
305
316
  "🔴 naming": {
306
- "rule": "MUST verify clear intent naming is used",
317
+ "rule": "MUST evaluate naming conventions per shared_framework.naming_conventions - Flag violations by severity level",
307
318
  "verification_key": "naming"
308
319
  },
309
320
  "🔴 function_size": {
@@ -323,7 +334,7 @@
323
334
  "solid_principles": "Verify Single Responsibility (each function has one reason to change), Open/Closed (open for extension, closed for modification), Liskov Substitution (subtypes must be substitutable), Interface Segregation (no unused interfaces), Dependency Inversion (depend on abstractions)",
324
335
  "dry_principle": "Verify no code duplication exists, extracted common logic into reusable functions/components, constants are defined once, similar patterns are abstracted",
325
336
  "complexity": "Verify functions are 10-20 lines max, nested conditionals are minimal, cyclomatic complexity is low, complex logic is broken into smaller functions",
326
- "naming": "Verify names clearly express intent, avoid abbreviations, use consistent naming conventions, names match their purpose",
337
+ "naming": "Evaluate naming conventions per shared_framework.naming_conventions: variables (boolean: isX/hasX, arrays: plural nouns, objects: singular nouns, constants: SCREAMING_SNAKE_CASE), functions (handlers: handleX, getters: getX, validators: validateX/isValidX, transformers: toX/formatX/parseX), components (PascalCase, role-based). Flag meaningless names (data, info, temp) as critical. Check allowed_abbreviations for acceptable short forms.",
327
338
  "function_size": "Verify functions have single responsibility, functions are focused and cohesive, long functions are broken down, related functions are grouped",
328
339
  "design_patterns": "Verify React 19/Next.js 16 patterns are used (Server Components, Server Actions), hooks are used appropriately, component composition is correct, state management follows best practices",
329
340
  "language": "Verify all response text is in Korean, check error messages and comments are in Korean"
@@ -451,11 +462,36 @@
451
462
  "Code style improvements"
452
463
  ]
453
464
  },
465
+ "naming_violations": {
466
+ "🔴 critical": [
467
+ "Meaningless names (data, info, temp, result, item, value)",
468
+ "Single letter variables outside loops (x, y, a, b)",
469
+ "Misleading names (name doesn't match behavior)",
470
+ "Hungarian notation misuse (strName, intCount)"
471
+ ],
472
+ "high": [
473
+ "Inconsistent patterns (onClick vs handleSubmit mixed)",
474
+ "Boolean without prefix (active vs isActive mixed)",
475
+ "Ambiguous names requiring context to understand",
476
+ "Handler naming inconsistency"
477
+ ],
478
+ "medium": [
479
+ "Unnecessary abbreviations (btn, msg, ctx, usr)",
480
+ "Overly long names (authenticatedUserProfileData)",
481
+ "Inconsistent casing patterns",
482
+ "Array naming without plural form"
483
+ ],
484
+ "low": [
485
+ "Better alternative exists but current is acceptable",
486
+ "Minor naming style preferences",
487
+ "Could be more descriptive"
488
+ ]
489
+ },
454
490
  "risk_assessment": {
455
- "🔴 critical": "Major SOLID violations, extensive duplication, very high complexity (>20), blocking maintainability",
456
- "high": "Significant code quality issues affecting maintainability, medium complexity (15-20), some SOLID violations",
457
- "medium": "Minor code quality improvements needed, acceptable complexity, small duplication",
458
- "low": "Code style improvements, minor optimizations, optional refactoring"
491
+ "🔴 critical": "Major SOLID violations, extensive duplication, very high complexity (>20), meaningless names (data, info, temp), blocking maintainability",
492
+ "high": "Significant code quality issues affecting maintainability, medium complexity (15-20), some SOLID violations, inconsistent naming patterns",
493
+ "medium": "Minor code quality improvements needed, acceptable complexity, small duplication, unnecessary abbreviations in naming",
494
+ "low": "Code style improvements, minor optimizations, optional refactoring, naming could be improved"
459
495
  }
460
496
  }
461
497
  }
@@ -531,6 +567,115 @@
531
567
  "Inefficient re-renders"
532
568
  ]
533
569
  },
570
+ "naming_conventions": {
571
+ "variables": {
572
+ "boolean": {
573
+ "pattern": "isX, hasX, canX, shouldX, willX",
574
+ "examples": ["isActive", "hasPermission", "canEdit", "shouldRender"],
575
+ "anti_patterns": ["active", "permission", "edit", "render"]
576
+ },
577
+ "arrays_collections": {
578
+ "pattern": "Plural nouns (users, items, products)",
579
+ "examples": ["users", "items", "selectedProducts"],
580
+ "anti_patterns": ["userList", "itemArray", "productCollection"]
581
+ },
582
+ "objects": {
583
+ "pattern": "Singular nouns describing the entity",
584
+ "examples": ["user", "config", "authState"],
585
+ "anti_patterns": ["data", "info", "obj", "item"]
586
+ },
587
+ "constants": {
588
+ "pattern": "SCREAMING_SNAKE_CASE for true constants",
589
+ "examples": ["MAX_RETRY_COUNT", "API_BASE_URL", "DEFAULT_TIMEOUT"],
590
+ "anti_patterns": ["maxRetryCount", "apiBaseUrl"]
591
+ }
592
+ },
593
+ "functions": {
594
+ "event_handlers": {
595
+ "pattern": "handleX (handleClick, handleSubmit, handleChange)",
596
+ "examples": ["handleClick", "handleSubmit", "handleInputChange"],
597
+ "anti_patterns": ["onClick", "clickHandler", "onClickHandler"]
598
+ },
599
+ "getters": {
600
+ "pattern": "getX for data retrieval",
601
+ "examples": ["getUser", "getUserById", "getConfig"],
602
+ "anti_patterns": ["fetchUser", "retrieveUser", "user"]
603
+ },
604
+ "setters": {
605
+ "pattern": "setX for state updates",
606
+ "examples": ["setUser", "setIsLoading", "setConfig"],
607
+ "anti_patterns": ["updateUser", "changeUser"]
608
+ },
609
+ "validators": {
610
+ "pattern": "validateX or isValidX",
611
+ "examples": ["validateEmail", "isValidPassword", "validateForm"],
612
+ "anti_patterns": ["checkEmail", "emailCheck", "emailValidator"]
613
+ },
614
+ "transformers": {
615
+ "pattern": "toX, formatX, parseX for data transformation",
616
+ "examples": ["toJSON", "formatDate", "parseResponse"],
617
+ "anti_patterns": ["convertToJSON", "dateFormatter"]
618
+ },
619
+ "async_operations": {
620
+ "pattern": "fetchX, loadX for async data fetching",
621
+ "examples": ["fetchUsers", "loadUserProfile", "fetchData"],
622
+ "anti_patterns": ["getUsers (if async)", "userData"]
623
+ }
624
+ },
625
+ "components": {
626
+ "naming": {
627
+ "pattern": "PascalCase, role-based naming",
628
+ "examples": ["UserProfile", "LoginForm", "NavigationMenu"],
629
+ "anti_patterns": ["Profile", "Form", "Menu"]
630
+ },
631
+ "props": {
632
+ "pattern": "Clear intent props",
633
+ "callback_props": "onX pattern (onSubmit, onChange, onClose)",
634
+ "boolean_props": "isX, hasX pattern (isDisabled, isLoading, hasError)",
635
+ "examples": ["onSubmit", "isDisabled", "hasError"],
636
+ "anti_patterns": ["submit", "disabled", "error"]
637
+ }
638
+ },
639
+ "severity_levels": {
640
+ "🔴 critical": [
641
+ "Meaningless names (data, info, temp, result, item, value)",
642
+ "Single letter variables outside loops (x, y, a, b)",
643
+ "Misleading names (name doesn't match behavior)",
644
+ "Hungarian notation misuse (strName, intCount)"
645
+ ],
646
+ "high": [
647
+ "Inconsistent patterns (onClick vs handleSubmit mixed)",
648
+ "Boolean without prefix (active vs isActive mixed)",
649
+ "Ambiguous names requiring context to understand"
650
+ ],
651
+ "medium": [
652
+ "Unnecessary abbreviations (btn, msg, ctx, usr)",
653
+ "Overly long names (authenticatedUserProfileData)",
654
+ "Inconsistent casing patterns"
655
+ ],
656
+ "low": [
657
+ "Better alternative exists but current is acceptable",
658
+ "Minor naming style preferences",
659
+ "Could be more descriptive"
660
+ ]
661
+ },
662
+ "allowed_abbreviations": [
663
+ "id (identifier)",
664
+ "url (uniform resource locator)",
665
+ "api (application programming interface)",
666
+ "db (database)",
667
+ "config (configuration)",
668
+ "props (properties - React specific)",
669
+ "params (parameters)",
670
+ "args (arguments)",
671
+ "env (environment)",
672
+ "src (source)",
673
+ "dest (destination)",
674
+ "prev (previous)",
675
+ "next (next)",
676
+ "i, j, k (loop indices)"
677
+ ]
678
+ },
534
679
  "best_practices_reference": {
535
680
  "solid_principles": "SOLID Principles - Robert C. Martin",
536
681
  "dry_principle": "Don't Repeat Yourself (DRY) - The Pragmatic Programmer",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codingbuddy-rules",
3
- "version": "0.2.6",
3
+ "version": "1.0.0",
4
4
  "description": "AI coding rules for consistent practices across AI assistants",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",