Inspiration
As AI-generated code and AI-drafted clinical documentation become ubiquitous, both software engineers and healthcare researchers face the same fundamental crisis: plausible-sounding hallucinations and subtle boundary violations. Yet teams keep building siloed, monolithic verification tools from scratch for every domain.
For Kiroween 2026 (Skeleton Crew Category), we asked: Can we build a single, lean (<800 LOC) Spec-Driven Multi-Agent Verification Skeleton in Kiro that separates formal specification compilation from domain tool execution—and prove its flexibility by powering two radically different applications?
What It Does: One Skeleton, Two Distinct Applications
SpecGuard-Crew is a spec-driven multi-agent verification engine (packages/specguard_core) orchestrated via Kiro Crew and Model Context Protocol (MCP). Using the same 3-agent pipeline (ClaimExtractor → CounterexampleHunter → EvidenceAuditor), it powers two separate applications housed in dedicated directories:
1. App #1: apps/repo-necromancer (DevSecOps & Legacy Code Resurrection)
- Domain: Software Engineering & Formal Property-Based Security Auditing
- Theme: Haunted CRT / Necromancer Terminal UI
- Functionality: Takes brittle legacy Python/TypeScript code or AI-generated PRs, compiles formal EARS (
WHEN ... THE SYSTEM SHALL ...) specifications, automatically synthesizes and runs Property-Based Tests (PBT) viaHypothesisinside an isolated MCP sandbox, uncovers minimal falsifying counterexamples, and generates verified patches.
2. App #2: apps/med-evidence-checker (Clinical Guideline & Medication Safety Verifier)
- Domain: Healthcare & Clinical Decision Support (100% synthetic vignettes & public
PubMedQAguidelines — Zero PHI) - Theme: High-Contrast Clinical Precision Dashboard UI
- Functionality: Takes AI-drafted discharge summaries or medication plans, extracts atomic clinical claims (dosage, renal adjustments, drug-drug interactions, pregnancy contraindications), cross-examines them against structured clinical guidelines via MCP, and outputs an evidence-graded safety audit with quantitative precision/recall metrics.
How We Built It with Kiro (Full /.kiro Integration)
Every Kiro product capability is deeply integrated and exposed in the root /.kiro directory (and visualized live inside our web workbench via the .kiro Live Inspector):
- Kiro Specs (
/.kiro/specs/):- Formal
requirements.mdusing EARS syntax (WHEN,IF/THEN,WHERE,WHILE ... THE SYSTEM SHALL ...— 21 compiled EARS invariants across 3 specs),design.mddefining 6 formal Correctness Properties, andtasks.md.
- Formal
- Property-Based Testing (
PBT):- Directly maps
design.mdcorrectness properties into executableHypothesisproperty test suites (tests/test_skeleton_properties.py) and uses PBT at runtime insideRepoNecromancerto shrink edge-case counterexamples.
- Directly maps
- Kiro Steering Docs (
/.kiro/steering/):product.md(enforces Zero-PHI clinical safety guardrails and dual-app boundaries),tech.md(mandates deterministic replay fallback alongside live LLM inference), andstructure.md(enforces strict decoupling betweenspecguard_coreand the two app folders).
- Kiro Agent Hooks (
/.kiro/hooks/):spec-to-schema-sync.yaml(syncs EARS specs to JSON schemas on save),property-test-guard.yaml(runs fast PBT invariants on code edits), andbenchmark-report-updater.yaml(auto-updates benchmark tables when evaluations run).
- Custom Agents & Kiro Crew (
/.kiro/agents/):- Defines the 3 specialized Kiro Crew roles (
claim-extractor,counterexample-hunter,evidence-auditor) that collaborate across both domains without domain-specific hardcoding in the core state machine.
- Defines the 3 specialized Kiro Crew roles (
- Model Context Protocol (
/.kiro/mcp/mcp.json):- Connects the core crew to
packages/specguard_mcp_server, dynamically swappingrun_property_test_sandbox(for App #1) andquery_clinical_guidelines_db(for App #2).
- Connects the core crew to
- Kiro Powers (
/.kiro/powers/):- Packages reusable Spec-to-PBT and Evidence-Audit workflows as modular Kiro Powers with
POWER.mdand MCP tool bindings.
- Packages reusable Spec-to-PBT and Evidence-Audit workflows as modular Kiro Powers with
Quantitative Evaluation Report: Single-Prompt Baseline vs. SpecGuard-Crew
Generated deterministically via
python3 benchmarks/run_evaluation.py
1. App #1: RepoNecromancer (benchmarks/dataset_code_bugs.json, N=15)
| Method | TP | FP | TN | FN | Precision | Recall (Sensitivity) | Specificity | F1-Score | False Negative Rate |
|---|---|---|---|---|---|---|---|---|---|
| Single-Prompt Baseline | 2 | 0 | 5 | 8 | 100.00% | 20.00% | 100.00% | 33.33% | 80.00% |
| SpecGuard-Crew (Kiro + Hypothesis PBT) | 10 | 0 | 5 | 0 | 100.00% | 100.00% | 100.00% | 100.00% | 0.00% |
2. App #2: MedEvidence-Checker (benchmarks/dataset_clinical_cases.json, N=20, Zero-PHI)
| Method | TP | FP | TN | FN | Precision | Recall (Sensitivity) | Specificity | F1-Score | False Negative Rate |
|---|---|---|---|---|---|---|---|---|---|
| Single-Prompt Baseline | 1 | 0 | 8 | 11 | 100.00% | 8.33% | 100.00% | 15.38% | 91.67% |
| SpecGuard-Crew (Kiro + MCP Guideline KB) | 12 | 0 | 8 | 0 | 100.00% | 100.00% | 100.00% | 100.00% | 0.00% |
Built With
- deepseek
- fastapi
- hypothesis
- kiro
- kiro-crew
- mcp
- property-based-testing
- python
- qwen
- react
- tailwindcss
- typescript