v1.0 | Created: 2025-04-10
This guide provides practical examples of how to use the context reference system in CursorRIPER Σ.
- Basic Context References
- Working with Mode-Specific Context
- Context Status Management
- Cross-References with Context
- Protection and Context Integration
- Context in Memory Files
- Advanced Context Operations
// Add a specific file to your context
!af src/main.js
// Add multiple files
!af src/components/Auth.js
!af src/utils/helpers.js
// Reference in discussion
According to the implementation in 📄src/components/Auth.js, we need to...
// Add specific function to context
!ac validateUser()
// Add a class to context
!ac AuthController
// Reference in discussion
The 💻validateUser() function should handle these edge cases...
// Add API documentation to context
!adoc API Reference
// Reference in discussion
Based on 📚API Reference, we should implement the endpoint as...
// Remove a reference that's no longer needed
!cr src/components/Auth.js
// Clear all context references
!cc
// Switch to Research mode
/r
// Apply default context for Research mode (docs, folders, git)
!cm
// Result:
// 📚API Documentation, 📁src/components/, 🔄feature/auth
/r
!cm
!adoc Security Best Practices
!ad src/auth/
!ag commit:a8f2e3
/i
!cm
!ac AuthProtocol
!adoc OAuth Standards
!an Auth Ideas
/p
!cm
!af src/roadmap.md
!ad test/
!ar Coding Standards
/e
!cm
!ac implementAuth()
!af src/auth/login.js
!pf test/auth/login.test.js
/rev
!cm
!ac validateCredentials()
!af src/auth/validation.js
!ag PR#42
// Mark a reference as essential
!cs validateUser() essential
// Mark a reference as partially relevant
!cs helpers.js partially
// Mark a reference as deprecated
!cs oldUtil.js deprecated
// In discussions
According to the essential context (🟣💻validateUser()), we should...
The partially relevant 🟡📄helpers.js contains utility functions...
We should replace 🔴📄oldUtil.js with the new implementation.
// Reference a requirement with code context
This implementation satisfies [↗️σ₁:R₃|Γ₃:validateUser()]
// Reference a task with file context
According to task [↗️σ₄:T₂|Γ₁:auth.js], we need to...
// Reference a protected region with documentation
The protected region [↗️σ₆:P₁|Γ₄:Security Guide] specifies...
// Direct context reference
The [Γ₃:AuthService] needs to handle these cases...
// With protection level
The [Ψ₁+Γ₃:validateUser()] function is protected and should not...
// Protected code reference
The 🔒💻validateUser() function contains critical authentication logic...
// Guarded code reference
The 🛡️💻processPayment() function should only be modified after review...
// Info code reference
The ℹ️💻logActivity() function provides context for debugging...
// Add protected code to context
!ac validateUser()
!cp validateUser()
// Combined reference in discussion
The 🔒💻validateUser() function satisfies requirement [↗️σ₁:R₂|Γ₃]
// activeContext.md excerpt:
## 📎 Context References
- 📄 Active Files: [auth.js, config.json]
- 💻 Active Code: [validateUser(), AuthService]
- 📚 Active Docs: [Security Guide]
- 🔄 Git References: [PR#42]
## 📡 Context Status
- 🟢 Active: [auth.js, AuthService]
- 🟣 Essential: [validateUser()]
- 🟡 Partially Relevant: [config.json]
// Current context contains research references
/i
!cm
// Context is updated with innovate-specific references
// Previous context is backed up before replacement
// Find overlap between active files and protected files
Let's look at the intersection of 📄 ∩ 🔒 = {auth.js, config.json}
// Combine debug and test code contexts for testing
We need to consider 🐞💻 ∪ 🧪💻 = {debug(), test(), validate.test()}
// Filter context by criteria
ΦΓ₂(💻, "auth") → {authenticateUser(), validateSession()}
// Context prioritization
ΦΓ₅(📄, "critical") → [auth.js, encryption.js]
- Start with
!cmafter switching modes to get default context - Use specific context commands (!af, !ac, etc.) to fine-tune
- Set status (!cs) for important references
- Use cross-references with context for traceability
- Backup context is created automatically on major changes
- Combine protection and context for security-critical code
- Use context operations for complex relationships
This guide provides examples for using the context reference system in CursorRIPER Σ
