@corbat-tech/coding-standards-mcp 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.
Files changed (89) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +371 -0
  3. package/assets/demo.gif +0 -0
  4. package/dist/agent.d.ts +53 -0
  5. package/dist/agent.d.ts.map +1 -0
  6. package/dist/agent.js +629 -0
  7. package/dist/agent.js.map +1 -0
  8. package/dist/cli/init.d.ts +3 -0
  9. package/dist/cli/init.d.ts.map +1 -0
  10. package/dist/cli/init.js +651 -0
  11. package/dist/cli/init.js.map +1 -0
  12. package/dist/config.d.ts +73 -0
  13. package/dist/config.d.ts.map +1 -0
  14. package/dist/config.js +105 -0
  15. package/dist/config.js.map +1 -0
  16. package/dist/index.d.ts +3 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +73 -0
  19. package/dist/index.js.map +1 -0
  20. package/dist/profiles.d.ts +39 -0
  21. package/dist/profiles.d.ts.map +1 -0
  22. package/dist/profiles.js +526 -0
  23. package/dist/profiles.js.map +1 -0
  24. package/dist/prompts-legacy.d.ts +25 -0
  25. package/dist/prompts-legacy.d.ts.map +1 -0
  26. package/dist/prompts-legacy.js +600 -0
  27. package/dist/prompts-legacy.js.map +1 -0
  28. package/dist/prompts-v2.d.ts +30 -0
  29. package/dist/prompts-v2.d.ts.map +1 -0
  30. package/dist/prompts-v2.js +310 -0
  31. package/dist/prompts-v2.js.map +1 -0
  32. package/dist/prompts.d.ts +30 -0
  33. package/dist/prompts.d.ts.map +1 -0
  34. package/dist/prompts.js +310 -0
  35. package/dist/prompts.js.map +1 -0
  36. package/dist/resources.d.ts +18 -0
  37. package/dist/resources.d.ts.map +1 -0
  38. package/dist/resources.js +95 -0
  39. package/dist/resources.js.map +1 -0
  40. package/dist/tools-legacy.d.ts +196 -0
  41. package/dist/tools-legacy.d.ts.map +1 -0
  42. package/dist/tools-legacy.js +1230 -0
  43. package/dist/tools-legacy.js.map +1 -0
  44. package/dist/tools-v2.d.ts +92 -0
  45. package/dist/tools-v2.d.ts.map +1 -0
  46. package/dist/tools-v2.js +410 -0
  47. package/dist/tools-v2.js.map +1 -0
  48. package/dist/tools.d.ts +92 -0
  49. package/dist/tools.d.ts.map +1 -0
  50. package/dist/tools.js +410 -0
  51. package/dist/tools.js.map +1 -0
  52. package/dist/types.d.ts +3054 -0
  53. package/dist/types.d.ts.map +1 -0
  54. package/dist/types.js +515 -0
  55. package/dist/types.js.map +1 -0
  56. package/dist/utils/index.d.ts +6 -0
  57. package/dist/utils/index.d.ts.map +1 -0
  58. package/dist/utils/index.js +5 -0
  59. package/dist/utils/index.js.map +1 -0
  60. package/dist/utils/retry.d.ts +44 -0
  61. package/dist/utils/retry.d.ts.map +1 -0
  62. package/dist/utils/retry.js +74 -0
  63. package/dist/utils/retry.js.map +1 -0
  64. package/package.json +79 -0
  65. package/profiles/README.md +199 -0
  66. package/profiles/custom/.gitkeep +2 -0
  67. package/profiles/templates/_template.yaml +159 -0
  68. package/profiles/templates/angular.yaml +494 -0
  69. package/profiles/templates/java-spring-backend.yaml +512 -0
  70. package/profiles/templates/minimal.yaml +102 -0
  71. package/profiles/templates/nodejs.yaml +338 -0
  72. package/profiles/templates/python.yaml +340 -0
  73. package/profiles/templates/react.yaml +331 -0
  74. package/profiles/templates/vue.yaml +598 -0
  75. package/standards/architecture/ddd.md +173 -0
  76. package/standards/architecture/hexagonal.md +97 -0
  77. package/standards/cicd/github-actions.md +567 -0
  78. package/standards/clean-code/naming.md +175 -0
  79. package/standards/clean-code/principles.md +179 -0
  80. package/standards/containerization/dockerfile.md +419 -0
  81. package/standards/database/selection-guide.md +443 -0
  82. package/standards/documentation/guidelines.md +189 -0
  83. package/standards/event-driven/domain-events.md +527 -0
  84. package/standards/kubernetes/deployment.md +518 -0
  85. package/standards/observability/guidelines.md +665 -0
  86. package/standards/project-setup/initialization-checklist.md +650 -0
  87. package/standards/spring-boot/best-practices.md +598 -0
  88. package/standards/testing/guidelines.md +559 -0
  89. package/standards/workflow/llm-development-workflow.md +542 -0
@@ -0,0 +1,331 @@
1
+ # ============================================================================
2
+ # CORBAT MCP - React Profile
3
+ # ============================================================================
4
+ # Production-ready standards for React applications with TypeScript.
5
+ # ============================================================================
6
+
7
+ name: "React Standards"
8
+ description: "Production-ready standards for React applications with TypeScript, focusing on hooks, component architecture, state management, and accessibility"
9
+
10
+ # ----------------------------------------------------------------------------
11
+ # ARCHITECTURE
12
+ # ----------------------------------------------------------------------------
13
+ architecture:
14
+ type: "feature-based"
15
+ enforceLayerDependencies: true
16
+ layers:
17
+ - name: features
18
+ description: "Feature modules containing components, hooks, and logic for specific features"
19
+ allowedDependencies:
20
+ - shared
21
+ - core
22
+ packages:
23
+ - "src/features/*"
24
+
25
+ - name: shared
26
+ description: "Reusable UI components, hooks, and utilities used across features"
27
+ allowedDependencies:
28
+ - core
29
+ packages:
30
+ - "src/shared"
31
+ - "src/shared/components"
32
+ - "src/shared/hooks"
33
+ - "src/shared/utils"
34
+
35
+ - name: core
36
+ description: "Application core: routing, state management setup, API client, types"
37
+ allowedDependencies: []
38
+ packages:
39
+ - "src/core"
40
+ - "src/core/api"
41
+ - "src/core/store"
42
+ - "src/core/types"
43
+
44
+ # ----------------------------------------------------------------------------
45
+ # CODE QUALITY
46
+ # ----------------------------------------------------------------------------
47
+ codeQuality:
48
+ maxMethodLines: 30
49
+ maxClassLines: 200
50
+ maxFileLines: 300
51
+ maxMethodParameters: 4
52
+ maxCyclomaticComplexity: 10
53
+ requireDocumentation: true
54
+ requireTests: true
55
+ minimumTestCoverage: 70
56
+
57
+ principles:
58
+ - "Component Single Responsibility"
59
+ - "Composition over inheritance"
60
+ - "Colocation (keep related code together)"
61
+ - "Minimal prop drilling"
62
+ - "Accessibility first"
63
+
64
+ # ----------------------------------------------------------------------------
65
+ # NAMING CONVENTIONS
66
+ # ----------------------------------------------------------------------------
67
+ naming:
68
+ general:
69
+ component: PascalCase
70
+ hook: '"use" prefix + camelCase'
71
+ util: camelCase
72
+ constant: SCREAMING_SNAKE_CASE
73
+ type: PascalCase
74
+ interface: PascalCase
75
+ enum: PascalCase
76
+ file: PascalCase for components, camelCase for utils
77
+ folder: kebab-case
78
+
79
+ suffixes:
80
+ page: "Page"
81
+ layout: "Layout"
82
+ context: "Context"
83
+ provider: "Provider"
84
+ hook: "" # useXxx pattern
85
+ store: "Store"
86
+ slice: "Slice"
87
+ service: "Service"
88
+ type: "" # No suffix for types
89
+
90
+ testing:
91
+ testFile: ".test.tsx"
92
+ testComponent: ".test.tsx"
93
+ testHook: ".test.ts"
94
+ storybook: ".stories.tsx"
95
+
96
+ # ----------------------------------------------------------------------------
97
+ # COMPONENT GUIDELINES
98
+ # ----------------------------------------------------------------------------
99
+ components:
100
+ structure:
101
+ - "Props interface at top"
102
+ - "Component function"
103
+ - "Hooks at the beginning"
104
+ - "Event handlers"
105
+ - "Render helpers (if needed)"
106
+ - "Return JSX"
107
+
108
+ rules:
109
+ - "One component per file"
110
+ - "Export component as default"
111
+ - "Export types as named exports"
112
+ - "Use functional components only"
113
+ - "Destructure props"
114
+ - "Use explicit return for complex JSX"
115
+ - "Keep components under 200 lines"
116
+
117
+ propsNaming:
118
+ eventHandlers: "onAction (onClick, onSubmit)"
119
+ booleans: "is/has/should prefix (isOpen, hasError)"
120
+ children: "children for nested content"
121
+ className: "className for styling"
122
+
123
+ # ----------------------------------------------------------------------------
124
+ # STATE MANAGEMENT
125
+ # ----------------------------------------------------------------------------
126
+ stateManagement:
127
+ local:
128
+ tool: "useState / useReducer"
129
+ useWhen:
130
+ - "Component-specific state"
131
+ - "Form state"
132
+ - "UI state (modals, dropdowns)"
133
+
134
+ shared:
135
+ tool: "Zustand or Redux Toolkit"
136
+ useWhen:
137
+ - "State shared across multiple components"
138
+ - "Complex state logic"
139
+ - "State that persists across routes"
140
+
141
+ server:
142
+ tool: "TanStack Query (React Query)"
143
+ useWhen:
144
+ - "API data fetching"
145
+ - "Caching server state"
146
+ - "Optimistic updates"
147
+ - "Background refetching"
148
+
149
+ rules:
150
+ - "Prefer server state (React Query) over client state"
151
+ - "Colocate state as close as possible to where it's used"
152
+ - "Avoid prop drilling > 2 levels"
153
+ - "Use context for theme, auth, i18n"
154
+
155
+ # ----------------------------------------------------------------------------
156
+ # TYPESCRIPT
157
+ # ----------------------------------------------------------------------------
158
+ technologies:
159
+ - name: typescript
160
+ version: "5.x"
161
+ specificRules:
162
+ strict: true
163
+ noImplicitAny: true
164
+ strictNullChecks: true
165
+ noUnusedLocals: true
166
+ preferConst: true
167
+ useUnknownInCatchVariables: true
168
+
169
+ - name: react
170
+ version: "18+"
171
+ specificRules:
172
+ useFunctionalComponents: true
173
+ useHooks: true
174
+ useStrictMode: true
175
+ useSuspense: true
176
+ useErrorBoundaries: true
177
+
178
+ - name: linting
179
+ tools:
180
+ - "ESLint"
181
+ - "Prettier"
182
+ - "eslint-plugin-react-hooks"
183
+ - "eslint-plugin-jsx-a11y"
184
+
185
+ # ----------------------------------------------------------------------------
186
+ # TESTING
187
+ # ----------------------------------------------------------------------------
188
+ testing:
189
+ framework: "Vitest"
190
+ assertionLibrary: "Vitest"
191
+ componentTesting: "React Testing Library"
192
+
193
+ types:
194
+ unit:
195
+ suffix: ".test.ts"
196
+ location: "**/*.test.ts"
197
+ coverage: 70
198
+
199
+ component:
200
+ suffix: ".test.tsx"
201
+ location: "**/*.test.tsx"
202
+ coverage: 70
203
+
204
+ integration:
205
+ suffix: ".integration.test.tsx"
206
+ location: "tests/integration"
207
+
208
+ e2e:
209
+ tool: "Playwright or Cypress"
210
+ location: "tests/e2e"
211
+
212
+ patterns:
213
+ arrange_act_assert: true
214
+ userCentric: true # Test from user perspective
215
+
216
+ rules:
217
+ - "Test behavior, not implementation"
218
+ - "Use getByRole, getByLabelText over getByTestId"
219
+ - "Avoid testing internal state"
220
+ - "Mock API calls, not components"
221
+ - "Test accessibility"
222
+
223
+ # ----------------------------------------------------------------------------
224
+ # STYLING
225
+ # ----------------------------------------------------------------------------
226
+ styling:
227
+ approach: "Utility-first or CSS Modules"
228
+ tools:
229
+ - "Tailwind CSS (recommended)"
230
+ - "CSS Modules"
231
+ - "Styled Components"
232
+
233
+ rules:
234
+ - "Mobile-first responsive design"
235
+ - "Use design tokens for consistency"
236
+ - "Avoid inline styles"
237
+ - "Keep specificity low"
238
+ - "Use CSS variables for theming"
239
+
240
+ # ----------------------------------------------------------------------------
241
+ # ACCESSIBILITY
242
+ # ----------------------------------------------------------------------------
243
+ accessibility:
244
+ level: "WCAG 2.1 AA"
245
+ rules:
246
+ - "All interactive elements must be keyboard accessible"
247
+ - "Use semantic HTML elements"
248
+ - "Provide alt text for images"
249
+ - "Ensure sufficient color contrast"
250
+ - "Use ARIA attributes when needed"
251
+ - "Test with screen readers"
252
+ - "Support reduced motion"
253
+
254
+ testing:
255
+ - "eslint-plugin-jsx-a11y"
256
+ - "axe-core"
257
+ - "Manual keyboard navigation testing"
258
+
259
+ # ----------------------------------------------------------------------------
260
+ # PERFORMANCE
261
+ # ----------------------------------------------------------------------------
262
+ performance:
263
+ rules:
264
+ - "Lazy load routes and heavy components"
265
+ - "Use React.memo for expensive renders"
266
+ - "Use useMemo and useCallback appropriately"
267
+ - "Optimize images (next/image, srcset)"
268
+ - "Minimize bundle size"
269
+ - "Use code splitting"
270
+
271
+ metrics:
272
+ - "Largest Contentful Paint (LCP) < 2.5s"
273
+ - "First Input Delay (FID) < 100ms"
274
+ - "Cumulative Layout Shift (CLS) < 0.1"
275
+
276
+ # ----------------------------------------------------------------------------
277
+ # API INTEGRATION
278
+ # ----------------------------------------------------------------------------
279
+ api:
280
+ client: "TanStack Query + fetch/axios"
281
+ patterns:
282
+ - "Centralize API client configuration"
283
+ - "Use TypeScript for API responses"
284
+ - "Handle loading, error, and success states"
285
+ - "Implement optimistic updates"
286
+ - "Use proper error boundaries"
287
+
288
+ errorHandling:
289
+ - "Show user-friendly error messages"
290
+ - "Provide retry mechanisms"
291
+ - "Log errors for debugging"
292
+ - "Graceful degradation"
293
+
294
+ # ----------------------------------------------------------------------------
295
+ # PROJECT STRUCTURE
296
+ # ----------------------------------------------------------------------------
297
+ # Recommended folder structure:
298
+ #
299
+ # src/
300
+ # ├── app/ # App entry, routing, providers
301
+ # │ ├── routes/
302
+ # │ ├── providers/
303
+ # │ └── App.tsx
304
+ # ├── core/ # Application core
305
+ # │ ├── api/ # API client setup
306
+ # │ ├── store/ # Global state
307
+ # │ ├── types/ # Shared types
308
+ # │ └── config/ # App configuration
309
+ # ├── features/ # Feature modules
310
+ # │ ├── auth/
311
+ # │ │ ├── components/
312
+ # │ │ ├── hooks/
313
+ # │ │ ├── services/
314
+ # │ │ ├── types/
315
+ # │ │ └── index.ts
316
+ # │ ├── dashboard/
317
+ # │ └── settings/
318
+ # ├── shared/ # Shared code
319
+ # │ ├── components/ # UI components
320
+ # │ │ ├── Button/
321
+ # │ │ ├── Input/
322
+ # │ │ └── Modal/
323
+ # │ ├── hooks/ # Custom hooks
324
+ # │ ├── utils/ # Utilities
325
+ # │ └── types/ # Shared types
326
+ # └── index.tsx
327
+ #
328
+ # tests/
329
+ # ├── integration/
330
+ # ├── e2e/
331
+ # └── setup.ts