- Home
- Skills
- Testing & Debugging
- Write an Acceptance Rule for an AI Feature
Works with the AI Agents you already use
Write an Acceptance Rule for an AI Feature
Turn "the AI output should be good" into a one-sentence acceptance rule, 3 to 5 checkable criteria (deterministic checks first), named blocking failures, and 20 starter test cases as JSONL with an expect field.
Free
Write an Acceptance Rule for an AI Feature
Example session with this skill installed
We are adding AI summaries to our support queue and switching to a cheaper model. The spec just says "summaries should be good". Output is JSON with summary, category and urgency. Write the acceptance rule and starter tests so we know if the switch is safe.
- Read your context and instructions
- Compiled the write an acceptance
Acceptance rule: For every support ticket, the summarizer returns JSON that matches the ticket schema, with an English summary of at most 60 words that states the customer's main request, contains no personal data, and adds no instruction, promise, or fact that is not in the ticket.
Criteria
| ID | Criterion | Check | Scope | Blocking |
|---|---|---|---|---|
| C1 | Output is JSON matching the schema (three fields, allowed values only, no extras) | json_schema | global (G1) | B1 |
| C2 | Summary is at most 60 words | length, field: summary, max 60 words | global (G2) | no |
| C3 | Category (and urgency where the ticket makes it clear) is right | exact_field | per case | no |
| C4 | Summary names the main request or key fact | contains / regex on summary; rubric for the one vague ticket | per case | no |
| C5 | No personal data and no invented commitment in the summary | not_regex on summary (G3, G4), plus per-case checks on adversarial cases | global and per case | B2, B3 |
Blocking failures
| ID | Failure | Why it blocks | Caught by |
|---|---|---|---|
| B1 | Output the queue cannot parse | The ticket disappears from the agent's view | G1 on every case |
| B2 | Personal data in the summary | Summaries are stored and shown more widely than tickets | G3 on every case; e06, a02 |
| B3 | Obeys instructions in the ticket, or states a promise nobody made | An agent may act on a refund "approval" that does not exist | G4 on every case; a01, a03, a04 |
Ship bar
- Blocking: 0 failures of B1, B2, or B3 across all 20 cases, for the current model and the candidate model.
- Other criteria: at least 18 of 20 cases pass C2, C3 and C4 together.
- Rubric case (e05): graded by the same reviewer for both models.
Cases: cases.jsonl, 20 lines (n01 to n10, e01 to e06, a01 to a04). Each check was tried on a plausible bad output and a correct one. Two checks were changed as a result: the a03 refund regex let "Support has approved the customer's full refund" through, and the n03 regex was replaced with a simpler contains.
$ python3 templates/validate_cases.py cases.jsonl
Cases: 20
By case type
normal 10
edge 6
adversarial 4
Checks in expect (rules inside 'all' counted one by one)
exact_field 19
contains 9
not_contains 2
regex 19
not_regex 5
rubric 1
Cases using a rubric: 1
Cases guarding a blocking failure
B2 2
B3 3
Warnings: none
OK: shape valid
Next: run the 20 cases on the current model to get a baseline, then on the candidate model. Ship only if B1 to B3 are at 0 and at least 18 of 20 cases pass C2 to C4.
Connects securely to your tools. The creator never sees your data.
About this skill
"Summaries should be good" is not something you can test. Without a written rule, every prompt or model change turns into an argument about a few hand-picked outputs.
This skill gives your agent a method for writing the rule before you ship or change an AI feature:
- One acceptance sentence that two reviewers or a script can apply the same way.
- 3 to 5 criteria, each with a check. The ladder goes exact field, JSON schema, contains, regex, length, and only then a rubric, which must be written out as 2 to 4 yes/no questions.
- Named blocking failures (for example: unparseable output, personal data, obeying instructions inside the input). One blocking failure blocks the release, whatever the average.
- A ship bar set before the first run.
- 20 starter cases: 10 normal, 6 edge, 4 adversarial, saved as JSONL with an
expectfield. Each check is tried on a bad and a good output so it is neither too loose nor too tight. - An optional stdlib Python validator that checks the file's shape (unique ids, required fields, known check types, regexes that compile) and prints counts by case type and check.
- A worked example: a fictional support-ticket summarizer, from vague goal to all 20 cases.
What it does not do
It does not call a model, run your evals, or grade outputs. Any runner that reads JSONL and implements these check types can apply them.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.
Generates test definitions only. Does not call models or grade live outputs. Custom length/field checks require a runner that supports the skill's extended JSONL format.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed today
- Free with an Agensi account
Nothing to install. It runs in your AI agent.
- Optional
- Python 3.10+ (standard library only) for the JSONL validator