@afterxleep/doc-bot
Version:
Generic MCP server for intelligent documentation access in any project
83 lines (66 loc) ⢠2.92 kB
Plain Text
# šļø 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.