RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/madebyaris/poinf-of-sales

Cursor rule

.cursor/rules/tech-debt-prevention.mdc

Tech debt prevention patterns with consistency enforcement, code quality gates, and architectural governance

Cursor rules

Quality

50/100

Scores the file, not the repository.

Length

2,195 words

12 headings · 7 code blocks

Repository

118

— · pushed 339 days ago

Last changed

3 days ago

First indexed 3 days ago.
madebyaris/poinf-of-sales/.cursor/rules/tech-debt-prevention.mdcRawGitHub
1---
2description: Tech debt prevention patterns with consistency enforcement, code quality gates, and architectural governance
3---
4 
5# 🏗️ Tech Debt Prevention & Code Quality Governance
6 
7## 🎯 Zero Tech Debt Philosophy
8 
9### Proactive Prevention Strategy
10```typescript
11// ✅ TECH DEBT PREVENTION: Systematic approach to code quality
12namespace TechDebtPrevention {
13 // Code quality metrics and thresholds
14 interface QualityGates {
15 code_coverage: { minimum: 85, target: 90 }
16 complexity_score: { maximum: 10, target: 7 }
17 duplication: { maximum: 3, target: 1 }
18 performance: { api_response: '< 200ms', ui_render: '< 100ms' }
19 security: { vulnerabilities: 0, code_quality: 'A' }
20 }
21 
22 // Automated quality enforcement
23 class QualityEnforcer {
24 static enforcePreCommitQuality(): PreCommitHook {
25 return {
26 // Code format and style
27 prettier_format: true,
28 eslint_validation: true,
29 typescript_strict_check: true,
30
31 // Business logic validation
32 business_rule_consistency: true,
33 api_contract_validation: true,
34 database_migration_safety: true,
35
36 // Performance validation
37 bundle_size_check: true,
38 query_performance_validation: true,
39 memory_leak_detection: true
40 }
41 }
42 }
43}
44```
45 
46## 🔒 Consistency Enforcement Patterns
47 
48### 1. Architectural Consistency
49```typescript
50// ✅ CONSISTENCY: Standardized architectural patterns
51class ArchitecturalConsistency {
52 // Enforce consistent API patterns
53 static createAPIEndpoint<TRequest, TResponse>(
54 config: APIEndpointConfig<TRequest, TResponse>
55 ): StandardAPIEndpoint<TRequest, TResponse> {
56 return {
57 // Standardized request validation
58 validateRequest: (request: TRequest): ValidationResult => {
59 const validator = this.createValidator(config.validation_schema)
60 return validator.validate(request)
61 },
62 
63 // Standardized business logic execution
64 executeBusinessLogic: async (request: TRequest): Promise<TResponse> => {
65 // Consistent error handling
66 try {
67 // Standardized logging
68 Logger.info(`Executing ${config.endpoint_name}`, { request })
69
70 // Business logic with consistent patterns
71 const result = await config.business_logic(request)
72
73 // Standardized success response
74 return {
75 success: true,
76 message: config.success_message,
77 data: result,
78 timestamp: new Date().toISOString(),
79 request_id: generateRequestId()
80 }
81 } catch (error) {
82 // Standardized error handling
83 return this.handleStandardError(error, config.endpoint_name)
84 }
85 },
86 
87 // Standardized response formatting
88 formatResponse: (response: TResponse): StandardAPIResponse<TResponse> => {
89 return {
90 ...response,
91 version: config.api_version,
92 performance_metrics: this.getPerformanceMetrics()
93 }
94 }
95 }
96 }
97 
98 // Enforce consistent component patterns
99 static createBusinessComponent<TProps>(
100 config: ComponentConfig<TProps>
101 ): React.FC<TProps> {
102 return React.memo((props: TProps) => {
103 // Standardized error boundary
104 return (
105 <ErrorBoundary fallback={config.error_fallback}>
106 {/* Standardized loading states */}
107 <Suspense fallback={config.loading_fallback}>
108 {/* Standardized accessibility */}
109 <div
110 role={config.accessibility.role}
111 aria-label={config.accessibility.label}
112 className={cn(config.base_classes, props.className)}
113 >
114 {/* Component content with consistent patterns */}
115 {config.render(props)}
116 </div>
117 </Suspense>
118 </ErrorBoundary>
119 )
120 }, config.memo_comparison || shallowEqual)
121 }
122 
123 // Database query consistency
124 static createDatabaseQuery<TParams, TResult>(
125 config: QueryConfig<TParams, TResult>
126 ): DatabaseQuery<TParams, TResult> {
127 return {
128 execute: async (params: TParams): Promise<TResult> => {
129 // Standardized query performance monitoring
130 const startTime = performance.now()
131
132 try {
133 // Standardized parameter validation
134 this.validateQueryParams(params, config.param_schema)
135
136 // Standardized query execution
137 const result = await this.executeQuery(config.query, params)
138
139 // Standardized performance logging
140 const duration = performance.now() - startTime
141 this.logQueryPerformance(config.name, duration, params)
142
143 return result
144 } catch (error) {
145 // Standardized error handling
146 this.handleQueryError(error, config.name, params)
147 throw error
148 }
149 }
150 }
151 }
152}
153```
154 
155### 2. Code Pattern Enforcement
156```typescript
157// ✅ PATTERN ENFORCEMENT: Consistent code patterns across the system
158class CodePatternEnforcement {
159 // Standardized hook patterns
160 static createBusinessHook<TData, TError = Error>(
161 config: BusinessHookConfig<TData, TError>
162 ): BusinessHook<TData, TError> {
163 return function useBusinessData() {
164 // Consistent state management
165 const [state, setState] = useState<BusinessHookState<TData, TError>>({
166 data: null,
167 loading: false,
168 error: null,
169 lastUpdated: null
170 })
171 
172 // Consistent data fetching
173 const fetchData = useCallback(async () => {
174 setState(prev => ({ ...prev, loading: true, error: null }))
175
176 try {
177 const data = await config.fetcher()
178 setState({
179 data,
180 loading: false,
181 error: null,
182 lastUpdated: new Date()
183 })
184 } catch (error) {
185 setState(prev => ({
186 ...prev,
187 loading: false,
188 error: error as TError
189 }))
190 }
191 }, [config.dependencies])
192 
193 // Consistent lifecycle management
194 useEffect(() => {
195 if (config.auto_fetch) {
196 fetchData()
197 }
198 }, [fetchData])
199 
200 // Consistent return interface
201 return {
202 ...state,
203 refetch: fetchData,
204 reset: () => setState({
205 data: null,
206 loading: false,
207 error: null,
208 lastUpdated: null
209 })
210 }
211 }
212 }
213 
214 // Standardized service patterns
215 static createBusinessService<TConfig>(
216 config: BusinessServiceConfig<TConfig>
217 ): BusinessService<TConfig> {
218 return {
219 // Consistent initialization
220 initialize: async (): Promise<void> => {
221 Logger.info(`Initializing ${config.service_name}`)
222 await config.initialize?.()
223 },
224 
225 // Consistent method patterns
226 ...Object.entries(config.methods).reduce((service, [methodName, methodConfig]) => {
227 service[methodName] = async (...args: any[]): Promise<any> => {
228 // Consistent logging
229 Logger.debug(`${config.service_name}.${methodName}`, { args })
230
231 // Consistent validation
232 if (methodConfig.validation) {
233 const validation = methodConfig.validation(...args)
234 if (!validation.isValid) {
235 throw new ValidationError(validation.errors)
236 }
237 }
238 
239 // Consistent caching
240 if (methodConfig.cache) {
241 const cacheKey = methodConfig.cache.keyGenerator(...args)
242 const cached = await this.cache.get(cacheKey)
243 if (cached) return cached
244 }
245 
246 // Execute business logic
247 const result = await methodConfig.implementation(...args)
248 
249 // Consistent caching
250 if (methodConfig.cache) {
251 const cacheKey = methodConfig.cache.keyGenerator(...args)
252 await this.cache.set(cacheKey, result, methodConfig.cache.ttl)
253 }
254 
255 return result
256 }
257 return service
258 }, {} as any)
259 }
260 }
261}
262```
263 
264## 🔄 DRY Principle Implementation
265 
266### 1. Reusable Business Logic Components
267```typescript
268// ✅ DRY: Centralized business logic to eliminate duplication
269namespace ReusableBusinessLogic {
270 // Unified validation system
271 export class ValidationEngine {
272 private static validators = new Map<string, Validator<any>>()
273 
274 static registerValidator<T>(name: string, validator: Validator<T>): void {
275 this.validators.set(name, validator)
276 }
277 
278 static createCompositeValidator<T>(
279 validatorNames: string[],
280 customValidations?: Validation<T>[]
281 ): Validator<T> {
282 return {
283 validate: (data: T): ValidationResult => {
284 const errors: string[] = []
285
286 // Apply registered validators
287 validatorNames.forEach(name => {
288 const validator = this.validators.get(name)
289 if (validator) {
290 const result = validator.validate(data)
291 if (!result.isValid) {
292 errors.push(...result.errors)
293 }
294 }
295 })
296 
297 // Apply custom validations
298 customValidations?.forEach(validation => {
299 if (!validation.check(data)) {
300 errors.push(validation.message)
301 }
302 })
303 
304 return {
305 isValid: errors.length === 0,
306 errors
307 }
308 }
309 }
310 }
311 }
312 
313 // Unified caching system
314 export class UnifiedCache {
315 private static cache = new Map<string, CacheEntry<any>>()
316 private static strategies = new Map<string, CacheStrategy>()
317 
318 static registerStrategy(name: string, strategy: CacheStrategy): void {
319 this.strategies.set(name, strategy)
320 }
321 
322 static async get<T>(
323 key: string,
324 fetcher: () => Promise<T>,
325 strategyName: string = 'default'
326 ): Promise<T> {
327 const strategy = this.strategies.get(strategyName)
328 if (!strategy) {
329 throw new Error(`Cache strategy '${strategyName}' not found`)
330 }
331 
332 const cached = this.cache.get(key)
333 if (cached && cached.expiresAt > Date.now()) {
334 return cached.data as T
335 }
336 
337 const data = await fetcher()
338 this.cache.set(key, {
339 data,
340 expiresAt: Date.now() + strategy.ttl,
341 createdAt: Date.now(),
342 accessCount: 1
343 })
344 
345 return data
346 }
347 
348 static invalidatePattern(pattern: string): void {
349 const regex = new RegExp(pattern)
350 Array.from(this.cache.keys())
351 .filter(key => regex.test(key))
352 .forEach(key => this.cache.delete(key))
353 }
354 }
355 
356 // Unified state management
357 export class BusinessStateManager<T> {
358 private state: T
359 private subscribers = new Set<StateChangeListener<T>>()
360 private middleware: StateMiddleware<T>[] = []
361 
362 constructor(initialState: T) {
363 this.state = { ...initialState }
364 }
365 
366 getState(): T {
367 return { ...this.state }
368 }
369 
370 setState(updater: StateUpdater<T>): void {
371 const previousState = { ...this.state }
372 const newState = typeof updater === 'function'
373 ? updater(previousState)
374 : { ...previousState, ...updater }
375 
376 // Apply middleware
377 const processedState = this.middleware.reduce(
378 (state, middleware) => middleware.process(state, previousState),
379 newState
380 )
381 
382 this.state = processedState
383
384 // Notify subscribers
385 this.subscribers.forEach(listener =>
386 listener(processedState, previousState)
387 )
388 }
389 
390 subscribe(listener: StateChangeListener<T>): () => void {
391 this.subscribers.add(listener)
392 return () => this.subscribers.delete(listener)
393 }
394 
395 addMiddleware(middleware: StateMiddleware<T>): void {
396 this.middleware.push(middleware)
397 }
398 }
399 
400 // Unified HTTP client
401 export class BusinessHTTPClient {
402 private static instance: BusinessHTTPClient
403 private interceptors: HTTPInterceptor[] = []
404 private retryPolicies = new Map<string, RetryPolicy>()
405 
406 static getInstance(): BusinessHTTPClient {
407 if (!this.instance) {
408 this.instance = new BusinessHTTPClient()
409 }
410 return this.instance
411 }
412 
413 async request<TResponse>(config: HTTPRequestConfig): Promise<TResponse> {
414 let processedConfig = { ...config }
415
416 // Apply request interceptors
417 for (const interceptor of this.interceptors) {
418 if (interceptor.request) {
419 processedConfig = await interceptor.request(processedConfig)
420 }
421 }
422 
423 // Execute request with retry policy
424 const retryPolicy = this.retryPolicies.get(config.endpoint) || DEFAULT_RETRY_POLICY
425 return this.executeWithRetry(processedConfig, retryPolicy)
426 }
427 
428 private async executeWithRetry<TResponse>(
429 config: HTTPRequestConfig,
430 retryPolicy: RetryPolicy
431 ): Promise<TResponse> {
432 let lastError: Error
433
434 for (let attempt = 0; attempt <= retryPolicy.maxRetries; attempt++) {
435 try {
436 const response = await this.executeRequest<TResponse>(config)
437
438 // Apply response interceptors
439 let processedResponse = response
440 for (const interceptor of this.interceptors) {
441 if (interceptor.response) {
442 processedResponse = await interceptor.response(processedResponse)
443 }
444 }
445
446 return processedResponse
447 } catch (error) {
448 lastError = error as Error
449
450 if (attempt < retryPolicy.maxRetries && retryPolicy.shouldRetry(error)) {
451 await this.delay(retryPolicy.calculateDelay(attempt))
452 continue
453 }
454
455 break
456 }
457 }
458
459 throw lastError!
460 }
461 }
462}
463```
464 
465### 2. Shared Component Library
466```typescript
467// ✅ DRY: Reusable UI components with consistent behavior
468namespace SharedComponentLibrary {
469 // Base form component with consistent validation and submission
470 export const BusinessForm = <TFormData extends Record<string, any>>({
471 schema,
472 onSubmit,
473 loading,
474 children
475 }: BusinessFormProps<TFormData>) => {
476 const form = useForm<TFormData>({
477 resolver: zodResolver(schema),
478 mode: 'onChange' // Consistent validation timing
479 })
480 
481 const handleSubmit = form.handleSubmit(async (data) => {
482 try {
483 await onSubmit(data)
484 } catch (error) {
485 // Consistent error handling
486 if (error instanceof ValidationError) {
487 error.fieldErrors.forEach(({ field, message }) => {
488 form.setError(field as Path<TFormData>, { message })
489 })
490 } else {
491 // Global form error
492 form.setError('root', {
493 message: error instanceof Error ? error.message : 'An error occurred'
494 })
495 }
496 }
497 })
498 
499 return (
500 <Form {...form}>
501 <form onSubmit={handleSubmit} className="space-y-6">
502 {children}
503
504 {/* Consistent form actions */}
505 <FormActions>
506 <Button type="submit" disabled={loading}>
507 {loading ? <LoadingSpinner size="sm" /> : 'Submit'}
508 </Button>
509 </FormActions>
510 </form>
511 </Form>
512 )
513 }
514 
515 // Reusable data table with consistent features
516 export const BusinessDataTable = <TData extends Record<string, any>>({
517 data,
518 columns,
519 loading,
520 pagination,
521 sorting,
522 filtering
523 }: BusinessDataTableProps<TData>) => {
524 // Consistent table state management
525 const table = useReactTable({
526 data: data || [],
527 columns,
528 getCoreRowModel: getCoreRowModel(),
529 getSortedRowModel: getSortedRowModel(),
530 getFilteredRowModel: getFilteredRowModel(),
531 getPaginationRowModel: getPaginationRowModel(),
532
533 // Consistent default configurations
534 initialState: {
535 pagination: { pageSize: 20 },
536 sorting: [],
537 columnVisibility: {}
538 }
539 })
540 
541 return (
542 <div className="space-y-4">
543 {/* Consistent table toolbar */}
544 <DataTableToolbar table={table} filtering={filtering} />
545
546 {/* Consistent table structure */}
547 <div className="rounded-md border">
548 <Table>
549 <TableHeader>
550 {table.getHeaderGroups().map(headerGroup => (
551 <TableRow key={headerGroup.id}>
552 {headerGroup.headers.map(header => (
553 <TableHead key={header.id}>
554 {/* Consistent sorting indicators */}
555 <DataTableColumnHeader header={header} />
556 </TableHead>
557 ))}
558 </TableRow>
559 ))}
560 </TableHeader>
561
562 <TableBody>
563 {loading ? (
564 <DataTableSkeleton columnCount={columns.length} />
565 ) : table.getRowModel().rows?.length ? (
566 table.getRowModel().rows.map(row => (
567 <TableRow key={row.id}>
568 {row.getVisibleCells().map(cell => (
569 <TableCell key={cell.id}>
570 {flexRender(cell.column.columnDef.cell, cell.getContext())}
571 </TableCell>
572 ))}
573 </TableRow>
574 ))
575 ) : (
576 <DataTableEmpty columnCount={columns.length} />
577 )}
578 </TableBody>
579 </Table>
580 </div>
581
582 {/* Consistent pagination */}
583 <DataTablePagination table={table} />
584 </div>
585 )
586 }
587 
588 // Reusable business card with consistent layout
589 export const BusinessCard = ({
590 title,
591 description,
592 actions,
593 status,
594 metadata,
595 children
596 }: BusinessCardProps) => {
597 return (
598 <Card className="h-full">
599 <CardHeader className="pb-3">
600 <div className="flex items-center justify-between">
601 <div className="space-y-1">
602 <CardTitle className="text-base">{title}</CardTitle>
603 {description && (
604 <CardDescription>{description}</CardDescription>
605 )}
606 </div>
607
608 {status && (
609 <Badge variant={getStatusVariant(status)}>
610 {status}
611 </Badge>
612 )}
613 </div>
614 </CardHeader>
615
616 <CardContent className="pb-3">
617 {children}
618
619 {metadata && (
620 <div className="mt-4 text-sm text-muted-foreground">
621 {Object.entries(metadata).map(([key, value]) => (
622 <div key={key} className="flex justify-between">
623 <span>{key}:</span>
624 <span>{value}</span>
625 </div>
626 ))}
627 </div>
628 )}
629 </CardContent>
630
631 {actions && (
632 <CardFooter className="pt-3">
633 <div className="flex gap-2 w-full">
634 {actions.map((action, index) => (
635 <Button
636 key={index}
637 variant={action.variant || 'outline'}
638 size="sm"
639 onClick={action.onClick}
640 disabled={action.disabled}
641 className={action.className}
642 >
643 {action.label}
644 </Button>
645 ))}
646 </div>
647 </CardFooter>
648 )}
649 </Card>
650 )
651 }
652}
653```
654 
655## 🛡️ Quality Gates & Automation
656 
657### 1. Automated Code Quality Checks
658```typescript
659// ✅ QUALITY GATES: Automated enforcement of quality standards
660class QualityGateEnforcement {
661 // Pre-commit quality checks
662 static createPreCommitPipeline(): QualityPipeline {
663 return {
664 stages: [
665 {
666 name: 'Format Check',
667 check: async (files: string[]) => {
668 const results = await Promise.all([
669 this.checkPrettierFormatting(files),
670 this.checkESLintRules(files),
671 this.checkTypeScriptCompilation(files)
672 ])
673
674 return {
675 passed: results.every(r => r.passed),
676 errors: results.flatMap(r => r.errors),
677 autoFixAvailable: results.some(r => r.autoFixAvailable)
678 }
679 }
680 },
681
682 {
683 name: 'Business Logic Validation',
684 check: async (files: string[]) => {
685 return {
686 passed: await this.validateBusinessRuleConsistency(files),
687 errors: await this.getBusinessRuleViolations(files),
688 autoFixAvailable: false
689 }
690 }
691 },
692
693 {
694 name: 'Performance Validation',
695 check: async (files: string[]) => {
696 const results = await Promise.all([
697 this.checkBundleSize(files),
698 this.validateQueryPerformance(files),
699 this.checkMemoryLeaks(files)
700 ])
701
702 return {
703 passed: results.every(r => r.passed),
704 errors: results.flatMap(r => r.errors),
705 warnings: results.flatMap(r => r.warnings || [])
706 }
707 }
708 }
709 ],
710
711 onFailure: (stage: QualityStage, errors: QualityError[]) => {
712 throw new QualityGateError(
713 `Quality gate failed at stage: ${stage.name}`,
714 errors
715 )
716 }
717 }
718 }
719 
720 // Code review automation
721 static createCodeReviewAssistant(): CodeReviewAssistant {
722 return {
723 // Automated pattern detection
724 detectPatternViolations: (diff: GitDiff): PatternViolation[] => {
725 const violations: PatternViolation[] = []
726
727 // Check for DRY violations
728 const duplicateCode = this.detectDuplicateCode(diff)
729 if (duplicateCode.length > 0) {
730 violations.push({
731 type: 'DRY_VIOLATION',
732 severity: 'high',
733 message: 'Duplicate code detected',
734 suggestions: duplicateCode.map(d => d.refactoringSuggestion)
735 })
736 }
737
738 // Check for inconsistent patterns
739 const inconsistentPatterns = this.detectInconsistentPatterns(diff)
740 violations.push(...inconsistentPatterns)
741
742 return violations
743 },
744 
745 // Automated test coverage analysis
746 analyzeTes tCoverage: (diff: GitDiff): TestCoverageAnalysis => {
747 return {
748 coverage_percentage: this.calculateCoverageForDiff(diff),
749 missing_tests: this.findUntested Code(diff),
750 test_quality_score: this.assessTestQuality(diff),
751 recommendations: this.generateTestRecommendations(diff)
752 }
753 },
754 
755 // Performance impact analysis
756 analyzePerformanceImpact: (diff: GitDiff): PerformanceAnalysis => {
757 return {
758 bundle_size_impact: this.calculateBundleSizeChange(diff),
759 query_performance_impact: this.analyzeQueryChanges(diff),
760 memory_impact: this.analyzeMemoryImpact(diff),
761 recommendations: this.generatePerformanceRecommendations(diff)
762 }
763 }
764 }
765 }
766}
767```
768 
769### 2. Continuous Quality Monitoring
770```typescript
771// ✅ MONITORING: Continuous quality and tech debt monitoring
772class ContinuousQualityMonitoring {
773 // Technical debt detection
774 static createTechDebtMonitor(): TechDebtMonitor {
775 return {
776 // Code complexity monitoring
777 monitorComplexity: async (): Promise<ComplexityReport> => {
778 const files = await this.getAllSourceFiles()
779 const complexityResults = await Promise.all(
780 files.map(file => this.analyzeFileComplexity(file))
781 )
782
783 return {
784 overall_score: this.calculateOverallComplexityScore(complexityResults),
785 high_complexity_files: complexityResults
786 .filter(r => r.complexity > COMPLEXITY_THRESHOLD)
787 .sort((a, b) => b.complexity - a.complexity),
788 trending_complexity: this.calculateComplexityTrend(complexityResults),
789 refactoring_candidates: this.identifyRefactoringCandidates(complexityResults)
790 }
791 },
792 
793 // Dependency analysis
794 monitorDependencies: async (): Promise<DependencyReport> => {
795 const dependencies = await this.analyzeDependencies()
796
797 return {
798 outdated_packages: dependencies.outdated,
799 security_vulnerabilities: dependencies.vulnerabilities,
800 unused_dependencies: dependencies.unused,
801 circular_dependencies: dependencies.circular,
802 upgrade_recommendations: this.generateUpgradeRecommendations(dependencies)
803 }
804 },
805 
806 // Performance regression detection
807 monitorPerformanceRegressions: async (): Promise<PerformanceReport> => {
808 const currentMetrics = await this.gatherPerformanceMetrics()
809 const historicalMetrics = await this.getHistoricalMetrics()
810
811 return {
812 regressions: this.detectRegressions(currentMetrics, historicalMetrics),
813 improvements: this.detectImprovements(currentMetrics, historicalMetrics),
814 trending_metrics: this.calculateTrends(currentMetrics, historicalMetrics),
815 optimization_opportunities: this.identifyOptimizationOpportunities(currentMetrics)
816 }
817 }
818 }
819 }
820 
821 // Automated refactoring suggestions
822 static createRefactoringSuggestionEngine(): RefactoringSuggestionEngine {
823 return {
824 // Extract common patterns
825 suggestPatternExtractions: (codebase: Codebase): PatternExtractionSuggestion[] => {
826 const duplicatePatterns = this.findDuplicatePatterns(codebase)
827
828 return duplicatePatterns.map(pattern => ({
829 pattern_description: pattern.description,
830 occurrences: pattern.locations,
831 suggested_abstraction: pattern.suggestedAbstraction,
832 estimated_impact: {
833 lines_reduced: pattern.duplicateLines,
834 maintainability_improvement: pattern.maintainabilityScore,
835 test_coverage_impact: pattern.testCoverageChange
836 }
837 }))
838 },
839 
840 // Component optimization suggestions
841 suggestComponentOptimizations: (components: ComponentAnalysis[]): ComponentOptimization[] => {
842 return components
843 .filter(c => c.needsOptimization)
844 .map(component => ({
845 component_name: component.name,
846 optimization_type: component.suggestedOptimization,
847 current_issues: component.issues,
848 suggested_solution: component.solution,
849 implementation_effort: component.estimatedEffort
850 }))
851 },
852 
853 // Database optimization suggestions
854 suggestDatabaseOptimizations: (queries: QueryAnalysis[]): DatabaseOptimization[] => {
855 return queries
856 .filter(q => q.performance_issues.length > 0)
857 .map(query => ({
858 query_identifier: query.id,
859 performance_issues: query.performance_issues,
860 suggested_indexes: query.suggestedIndexes,
861 query_rewrite_suggestions: query.rewriteSuggestions,
862 estimated_improvement: query.estimatedImprovement
863 }))
864 }
865 }
866 }
867}
868```
869 
870This comprehensive tech debt prevention system ensures that code quality remains high, patterns stay consistent, and the system continues to evolve without accumulating technical debt. The automated checks and monitoring provide continuous feedback to maintain the highest standards of code quality and architectural integrity.
871 
872<function_calls>
873<invoke name="todo_write">
874<parameter name="merge">true

Sections

  • 🏗️ Tech Debt Prevention & Code Quality Governance
  • 🎯 Zero Tech Debt Philosophy
  • Proactive Prevention Strategy
  • 🔒 Consistency Enforcement Patterns
  • 1. Architectural Consistency
  • 2. Code Pattern Enforcement
  • 🔄 DRY Principle Implementation
  • 1. Reusable Business Logic Components
  • 2. Shared Component Library
  • 🛡️ Quality Gates & Automation
  • 1. Automated Code Quality Checks
  • 2. Continuous Quality Monitoring

What it covers

code-styletesting-strategyui

Stack — with the evidence

typescript

(1.00)

react

(1.00)

tailwind

(1.00)

docker

(1.00)

vite

(0.70)

eslint

(0.70)

javascript

(0.50)

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
madebyaris
Language
—
License
—
Archived
no

All configs in this repo

Also in madebyaris/poinf-of-sales

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
madebyaris/poinf-of-sales.cursor/rules/admin-interface-patterns.mdc · 118Cursor rulestypescriptreact+5stylearchsecurityapi+262/1003 days ago
madebyaris/poinf-of-sales.cursor/rules/api-patterns.mdc · 118Cursor rulestypescriptreact+5lint-formatstylesecuritydatabase+362/1003 days ago
madebyaris/poinf-of-sales.cursor/rules/authentication-and-security-patterns.mdc · 118Cursor rulestypescriptreact+5setupteststylesecurity+481/1003 days ago
madebyaris/poinf-of-sales.cursor/rules/backend-golang.mdc · 118Cursor rulestypescriptreact+5testlint-formatstylearch+569/1003 days ago
madebyaris/poinf-of-sales.cursor/rules/business-logic-patterns.mdc · 118Cursor rulestypescriptreact+5teststyledatabaseperformance+150/1003 days ago
madebyaris/poinf-of-sales.cursor/rules/database-patterns.mdc · 118Cursor rulestypescriptreact+5stylearchtypessecurity+262/1003 days ago
madebyaris/poinf-of-sales.cursor/rules/development-workflow.mdc · 118Cursor rulestypescriptreact+5setupbuildteststyle+386/1003 days ago
madebyaris/poinf-of-sales.cursor/rules/docker-deployment.mdc · 118Cursor rulestypescriptreact+6setupbuildteststyle+877/1003 days ago
madebyaris/poinf-of-sales.cursor/rules/frontend-react.mdc · 118Cursor rulestypescriptreact+5buildtestlint-formatstyle+469/1003 days ago
madebyaris/poinf-of-sales.cursor/rules/makefile-scripting.mdc · 118Cursor rulestypescriptreact+5setuplint-formatstylearch+281/1003 days ago
madebyaris/poinf-of-sales.cursor/rules/performance-optimization-patterns.mdc · 118Cursor rulestypescriptreact+5buildteststyledatabase+366/1003 days ago
madebyaris/poinf-of-sales.cursor/rules/project-architecture.mdc · 118Cursor rulestypescriptreact+5setupteststylearch+678/1003 days ago
madebyaris/poinf-of-sales.cursor/rules/react-native-mobile-patterns.mdc · 118Cursor rulestypescriptreact+5buildstylearchui+274/1003 days ago
madebyaris/poinf-of-sales.cursor/rules/role-based-access-patterns.mdc · 118Cursor rulestypescriptreact+5styletypessecuritydatabase+258/1003 days ago
madebyaris/poinf-of-sales.cursor/rules/testing-patterns.mdc · 118Cursor rulestypescriptreact+6setupteststylearch+474/1003 days ago
madebyaris/poinf-of-sales.cursor/rules/user-journey-optimization.mdc · 118Cursor rulestypescriptreact+5styleperformanceagent-behaviour50/1003 days ago
Diff against .cursor/rules/admin-interface-patterns.mdc Diff against .cursor/rules/api-patterns.mdc Diff against .cursor/rules/authentication-and-security-patterns.mdc Diff against .cursor/rules/backend-golang.mdc Diff against .cursor/rules/business-logic-patterns.mdc Diff against .cursor/rules/database-patterns.mdc Diff against .cursor/rules/development-workflow.mdc Diff against .cursor/rules/docker-deployment.mdc Diff against .cursor/rules/frontend-react.mdc Diff against .cursor/rules/makefile-scripting.mdc Diff against .cursor/rules/performance-optimization-patterns.mdc Diff against .cursor/rules/project-architecture.mdc Diff against .cursor/rules/react-native-mobile-patterns.mdc Diff against .cursor/rules/role-based-access-patterns.mdc Diff against .cursor/rules/testing-patterns.mdc Diff against .cursor/rules/user-journey-optimization.mdc

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45Cursor rulestypescriptpytest+15testlint-formatstylearch+5100/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack