{"slug": "what-building-a-haunted-hospital-api-tester-taught-me-about-kiro", "title": "What building a haunted-hospital API tester taught me about Kiro", "summary": "A developer built Sanitarium Chaos, an API resilience tester styled as a haunted 1980s hospital, for the Kiroween 2026 hackathon using the Kiro IDE. The build relied on Kiro's spec workflow to turn numbered correctness properties into fast-check property-based tests, which caught two bugs the developer says vibe coding would have shipped: a `__proto__: null` key crashing the Prisma JSON serializer and a second unspecified failure. Five steering files and agent hooks enforced rules across hundreds of changes, and a read-only security-review agent found three CLI flaws — credential-bearing URLs written to saved files, saved files redirecting replays at internal addresses, and redirects leaking custom headers — all of which were fixed.", "body_md": "This post was written as part of the Kiroween 2026 hackathon.\n\nI built **Sanitarium Chaos** for Kiroween 2026, using the Kiro IDE: an API resilience tester styled as a haunted 1980s hospital. You admit an endpoint as a patient, hostile inputs flatline it, an AI autopsy explains why, and **Verify Cure** replays the exact payload that broke it. The room decays as results come in (sterile, stained, dimming, dark), and the EKG beats only from recorded results.\n\nThis post is about how Kiro shaped the build, including what did not pay off.\n\nI used Kiro's spec workflow: requirements, then design, then tasks. The design numbered its **correctness properties**, and each one became a single property-based test with fast-check. That mapping was the most valuable thing Kiro gave me. Two of those tests caught bugs I would never have written an example for:\n\n`__proto__: null` key crashed the Prisma JSON serializer.\nWith vibe coding I would have shipped both. The spec forced me to state the invariant first, and the property test then hunted for the counterexample.\n\nI wrote five steering files: product, tech, security, testing and UI/UX. They held rules the agent kept applying without me repeating them: every result is labeled \"controlled in-process simulation\", the UI never claims anything is \"secure\", untrusted AI output is treated as data, and every color pair is declared and contrast-checked. A CI check even bans one word from the UI strings. Written once as steering, those rules applied to hundreds of changes.\n\nI configured agent hooks to run lint and related tests on backend saves, contracts tests plus a frontend typecheck when shared code changes, and Prisma validation on schema edits.\n\nI also created a read-only `security-review` custom agent from my security checklist. Its one run found problems in my CLI that I had missed: URLs with credentials could be written to a saved file, a saved file could aim a replay at internal addresses, and redirects could leak custom headers. I fixed all three and recorded the run in the repo.\n\nFull spec and test rigor cost a lot of time and tokens, and most of it protected a *simulated* target: the three hosted demo patients are rule tables inside the backend. That made a nice demo but a weak tool. The fix was a small CLI that tests your own API from your own machine:\n\n```\nnpx sanitarium-cli examine http://localhost:3000/your-route --body '{\"key\":\"value\"}'\n```\n\nCrashing payloads are saved to a \"morgue\" file, and `sanitarium-cli replay` fails a CI build if an old crash comes back. It found six crashes in one of my own NestJS endpoints, and its replay caught that my first fix was incomplete. Next time I would start with that useful core and spend spec effort only where correctness is hard.\n\nI used an MCP `fetch` server only for small lookups (checking npm package names), and I did not use Kiro powers.\n\nWritten for the Kiroween 2026 hackathon. #KiroweenHackathon26", "url": "https://wpnews.pro/news/what-building-a-haunted-hospital-api-tester-taught-me-about-kiro", "canonical_source": "https://dev.to/muntasir-za/what-building-a-haunted-hospital-api-tester-taught-me-about-kiro-n88", "published_at": "2026-12-03 20:40:00+00:00", "updated_at": "2026-12-03 20:47:07.533537+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "developer-tools", "ai-safety"], "entities": ["Kiro", "Sanitarium Chaos", "Kiroween 2026", "Prisma", "fast-check", "NestJS"], "also_reported_by": [], "takeaway": "Turning each numbered correctness property into a single fast-check property test caught a `__proto__: null` key that crashed Prisma's JSON serializer, a bug example-based tests would have missed.", "recommendation": {"advice": "Write correctness properties as invariants first, then map each to one property-based test so the test hunts counterexamples instead of confirming examples you already imagined.", "playbook": "evals-testing", "playbook_url": "https://wpnews.pro/playbooks/evals-testing"}, "alternates": {"html": "https://wpnews.pro/news/what-building-a-haunted-hospital-api-tester-taught-me-about-kiro", "markdown": "https://wpnews.pro/news/what-building-a-haunted-hospital-api-tester-taught-me-about-kiro.md", "text": "https://wpnews.pro/news/what-building-a-haunted-hospital-api-tester-taught-me-about-kiro.txt", "jsonld": "https://wpnews.pro/news/what-building-a-haunted-hospital-api-tester-taught-me-about-kiro.jsonld"}}