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:
| Field | Description | Example |
|---|---|---|
description | Human-readable summary | ”Auth client file exists” |
subject | What to check | src/auth/client.ts |
property | What about it | file_exists |
expected | The right answer | true |
method | How to verify | { type: "shell", command: "test -f src/auth/client.ts", expect: "exit 0" } |
Property types
| Property | Checks |
|---|---|
file_exists | Whether a file exists at the subject path |
contains_string | Whether the subject contains the expected string |
not_contains | Whether the subject does not contain the expected string |
http_status | Whether a URL returns the expected HTTP status code |
output_matches | Whether a command’s output matches the expected pattern |
column_exists | Whether a database table contains the expected column |
count_gte | Whether a count is greater than or equal to expected |
schema_matches | Whether a schema matches the expected structure |
Method types
| Method | How it runs |
|---|---|
shell | Executes a shell command; checks exit code and output |
sql | Runs a SQL query against the database |
http | Makes an HTTP request; checks status and response body |
playwright | Runs 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: stagingEnvironment scoping
Each criterion can be scoped to an environment:
| Environment | When it runs | Typical checks |
|---|---|---|
local (default) | jig test <task> | File existence, typecheck, unit tests |
staging | jig test <task> --staging | Browser tests, API integration, E2E |
production | jig test <task> --production | Health 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:
# Add a criterion interactivelyjig criteria add <task>
# Add with inline JSONjig 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 taskjig criteria list <task>
# Remove a criterion by IDjig criteria remove <task> <criterion-id>Running criteria
Execute all structured criteria for a task:
# Run local criteriajig test <task>
# Run staging criteriajig test <task> --staging
# Run production criteriajig test <task> --production
# Run all environmentsjig test <task> --all
# Batch run staging criteria for all eligible tasksjig test --staging --waveEach 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.