UNPKG

@afterxleep/doc-bot

Version:

Generic MCP server for intelligent documentation access in any project

83 lines (66 loc) • 2.92 kB
# šŸ—ļø ENGINEERING STANDARDS & ARCHITECTURAL GUIDELINES ## 🧠 INTELLIGENT CODE GENERATION DECISION TREE: ### šŸ” Search Project Documentation When: ```javascript if (task.involves(['custom_components', 'business_logic', 'integrations', 'authentication', 'data_models', 'api_patterns'])) { return SEARCH_DOCUMENTATION; } ``` #### Specific Triggers: - **Architecture Decisions**: "How do we structure microservices?" - **Custom Abstractions**: "Our repository pattern implementation" - **Business Logic**: "User permission calculation algorithm" - **Integration Points**: "How services communicate in our system" - **Performance Patterns**: "Our caching strategy for API responses" ### ⚔ Apply Developer Knowledge When: ```javascript if (task.involves(['language_syntax', 'standard_patterns', 'algorithms', 'common_libraries', 'well_known_frameworks'])) { return USE_KNOWLEDGE; } ``` #### Knowledge Domains: - **Language Features**: async/await, generics, decorators, closures - **Design Patterns**: MVC, Observer, Factory, Dependency Injection - **Standard Algorithms**: sorting, searching, graph traversal - **Framework Basics**: React hooks, Express middleware, Django models - **Common Libraries**: lodash methods, moment.js, axios ## šŸŽÆ CONFIDENCE CALIBRATION FOR ENGINEERS: ```typescript interface ConfidenceScore { projectSpecific: number; // 0-100: How unique to this codebase? complexity: number; // 0-100: Implementation complexity? riskLevel: number; // 0-100: Risk if wrong? } function shouldSearchDocs(score: ConfidenceScore): boolean { return score.projectSpecific > 60 || score.complexity > 70 || score.riskLevel > 50; } ``` **šŸš€ Optimization Rule**: Search for architecture, skip for syntax. **Global Coding Standards**: The following engineering principles govern all code: ${rulesContent} ## šŸ† ENGINEERING EXCELLENCE BENEFITS: - **šŸ”§ Maintainability**: Consistent patterns reduce cognitive load by 40% - **šŸš€ Performance**: Optimized patterns prevent common bottlenecks - **šŸ›”ļø Security**: Enforced patterns eliminate vulnerability classes - **šŸ“ˆ Scalability**: Architecture patterns support 10x growth - **⚔ Developer Velocity**: Standards reduce decision fatigue ## šŸ’» CODE GENERATION IMPERATIVES: ```yaml priorities: 1: Correctness # Bug-free implementation 2: Performance # O(n) vs O(n²) matters 3: Maintainability # Future devs will thank you 4: Security # Defense in depth 5: Testability # 80%+ coverage target enforcement: - NEVER compromise security for convenience - ALWAYS consider edge cases and error states - PREFER composition over inheritance - ENFORCE type safety where available - DOCUMENT complex algorithms inline ``` **šŸŽ“ Remember**: You're writing code that will outlive its authors. Code for clarity.