mayros rules
Manage hierarchically scoped rules stored in AIngle Cortex. Rules guide agent behavior with priority-sorted, queryable constraints.
Rule scopes
Rules are organized in a hierarchy — more specific scopes take priority:
| Scope | Description | Example |
|---|---|---|
global | Applies everywhere | "Always use TypeScript strict mode" |
project | Scoped to a project | "Use pnpm in this monorepo" |
agent | Scoped to an agent | "Agent ops should prefer JSON output" |
skill | Scoped to a skill | "verify-kyc must validate phone format" |
file | Scoped to a file pattern | "*.test.ts files use vitest" |
Global options
--cortex-host <host>— Cortex host (default:127.0.0.1or from config)--cortex-port <port>— Cortex port (default:8080or from config)--cortex-token <token>— Cortex auth token (or setCORTEX_AUTH_TOKEN)
Subcommands
rules list
List rules, optionally filtered by scope.
Options:
| Flag | Description |
|---|---|
--scope <scope> | Filter by scope (global, project, agent, skill, file) |
--limit <n> | Max results (default: 50) |
rules add <content>
Add a new manual rule. Manual rules are enabled immediately.
Options:
| Flag | Description |
|---|---|
--scope <scope> | Rule scope (default: global) |
--target <target> | Scope target (project name, agent ID, file glob) |
--priority <n> | Priority level (higher = more specific) |
rules remove <id>
Remove a rule by its ID (full or prefix match).
rules learn <content>
Propose a learned rule. Learned rules start disabled and require manual confirmation before taking effect.
Options:
| Flag | Description |
|---|---|
--scope <scope> | Rule scope (default: global) |
--target <target> | Scope target |
rules status
Show rule counts by scope and enabled/disabled statistics.
Examples
bashmayros rules list mayros rules list --scope project mayros rules add "Use ESM imports, never CommonJS require" --scope project mayros rules add "Tests must use vitest" --scope file --target "*.test.ts" mayros rules add "Always respond in Spanish" --scope agent --target ops mayros rules remove a1b2c3d4 mayros rules learn "Prefer const over let when variable is not reassigned" mayros rules status