CARL Rules Manager
Help users create and manage CARL domains and rules through natural conversation.
Router
Parse user intent first:
| User says | Action |
|---|---|
| "make this a rule" | Suggest domain -> add rule |
| "add rule to X" | Add rule to domain X |
| "create domain" | Create domain + manifest |
| "what domain for X" | Read SUGGEST-DOMAIN.md |
| "edit rule" | Find and edit rule |
| "toggle X" | Update manifest state |
| "add a star-command" | Add to COMMANDS domain |
Quick Reference
Paths
- Project:
./.carl/(current workspace) - Global:
~/.carl/(user home) - Manifest:
.carl/manifest
Domain File Format
# {DOMAIN} Domain Rules
{DOMAIN}_RULE_0=First rule
{DOMAIN}_RULE_1=Second rule
Manifest Entry
{DOMAIN}_STATE=active
{DOMAIN}_RECALL=keyword1, keyword2
{DOMAIN}_EXCLUDE=
{DOMAIN}_ALWAYS_ON=false
Operations
Add Rule to Existing Domain
- Read domain file
- Find highest RULE_N index
- Append new rule at index+1
- Write file
Create New Domain
- Create
.carl/{domain}(lowercase filename) - Add rules with UPPERCASE prefix
- Add manifest entries
- Optionally add to DOMAIN_ORDER
Suggest Domain
See SUGGEST-DOMAIN.md for domain categorization logic.
Toggle Domain
- Read manifest
- Update {DOMAIN}_STATE to active/inactive
- Write manifest
Create Star-Command
- Read
.carl/commands - Add {COMMAND}_RULE_N entries
- User invokes with *commandname
Response Style
Be direct. Show exact changes:
Adding to DEVELOPMENT domain:
.carl/development:
+ DEVELOPMENT_RULE_5=Always use TypeScript strict mode
Done. Rule added at index 5.
Supporting Files
| File | Purpose |
|---|---|
| DOMAIN-GUIDE.md | Domain structure, naming conventions |
| MANIFEST-REFERENCE.md | All manifest fields explained |
| CONTEXT-RULES.md | CONTEXT bracket system (FRESH/MODERATE/DEPLETED) |
| COMMANDS-GUIDE.md | Star-command format and examples |
| SUGGEST-DOMAIN.md | Logic for suggesting domain placement |
When to Activate
- User says "make this a rule" or "add this as a rule"
- User asks "what domain should this be in?"
- User wants to "create a domain for X"
- User mentions modifying
.carlfiles - User wants to add a star-command (*brief, *discuss, etc.)
- User asks about CARL structure or configuration
Important Notes
- Filenames lowercase, rule prefixes UPPERCASE
- Sequential indices starting at 0
- Manifest uses
=with no spaces - GLOBAL is always-on by default
- Read existing file first to get current max index