Rule Cascade
Reference

Project configuration (rcas.yaml)

rcas.yaml tells the rcas command where a project keeps its rules and what to do with them. rcas init writes one.

rcas.yaml tells the rcas command where a project keeps its rules and what to do with them. rcas init writes one. Commands look for rcas.yaml, rcas.yml or rcas.json in the working directory and each directory above it; --config or RCAS_CONFIG names one explicitly. Relative paths in it are relative to the file. Every member except rcas is optional, and an unknown member is an error (exit status 3), so a typo cannot be silently ignored.

rcas: 1                         # the version of this file's format
project:
  name: Acme Payments
  idPrefix: acme.payments       # ruleset ids start with this; derived rulesets use <idPrefix>.generated
rules:
  dir: rules                    # where *.ruleset.yaml files are (default: rules)
  include: ["**/*.ruleset.yaml"] # optional globs under dir; default: every *.ruleset.yaml, .yml, .json
output:
  dir: build/rules              # where 'rcas compile --all' writes (default: build/rules)
  manifests: [client]           # also write <id>.<channel>.manifest.json for these channels
languages: [ts, java]           # ts, python, java, go, other: the runtimes that load the bundles
channels: [client, server]
sources:                        # the API descriptions rules are derived from
  openapi:
    - { path: api/openapi.yaml, schemas: [Transfer, Customer], idPrefix: acme.payments.generated }
  jsonSchema:
    - { path: schemas/order.schema.json, pointer: /$defs/Order, entity: Order }
analyze:
  include: ["src/**"]           # globs for 'rcas analyze'; ** matches directories
  exclude: ["**/test/**", "**/*.test.*", "**/*_test.go"]
  maxFiles: 20000
mcp:
  readOnly: false               # true: the MCP server offers no propose_ruleset tool
proposals:
  dir: .rcas/proposals          # where proposals wait for review (keep it out of version control)
MemberUsed byMeaning
rcasevery commandmust be 1
project.name, project.idPrefixinit, analyze --derivethe project's name and the prefix of its ruleset ids
rules.dir, rules.includecheck, test, compile --all, mcp, doctorthe rulesets of the project. RCAS_RULES_DIR overrides dir
output.dir, output.manifestscompile --allwhere bundles and manifests go. RCAS_OUT_DIR overrides dir
languagesinit, agent instructionsthe runtimes that load the rules: ts, python, java, go, other
channelsdocumentation of intentclient and/or server
sources.openapi, sources.jsonSchemapeople and agentsthe API descriptions to derive from; rcas derive takes them as arguments
analyze.include, analyze.exclude, analyze.maxFilesanalyze, init --from, the MCP analyze toolwhat to scan
mcp.readOnlymcpleave out propose_ruleset
proposals.dirproposals, derive --propose, analyze --derive, mcpwhere proposals are stored

Commit rcas.yaml. Keep .rcas/ out of version control (rcas init adds it to .gitignore).