---
description: Optimized Level 1 workflow for quick bug fixes with token efficiency
globs: "**/level1*/**", "**/quick*/**", "**/bugfix*/**"
alwaysApply: false
---
# OPTIMIZED LEVEL 1 WORKFLOW
> **TL;DR:** This streamlined workflow for Level 1 tasks (quick bug fixes) optimizes for speed and token efficiency while maintaining quality.
## π§ LEVEL 1 PROCESS FLOW
```mermaid
graph TD
Start["START LEVEL 1<br>QUICK FIX"] --> Analyze["1οΈβ£ ANALYZE<br>Understand issue"]
Analyze --> Implement["2οΈβ£ IMPLEMENT<br>Fix the issue"]
Implement --> Verify["3οΈβ£ VERIFY<br>Test the fix"]
Verify --> Document["4οΈβ£ DOCUMENT<br>Record solution"]
style Start fill:#4da6ff,stroke:#0066cc,color:white
style Analyze fill:#ffa64d,stroke:#cc7a30,color:white
style Implement fill:#4dbb5f,stroke:#36873f,color:white
style Verify fill:#d94dbb,stroke:#a3378a,color:white
style Document fill:#4dbbbb,stroke:#368787,color:white
```
## π CONSOLIDATED DOCUMENTATION
Level 1 tasks use a single-file approach to minimize context switching:
```markdown
# QUICK FIX: [Issue Name]
## Issue Summary
- Type: [Bug/Hotfix/Quick Enhancement]
- Priority: [Low/Medium/High/Critical]
- Reported by: [Name/System]
- Affected area: [Component/Feature]
## Analysis
- Root cause: [Brief description]
- Affected files: [List of files]
- Impact: [Scope of impact]
## Solution
- Approach: [Brief description]
- Changes made: [List of changes]
- Commands executed: [Key commands]
## Verification
- Testing: [How the fix was tested]
- Results: [Test results]
- Additional checks: [Any other verification]
## Status
- [x] Fix implemented
- [x] Tests passed
- [x] Documentation updated
```
## π MEMORY BANK UPDATE
Level 1 tasks use a simplified Memory Bank update with minimal overhead:
```markdown
## tasks.md Update (Level 1)
### Task: [Task Name]
- Status: Complete
- Implementation: [One-line summary]
- Link to fix: [File/line reference]
```
## β‘ TOKEN-OPTIMIZED TEMPLATE
For maximum efficiency, Level 1 tasks can use this ultra-compact template:
```markdown
## π§ FIX: [Issue]
π Problem: [Brief description]
π Cause: [Root cause]
π οΈ Solution: [Implemented fix]
β
Tested: [Verification method]
```
## π AUTO-DOCUMENTATION HELPERS
Use these helpers to automatically generate documentation:
```javascript
function generateLevel1Documentation(issue, rootCause, solution, verification) {
return `## π§ FIX: ${issue}
π Problem: ${issue}
π Cause: ${rootCause}
π οΈ Solution: ${solution}
β
Tested: ${verification}`;
}
```
## π QUICK TEMPLATES FOR COMMON ISSUES
### Performance Fix
```markdown
## π§ FIX: Performance issue in [component]
π Problem: Slow response times in [component]
π Cause: Inefficient query/algorithm
π οΈ Solution: Optimized [specific optimization]
β
Tested: Response time improved from [X]ms to [Y]ms
```
### Bug Fix
```markdown
## π§ FIX: Bug in [component]
π Problem: [Specific behavior] not working correctly
π Cause: [Root cause analysis]
π οΈ Solution: Fixed by [implementation details]
β
Tested: Verified with [test approach]
```
### Quick Enhancement
```markdown
## π§ ENHANCEMENT: [Feature]
π Request: Add [specific capability]
π οΈ Implementation: Added by [implementation details]
β
Tested: Verified with [test approach]
```
## β
STREAMLINED VERIFICATION
Level 1 tasks use a minimal verification process:
```markdown
VERIFICATION:
[x] Fix implemented and tested
[x] No regressions introduced
[x] Documentation updated
```
## π CONSOLIDATED MEMORY BANK UPDATE
Optimize Memory Bank updates for Level 1 tasks by using a single operation:
```javascript
// Pseudocode for optimized Level 1 Memory Bank update
function updateLevel1MemoryBank(taskInfo) {
// Read current tasks.md
const tasksContent = readFile("tasks.md");
// Create minimal update
const updateBlock = `
### Task: ${taskInfo.name}
- Status: Complete
- Implementation: ${taskInfo.solution}
- Link to fix: ${taskInfo.fileReference}
`;
// Add update to tasks.md
const updatedContent = appendToSection(tasksContent, "Completed Tasks", updateBlock);
// Write in single operation
writeFile("tasks.md", updatedContent);
return "Memory Bank updated";
}
```
## π OPTIMIZED LEVEL 1 WORKFLOW EXAMPLE
```markdown
## π§ FIX: Login button not working on mobile devices
π Problem:
Users unable to log in on mobile devices, button appears but doesn't trigger authentication
π Cause:
Event listener using desktop-specific event (mousedown instead of handling touch events)
π οΈ Solution:
Updated event handling to use event delegation and support both mouse and touch events:
```js
// Before:
loginButton.addEventListener('mousedown', handleLogin);
// After:
loginButton.addEventListener('mousedown', handleLogin);
loginButton.addEventListener('touchstart', handleLogin);
```
β
Tested:
- Verified on iOS Safari and Android Chrome
- Login now works on all tested mobile devices
- No regression on desktop browsers
```
## β‘ TOKEN EFFICIENCY BENEFITS
This optimized Level 1 workflow provides:
1. Reduced documentation overhead (70% reduction)
2. Consolidated Memory Bank updates (single operation vs. multiple)
3. Focused verification process (essential checks only)
4. Template-based approach for common scenarios
5. Streamlined workflow with fewer steps
The updated approach maintains all critical information while significantly reducing token usage.