-
-
Notifications
You must be signed in to change notification settings - Fork 34
Context Management
Master the art of managing project context to keep AI assistance focused, relevant, and efficient throughout your development workflow.
Effective context management:
- π― Maintains focus on current work
- π Reduces irrelevant suggestions
- π Speeds up AI responses
- π‘ Improves suggestion quality
- π Enables smooth transitions
Poor context management leads to:
- π« Off-topic AI responses
- π« Missed relevant files
- π« Slower processing
- π« Generic suggestions
Add Context β Use Context β Update Status β Clean Context
β β β β
!af/!ac Active !cs !cc/!cr
When starting work:
!af src/auth/login.js # Add file
!ac validateUser() # Add function
!ad src/auth/ # Add directory
!adoc "Auth Spec" # Add documentation
AI references active context:
"Based on validateUser() in your context..."
"Looking at src/auth/login.js..."
"According to Auth Spec documentation..."
As relevance changes:
!cs login.js active # Currently editing
!cs validateUser() partial # May reference
!cs old-auth.js deprecated # To be removed
When work completes:
!cr old-auth.js # Remove single item
!cc # Clear all context
!cm # Reset to mode defaults
Organize by feature being developed:
## Feature: User Authentication
### Context Setup
!cc # Clear previous
!af src/auth/login.js # Main implementation
!af src/auth/register.js # Related feature
!ac AuthService # Core service
!ac validateCredentials() # Key function
!adoc "Auth Requirements" # Specifications
!pf src/types/user.ts # Type definitionsOrganize by application layer:
## Working on: API Layer
### Context Setup
!ad src/controllers/ # All controllers
!af src/middleware/auth.js # Auth middleware
!ac validateRequest() # Validation logic
!ar "API Standards" # Design rulesFocus on specific issue:
## Bug: Login Timeout Issue
### Context Setup
!ag "timeout error" # Git history
!af src/auth/session.js # Problem file
!ac refreshSession() # Suspect function
!af logs/error.log # Error logsLet mode determine context:
/research
!cm # Sets: Docs, Folders, Git
/execute
!cm # Sets: Code, Files, Pinned
Broad exploration context:
/research
!ad src/ # Entire source
!adoc "Architecture.md" # System design
!ag main # Git history
!ar "Coding Standards" # Guidelines
# AI can now explore broadly
"What authentication methods are used in this codebase?"
Focused execution context:
/execute
!cc # Clear exploration
!af src/feature.js # Target file
!ac implementFeature() # Function to write
!pf src/types.ts # Type reference
!cs feature.js essential # Mark critical
# AI focuses on specific implementation
"Implement the feature according to plan"
Problem-solving context:
/research
!ag "Error: undefined" # Search errors
!af src/problem-file.js # Suspect file
!ac buggyFunction() # Problem function
!af tests/failing.test.js # Failing test
# AI can investigate issue
"Why is this test failing?"
Validation context:
/review
!ag PR#123 # Pull request
!af src/changed-file1.js # Changed files
!af src/changed-file2.js
!ac newImplementation() # New code
# AI reviews changes
"Review these changes against requirements"
Clear context between features:
# Finishing Feature A
Feature A complete β
# Starting Feature B
!cc # Clear all
!cm # Mode defaults
!af src/feature-b.js # New focus
Build context as you work:
Research: !ad src/ # Broad
Plan: !ad src/auth/ # Narrower
Execute: !af src/auth/jwt.js # Specific
Keep status current:
!cs auth.js active # Working on this
!cs helper.js partial # Might need
!cs old.js deprecated # Will remove
Manage multiple features:
# Save Feature A context
!an "Feature A context: auth.js, login.js"
# Switch to Feature B
!cc
!af feature-b.js
# Return to Feature A
!cc
!af auth.js
!af login.js
Keep critical files always visible:
!pf src/types/global.ts # Always needed
!cs global.ts essential # Mark importance
Create reusable context sets:
## Context Template: API Development!cc !ad src/controllers/ !ad src/routes/ !af src/middleware/auth.js !ar "API Design Guide" !pf src/types/api.ts
Save as "API Context" notepad
Build on existing context:
# Base context
!af src/core/base.js
# Feature extends base
!ac BaseClass # From base.js
!af src/feature/extend.js # New feature
Focus within broad context:
!ad src/ # All source
filter: "auth" # Only auth-related
Results in focused view of auth files
Save context state:
# Before major change
Context snapshot: auth-implementation
- Files: auth.js, jwt.js
- Code: validateUser(), generateToken()
- Docs: "JWT Spec"
- Status: All active
# Can restore later
Context that updates automatically:
!ag current-branch # Always current branch
!af *.test.js # All test files
!ac *Error() # All error handlers
Monitor context effectiveness:
## Context Health Check
- Total items: 12
- Active items: 8 (67%)
- Stale items: 2
- Essential items: 3
- Last cleanup: 2 hours agoKeep context manageable:
Optimal context size:
- Files: 5-10
- Code elements: 10-15
- Folders: 2-3
- Total items: < 25
Track how often items are referenced:
## Context Usage Stats
- auth.js: 15 references β
- helper.js: 3 references
- old.js: 0 references β
- types.ts: 8 referencesProblem: Too many items in context
Active context: 47 items β
Solution: Aggressive cleanup
!cc # Clear all
!cm # Mode defaults only
# Add only essential items
Problem: Outdated references
Context includes deleted files
Solution: Regular validation
# Weekly context review
- Remove deleted files
- Update changed names
- Refresh status markers
Problem: AI not seeing relevant files
"I don't see the authentication implementation"
Solution: Add missing items
!af src/auth/impl.js
!ac authImplementation()
Problem: Research context in Execute mode
Mode: EXECUTE
Context: Documentation heavy β
Solution: Use mode context
!cm # Auto-adjust for mode
| Command | Purpose | Example |
|---|---|---|
!af |
Add file | !af src/main.js |
!ad |
Add directory | !ad src/utils/ |
!ac |
Add code | !ac validateUser() |
!adoc |
Add docs | !adoc "API Guide" |
!ar |
Add rules | !ar "Style Guide" |
!ag |
Add git | !ag feature-branch |
!an |
Add notepad | !an "TODO List" |
!pf |
Pin file | !pf config.json |
| Command | Purpose | Example |
|---|---|---|
!cs |
Set status | !cs file.js active |
!cr |
Remove item | !cr old-file.js |
!cc |
Clear all | !cc |
!cm |
Mode context | !cm |
- Clear previous context (
!cc) - Set mode-appropriate context (
!cm) - Add primary work files
- Add supporting documentation
- Pin essential references
- Add new files as created
- Update status markers
- Remove irrelevant items
- Keep context focused
- Mark completed items
- Archive important context
- Clean up temporary items
- Document context decisions
- Weekly context audit
- Remove stale items
- Update status markers
- Optimize context size
- Document patterns
- ποΈ Framework Overview
- π RIPER Modes
- πΎ Memory System
- π£ Symbolic Notation
- π Phase Management
- π‘οΈ Code Protection
- π Context References
- π Permission System
- π Cross-References
- πΎ Backup System
- π Mode Transitions
- πΎ Memory Management
- π‘οΈ Protection Workflow
- π Context Management
- π₯ Team Collaboration
- π£ Symbol Reference
- β¨οΈ Command Reference
- π Mode Reference
- π Permission Matrix
- π API Reference
- π Overview
- π GitHub Integration
- π Web Search
- π Browser Automation
- π³ Docker Integration
-
Installation Issues
- Node.js Version Compatibility
- Package Installation Failures
- Framework Dependencies Missing
- Database Connection Issues
- Port Conflicts
- Environment Setup Issues
- Build and Development Issues
- Framework CLI Issues
-
Configuration & Runtime Issues
- Framework Configuration Problems
- Runtime Performance Issues
- Module Loading and Plugin Issues
- Database and Storage Issues
- Memory Leaks and High Memory Usage
- High CPU Usage
-
BMAD Module Issues
- BMAD Module Initialization Problems
- Business Model Canvas Issues
- Stakeholder Management Issues
- Analytics and Reporting Issues
- Performance Optimization
-
Database & API Issues
- Database Connection Problems
- Database Migration Issues
- API Performance and Reliability Issues
- Data Consistency Issues
- Transaction Problems
-
Performance & Memory Issues
- Memory Management
- CPU Optimization
- Database Query Performance
- Caching Issues
- Resource Monitoring
-
Security & Authentication Issues
- Authentication Failures
- Authorization Problems
- JWT Token Issues
- Session Management
- CORS and Security Headers
- SSL/TLS Configuration
-
Deployment & Production Issues
- Production Deployment Failures
- Environment Configuration
- Load Balancing Issues
- Monitoring and Logging
- Backup and Recovery
When reporting issues, please include:
- Framework version (
npm list @cursoriper/core) - Node.js version (
node --version) - Operating system and version
- Error messages and stack traces
- Steps to reproduce the issue
- Configuration files (sanitized)
- Recent changes or deployments
- Technical Support: support@cursoriper.com
- Documentation: https://docs.cursoriper.com
- Community Forum: https://community.cursoriper.com