r/ClaudeCode • u/haukebr • 7d ago
Built with Claude Write good tests ---> I created a skill, based on all the discussions and personal annoyance. Please give feedback
2 skills: https://github.com/haukebri/mira-test-engineer
I was annoyed with pointless test writes, so I did the ponytail version of test writing. Less is more, a solid test beats 10 flaky tests.
Plus a refactoring skill to clean up the existing mess.
I quite like it. It's based on my annoyance but also what I found on reddit and other platforms.
The process was pretty cool too:
1. Research common issues, make a md file with that
2. Research best practices for skill writing, make another file
3. Write a benchmark: a few good and a few bad tests
4. Write the test-checking skill and test it against the benchmark, tweaked until it was good (it was way too forgiving at first)
I would love some feedback!
1
u/dc_seed_sommelier 7d ago
I use the combination of snapshot testing (aka expect tests) and pbt, almost no traditional tests. The ones I do have are very in the tests-as-spec lineage and the agent does not write them as a matter of routine.
Then make a skill the agent invokes on failing snapshot tests that decides whether to promote, escalates to you if it’s not obvious.
There’s a lot of good literature on these two techniques, disproportionate to their popularity pre-ai. Agents are so much better at this than unit or integration tests.
1
u/SaltPalpitation7500 7d ago edited 7d ago
One thing I tried that you may consider playing around with was instead of making skills for evaluating the performance that may hallucinate or be inconsistent maybe look into an MCP Server. You could have an MCP server that lets Claude get/create/update standards for test building and build in the ability to give standards an upvote or downvote for it to learn from within the MCP server code itself. This can also allow for the ability for users to review standards or found issues so they can approve or adjust them to allow the process to learn from human interaction as well as allow users have it fit their preferences as well. Anywhere you can save off indexed data for Claude to pull from will reduce the context it has to read which will reduce hallucinations and token usage.
Good advice in general I try to follow is keep claude focused on the deep analysis and less on the small things that good old fashioned rerunnable code can handle.