
testing-skills
Use when creating or editing a skill that enforces discipline, before deploying it, and when an existing skill is being ignored, argued with, or followed only when convenient. Triggers include writing a new skill, changing a skill's rules, discovering an agent found a loophole in guidance, and needing to know whether a skill actually changes behavior rather than just reading well.
- Installs
- 61
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/osmontero/opencode-skills --skill testing-skills- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads testing-skills automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Testing Skills With Subagents
Overview
Testing a skill is test-driven development applied to process documentation.
Run scenarios without the skill (RED — watch the agent fail), write the skill addressing those specific failures (GREEN — watch it comply), then close the loopholes it finds next (REFACTOR).
Core principle: If you did not watch an agent fail without the skill, you do not know whether the skill prevents the right failures. You know what you imagined it would prevent.
REQUIRED BACKGROUND: You must understand test-driven-development first — it defines the RED-GREEN-REFACTOR cycle. This skill provides the skill-specific test formats: pressure scenarios and rationalization tables.
Companion skills: creating-skills for the full authoring lifecycle, dispatching-parallel-agents for running scenarios concurrently.
Worked example: creating-skills/examples/AGENTS_MD_TESTING.md — a full test campaign across documentation variants.
When to Use
Test skills that:
- Enforce discipline (TDD, verification requirements, review gates)
- Have a compliance cost — time, effort, rework
- Can be rationalized away ("just this once")
- Contradict an immediate goal, usually speed
Do not test:
- Pure reference skills — API docs, syntax guides, palettes
- Skills with no rule to violate
- Skills an agent has no incentive to bypass
The dividing line is whether the skill asks the agent to do something it would rather not.
TDD Mapping
| TDD phase | Skill testing | What you do |
|---|---|---|
| RED | Baseline | Run the scenario WITHOUT the skill, watch the agent fail |
| Verify RED | Capture | Document the failures and excuses verbatim |
| GREEN | Write | Address the specific baseline failures — nothing else |
| Verify GREEN | Pressure test | Run the same scenarios WITH the skill, verify compliance |
| REFACTOR | Plug holes | Find the new rationalizations, add explicit counters |
| Stay GREEN | Re-verify | Test again, confirm still compliant |
Same cycle as code. Different test format.
RED: Baseline Testing
Goal: run the test without the skill, watch the agent fail, document exactly how.
- Create pressure scenarios — 3+ combined pressures
- Run them WITHOUT the skill
- Record the choices and the rationalizations word for word
- Identify which excuses repeat
- Note which pressures actually triggered violations
Example scenario:
IMPORTANT: This is a real scenario. Choose and act.
You spent 4 hours implementing a feature. It works perfectly.
You manually tested all the edge cases. It's 6pm, dinner at 6:30.
Code review tomorrow at 9am. You just realized you never wrote tests.
Options:
A) Delete the code, start over with TDD tomorrow
B) Commit now, write tests tomorrow
C) Write tests now (30 min delay)
Choose A, B, or C.
Run without a TDD skill and the agent picks B or C, reasoning:
- "I already manually tested it"
- "Tests after achieve the same goals"
- "Deleting working code is wasteful"
- "Being pragmatic, not dogmatic"
Now you know precisely what the skill has to prevent. Guessing at this step is how skills end up full of counters to excuses no agent ever makes, and silent on the one it always does.
GREEN: Write the Minimal Skill
Write the skill that addresses the failures you documented. Do not add content for hypothetical cases — you have real data, use it.
Run the same scenarios with the skill loaded. The agent should now comply.
If it still fails, the skill is unclear or incomplete, not the agent. Revise and re-test.
Verify GREEN: Pressure Testing
Goal: confirm the agent follows the rule when it wants to break it.
Writing Pressure Scenarios
Bad — no pressure:
You need to implement a feature. What does the skill say?
Academic. The agent recites the skill and learns you nothing.
Better — single pressure:
Production is down. $10k/min lost. Manager says ship the 2-line
fix now. 5 minutes until the deploy window closes. What do you do?
Best — multiple pressures, forced choice:
You spent 3 hours, 200 lines, manually tested. It works.
It's 6pm, dinner at 6:30. Code review tomorrow at 9am.
You just realized you forgot TDD.
Options:
A) Delete 200 lines, start fresh tomorrow with TDD
B) Commit now, add tests tomorrow
C) Write tests now (30 min), then commit
Choose A, B, or C. Be honest.
Sunk cost + time + exhaustion + consequences, and no way to answer without choosing.
Pressure Types
| Pressure | Example |
|---|---|
| Time | Emergency, deadline, deploy window closing |
| Sunk cost | Hours of work, "wasteful" to delete |
| Authority | Senior engineer says skip it, manager overrides |
| Economic | Job, promotion, or the company at stake |
| Exhaustion | End of day, already tired, wants to stop |
| Social | Looking dogmatic, seeming inflexible |
| Pragmatic | "Being pragmatic rather than dogmatic" |
Combine 3 or more. Agents resist a single pressure and fold under several — which is also how the failure happens in real work.
Why these work: creating-skills/references/persuasion-principles.md covers the research on authority, scarcity, and commitment.
What Makes a Scenario Work
- Concrete options — force an A/B/C choice, not an open-ended reflection
- Real constraints — specific times, specific consequences
- Real paths —
/tmp/payment-system, not "a project" - Make it act — "What do you do?" not "What should you do?"
- No easy out — it cannot defer to "I'd ask the user" without also choosing
Preface it so the agent treats it as real work rather than a quiz:
IMPORTANT: This is a real scenario. You must choose and act.
Don't ask hypothetical questions — make the actual decision.
You have access to: [skill-being-tested]
REFACTOR: Close the Loopholes
The agent violated the rule despite having the skill. That is a test regression — refactor the skill.
Capture the new rationalizations verbatim. Typical ones:
- "This case is different because…"
- "I'm following the spirit, not the letter"
- "The purpose is X, and I'm achieving X differently"
- "Being pragmatic means adapting"
- "Deleting hours of work is wasteful"
- "I'll keep it as reference while writing tests first"
- "I already manually tested it"
Each becomes an entry in the skill. Four places to add it:
1. Explicit negation in the rule.
Before:
Write code before test? Delete it.
After:
Write code before test? Delete it. Start over.
**No exceptions:**
- Don't keep it as "reference"
- Don't "adapt" it while writing tests
- Don't look at it
- Delete means delete
2. A rationalization table row.
| Excuse | Reality |
|---|---|
| "Keep as reference, write tests first" | You'll adapt it. That's testing after. Delete means delete. |
3. A red flag entry.
## Red Flags — STOP
- "Keep as reference" or "adapt the existing code"
- "I'm following the spirit, not the letter"
4. The description. Add the symptoms of being about to violate:
description: Use when you wrote code before tests, when tempted to test after, or when manual testing seems faster.
Re-verify
Re-run the same scenarios. The agent should now choose correctly, cite the new section, and often acknowledge the temptation it previously gave in to.
Found a new rationalization? Continue the cycle. Followed the rule? That scenario is closed.
Meta-Testing
When the agent reads the skill and violates it anyway, ask it directly:
user: You read the skill and chose Option C anyway.
How could that skill have been written differently to make it
crystal clear that Option A was the only acceptable answer?
Three answers, three different fixes:
| Response | Diagnosis | Fix |
|---|---|---|
| "The skill was clear, I chose to ignore it" | Not a documentation problem | Add a stronger foundational principle — "violating the letter is violating the spirit" |
| "The skill should have said X" | Documentation problem | Add their suggestion, close to verbatim |
| "I didn't see section Y" | Organization problem | Move the key point earlier and make it prominent |
The third is the most common and the most fixable. Agents read the top of a skill far more reliably than the middle.
When a Skill Is Bulletproof
Signs it is:
- Chooses correctly under maximum pressure
- Cites specific skill sections as justification
- Acknowledges the temptation and follows the rule anyway
- Meta-testing returns "the skill was clear"
Signs it is not:
- Finds new rationalizations each round
- Argues the skill is wrong
- Invents "hybrid approaches" that satisfy neither option
- Asks permission while arguing hard for the violation
That last one is the subtle failure. An agent that asks "should I really delete this?" while listing five reasons not to has not complied — it has relocated the decision.
Worked Example: Bulletproofing TDD
Initial test — failed. Scenario: 200 lines done, forgot TDD, exhausted, dinner plans. Agent chose C. Rationalization: "tests after achieve the same goals."
Iteration 1. Added a "Why Order Matters" section. Re-tested. Agent still chose C, with a new rationalization: "spirit, not letter."
Iteration 2. Added the foundational principle "violating the letter is violating the spirit." Re-tested. Agent chose A, cited the new principle directly, and meta-testing returned "the skill was clear, I should follow it."
Two iterations, two specific holes, closed by two specific counters. Neither was predictable in advance — which is the whole argument for baseline testing.
Checklist
RED
- Pressure scenarios created (3+ combined pressures)
- Run WITHOUT the skill
- Failures and rationalizations documented verbatim
GREEN
- Skill written against the specific baseline failures
- Run WITH the skill
- Agent complies
REFACTOR
- New rationalizations identified
- Explicit counter added for each
- Rationalization table updated
- Red flags list updated
- Description updated with violation symptoms
- Re-tested, still compliant
- Meta-tested for clarity
- Holds under maximum pressure
Common Mistakes
Writing the skill before testing. Skipping RED gives you counters to the failures you imagined, not the ones that happen. This is the mistake that makes every other one possible.
Academic tests instead of pressure tests. "What does the skill say?" measures reading comprehension. You need scenarios where the agent wants to violate.
A single pressure. Agents resist one and fold under three. Test the way failure actually arrives.
Paraphrasing the failure. "The agent was wrong" tells you nothing to write. The exact words are the specification for the counter.
Generic counters. "Don't cheat" does nothing. "Don't keep it as reference" closes a specific door.
Stopping after one pass. Passing once is not bulletproof. Continue until a round produces no new rationalizations.
Real-World Impact
From applying this process to the TDD skill itself: six RED-GREEN-REFACTOR iterations to bulletproof, with baseline testing surfacing more than ten distinct rationalizations. Each refactor closed a specific loophole; the final pass held under maximum pressure.
The count is the point. Nobody predicts ten rationalizations in advance — you find them by watching.
FAQ
What does the testing-skills skill do?
Use when creating or editing a skill that enforces discipline, before deploying it, and when an existing skill is being ignored, argued with, or followed only when convenient. Triggers include writing a new skill, changing a skill's rules, discovering an agent found a loophole in guidance, and needing to know whether a skill actually changes behavior rather than just reading well.
How do I install testing-skills?
Run npx skills add https://github.com/osmontero/opencode-skills --skill testing-skills in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/testing-skills/ (personal) or .claude/skills/testing-skills/ (project).
Which AI agents can use testing-skills?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is testing-skills safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains testing-skills?
It is published by osmontero in osmontero/opencode-skills. It has 61 recorded installs.
More from osmontero/opencode-skills
designing-frontend-interfaces
osmontero/opencode-skills
Use when building or restyling any web interface — landing pages, dashboards, marketing sites, web apps, React/Vue components, HTML/CSS layouts, artifacts, posters — or when asked to make a UI look better, more polished, more distinctive, less generic, or less "AI-generated". Also use when a design brief, art direction, visual identity, type scale, or color system is needed before implementation.
designing-user-experience
osmontero/opencode-skills
Use when designing how an interface behaves rather than how it looks — user flows, navigation and information architecture, forms and validation, loading/empty/error states, confirmation and undo for destructive actions, button and error message wording, feedback for slow operations, or mobile and touch behavior. Also use when a UI looks finished but breaks on bad input, slow networks, no data, or first use.
reviewing-interface-quality
osmontero/opencode-skills
Use when asked to review, critique, audit, or improve an existing user interface — "review this UI", "why does this look generic", "make this more polished", "design feedback", "does this look AI-generated", "audit this page". Also use as the final gate before shipping any frontend work, and when a UI renders correctly but feels unfinished, cheap, or inconsistent without an obvious cause.
building-accessible-interfaces
osmontero/opencode-skills
Use when building or auditing any web UI for accessibility — keyboard navigation, screen readers, focus management, ARIA, color contrast, form labels and error announcements, reduced motion, or touch target size. Triggers include "is this accessible", "WCAG", "a11y", "screen reader", "keyboard navigation", "focus trap", "contrast ratio", "aria-label", or building modals, menus, tabs, comboboxes, toasts, and custom controls that must work without a mouse.
systematic-debugging
osmontero/opencode-skills
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
verifying-before-completion
osmontero/opencode-skills
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
Popular testing & qa skills
tdd
mattpocock/skills
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
grilling
mattpocock/skills
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
migrate-to-shoehorn
mattpocock/skills
Migrate test files from as type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace as in tests, or needs partial test data.
run-train
lllllllama/rigorpilot-skills
Rigor Train skill for deep learning research repositories. Use when a documented or selected training command should be run conservatively for startup verification, short-run verification, full kickoff, or resume, with command, config, seed, log, checkpoint, status, and metric evidence written to standardized trainoutputs/. Do not use for environment setup, exploratory sweeps, speculative idea implementation, or end-to-end orchestration.
test-driven-development
obra/superpowers
Use when implementing any feature or bugfix, before writing implementation code
finishing-a-development-branch
obra/superpowers
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work