T-Bank Taught Its AI Agent to Write iOS Unit Tests Using AGENTS.md and SKILL.md
T-Bank iOS developer Artem Zhitko described on Habr how his team got an LLM agent to write unit tests that follow project rules. The first attempts with ChatLLM failed: the code did not compile, the model invented nonexistent Mock objects, ignored architectural conventions and picked the wrong testing utilities. Instead of writing new prompts, the engineers built a system of rules on top of AGENTS.md and SKILL.md files. Test generation went from a one-off request to a reproducible process. The team's conclusion: the quality of the rules now matters more than choosing the smartest model. • Cause of the failures: the model had no project context. • Solution: AGENTS.md and SKILL.md instead of one-off prompts. • The announcement includes no quantitative metrics.
AI-processed from Habr: Т-Банк; edited by Hamidun News
T-Bank's iOS development team described on Habr how it taught an LLM agent to write unit tests in the project's style: with real Mock objects, the right utilities and code that builds on the first try. The author, iOS developer Artem Zhitko, says prompt tuning did not help. What helped was a system of rules built on AGENTS.md and SKILL.md files. The announcement gives no figures, such as the percentage of tests that compile or hours saved. Those apparently stayed inside the full article.
What broke in the first attempt
Tests are usually written at the end of a task, when the logic is done and motivation is low. That makes them an obvious candidate to hand off to an agent. T-Bank tried assigning the job to ChatLLM and got a typical set of defects:
- the code did not compile;
- the model invented Mock objects that do not exist in the project;
- the team's architectural conventions were ignored;
- it used testing utilities other than the ones the codebase normally uses.
All four problems share a root cause. The model could not see the project from the inside. It knows what Swift tests look like in general, but it does not know what your helpers are called, where the stubs live or which dependency layer is normally replaced. So it fills the gaps with plausible fabrication. For code, that is the worst outcome: the invention looks convincing and only breaks at build time.
Rules instead of prompts
The team concluded that the cause was missing context, not a weak model, and moved its project knowledge into files. AGENTS.md serves as the general instruction for the agent in the repository: structure, conventions and mandatory practices. SKILL.md describes a specific skill, here test writing: the order of steps, which utilities to use, how to name cases and what counts as a finished result. The announcement does not reveal how exactly the rules are split between the two files.
The main change lies in the approach itself. A prompt lives in someone's head or chat, and the result depends on who wrote it and how. A rules file sits in the repository, gets reviewed and versioned, and works the same way for every developer. As the author puts it, test generation turns from a one-off request into a reproducible engineering process.
Key facts from the announcement
- Platform: iOS, unit tests.
- Initial model: ChatLLM; the result without context was deemed unusable.
- Tools: AGENTS.md and SKILL.md.
- The team's thesis: good rules matter more than choosing the smartest model.
- No metrics for quality or time savings are given in the announcement.
The thesis about rules versus models is best read with a caveat. It is the conclusion of one team on one codebase, with no published numbers so far. But it matches what many people notice when working with coding agents: quality gains often come from describing the environment and verifying the output, not from switching to a more expensive model.
How to apply this yourself
If you want to repeat the approach, start by analyzing errors rather than writing rules. Collect 10–20 tests the agent generated badly and label the causes: an invented class, a wrong utility, a violated architecture. Each recurring cause becomes a concrete rule.
Put in AGENTS.md what holds true for the whole repository: module structure, naming conventions, prohibitions. Move a narrow procedure, such as writing tests, into a separate skill, and include one or two reference examples from real code. List the existing Mock objects and testing utilities explicitly, and forbid creating new ones without a request. This directly addresses the main problem the team described.
And always close the loop with verification: let the agent run the build and the tests and fix errors itself. Rules reduce the number of fabrications, but the compiler remains the most reliable reviewer. Review rules files like ordinary code and update them together with the architecture, otherwise they will quickly go stale and start doing harm.
- Oct 25, 2026Anthropic: Claude Sent Philadelphia Police a False Tip About a Murder on Its Own
- Oct 25, 2026Claude Can Now Run Up to 1000 Subagents and Find 66 of 70 Bugs
- Oct 25, 2026Microsoft Announces Maia 300: 40% More Tokens per Megawatt Than GPUs
- Oct 25, 2026Anthropic cuts internet access for all internal model tests after incidents
Key Questions Answered
What broke in the first attempt?
Tests are usually written at the end of a task, when the logic is done and motivation is low. That makes them an obvious candidate to hand off to an agent. T-Bank tried assigning the job to ChatLLM and got a typical set of defects: the code did not compile; the model invented Mock objects that do not exist in the project; the team's architectural conventions were ignored; it used testing utilities other than the ones the codebase normally uses. All four problems share a root cause. The model could not see the project from the inside. It knows what Swift tests look like in g
What are the key details on Rules instead of prompts?
The team concluded that the cause was missing context, not a weak model, and moved its project knowledge into files. AGENTS.md serves as the general instruction for the agent in the repository: structure, conventions and mandatory practices. SKILL.md describes a specific skill, here test writing: the order of steps, which utilities to use, how to name cases and what counts as a finished result. The announcement does not reveal how exactly the rules are split between the two files. The main change lies in the approach itself. A prompt lives in someone's head or chat, and the
What are the key details on Key facts from the announcement?
Platform: iOS, unit tests. Initial model: ChatLLM; the result without context was deemed unusable. Tools: AGENTS.md and SKILL.md. The team's thesis: good rules matter more than choosing the smartest model. No metrics for quality or time savings are given in the announcement. The thesis about rules versus models is best read with a caveat. It is the conclusion of one team on one codebase, with no published numbers so far. But it matches what many people notice when working with coding agents: quality gains often come from describing the environment and verifying the output,
Delegate Deep Research, Coding & Workflows to an AI Agent
Deploy autonomous multi-step execution with NomadNet Agent (agent.nomadnet.ai) — automated web research, data synthesis, code generation, and complex task orchestration.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.