An AI Agent Skill Turns Manual Test Cases into Playwright Autotests in 6 Steps
An AI agent doesn't know your team's rules: which file a test belongs in, which fixture to use. A skill is a SKILL.md file with instructions that the agent loads on its own. In a Habr write-up, the author walks Kimi Code through 6 steps: pick up a manual test case, find the right file, choose a fixture, write a Playwright test, run the checks, and report back. Where the case is ambiguous, the agent asks the human, which is why the author recommends keeping the skill in git.
AI-processed from Habr AI; edited by Hamidun News
If you ask an AI agent to write an autotest, it can handle the code, but it doesn't know your team's rules: which file to add the test to, which fixture (a prepared setup with a configured environment and user) to use, or whether it may create a page object (a wrapper class around a page) on its own. You end up explaining this again every time. The author of a recent write-up on Habr closed this gap with a skill.
A skill is a file with instructions that the agent loads by itself when it sees a matching request. In the demo, such a skill turns a manual test case (a description of a check that a tester used to run by hand) into an autotest in TypeScript and Playwright, a popular framework for end-to-end (E2E) browser tests. The work is split into 6 steps, and where the case is ambiguous, the agent stops and asks a human.
What a skill is and where it lives
A skill is a file or folder with a main SKILL.md file. It contains instructions that the model loads when the user's request matches specified triggers. The goal is simple: don't repeat the same explanation with every request.
Each client has its own settings folder: Claude Code uses .claude/skills, Codex uses .agents/skills, and Kimi Code, which the demo is built on, uses .kimi-code/skills. Skills can live in the home directory, making them shared across all projects, or in the repository, making them specific to one project. There is a catch: Claude Code and Codex pick up settings folders by walking up the path to the git repository root, while Kimi Code reads only the folder at the root.
The author's main advice: treat a skill like code. Keep it under version control, build it around one task, split it into several files, and watch its size, because each run consumes limited context.
How the skill file is structured
The file starts with a YAML header containing the name and description fields. This is the skill's interface: while the model decides whether to invoke it, it sees only the header. So the description needs specifics and invocation conditions.
In the demo, it says to use the skill when the user wants to turn a manual test case from a mock TMS (a test management system simulator) behind an MCP server into a Playwright autotest; the trigger is a test case ID or phrases like "automate the test case." It is also useful to state when the skill should not be invoked, for example for generating tests that don't come from manual cases. The description should stay within 1,024 characters.
The author writes the skill body in English so as not to mix languages, and does not explain the obvious to the model. It contains only what the model wouldn't work out on its own. For example, the rule "one spec file does not equal one test case": a new test should be added to the existing .spec.ts file for the relevant area, and a new file should be created only if the area is not yet covered at all.
Next comes a step-by-step Workflow, and its first line is "create a todo for each step and execute them in order." It addresses two problems. Agents tend to parallelize work, skip steps, and drift from the plan as context grows. And if the work has to be interrupted to consult a human, a written plan helps return to the stopping point.
The six steps are:
- get the test case via an MCP tool by ID, or find it by name; if it isn't found, stop and ask;
- find the appropriate .spec.ts by feature and by the test case's history;
- choose a fixture from test/fixtures.ts, defaulting to newUser, and ask the user if it's ambiguous;
- write the test, taking metadata from the case, and agree on creating a page object in advance;
- run ESLint, Prettier, tsc, and a targeted run of the test;
- report: the test name, file path, page object used, and any pre-existing tsc errors.
The economics are clear: the more checks the code performs rather than the model, the cheaper each run. The model is allowed to edit only what it itself touched. After the checks, it looks at git status and reverts extra changes. It does not fix tsc errors in other people's files but simply mentions them in the report.
Iterations and the Common mistakes section
The most valuable section is Common mistakes. Modern models don't need general advice; they need the specifics you've stumbled over. For example, on the first run the MCP server was not connected, and the agent quietly read the test case straight from a JSON file. The author added a strict rule: if a tool is unavailable, stop, report it, and do not look for workarounds. After that, the agent started behaving as intended and asking questions exactly where it was supposed to.
The cycle goes like this: a failed run, a skill edit, a better run, another edit. This leads to a limitation. The skill will grow, and with it the cost of each run. Anthropic recommends staying under 500 lines, so situational material is better moved into separate files that load only when needed. The author did this with style: the test-writing rules live in e2e-rules.md, not in the main file.
What follows from this
The article is candid about its limits: it is a demo with a mock TMS and simple style rules, not an implementation report with metrics. The author does not measure what share of tests the agent writes without edits. But the practical takeaway is clear. In testing, AI has two weak spots: the team's local context and industry practices, such as boundary-value coverage or deriving tests from requirements rather than from code. A skill addresses both. If you automate tests with agents, start with a small skill for one task, keep it in the repository, and add to it every mistake the agent makes twice.
- Nov 30, 2026Claude Code built a 137-test bench for the Waterius water meter in two weeks
- Nov 30, 2026A Chat Completions-only service will connect to just 2 of 5 coding agents
- Nov 30, 2026Given missing data, 9 LLMs asked clarifying questions in at most 4 of 17 tasks and made up document details
- Nov 30, 2026Claude Code wrote 781 of 870 commits, but pushed to production in the middle of someone else's interview
Key Questions Answered
What a skill is and where it lives?
A skill is a file or folder with a main SKILL.md file. It contains instructions that the model loads when the user's request matches specified triggers. The goal is simple: don't repeat the same explanation with every request. Each client has its own settings folder: Claude Code uses .claude/skills, Codex uses .agents/skills, and Kimi Code, which the demo is built on, uses .kimi-code/skills.
How the skill file is structured?
The file starts with a YAML header containing the name and description fields. This is the skill's interface: while the model decides whether to invoke it, it sees only the header. So the description needs specifics and invocation conditions.
What are the key details on Iterations and the Common mistakes section?
The most valuable section is Common mistakes. Modern models don't need general advice; they need the specifics you've stumbled over. For example, on the first run the MCP server was not connected, and the agent quietly read the test case straight from a JSON file. The author added a strict rule: if a tool is unavailable, stop, report it, and do not look for workarounds. After that, the agent started behaving as intended and asking questions exactly where it was supposed to.
Free 2-Day Vibecoding & AI Agents Intensive
Day 1: the autonomous Hermes + DeepSeek AI agent — vibecoding and development on par with Claude Code / Codex / Gemini. Led by Jemal Hamidun, Head of AI at Alpina Digital and academic supervisor at MIPT. Right after you register with our bot Nika: the recording + 11 materials from the previous intensive.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
