-
-
Notifications
You must be signed in to change notification settings - Fork 34
Context References
The Context Reference System helps maintain focus by tracking relevant files, code, and documentation throughout your development workflow. It ensures AI assistance stays targeted and efficient.
Context in CursorRIPER♦Σ represents the relevant scope of your current work:
- Files you're working with
- Code functions you're implementing
- Documentation you're referencing
- Folders containing related work
Without context management, AI might:
- 🚫 Reference unrelated files
- 🚫 Suggest changes to wrong components
- 🚫 Lose track of your focus
- 🚫 Provide generic instead of specific help
Track specific files in your project
!af src/auth/login.js
!af config/database.json
!af tests/auth.test.js
Use for:
- Implementation files
- Configuration files
- Test files
- Documentation files
Track entire directories
!ad src/components/
!ad tests/integration/
!ad docs/api/
Use for:
- Feature folders
- Module directories
- Test suites
- Documentation sections
Track specific code elements
!ac validateUser()
!ac AuthenticationService
!ac DATABASE_CONFIG
Use for:
- Functions
- Classes
- Constants
- Interfaces
Track external or internal docs
!adoc "API Design Guide"
!adoc "Security Best Practices"
!adoc README.md
Use for:
- Technical specifications
- Best practices
- API documentation
- Architecture docs
Track Cursor project rules
!ar "Code Style Guide"
!ar "Testing Standards"
!ar RIPERsigma1.0.5.mdc
Use for:
- Coding standards
- Project guidelines
- Framework rules
- Team conventions
Track version control context
!ag feature/authentication
!ag commit:a1b2c3d
!ag PR#42
Use for:
- Feature branches
- Specific commits
- Pull requests
- Git history
Track temporary notes and ideas
!an "Authentication Ideas"
!an "Refactoring Notes"
!an "Meeting Notes 2024-01-15"
Use for:
- Brainstorming
- Temporary notes
- Meeting outcomes
- Quick ideas
Pin files without direct reference
!pf src/core/engine.js
!pf .env.example
!pf package.json
Use for:
- Always-relevant files
- Core dependencies
- Critical configs
- Reference files
Context is displayed in activeContext.md:
## 📎 Context References
### 📄 Active Files
- src/auth/login.controller.js 🟢
- src/auth/auth.service.js 🟢
- src/middleware/auth.js 🟡
### 💻 Active Code
- validateCredentials() 🟢
- generateToken() 🟢
- AuthGuard 🟣
### 📚 Active Docs
- JWT Best Practices 🟢
- OAuth2 Specification 🟡
## 📡 Context Status
🟢 Active - Currently working
🟡 Partial - May reference
🟣 Essential - Always relevant
🔴 Deprecated - To be removedCurrently being worked on
src/auth/login.js 🟢
May be referenced
src/utils/helpers.js 🟡
Core to current work
src/config/app.js 🟣
Marked for removal
src/legacy/old-auth.js 🔴
Each mode automatically loads appropriate context:
MΓ[Ω₁] = [Γ₄, Γ₂, Γ₆] // Docs, Folders, Git- Documentation for understanding
- Folder structure exploration
- Git history investigation
MΓ[Ω₂] = [Γ₃, Γ₄, Γ₇] // Code, Docs, Notepads- Code patterns to consider
- Best practices docs
- Brainstorming notes
MΓ[Ω₃] = [Γ₁, Γ₂, Γ₅] // Files, Folders, Rules- Target files to modify
- Project structure
- Coding standards
MΓ[Ω₄] = [Γ₃, Γ₁, Γ₈] // Code, Files, Pinned- Active code elements
- Implementation files
- Critical references
MΓ[Ω₅] = [Γ₃, Γ₁, Γ₆] // Code, Files, Git- Implemented code
- Changed files
- Git comparisons
| Command | Description | Example |
|---|---|---|
!af |
Add file | !af src/main.js |
!ad |
Add directory | !ad src/services/ |
!ac |
Add code | !ac processPayment() |
!adoc |
Add documentation | !adoc "API Guide" |
!ar |
Add rules | !ar "Style Guide" |
!ag |
Add git ref | !ag feature/auth |
!an |
Add notepad | !an "Ideas" |
!pf |
Pin file | !pf config.json |
| Command | Description | Example |
|---|---|---|
!cs |
Set status | !cs login.js active |
!cr |
Remove reference | !cr old-file.js |
!cc |
Clear all | !cc |
!cm |
Mode context | !cm |
/plan
!af src/feature.js # Add target file
!ac newFeature() # Add function to implement
!adoc "Feature Spec" # Add specification
/execute
!cs src/feature.js essential # Mark as essential
!ac helperFunction() # Add new function
!cr "Feature Spec" # Remove spec (no longer needed)
/review
!cs src/feature.js partial # Downgrade relevance
!cr helperFunction() # Remove temporary function
Feature complete - context archived to memory
!cc # Clear for next task
Keep context minimal and relevant:
❌ Bad: Add entire src/ directory
✅ Good: Add specific feature folder
Build context as you work:
Research: Broad folders and docs
Plan: Specific files and rules
Execute: Exact code elements
Review: Changed files and tests
Swap context for different features:
!cc # Clear current
!cm # Load mode defaults
!af src/new-feature.js # Add new focus
Important context persists across modes:
!pf src/core/app.js # Always relevant
!cs database.config essential # Mark critical
# Research Phase
!ad src/features/auth/ # Explore structure
!adoc "Auth Requirements" # Understand needs
# Plan Phase
!af src/features/auth/login.js # Target file
!ar "Security Standards" # Apply standards
# Execute Phase
!ac loginUser() # Implement function
!pf src/features/auth/types.ts # Reference types
# Review Phase
!ag feature/auth-implementation # Compare changes
!af tests/auth.test.js # Verify tests
# Research
!ag issue#123 # Git issue
!af src/problematic-file.js # Problem file
# Plan
!ac buggyFunction() # Target function
!adoc "Expected Behavior" # Correct behavior
# Execute
!cs buggyFunction() essential # Focus on fix
# Review
!af tests/regression.test.js # Verify fix
# Research
!ad src/legacy/ # Old code
!adoc "New Architecture" # Target design
# Plan
!ac oldImplementation() # Current code
!ac newImplementation() # Target code
# Execute
!pf src/legacy/interfaces.ts # Maintain compatibility
# Review
!ag main...refactor-branch # Full comparison
Find common elements:
Γ₁ ∩ Γ₃ = Files containing active codeCombine contexts:
Γ₃ ∪ Γ₈ = All code references plus pinned filesfilter(Γ₃, "auth") = All auth-related coderank(Γ₁, relevance) = Files by importance[↗️σ₁:R₃] = Requirement 3
[↗️σ₁:R₃|Γ₃:validateUser()] = Requirement 3, specifically validateUser()
[Γ₃:AuthService] = Reference to AuthService
[Ψ₁+Γ₃:secretKey] = Protected code reference
Research: !ad src/
Plan: !ad src/auth/
Execute: !af src/auth/login.js
🟢 Active: What you're editing
🟡 Partial: What you might need
🟣 Essential: What you always need
🔴 Deprecated: What to remove
Let mode transitions update context:
!cm # Automatically sets mode-appropriate context
# End of feature
!cc # Clear all context
# Start of new feature
!cm # Fresh context for mode
!an "Why auth.service.js is essential"
# This service contains the core business logic
# All auth features depend on it
Problem: Too many references Solution: Use status markers and remove irrelevant
Problem: Cleared accidentally
Solution: Check backups in memory-bank
Problem: Old context still active
Solution: !cc then rebuild
Problem: AI not seeing relevant files Solution: Add with appropriate commands
/research
!ad src/features/ # Explore features
!adoc "Feature Request #42" # Understand requirements
/plan
!cc # Clear exploration context
!cm # Load planning context
!af src/features/search.js # Target implementation file
!ar "API Design Standards" # Apply standards
/research
!ag "Error: undefined user" # Search git for error
!af src/auth/middleware.js # Suspected problem file
!ac checkUserSession() # Problem function
/execute
!cs checkUserSession() essential # Focus on this
!pf src/types/user.ts # Reference for types
/review
!ag PR#123 # Pull request context
!af src/changed-file-1.js 🟢 # Files to review
!af src/changed-file-2.js 🟢
!ac newFeatureImplementation() # New code to check
- 🔄 Mode Transitions
- 💾 Memory Management
- 🛡️ Protection Workflow
- 📎 Context Management
- 👥 Team Collaboration
-
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