@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.
- package/LICENSE +21 -0
- package/README.md +371 -0
- package/assets/demo.gif +0 -0
- package/dist/agent.d.ts +53 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +629 -0
- package/dist/agent.js.map +1 -0
- package/dist/cli/init.d.ts +3 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +651 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/config.d.ts +73 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +105 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/profiles.d.ts +39 -0
- package/dist/profiles.d.ts.map +1 -0
- package/dist/profiles.js +526 -0
- package/dist/profiles.js.map +1 -0
- package/dist/prompts-legacy.d.ts +25 -0
- package/dist/prompts-legacy.d.ts.map +1 -0
- package/dist/prompts-legacy.js +600 -0
- package/dist/prompts-legacy.js.map +1 -0
- package/dist/prompts-v2.d.ts +30 -0
- package/dist/prompts-v2.d.ts.map +1 -0
- package/dist/prompts-v2.js +310 -0
- package/dist/prompts-v2.js.map +1 -0
- package/dist/prompts.d.ts +30 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +310 -0
- package/dist/prompts.js.map +1 -0
- package/dist/resources.d.ts +18 -0
- package/dist/resources.d.ts.map +1 -0
- package/dist/resources.js +95 -0
- package/dist/resources.js.map +1 -0
- package/dist/tools-legacy.d.ts +196 -0
- package/dist/tools-legacy.d.ts.map +1 -0
- package/dist/tools-legacy.js +1230 -0
- package/dist/tools-legacy.js.map +1 -0
- package/dist/tools-v2.d.ts +92 -0
- package/dist/tools-v2.d.ts.map +1 -0
- package/dist/tools-v2.js +410 -0
- package/dist/tools-v2.js.map +1 -0
- package/dist/tools.d.ts +92 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +410 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.d.ts +3054 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +515 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/retry.d.ts +44 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +74 -0
- package/dist/utils/retry.js.map +1 -0
- package/package.json +79 -0
- package/profiles/README.md +199 -0
- package/profiles/custom/.gitkeep +2 -0
- package/profiles/templates/_template.yaml +159 -0
- package/profiles/templates/angular.yaml +494 -0
- package/profiles/templates/java-spring-backend.yaml +512 -0
- package/profiles/templates/minimal.yaml +102 -0
- package/profiles/templates/nodejs.yaml +338 -0
- package/profiles/templates/python.yaml +340 -0
- package/profiles/templates/react.yaml +331 -0
- package/profiles/templates/vue.yaml +598 -0
- package/standards/architecture/ddd.md +173 -0
- package/standards/architecture/hexagonal.md +97 -0
- package/standards/cicd/github-actions.md +567 -0
- package/standards/clean-code/naming.md +175 -0
- package/standards/clean-code/principles.md +179 -0
- package/standards/containerization/dockerfile.md +419 -0
- package/standards/database/selection-guide.md +443 -0
- package/standards/documentation/guidelines.md +189 -0
- package/standards/event-driven/domain-events.md +527 -0
- package/standards/kubernetes/deployment.md +518 -0
- package/standards/observability/guidelines.md +665 -0
- package/standards/project-setup/initialization-checklist.md +650 -0
- package/standards/spring-boot/best-practices.md +598 -0
- package/standards/testing/guidelines.md +559 -0
- 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
|