Goals and rubrics
OpsCode provides two mechanisms for defining acceptance criteria and verifying that infrastructure changes meet your engineering standards:
- Goals — Designed for interactive sessions. OpsCode breaks your objective into a checklist of verifiable acceptance criteria and tracks progress live in the TUI.
- Rubrics — Designed for non-interactive CI/CD pipelines. A dedicated grader model evaluates the agent's output against your criteria and sends deficiency reports back to the worker agent until every check passes.
Goals vs. rubrics
| Feature | Goals | Rubrics |
|---|---|---|
| Primary use case | Interactive sessions in the TUI | Headless CI/CD and automated workflows |
| How criteria are defined | Auto-generated from your high-level objective | Explicitly provided inline or via @file |
| Feedback loop | Real-time checklist visible in the TUI | Autonomous worker-grader retry loop |
| Evaluator model | Active session model | Optional dedicated grader model (--rubric-model) |
| CLI flag | --goal TEXT | --rubric TEXT|@PATH |
Goals
Use goals when pair-programming with OpsCode in an interactive session and you want structured tracking across a multi-step infrastructure change.
Set a goal
Pass --goal when launching OpsCode:
ops --goal "Harden the production EKS cluster with Pod Security Standards and NetworkPolicies"
Or set a goal inside an active session with /goal:
/goal Implement AWS KMS state encryption and cross-account IAM roles for OpenTofu
How goals work
- OpsCode inspects your workspace and decomposes the goal into concrete acceptance criteria.
- A live status panel in the TUI tracks each criterion as
[pending],[passed], or[failed]. - As the agent writes files and runs validation commands, it updates each criterion using the built-in
get_goalandupdate_goaltools.
Rubrics
Use rubrics in headless (-n) workflows when you want autonomous quality assurance before OpsCode exits or opens a pull request.
Inline rubric
Pass acceptance criteria directly via --rubric:
ops -n "Author a Terraform module for an AWS RDS Aurora Postgres cluster" \
--rubric "1. Multi-AZ deployment is enabled.
2. Storage is encrypted with an AWS KMS customer-managed key.
3. Automated backups are retained for at least 14 days.
4. Enhanced monitoring and Performance Insights are enabled.
5. Security group restricts port 5432 ingress to the VPC CIDR only."
Load a rubric from a file
For detailed architectural specifications, store your rubric in version control and reference it with @path:
ops -n "Refactor VPC networking" --rubric @specs/vpc-rubric.md
# VPC Architecture Rubric
1. Primary CIDR block is 10.100.0.0/16 with 3 public and 3 private subnets across 3 AZs.
2. NAT Gateways are deployed across all 3 availability zones.
3. VPC Flow Logs publish to an encrypted CloudWatch Log Group.
4. Default security group denies all inbound and outbound traffic.
5. Gateway VPC endpoints are provisioned for S3 and DynamoDB.
Rubric CLI options
| Flag | Description |
|---|---|
--rubric TEXT|@PATH | Acceptance criteria string or @path to a markdown/text file |
--rubric-model MODEL | Separate grader model (e.g., --rubric-model openai:gpt-4.1) |
--rubric-max-iterations N | Maximum worker-grader fix cycles before failing (default: 3) |
How the grading loop works
- The worker agent completes the requested task and runs local validation tools.
- The grader model inspects the modified files and command outputs against each rubric item.
- If every criterion passes, OpsCode exits with code
0. - If any criterion fails, the grader returns a structured deficiency report to the worker agent.
- The worker fixes the cited issues and resubmits its work until all criteria pass or
--rubric-max-iterationsis reached.
Grading an Anthropic worker model (anthropic:claude-opus-4-7) with an OpenAI grader model (--rubric-model openai:gpt-4.1) reduces self-evaluation bias and catches subtle compliance gaps.
CI/CD examples
Kubernetes manifest compliance gate
ops -n "Audit and fix k8s/deployment.yaml" \
--rubric "1. Non-root securityContext (runAsNonRoot: true) is configured.
2. Read-only root filesystem (readOnlyRootFilesystem: true) is enabled.
3. Liveness and readiness probes define explicit timeoutSeconds.
4. CPU and memory requests and limits are defined on all containers." \
--rubric-max-iterations 3 \
--quiet
GitHub Actions workflow generation
ops -n "Create a container release pipeline workflow in .github/workflows/release.yml" \
--rubric @specs/gha-security-rubric.md \
--rubric-model "openai:gpt-4.1" \
--max-turns 15