alp on Nostr: If you want to know how to get coding agents to actually write tests. The answer is ...
If you want to know how to get coding agents to actually write tests. The answer is boring: you don't prompt harder, you write one rule down.
Mine lives in the agent instructions file (AGENTS.md) and says exactly this: every bugfix or new feature in pure logic ships with a test in the same commit. Not later, not eventually. Same commit.
But the rule alone isn't the trick. The muscle is the pipeline. My build step (defined as a custom skill '/built-validate' with 32 points to check for the AI) refuses to commit or push anything while a single test is red. The agent physically can't sneak a change through, so writing tests stopped being about hoping the AI feels like it and just became part of shipping code.
One thing that keeps this alive: I also decided what NOT to test. DOM and rendering stuff is excluded on purpose. Tests only cover pure logic like parsing, reordering and storage recovery. Without that boundary the rule would rot within a week and I would quietly start ignoring it.
So yeah. One written rule the agent reads every session, plus a gate it can't bypass. That's the whole trick.
Published at
2026-09-19 17:16:30 UTCEvent JSON
{
"id": "5709d45721f1372aa325af12fb15d7a23ad8382ba4a603499f4de9c3f4795e27",
"pubkey": "f527cf970ce260e74261214bf612e8f75a59db1835ed7e4053326c3f65e232ee",
"created_at": 1789838190,
"kind": 1,
"tags": [
[
"client",
"NoorNote"
]
],
"content": "If you want to know how to get coding agents to actually write tests. The answer is boring: you don't prompt harder, you write one rule down.\n\nMine lives in the agent instructions file (AGENTS.md) and says exactly this: every bugfix or new feature in pure logic ships with a test in the same commit. Not later, not eventually. Same commit.\n\nBut the rule alone isn't the trick. The muscle is the pipeline. My build step (defined as a custom skill '/built-validate' with 32 points to check for the AI) refuses to commit or push anything while a single test is red. The agent physically can't sneak a change through, so writing tests stopped being about hoping the AI feels like it and just became part of shipping code.\n\nOne thing that keeps this alive: I also decided what NOT to test. DOM and rendering stuff is excluded on purpose. Tests only cover pure logic like parsing, reordering and storage recovery. Without that boundary the rule would rot within a week and I would quietly start ignoring it.\n\nSo yeah. One written rule the agent reads every session, plus a gate it can't bypass. That's the whole trick.",
"sig": "ba5c4b743af552ede6c3915c51d6dba1b7e91d3541e3c074050c2d18eb0273bc5610fa750831470338f87f0d5c394dbf272d3d56563811e1f758275d44c51a00"
}