Skip to main content

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​

FeatureGoalsRubrics
Primary use caseInteractive sessions in the TUIHeadless CI/CD and automated workflows
How criteria are definedAuto-generated from your high-level objectiveExplicitly provided inline or via @file
Feedback loopReal-time checklist visible in the TUIAutonomous worker-grader retry loop
Evaluator modelActive session modelOptional 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​

  1. OpsCode inspects your workspace and decomposes the goal into concrete acceptance criteria.
  2. A live status panel in the TUI tracks each criterion as [pending], [passed], or [failed].
  3. As the agent writes files and runs validation commands, it updates each criterion using the built-in get_goal and update_goal tools.

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
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​

FlagDescription
--rubric TEXT|@PATHAcceptance criteria string or @path to a markdown/text file
--rubric-model MODELSeparate grader model (e.g., --rubric-model openai:gpt-4.1)
--rubric-max-iterations NMaximum worker-grader fix cycles before failing (default: 3)

How the grading loop works​

  1. The worker agent completes the requested task and runs local validation tools.
  2. The grader model inspects the modified files and command outputs against each rubric item.
  3. If every criterion passes, OpsCode exits with code 0.
  4. If any criterion fails, the grader returns a structured deficiency report to the worker agent.
  5. The worker fixes the cited issues and resubmits its work until all criteria pass or --rubric-max-iterations is reached.
Use a cross-provider grader model

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