-
-
Notifications
You must be signed in to change notification settings - Fork 34
API Reference
Complete API reference for the CursorRIPER♦Σ framework functions, operations, and system interfaces.
The framework API consists of:
- System Functions (Σ) - Core memory and state management
- File Operations (Φ) - File system interactions
- Context Operations (Γ) - Context management
- Protection Functions (Ψ) - Code protection
- Permission Functions (ℙ) - Access control
Core memory system management.
Σ_memory = {
σ₁: "projectbrief.md",
σ₂: "systemPatterns.md",
σ₃: "techContext.md",
σ₄: "activeContext.md",
σ₅: "progress.md",
σ₆: "protection.md"
}Updates memory files based on current mode.
Σ_update(mode) = {
Ω₁: σ₃ += technical_details, σ₄ = current_focus,
Ω₂: σ₄ += potential_approaches, σ₂ += design_decisions,
Ω₃: σ₄ += planned_changes, σ₅ += expected_outcomes,
Ω₄: σ₅ += implementation_progress, σ₄ += step_completion,
Ω₅: σ₅ += review_findings, σ₄ += review_status
}Parameters:
-
mode- Current RIPER mode (Ω₁-Ω₅)
Returns: Updated memory state
Backup system operations.
Σ_backup = {
create_backup() = copy_files(𝕄, 📦 + timestamp),
backup_context() = save_context_state(),
emergency_backup() = full_state_snapshot()
}Creates timestamped backup of all memory files.
Returns: Backup path
Saves current context state.
backup_context() = {
ctx_backup = {
refs: Σ_context.active_references,
status: Σ_context.status_map
},
write_json(path, ctx_backup)
}Creates emergency state snapshot.
emergency_backup() = {
create_backup(),
save_state({
mode: current_mode,
context: Σ_context.active_references,
permissions: current_permissions,
last_operation: last_op,
error_state: current_error
})
}Basic file system operations.
Φ_file = {
ensure_directory(path),
init(),
check_files()
}Creates directory if it doesn't exist.
Parameters:
-
path- Directory path
Returns: Success boolean
Initializes memory bank structure.
init() = {
ensure_directory(📂),
ensure_directory(📦)
}Verifies all memory files exist.
Returns: Validation report
Memory file operations.
Φ_memory = {
create_template(template, params),
initialize()
}Creates file from template.
Parameters:
-
template- Template string -
params- Replacement parameters
Returns: Formatted content
Creates all memory files from templates.
initialize() = {
ensure_directory(📂),
create_file(σ₁, template_σ₁),
create_file(σ₂, template_σ₂),
// ... all memory files
}Mode transition operations.
Φ_mode_transition = {
transition(mode_a, mode_b),
verify_completion(mode),
enforce_permissions(mode)
}Executes mode transition.
transition(mode_a, mode_b) = {
Σ_backup.create_backup(),
verify_completion(mode_a),
set_mode(mode_b),
enforce_permissions(𝕊(mode_b)),
update_context(MΓ[mode_b]),
log_transition(mode_a, mode_b)
}Parameters:
-
mode_a- Current mode -
mode_b- Target mode
Returns: Transition success
Context management system.
Σ_context = {
active_references: [],
status_map: {},
add_reference(type, name, status),
remove_reference(name),
clear_references(),
set_status(name, status),
context_for_mode(mode)
}Adds item to active context.
Parameters:
-
type- Context type (Γ₁-Γ₈) -
name- Item identifier -
status- Optional status (default: "active")
Example:
add_reference(Γ₁, "src/auth.js", "active")Removes item from context.
Parameters:
-
name- Item to remove
Clears all context references.
clear_references() = {
backup_context_refs(),
active_references = [],
status_map = {},
update_file(σ₄)
}Updates context item status.
Parameters:
-
name- Item identifier -
status- New status ("active"|"partial"|"essential"|"deprecated")
Sets mode-appropriate context.
context_for_mode(mode) = {
clear_references(),
for context_type in MΓ[mode] {
add_reference(context_type, "auto:" + mode, "essential")
}
}Advanced context operations.
Φ_context = {
expand(Γₙ),
filter(Γₙ, criteria),
persist(Γₙ, 📂),
retrieve(Γₙ, 📂),
rank(Γₙ, relevance)
}Expands context reference to full details.
Parameters:
-
Γₙ- Context type
Returns: Expanded context
Filters context by criteria.
Parameters:
-
Γₙ- Context type -
criteria- Filter criteria
Returns: Filtered context
Mode-specific protection behavior.
Ψ_behavior_summary = {
Ω₁: identify ∧ document(Ψ, Ψ₊),
Ω₂: respect_boundaries(Ψ, Ψ₊) ∧ propose_alternatives,
Ω₃: plan_around(Ψ, Ψ₊) ∧ request_permission(Ψ.GUARDED),
Ω₄: enforce_protection(Ψ, Ψ₊) ∧ follow_guidelines,
Ω₅: verify_integrity(Ψ, Ψ₊) ∧ report_violations
}Ψ = [PROTECTED, GUARDED, INFO, DEBUG, TEST, CRITICAL]
Ψ₊ = [END-P, END-G, END-I, END-D, END-T, END-C]Quick protection application.
protection_commands = {
"!cp": add_protection(Ψ₁),
"!cg": add_protection(Ψ₂),
"!ci": add_protection(Ψ₃),
"!cd": add_protection(Ψ₄),
"!ct": add_protection(Ψ₅),
"!cc": add_protection(Ψ₆)
}Permission management system.
Σ_permission = {
check_permission(operation, mode),
enforce_permissions(mode_permissions),
handle_violation(operation, mode),
check_operation_allowed(operation),
calculate_severity(operation, mode)
}Verifies operation permission.
Parameters:
-
operation- Operation to check -
mode- Current mode
Returns: Boolean allowed
check_permission(operation, mode) = {
op_category = get_operation_category(operation),
return 𝕊(mode)[op_category] === "✓" ||
𝕊(mode)[op_category] === "~"
}Updates active permissions.
Parameters:
-
mode_permissions- Permission set
Handles permission violation.
handle_violation(operation, mode) = {
severity = calculate_severity(operation, mode),
log_violation_to_registry(operation, mode, severity),
if (severity === "CRITICAL" || severity === "HIGH") {
Σ_backup.create_backup(),
safe_transition(mode, Ω₃)
} else {
notify_violation(operation, mode, severity)
}
}Determines violation severity.
Returns: "CRITICAL"|"HIGH"|"MEDIUM"|"LOW"
Main permission verification.
Ξ(op, Ω) = op ∈ 𝕊(Ω) ? allow(op) : 𝕍(op, Ω)𝕆ᵣₑₐₗ = {modify_files, write_code, delete_content, refactor}
𝕆ᵥᵢᵣₜᵤₐₗ = {suggest_ideas, explore_concepts, evaluate_approaches}
𝕆ₒᵦₛₑᵣᵥₑ = {read_files, analyze_content, identify_patterns}𝕊(Ω) = {
Ω₁: {𝕆ₒᵦₛₑᵣᵥₑ: ✓, 𝕆ᵥᵢᵣₜᵤₐₗ: ~, 𝕆ᵣₑₐₗ: ✗},
Ω₂: {𝕆ₒᵦₛₑᵣᵥₑ: ✓, 𝕆ᵥᵢᵣₜᵤₐₗ: ✓, 𝕆ᵣₑₐₗ: ✗},
Ω₃: {𝕆ₒᵦₛₑᵣᵥₑ: ✓, 𝕆ᵥᵢᵣₜᵤₐₗ: ✓, 𝕆ᵣₑₐₗ: ~},
Ω₄: {𝕆ₒᵦₛₑᵣᵥₑ: ✓, 𝕆ᵥᵢᵣₜᵤₐₗ: ~, 𝕆ᵣₑₐₗ: ✓},
Ω₅: {𝕆ₒᵦₛₑᵣᵥₑ: ✓, 𝕆ᵥᵢᵣₜᵤₐₗ: ~, 𝕆ᵣₑₐₗ: ✗}
}Δ = {
1: destructive_op(x) ⟶ warn ∧ confirm ∧ Σ_backup.create_backup(),
2: phase_transition(x) ⟶ verify ∧ Σ_backup.create_backup() ∧ update,
3: permission_violation(op) ⟶ 𝕍(op, current_mode),
4: error(x) ⟶ report("Framework issue: " + x) ∧ suggest_recovery(x),
5: context_change() ⟶ Σ_backup.backup_context() ∧ update_context_references()
}create_reference(file, item) = "[↗️" + file + ":" + item + "]"
create_context_ref(file, item, context) = "[↗️" + file + ":" + item + "|" + context + "]"
validate_reference(ref) = check_target_exists(ref)get_current_mode() = current_mode
is_mode_allowed(mode) = mode ∈ [Ω₁, Ω₂, Ω₃, Ω₄, Ω₅]
get_mode_name(mode) = mode_names[mode]get_framework_status() = {
version: "1.0.5",
phase: current_phase,
mode: current_mode,
memory_health: check_memory_health(),
context_size: Σ_context.active_references.length
}register_command(pattern, handler) = {
commands[pattern] = handler
}execute_command(input) = {
command = parse_command(input),
if (check_permission(command, current_mode)) {
return commands[command.pattern](command.args)
} else {
handle_violation(command, current_mode)
}
}Add custom functionality:
extend_framework(name, implementation) = {
if (!framework[name]) {
framework[name] = implementation
}
}hooks = {
before_mode_transition: [],
after_mode_transition: [],
before_backup: [],
after_backup: [],
on_violation: []
}
add_hook(event, handler) = {
hooks[event].push(handler)
}metrics = {
track_transition(from, to) = log_metric("transition", {from, to}),
track_violation(op, mode) = log_metric("violation", {op, mode}),
track_command(cmd) = log_metric("command", {cmd})
}generate_report() = {
transitions: count_transitions(),
violations: count_violations(),
commands: count_commands(),
mode_time: calculate_mode_time()
}FrameworkError = class extends Error {}
PermissionError = class extends FrameworkError {}
TransitionError = class extends FrameworkError {}
ContextError = class extends FrameworkError {}recover_from_error(error) = {
if (error instanceof PermissionError) {
suggest_mode_switch(error.required_mode)
} else if (error instanceof TransitionError) {
rollback_transition()
} else {
emergency_backup() ∧ report_error(error)
}
}- 🔄 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