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:

ScopeDescriptionExample
globalApplies everywhere"Always use TypeScript strict mode"
projectScoped to a project"Use pnpm in this monorepo"
agentScoped to an agent"Agent ops should prefer JSON output"
skillScoped to a skill"verify-kyc must validate phone format"
fileScoped to a file pattern"*.test.ts files use vitest"

Global options

  • --cortex-host <host> — Cortex host (default: 127.0.0.1 or from config)
  • --cortex-port <port> — Cortex port (default: 8080 or from config)
  • --cortex-token <token> — Cortex auth token (or set CORTEX_AUTH_TOKEN)

Subcommands

rules list

List rules, optionally filtered by scope.

Options:

FlagDescription
--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:

FlagDescription
--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:

FlagDescription
--scope <scope>Rule scope (default: global)
--target <target>Scope target

rules status

Show rule counts by scope and enabled/disabled statistics.

Examples

bash
mayros 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