Optimizing AI Skills for QA A QA-focused developer argues that repeated corrections to coding assistants should be captured in reusable configuration rather than retyped each session, distinguishing four layers: persistent context files (CLAUDE.md, AGENTS.md, copilot-instructions.md, GEMINI.md), on-demand SKILL.md skills, deterministic scripts, and one-off prompts. The developer recommends writing context only when it changes agent behavior, building skills from observed failures rather than speculation, and notes that Anthropic, OpenAI, Google, and Microsoft all support the same open Agent Skills format built around SKILL.md. You ask your coding assistant to fix a flaky test. It comes back with a brand-new helper function, a hardcoded two-second wait, and a rewrite of three files you didn't ask it to touch. Did it "fix it" ? Sure. Did it fix it to your standards, best practices, and focus? Absolutely not. So then you correct it. "Use our existing fixtures." "Stop creating new helpers." "Don't add arbitrary waits." "We already have a method for that." And my personal favorite: "Please stop rewriting half the test suite I haven't had enough coffee for this." It apologizes. Tells you how right you are. Probably puts you on a list when the AI revolution begins but does actually perform better. Then you open a new session the next morning, and you get to have the exact same conversation again. The truth though is that AI isn't the only one with a memory problem. If I've typed the same correction into five different chats, that's not really the model failing to learn. That's me failing to write it down so it can. We would never accept this from a human onboarding process. If every new engineer on the team asked where the test fixtures live, we'd write a README. So that's the idea behind this whole post. If you keep giving AI the same instructions, those instructions probably belong somewhere reusable. The trick is figuring out where , and what "reusable" should actually look like. Most people by now know what skills are, if you don't you can quickly read up on them at agentskills.io https://agentskills.io/ . Once you discover skills, there's a strong temptation to turn everything into one. I've been there but try and resist it. There are four different tools here, and they do different jobs. CLAUDE.md , AGENTS.md , .github/copilot-instructions.md , or GEMINI.md , depending on your tool. It's for facts that are true no matter what you're working on, like where fixtures live or which selector strategy you use. SKILL.md file and, optionally, scripts, references, and templates. They only get pulled in when the task calls for them. "How we triage a failing end-to-end test" is a great skill. Of the four, persistent context is the one I see underused. A lot of my repeated corrections never needed a skill. They needed one line in the project's context file. Think about what a new QA hire needs to know in week one. Where the fixtures live. Which custom commands and helpers already exist. That we select elements by a dedicated test attribute, not by CSS class. That specs mirror the feature folder structure. That we don't mock the API in end-to-end tests, or that we do, and exactly when. None of that is a workflow. It's just how things are here . An agent can't reasonably know any of it. It can guess from the code, and sometimes it guesses well. But a guess is how you end up with a shiny new waitForPageLoad helper sitting right next to the one you wrote two years ago. The one test for a line of context: does it change what the agent does? "We value clean code" changes nothing. "Reuse the helpers in our shared support folder before writing new ones" changes a lot more. The rough rule I use: if it's true everywhere, it's context. If it's a procedure for a certain kind of task, it's a skill. If it must happen the same way every time, it's a script. And if it only matters today, it's just a prompt. The good news is that the major vendors mostly agree. Anthropic, OpenAI, Google, and Microsoft all support the same open Agent Skills format https://code.visualstudio.com/docs/copilot/customization/agent-skills , built around a SKILL.md file, and their guidance overlaps far more than it conflicts. These are the principles that keep showing up. Start from observed failures, not ideas. Run the agent on real tasks without a skill, note where it goes wrong, and write just enough to close those gaps. Anthropic goes as far as saying to build your evaluations before you write extensive documentation https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices . Every correction you catch yourself making is a candidate for the skill and a candidate for a test. I think this is the most important principle and often the most ignored. If you can't name the mistake a skill prevents, you probably don't need the skill at all. Agents don't read every skill up front. They read each skill's name and description, then decide whether to load the rest. A description has two jobs. Say what the skill does and when to use it, in the words a user would actually type. "Use when an end-to-end test fails locally or in CI" beats "Helps with testing." Keep it short, too. OpenAI notes that long descriptions get truncated when many skills are installed https://developers.openai.com/blog/rethinking-skills-and-prompts-for-gpt-6-astra , and overlapping ones lead the model to load instructions that don't help. Skills load in three tiers. The metadata is always present. The SKILL.md body loads when the skill triggers. Supporting files load only when the instructions point to them. Keep the main file lean and treat it as a router to everything else. In practice, your triage skill doesn't need the full catalog of known flaky patterns in the main file. Put that in references/flaky-patterns.md and tell the agent when to open it. Not every part of a skill needs the same level of detail. The question to ask is: how many right answers are there, and how bad is a wrong one? When there are several good approaches, like figuring out why a test failed, give the agent goals and guardrails and let it reason. When there's one right way and a mistake is costly, like the exact command to reproduce a failure or the file structure every new spec must follow, be exact. Better yet, hand it a script or a template so there's nothing to interpret. The common mistake is applying strict steps everywhere. OpenAI notes that with newer models, overly rigid step-by-step recipes can now limit results https://developers.openai.com/blog/rethinking-skills-and-prompts-for-gpt-6-astra instead of helping. Lock down the parts that must never vary, and trust the agent with the thinking. Good skills spell out inputs, steps, constraints, verification, and what the final output should contain. Numbered steps and checklists help. So do validation loops: run the check, fix what fails, repeat until it passes. And define what "done" means before the work starts. If the job includes running, inspecting, and fixing, say so. This is just acceptance criteria. We already know how to write those. A skill is software, so test it. OpenAI's eval guide https://developers.openai.com/blog/eval-skills is the most detailed version of this. Start with a small set of 10 to 20 prompts. Cover requests that name the skill, requests that only describe the task, requests buried in noisy context, and negative controls where the skill shouldn't fire. Grade with deterministic checks first, and use model-graded rubrics only where rules fall short. Test the two halves separately. Does the skill do the right thing when you invoke it directly? And does the agent pick it on its own when it should? Negative controls are the part people skip. A triage skill that fires every time someone mentions "test" is a bug. Here's an exaggerated example of what a first-draft skill could look like: --- name: test-fixer description: "Helps with tests." --- You are an expert test engineer. Analyze failing tests and fix them using best practices. This fails almost every principle above. The description will never trigger reliably. "Expert" adds nothing the model doesn't already assume. "Best practices" is incredibly vague and there's no definition of done, so "the test passes now" counts as success, even if it passes because the agent deleted the assertion. Now compare a structured version. Here's an illustrative example: --- name: triaging-nightly-failures description: Diagnoses failures from the nightly end-to-end run. Use when a test failed in last night's run or the user asks what broke overnight. --- Triaging nightly failures Collect evidence first 1. The exact error message and stack trace 2. Screenshots, videos, or traces from the failed run 3. Whether it fails consistently rerun the single spec 3x with scripts/rerun-spec.sh 4. Recent changes to the spec, the app code it covers, and shared fixtures Diagnose Classify the failure before changing code: product bug, test bug, environment, or test data. State the evidence for your classification. If it passes on rerun, treat it as flaky: note it for the weekly flake review instead of patching it here. Do not - Add hard-coded waits or sleeps. Wait on a condition instead. - Weaken or delete assertions to make a test pass. - Create new helpers when one already exists in the shared support code. - Apply a fix you can't connect to the evidence. Verify Run the spec until it passes 3 times in a row, then run the full spec file. If the root cause is a product bug, stop and report it. Don't patch the test. Report Root cause, evidence, the change made, how it was verified, remaining risk. The difference isn't length. It's that every section answers a question the vague version left to chance: when to activate, what evidence to gather, how to think about it, what's off limits, how to prove the fix, and what to hand back. Notice how narrow the description is. Flaky tests are a different job with different evidence, so they get their own skill and their own trigger: --- name: investigating-flaky-tests description: Investigates tests flagged in the weekly flaky-test report. Use when reviewing the flake report or when a test passes and fails intermittently. --- The body follows the same shape, but the evidence is run history instead of a single failure, and the output is a ranked list of what to stabilize first. I'm a solo QA engineer looking after an end-to-end suite of roughly 650 tests that runs on every PR. The AI is the closest thing I have to a teammate, so I need it to work the way the suite works. The easiest way to explain my skills is to follow a test through its life: planned, built, then kept alive. Planning it: writing automation tickets. Not every skill writes code. When I find a gap in coverage, a skill turns it into a well-formed automation ticket instead of a vague "add tests for X" note I'll regret later. That ticket becomes the input for the next stage. Building it: scaffolding and writing new tests. New tests should look like the existing ones: same selector strategy, same fixtures, same shared commands, same file layout. The bigger win is timing. Because the skill knows what our tests should look like and what the product deliverable is, I can build tests while the feature is still being developed, so they don't trail the feature by a sprint. I've written about getting ahead of development like this here https://dev.to/cydavid/treating-the-ui-as-a-contract-eliminating-the-wait-in-modern-development-673 . Keeping it alive: two troubleshooting skills. Once a test is in the suite, it needs maintenance, and I actually have two skills for that. The first handles failures from my nightly hosted runs. The question there is "what broke last night, and is it the app or the test?" The second works from a weekly flaky-test report here's how I set that up https://dev.to/cydavid/cypress-how-to-create-automatic-weekly-flake-alerting-90i . That's a different question: "which tests have been unreliable lately, and why?" That split is worth calling out. The triggers are different, the evidence is different, and what I want back is different. Two focused skills with clear descriptions work better than one skill trying to guess which job it's doing. Here's the part that should feel familiar to anyone in QA. A skill is a piece of software that changes how another piece of software behaves. We already know how to manage those. Version-control it. Skills belong in the repo, next to the code they describe. Every tool covered here supports project-level skill folders, whether that's .claude/skills/ , .github/skills/ , or .agents/skills/ . If a skill changes how tests get written, the change should show up in a PR. Iterate on it. A skill won't be right the first time, and it won't be right the tenth time either. That's fine. It's a tool you keep sharpening as you use it. Whenever it produces something you'd reject, treat that as a bug report: find the instruction that was missing or misleading, fix it, and add the case to your tests so it doesn't come back. If you've ever stabilized a flaky test, you already know this loop. Executable checks beat instructions. "Don't add hard-coded waits" in a skill is a polite request, while a lint rule that fails the build is not, so when a rule really matters, enforce it with a check https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices and have the skill tell the agent to run it. I know the arc because it's the arc of every test framework I've ever seen. It starts lean. Then something breaks, so you add a rule. Then something else breaks, so you add another. Six months later you have a 900-line CLAUDE.md that contradicts itself in three places. The agent is technically following all of it and practically following none of it. I just reviewed my e2e writing skill and was absolutely guilty of all of these. That's instruction bloat, and it hurts in four ways. It eats context. Every line competes with the code the agent is actually trying to read. It duplicates. The same rule lives in your context file, two skills, and a prompt template. Then you update one of them. It over-constrains. Rules written to hand-hold older models can make newer ones stop early or follow a script that no longer fits. OpenAI suggests auditing your instructions whenever you switch models https://developers.openai.com/blog/rethinking-skills-and-prompts-for-gpt-6-astra , and even asking the model to do the audit. It goes stale. That rule about the old login flow? The old login flow has been gone since spring. The fix is boring, which is usually how you know it works. Every instruction should prevent a mistake you've actually seen. Prefer one default over a menu of options, push reference material into separate files, and turn anything that must be enforced into a check. Then put your skills on a review cycle, the same way you'd prune a test suite. Does the helper it mentions still exist? Has the agent stopped making the mistake this rule was added for? Did you switch models? Trim what's dead and tighten what's vague. A skill is never finished. It's maintained. A 50-line skill that gets read beats a 500-line skill that gets skimmed. None of this replaces engineering judgment. If anything, it makes judgment matter more. Remember, the most valuable skill in the age of AI is thinking. https://dev.to/cydavid/the-most-valuable-qa-skill-in-the-age-of-ai-is-thinking-3b8p Think back to the flaky test from the start of this post. With the right setup, the agent already knows where the fixtures live, which helpers exist, and that a hard-coded wait is off the table. It gathers evidence before touching code, runs the check, and hands back a root cause instead of a suspiciously green build. That's what good context, a well-scoped skill, and a couple of scripts buy you. You stop repeating yourself. What they don't buy you is the decision. A skill can stop the agent from loosening an assertion, but it can't tell you whether that assertion was checking the right thing in the first place. It can scaffold a test before the feature ships, but it can't tell you whether the feature needed that test at all. Skills and context help with the steering. You're still the one driving https://dev.to/cydavid/how-to-be-a-10x-engineer-2d7 . So the next time you catch yourself typing the same correction, treat it like a bug report. Decide where the fix belongs: context if it's always true, a skill if it's a workflow, a script or lint rule if it must never be wrong. Write the smallest thing that prevents the mistake, test that it works, and come back to trim it once it stops earning its place. The goal isn't to teach AI everything you know. It's to teach it what it keeps getting wrong, give it the context it couldn't reasonably know, and verify that it actually learned the lesson. As always, happy testing.