Skip to content

Acceptance Criteria

Acceptance criteria in Jig follow the Structured Acceptance Protocol (SAP): every criterion that can be checked mechanically is defined with enough information that a machine can grade it without human judgment.

The structured format

Each criterion has five required fields:

FieldDescriptionExample
descriptionHuman-readable summary”Auth client file exists”
subjectWhat to checksrc/auth/client.ts
propertyWhat about itfile_exists
expectedThe right answertrue
methodHow to verify{ type: "shell", command: "test -f src/auth/client.ts", expect: "exit 0" }

Property types

PropertyChecks
file_existsWhether a file exists at the subject path
contains_stringWhether the subject contains the expected string
not_containsWhether the subject does not contain the expected string
http_statusWhether a URL returns the expected HTTP status code
output_matchesWhether a command’s output matches the expected pattern
column_existsWhether a database table contains the expected column
count_gteWhether a count is greater than or equal to expected
schema_matchesWhether a schema matches the expected structure

Method types

MethodHow it runs
shellExecutes a shell command; checks exit code and output
sqlRuns a SQL query against the database
httpMakes an HTTP request; checks status and response body
playwrightRuns Playwright browser automation steps

Example

A task for creating an auth client might have these criteria:

criteria:
- description: "Auth client module exists"
subject: "src/auth/client.ts"
property: file_exists
expected: "true"
method:
type: shell
command: "test -f src/auth/client.ts && echo exists"
expect: "exists"
- description: "Auth client exports createClient function"
subject: "src/auth/client.ts"
property: contains_string
expected: "export function createClient"
method:
type: shell
command: "grep 'export function createClient' src/auth/client.ts"
expect: "export function createClient"
- description: "Health endpoint returns 200"
subject: "https://staging.example.com/api/health"
property: http_status
expected: "200"
method:
type: http
command: "https://staging.example.com/api/health"
expect: "200"
environment: staging

Environment scoping

Each criterion can be scoped to an environment:

EnvironmentWhen it runsTypical checks
local (default)jig test <task>File existence, typecheck, unit tests
stagingjig test <task> --stagingBrowser tests, API integration, E2E
productionjig test <task> --productionHealth checks, smoke tests, migration verification

A task with only local criteria reaches local-verified when they pass. A task with production criteria only reaches passed when those also pass after deployment.

Managing criteria

Add, list, and remove criteria from the CLI:

Terminal window
# Add a criterion interactively
jig criteria add <task>
# Add with inline JSON
jig criteria add <task> --json '{"description": "...", "subject": "...", "property": "file_exists", "expected": "true", "method": {"type": "shell", "command": "test -f src/foo.ts", "expect": "exit 0"}}'
# List all criteria for a task
jig criteria list <task>
# Remove a criterion by ID
jig criteria remove <task> <criterion-id>

Running criteria

Execute all structured criteria for a task:

Terminal window
# Run local criteria
jig test <task>
# Run staging criteria
jig test <task> --staging
# Run production criteria
jig test <task> --production
# Run all environments
jig test <task> --all
# Batch run staging criteria for all eligible tasks
jig test --staging --wave

Each criterion is graded independently. The task passes only if every criterion in the targeted environment passes.

Plain English criteria

Not everything is mechanically verifiable. For items requiring human judgment — “the UI feels responsive,” “the error message is helpful” — use plain English acceptance criteria in the task’s acceptance_criteria array. These are reviewed by humans, not machines.

The rule of thumb: if you can write a shell command to check it, make it a structured criterion. If you cannot, write it in plain English.

CLI commands

See CLI Reference for full details on criteria add, criteria list, criteria remove, and test.