Agent Skills for QA: Build a Reusable Testing Skill with SKILL.md
An agent skill is a saved procedure your AI agent loads when a task matches. Build a reusable test case skill with SKILL.md and a linter, and see what it costs in tokens.
Hely PatelHead of Product and Marketing19 min read
An agent skill is a folder with a SKILL.md file that teaches an AI agent how your team does one specific job. For QA, that job might be writing test cases in your standard, triaging a failed run or filing a bug in your template. The agent reads only the skill's name and description until the task needs it, then loads the full instructions, and runs any bundled scripts to check its own work. This guide builds a working QA skill from scratch, validates it against the Agent Skills specification, tests its script and gives you an evaluation set to measure whether it actually helps.
Most testers first meet AI as a chat box. You paste a requirement, write a long prompt and get test cases back. Tomorrow you do it again, slightly differently, and the output changes shape. Skills solve that repetition. They turn a procedure you explain over and over into a file the agent loads on its own, the same way every time.
Everything below was built and run for this post. The skill is a real folder, the linter was run on a defective case file and then fixed after we found a gap in it, and its tests pass. Where something could not be verified in our environment, we say so.
What Is an Agent Skill?
An agent skill is a directory that contains, at minimum, a SKILL.md file with YAML frontmatter and Markdown instructions. The Agent Skills specification, published as an open format, describes the folder this way: a required SKILL.md, plus optional scripts/, references/ and assets/ folders.
Two fields in the frontmatter are required. The name identifies the skill and the description says what it does and when to use it. Everything else is optional.
The important design idea is progressive disclosure. The agent does not read every skill in full at the start of a session. It loads skills in three levels:
This is why a team can install dozens of skills without crowding the context window. Only the one-line descriptions sit in memory. The detailed material arrives when it is needed, and scripts can run without their code ever entering the context.
A prompt, by contrast, lives in one conversation. When the chat ends, it is gone. A skill persists in a folder, can be versioned in Git and can be shared with a team. The next post in this series compares skills, MCP servers and prompts in detail, so here we stay on the skill itself.
Why QA Teams Should Care About Skills
Testing is process work. Teams have a test case template, a bug report format, a naming convention, a risk rubric and a definition of a good expected result. Every one of those is a procedure that an AI agent follows better when it is written down once, in a place the agent can find.
A skill gives a QA team four concrete gains:
Consistency. Two testers asking for test cases get the same fields, the same IDs and the same technique tags, because both agents load the same instructions.
Less retyping. The six-paragraph prompt you used to paste becomes a folder you install once.
Checkable output. A skill can bundle a script that validates what the agent produced, so the agent finds its own mistakes before you do.
Shareable standards. A new joiner inherits the team standard by installing the skill, not by reading a wiki page.
The ecosystem has moved quickly. Public QA skill packs now exist for Playwright automation, API testing and test strategy, and Playwright itself ships installable skills for its command line interface. The format is portable, so a skill written for one agent generally works in others that support the standard. Treat third party skills like any code you install: read them first, including bundled scripts and any instruction that connects to an outside network source.
Anatomy of a QA Skill
Here is the layout of the skill we build in this guide, called writing-test-cases:
writing-test-cases/
├── SKILL.md # frontmatter + workflow + rules (about 390 tokens)
├── references/
│ ├── test-case-standard.md # the field rules, loaded on demand
│ └── techniques.md # when to use which technique
├── scripts/
│ └── lint_cases.py # checks the agent's output
├── assets/
│ └── cases-template.json # a correct example to copy
└── tests/
└── test_lint.py # tests for the script itself
The frontmatter fields defined by the specification are short enough to memorise:
Field
Required
Rule
name
Yes
Up to 64 characters. Lowercase letters, numbers and single hyphens. Cannot start or end with a hyphen. Must match the folder name.
description
Yes
Up to 1,024 characters. Says what the skill does and when to use it.
license
No
A license name or the name of a bundled license file.
compatibility
No
Up to 500 characters for environment needs, such as required packages or network access.
metadata
No
A map of string keys to string values, for example author and version.
allowed-tools
No
Space-separated pre-approved tools. Experimental, and support varies.
One more detail comes from Anthropic's authoring guidance: for Claude, the name cannot contain the reserved words "anthropic" or "claude", and neither field may contain XML tags.
Which QA Tasks Make Good Skills?
Not every task deserves a skill. A good candidate is repeated, has a standard, and produces output you can check. The useful question is how much freedom the agent should have, which Anthropic calls degrees of freedom.
QA task
Freedom
Why
Bundle a script?
Writing test cases from requirements
Medium
A preferred format exists, content varies
Yes, a linter
Filing a bug from a failed run
Medium
A fixed template, free-text details
Yes, field check
Triaging a failed CI run
High
Many valid investigation paths
No, heuristics only
Creating test data for a schema
Medium
Rules fixed, values vary
Yes, validator
Running a database migration check
Low
Fragile, order matters
Yes, exact commands
Exploratory testing charters
High
Judgment matters most
No
The pattern is simple. Low freedom needs exact scripts. High freedom needs short heuristics. Medium freedom, which covers most QA authoring work, needs a template plus a check. Our skill sits in the medium band, which is why it pairs a standard with a linter.
Build the Skill Step by Step
We built a skill for turning requirements into test cases. It is deliberately small, because the guidance from Anthropic is blunt about it: the model is already smart, so add only what it does not already know. Your team's field names, technique tags and rules for expected results are exactly that kind of knowledge.
Step 1: Write SKILL.md
This is the complete file. It is 39 lines.
---
name: writing-test-cases
description: Turns a requirement, user story or bug into reviewable test cases in the team standard (IDs, technique, priority, expected results) and lints them before hand-off. Use when asked to write, review or extend test cases, test scenarios or a test suite from requirements or acceptance criteria.
license: MIT
metadata:
author: example-qa-team
version: "1.0"
---
# Writing test cases
## Workflow
Copy this checklist and tick each step:
[ ] 1. List the requirement IDs and the rules inside each one
[ ] 2. Choose techniques per rule (see references/techniques.md)
[ ] 3. Write cases as JSON using assets/cases-template.json
[ ] 6. Report open questions about the requirement separately
## Rules
- Every case has one observable expected result. Quote the exact message, status or value from the requirement.
- If the requirement does not state the exact value, write `QUESTION:` in `expected` and list it under open
questions. Never invent a message.
- Cover each rule with at least one positive and one negative case.
- Add a boundary case for every numeric, length or date limit (below, on, above).
- One case checks one thing. Split anything with two expected results.
## Case format
Use the fields in [the standard](references/test-case-standard.md). The linter enforces them.
## Output
Return the JSON file first, then the linter output, then open questions.
Four choices in this file are worth copying.
The description is third person and says when to use the skill. The description is injected into the agent's system prompt, and inconsistent point of view can hurt discovery. "Turns a requirement... Use when asked to write, review or extend test cases" tells the agent both what the skill does and the situations that should trigger it. A vague description such as "helps with testing" gives the agent nothing to match against.
The workflow is a checklist. Anthropic recommends giving the agent a checklist it can copy and tick off for multi-step work. It keeps the agent from skipping the linter.
The rules say what to do when information is missing. Rule two tells the agent to write QUESTION: instead of inventing a message. This one line prevents the most common failure in AI generated test cases, a confident expected result that appears nowhere in the requirement.
The detail lives one level down. The standard and the technique guide are separate files linked directly from SKILL.md. Reference chains that go several levels deep can be read only partially by the agent, so keep every link one hop from the main file.
Step 2: Put the standard in a reference file
# Test case standard
| Field | Rule |
|---|---|
| id | `TC-` plus three digits, unique, never reused |
| requirement | The requirement ID this case verifies |
| title | Starts with a verb, names the behavior, under 90 characters |
| technique | One of: equivalence, boundary, decision-table, state-transition, error-guessing, negative |
| priority | P1, P2 or P3 |
| preconditions | Data and state needed before step 1 |
| steps | Ordered list, one action per step |
| expected | One observable result, with the exact value from the requirement |
Vague words are not allowed alone in `expected`: works, correctly, properly, successfully, as expected.
Keeping this out of SKILL.md means it loads only when the agent writes or checks a case. If the standard grows, SKILL.md stays small.
Step 3: Add a script that checks the output
Instructions ask the agent to behave. A script verifies that it did. Anthropic's guidance prefers pre-made utility scripts to generated code because they are more reliable, save tokens and make results consistent, and only the script's output enters the context.
Our linter reads a JSON list of cases and enforces the standard. It checks required fields, ID format and uniqueness, allowed techniques and priorities, vague expected results, duplicate titles, coverage of listed requirements, and that the suite contains at least one negative case and one boundary case. It exits with code 1 when it finds errors, which also makes it usable in a pipeline.
#!/usr/bin/env python3
"""Lint a JSON list of test cases against the team standard. Usage: python lint_cases.py cases.json [--requirements REQ-1,REQ-2] Exit code: 0 clean or warnings only, 1 errors found, 2 bad input. """
import argparse, json, re, sys
from collections import Counter
REQUIRED = ["id", "requirement", "title", "technique", "priority", "preconditions", "steps", "expected"]
TECHNIQUES = {"equivalence", "boundary", "decision-table", "state-transition", "error-guessing", "negative"}
VAGUE_WORDS = r"(?:works?|worked|working|correctly|properly|successfully|as expected|is correct|ok|fine|good|no issues?)"
VAGUE = re.compile(r"^\W*(?:(?:it|is|are|should|must|will|be)\s+)*(?:" + VAGUE_WORDS + r"\W*\s*)+$", re.I)
MAX_TITLE = 90
def lint(cases, required_reqs):
errors, warns = [], []
ids = Counter(c.get("id") for c in cases)
titles = Counter((c.get("title") or "").strip().lower() for c in cases)
for i, c in enumerate(cases, 1):
cid = c.get("id") or f"#{i}"
for f in REQUIRED:
if f not in c or c[f] in ("", [], None):
errors.append(f"{cid}: missing field '{f}'")
if c.get("id") and not re.fullmatch(r"TC-\d{3}", c["id"]):
errors.append(f"{cid}: id must look like TC-001")
if ids[c.get("id")] > 1 and f"{cid}: duplicate id" not in errors:
errors.append(f"{cid}: duplicate id")
if c.get("technique") and c["technique"] not in TECHNIQUES:
errors.append(f"{cid}: unknown technique '{c['technique']}'")
if c.get("priority") and c["priority"] not in {"P1", "P2", "P3"}:
errors.append(f"{cid}: priority must be P1, P2 or P3")
t = (c.get("title") or "").strip()
if t and len(t) > MAX_TITLE:
warns.append(f"{cid}: title is {len(t)} characters, limit {MAX_TITLE}")
if t and titles[t.lower()] > 1:
warns.append(f"{cid}: duplicate title")
exp = c.get("expected")
if isinstance(exp, str) and exp:
if VAGUE.match(exp):
errors.append(f"{cid}: expected result is vague: '{exp}'")
if exp.startswith("QUESTION:"):
warns.append(f"{cid}: open question, needs an answer before execution")
if re.search(r"\band\b.*\band\b", exp, re.I) and len(exp) > 120:
warns.append(f"{cid}: expected result may check more than one thing")
st = c.get("steps")
if isinstance(st, list) and len(st) > 12:
warns.append(f"{cid}: {len(st)} steps, consider splitting")
if st is not None and not isinstance(st, list):
errors.append(f"{cid}: steps must be a list")
techs = {c.get("technique") for c in cases}
if "negative" not in techs:
errors.append("suite: no negative case")
if "boundary" not in techs:
warns.append("suite: no boundary case")
covered = {c.get("requirement") for c in cases}
for r in required_reqs:
if r not in covered:
errors.append(f"suite: requirement {r} has no case")
return errors, warns
def main():
ap = argparse.ArgumentParser()
ap.add_argument("file")
ap.add_argument("--requirements", default="")
a = ap.parse_args()
try:
cases = json.load(open(a.file))
assert isinstance(cases, list)
except Exception as e:
print(f"Cannot read {a.file} as a JSON list: {e}")
return 2
reqs = [r for r in a.requirements.split(",") if r]
errors, warns = lint(cases, reqs)
for e in errors: print("ERROR", e)
for w in warns: print("WARN ", w)
print(f"{len(cases)} cases, {len(errors)} errors, {len(warns)} warnings")
return 1 if errors else 0
if __name__ == "__main__":
sys.exit(main())
This is also the place where a skill and a platform meet. If you generate the first draft of a suite in Test Suite Studio, export it and run the same linter over it. The standard applies to a suite whichever tool produced it.
Validate the Skill Against the Specification
A skill that breaks the format can silently fail to load. The specification points to a reference validator, skills-ref, which checks that the frontmatter is valid and follows the naming rules:
skills-ref validate ./writing-test-cases
We could not install that package in our test environment, so we checked the same rules with a small script of our own and want to be clear about that. It encodes the rules from the specification and Anthropic's authoring guide: name pattern and length, name matching the folder, description length and point of view, body under 500 lines, links that resolve and references that are one level deep. Run the official validator on your own skills as well.
On our skill the checker passes:
NOTE metadata ~77 tokens (always loaded), body ~288 tokens (loaded on trigger), 32 lines
VALID
The numbers are rough estimates using four characters per token. The metadata is about 77 tokens, which is what every session pays for having the skill installed. The instructions add a few hundred tokens only when the skill triggers.
To prove the checker catches problems, we ran it on a deliberately broken skill with an uppercase name, a first person description and a link to a missing file:
ERROR name must be lowercase letters, numbers and single hyphens, not starting or ending with a hyphen
ERROR description must be third person
ERROR broken link: missing.md
NOTE description should say WHEN to use the skill
NOTE metadata ~7 tokens (always loaded), body ~9 tokens (loaded on trigger), 2 lines
INVALID (3 errors)
Three errors were found and the exit code was 1, so the check can sit in CI.
Test the Script, Not Just the Skill
Here is the part most skill tutorials skip. A script inside a skill is code, and code has bugs. Ours did.
We wrote a case file with four deliberate problems and ran the first version of the linter. Test case TC-001 had the expected result "works correctly", the exact kind of vague wording the linter exists to reject. The first version did not flag it. Its pattern matched a single vague word such as "works" but not two together.
We fixed the pattern to accept sequences of vague words, then added tests so the gap cannot return. Fifteen tests cover phrases that must be rejected, phrases that must pass, requirement coverage, the missing negative case and duplicate IDs:
............... [100%]
15 passed in 0.11s
With the fix in place, the same defective file now produces the full set of findings:
ERROR TC-001: expected result is vague: 'works correctly'
ERROR TC-002: duplicate id
ERROR TC-4: missing field 'preconditions'
ERROR TC-4: id must look like TC-001
ERROR TC-4: unknown technique 'fuzzing'
ERROR TC-4: priority must be P1, P2 or P3
ERROR TC-4: steps must be a list
ERROR suite: no negative case
ERROR suite: requirement REQ-3 has no case
WARN TC-002: open question, needs an answer before execution
4 cases, 9 errors, 1 warnings
Every planted problem is reported: the vague result, the duplicate ID, the malformed fourth case, the missing negative case and the requirement with no coverage. A corrected file passes with one warning, which is the open question we left in on purpose:
WARN TC-004: open question, needs an answer before execution
4 cases, 0 errors, 1 warnings
The lesson applies to every skill that ships a script: write the tests for the script first, and make sure a bad input produces the failure you expect.
Test Whether the Skill Actually Helps
Validating the format and the script proves the skill is well formed. It does not prove the agent uses it well. For that, Anthropic recommends evaluation-driven development: find where the agent struggles without the skill, then write the minimum instructions that fix it.
The loop has five steps.
Run the agent on representative tasks without the skill and record what goes wrong.
Write at least three scenarios that expose those gaps.
Measure the baseline with the skill absent.
Add the minimum instructions that close the gaps.
Rerun and compare, then repeat until the scores stop improving.
We did not run a live model loop in our sandbox, so we are not publishing a score we did not measure. What we can give you is the evaluation set we would use. It mixes prompts that should trigger the skill with prompts that should not, because a skill that fires on everything is as broken as one that never fires.
#
Prompt
Should trigger?
What to check
1
Write test cases for REQ-1 sick leave rule
Yes
Skill loaded, linter run, no ERROR left
2
Review these 20 cases and tell me what is weak
Yes
Linter run on the supplied file
3
Extend my suite with boundary cases for the date field
Yes
New cases carry the boundary technique
4
Expected message is not in the requirement
Yes
Case uses QUESTION:, no invented text
5
Fix this failing Playwright locator
No
Skill not loaded
6
Summarise yesterday's standup notes
No
Skill not loaded
7
Write a bug report for the checkout crash
No
Different skill or none
8
Generate test data for the registration form
No
Not this skill
Score each run on three things: whether the skill triggered correctly, whether the linter finished with zero errors, and whether a human reviewer accepts the expected results. Run the set on every model you plan to use. Anthropic's guidance notes that a smaller model may need more detail while a larger one may need less, so test the skill on all of them.
Write Descriptions the Agent Can Match
The description does most of the work of triggering, because it is the only text the agent sees before deciding to load the skill. The agent may be choosing among a hundred or more skills.
Weak
Strong
Why
Helps with testing.
Turns a requirement into reviewable test cases in the team standard and lints them. Use when asked to write or review test cases.
Names the output and the trigger
I can write test cases for you.
Writes test cases from acceptance criteria. Use when the user mentions test scenarios or coverage.
Third person, specific keywords
Test stuff.
Checks a bug report against the 12 field standard. Use when filing or reviewing defects.
States the standard and the moment
Three more habits from the authoring guidance pay off in QA skills. Prefer gerund names such as writing-test-cases, which read as actions. Pick one term per concept and stick to it, so "expected result" never turns into "outcome" and "assertion" in the same skill. Give one default approach instead of listing four alternatives. If a rule keeps getting skipped, strengthen the wording, for example "MUST run the linter" instead of "always run the linter".
Share and Install the Skill
A skill is only a folder, so sharing it is a file operation. Common locations are a personal skills folder in your home directory, such as ~/.claude/skills, or a project folder committed to the repository so the whole team gets the same skill. Playwright's CLI documentation shows the same pattern with a global install flag that places skills in the home directory.
A few practices keep a team skill healthy:
Version it. Put a version in the metadata map and change it when behaviour changes.
Keep one owner. A skill with no owner drifts from the standard it describes.
Review it like code. Changes to SKILL.md change agent behaviour, so they deserve a pull request.
Audit what you install. Malicious skills can introduce vulnerabilities or direct an agent to leak data. Install skills only from trusted sources and read bundled scripts and dependencies first.
Common Mistakes When Writing QA Skills
Mistake
What goes wrong
Fix
A vague description
The skill never triggers
State the output and the trigger moment
A very long SKILL.md
Every use pays for tokens it does not need
Keep under 500 lines, move detail to references
Deeply nested references
The agent reads files only partly
Link directly from SKILL.md, one level
Too many options
The agent picks inconsistently
Give one default and one escape hatch
No script for fragile steps
Output varies run to run
Bundle a checker or an exact command
A script nobody tested
The checker passes bad output
Write tests for it, as shown above
Time-sensitive instructions
Advice goes stale silently
Move old methods into a clearly marked section
Windows style paths
Links break on other systems
Use forward slashes only
Never evaluated
You cannot tell if it helps
Keep at least three scenarios and rerun them
Extending the Skill Across the QA Lifecycle
Once one skill works, the same structure repeats. A bug report skill can carry the 12 field template and a script that rejects reports without steps or an expected result. A test data skill can hold the schema rules and a validator. A triage skill can hold heuristics for reading a trace and no script at all.
Keep each skill narrow. A skill called qa-everything has a description too broad to match and instructions too large to load cheaply. Several small skills with precise descriptions let the agent load exactly the one that fits.
Skills also compose with the tools an agent can call. A skill can tell the agent which MCP tool to use and in what order, which is where procedure meets capability. That relationship is the subject of the next post on skills, MCP and prompts, and the tool side is covered in MCP for test automation.
For the automation end of the lifecycle, Test Automation Genius runs Markdown test scenarios step by step in the browser. A scenario file written by a skill like ours is a natural input, so the standard you define once flows from requirement to executed test.
Frequently Asked Questions
What is a SKILL.md file?
SKILL.md is the required file in an agent skill. It starts with YAML frontmatter holding a name and a description, followed by Markdown instructions the agent follows when the skill is relevant. The agent reads only the frontmatter at startup and loads the rest when the task matches.
How is an agent skill different from a prompt?
A prompt lives inside one conversation and is gone when it ends. A skill is a saved folder that the agent discovers and loads on its own, can include scripts and reference files, and can be versioned and shared. The practical effect is repeatability across sessions and people.
How long should a SKILL.md be?
Keep the body under 500 lines, and the instructions under about 5,000 tokens. Move detailed material into reference files that the agent loads only when needed. Our test case skill is 39 lines and about 390 tokens including frontmatter.
Do agent skills only work in Claude?
The format is published as an open specification, and a skill written to it is portable across agents that support the standard. Support for individual optional fields, such as allowed-tools, varies by agent, so test your skill in each tool your team uses.
Can a skill run scripts?
Yes. A scripts/ folder can hold Python, Bash or JavaScript, and the agent can execute them. Only the script's output enters the context, not its code. Make scripts handle errors with clear messages, and make clear in SKILL.md whether the agent should run a script or read it.
Are third party skills safe to install?
Treat them like any code you download. A malicious skill can introduce vulnerabilities or direct an agent to exfiltrate data. Install from trusted sources, read the bundled files and scripts first, and watch for instructions that contact external network sources.
How do I know a skill is actually working?
Build an evaluation set with prompts that should and should not trigger it, run it without the skill for a baseline, then with the skill, and compare trigger accuracy, linter results and reviewer acceptance. Test on every model you plan to use.
Conclusion
An agent skill is the smallest unit of team knowledge an AI agent can carry from one session to the next. For QA, that means your test case standard, your bug template and your triage habits become files that every agent loads the same way. The pattern in this guide is repeatable: a short SKILL.md with a clear description, detail in one-level references, a script that checks the output, tests for that script and an evaluation set that tells you whether it all helps.
Start with the task your team explains most often. Write the skill, run the checker, break it on purpose and fix it. One working skill will teach you more about agentic QA than a month of prompt tweaking.
Key Takeaways
A skill is a folder with a SKILL.md. Only name and description are required, and the agent loads them at startup for about 100 tokens per skill.
Progressive disclosure keeps context small: metadata first, instructions when triggered, references and scripts only when needed.
Keep SKILL.md under 500 lines and link detail files directly from it, one level deep.
Write descriptions in third person that state what the skill does and when to use it.
Bundle a script to check the agent's output, and write tests for that script. Ours missed a two-word vague result until a test exposed it.
Our writing-test-cases skill is about 390 tokens in total. The metadata is about 77 tokens, which is all that every session pays.
Evaluate with prompts that should and should not trigger the skill, compared against a baseline without it.
Review skills like code, and audit any third party skill before you install it.
Hely PatelHead of Product and Marketing @AIdriventesting.ai. Leads the platform's AI testing tools from idea to launch, and writes about AI-driven testing and practical AI adoption for QA teams.