# Reasoning Response Templates
This document provides standardized response patterns to ensure proper problem-solving approach and prevent shortcut-seeking behavior.
## Error Response Template
When encountering ANY error, test failure, or quality gate violation:
### Phase 1: Root Cause Analysis (MANDATORY)
```
š ROOT CAUSE ANALYSIS:
1. Error message: [exact error text]
2. Affected component: [specific file/function/system]
3. Underlying cause: [what's actually wrong]
4. Why it occurred: [technical reason]
ā NOT ALLOWED: "Let's bypass this error"
ā
REQUIRED: "Let's understand and fix this error"
```
### Phase 2: Proper Solution Design
```
š ļø SOLUTION APPROACH:
1. Fix strategy: [how to address root cause]
2. Standards compliance: [how solution meets all requirements]
3. Side effects: [what else might be impacted]
4. Verification plan: [how to confirm fix works]
ā NOT ALLOWED: "Quick workaround"
ā
REQUIRED: "Comprehensive proper fix"
```
### Phase 3: Implementation & Verification
```
ā
IMPLEMENTATION:
1. Changes made: [specific modifications]
2. Standards verified: [ESLint, TypeScript, tests all pass]
3. Root cause eliminated: [confirmation of fix]
4. No regressions: [other functionality still works]
ā NOT ALLOWED: Skipping verification
ā
REQUIRED: Complete validation through original quality gate
```
## Quality Gate Failure Template
For ESLint violations, test failures, TypeScript errors, etc.:
### Step 1: Understanding Phase
```
š QUALITY GATE ANALYSIS:
- Gate type: [ESLint/TypeScript/Test/Coverage]
- Specific violation: [exact rule/error]
- Files affected: [list of files]
- Standard being enforced: [why this matters]
š« BYPASS ATTEMPT DETECTED? NO - We fix the code to meet standards
```
### Step 2: Compliance Strategy
```
šÆ COMPLIANCE APPROACH:
- Code changes needed: [specific modifications required]
- Type improvements: [if TypeScript related]
- Test additions: [if coverage related]
- Refactoring required: [if structural issues]
ā
GOAL: Meet existing standards, don't lower them
```
## Shortcut Detection & Redirection
When shortcut patterns are detected:
### Immediate Redirection
```
š« SHORTCUT DETECTED: [specific bypass pattern]
ā WRONG APPROACH: [what was suggested]
ā
PROPER APPROACH: [correct solution path]
MANDATORY QUESTIONS:
1. What's the actual problem? [force root cause analysis]
2. Why avoid the proper fix? [challenge shortcut mentality]
3. What standards apply? [ensure compliance thinking]
4. How to verify success? [require validation]
```
## Decision Tree Templates
### Problem Encountered Decision Tree
```
PROBLEM ENCOUNTERED
āāā Is this a quality gate failure?
ā āāā YES ā Use Quality Gate Failure Template
ā āāā NO ā Continue to cause analysis
āāā Can I identify the root cause?
ā āāā YES ā Design proper fix
ā āāā NO ā Investigate further (no workarounds)
ā āāā UNSURE ā Research and analyze
āāā Am I tempted to use a shortcut?
āāā YES ā STOP - Use Shortcut Redirection Template
āāā NO ā Proceed with proper solution
```
### Solution Validation Decision Tree
```
SOLUTION PROPOSED
āāā Does it address root cause?
ā āāā YES ā Continue validation
ā āāā NO ā REJECT - Not a proper fix
āāā Does it meet all quality standards?
ā āāā YES ā Continue validation
ā āāā NO ā REJECT - Standards must be met
āāā Does it avoid bypassing any checks?
ā āāā YES ā Proceed with implementation
ā āāā NO ā REJECT - No bypasses allowed
āāā Can success be verified?
āāā YES ā Implement and verify
āāā NO ā Design better verification method
```
## Success Validation Templates
### Pre-Implementation Checklist
```
ā
PRE-IMPLEMENTATION VALIDATION:
ā” Root cause clearly identified
ā” Solution addresses actual problem
ā” All quality standards will be met
ā” No bypasses or shortcuts involved
ā” Verification method planned
ā” Side effects considered
ā” Documentation updated if needed
PROCEED ONLY IF ALL CHECKED
```
### Post-Implementation Verification
```
ā
POST-IMPLEMENTATION VERIFICATION:
ā” Original error/failure resolved
ā” All quality gates pass (ESLint, TypeScript, tests)
ā” No new errors introduced
ā” Standards maintained or improved
ā” Documentation reflects changes
ā” Learning documented for future
SUCCESS ONLY IF ALL VERIFIED
```
## Common Anti-Patterns & Redirections
### Pattern: "Let's disable the rule"
```
ā DETECTED: "eslint-disable", "@ts-ignore", "skip test"
š« BLOCKED: Rule disabling is not a solution
ā
REDIRECT: "What is this rule protecting against?"
ā
ACTION: Fix the code to comply with the rule
ā
RESULT: Better code quality and safety
```
### Pattern: "Lower the threshold"
```
ā DETECTED: "reduce coverage", "lower threshold", "relax requirement"
š« BLOCKED: Standard lowering is not acceptable
ā
REDIRECT: "How can we meet the existing standard?"
ā
ACTION: Improve code quality to reach threshold
ā
RESULT: Higher quality codebase
```
### Pattern: "Quick fix for now"
```
ā DETECTED: "temporary", "for now", "quick fix", "workaround"
š« BLOCKED: Temporary fixes become permanent problems
ā
REDIRECT: "What's the proper long-term solution?"
ā
ACTION: Implement the correct fix immediately
ā
RESULT: Sustainable, maintainable code
```
## Usage Guidelines
1. **Always use templates** when encountering problems
2. **Never skip phases** in the response templates
3. **Force root cause analysis** before any solution
4. **Validate through original quality gate** always
5. **Document the reasoning process** for future reference
These templates ensure consistent, proper problem-solving approach and prevent regression to shortcut-seeking behavior.