What is OpenCARL?
OpenCARL is a dynamic rule injection plugin for OpenCode. Define your preferences once, and they load automatically when relevant to your current task.
🎯 Keyword-Based Loading
Rules load automatically when your prompt matches domain keywords. No manual activation needed.
⭐ Star-Commands
Explicit triggers like *brief or *deep for on-demand behavior changes.
📊 Context-Aware
Rules adapt based on context window usage — thorough when fresh, concise when depleted.
🔄 Global & Project Rules
Universal preferences in global config, project-specific rules in each repo.
Quick Start
Installation
# Install OpenCARL
npm install opencarl
# Add to opencode.json
echo '{"plugin": ["opencarl"]}' > opencode.json
# Run setup
npx opencarl --local
Basic Usage
# Interactive help
*opencarl
# View documentation
*opencarl docs
# Create a domain
/opencarl create DEVELOPMENT --recall 'write code, implement, test'
Rules load automatically when your prompt matches domain keywords (e.g., "fix bug" loads development rules).
Documentation
Explore guides, tutorials, and API reference:
📥 Installation
Detailed setup instructions and configuration
📖 OpenCARL Overview
Core concepts and how it works
🏗️ Domain Guide
Create and manage custom domains
⭐ Commands Guide
Create star-commands for common workflows
📋 Manifest Reference
Complete manifest configuration options
📊 Context Rules
Context-aware bracket system
🐍 Python API Tutorial
TDD with pytest, mocks, and external APIs
🔧 Troubleshooting
Common problems and solutions
📚 API Reference
TypeScript API documentation
CLI Commands
Setup
npx opencarl --local— Install for projectnpx opencarl --global— Install globallynpx opencarl --integrate— Add to AGENTS.md
Management
/opencarl create DOMAIN— Create domain/opencarl add rule— Add rule/opencarl list— List domains/opencarl view DOMAIN— View rules
File Structure
.opencarl/
├── manifest # Domain registry (states + keywords)
├── global # Always-loaded rules
├── commands # Star-command definitions
├── context # Context bracket rules
└── {domain} # Custom domains (lowercase, no extension)