Inspiration
Spec-driven development has a quiet failure. You write requirements, Kiro generates tasks and code, and the tasks get checked off. Weeks later, nobody can say whether the spec and the repo still agree. A requirement may never have been built, a task may be ticked without any code behind it, and code may exist that no requirement explains. A passing test suite doesn't catch this, because it only checks the behavior someone thought to test.
We wanted a tool that answers one question: where do my Kiro specs and my code disagree? It's also a good fit for Kiroween. Requirements nobody built are ghosts, code nobody asked for is zombie code, and a task marked done with nothing behind it is a liar. That vocabulary makes the findings easy to remember.
What it does
GraveWatch reads a repo's .kiro/specs/*/requirements.md and tasks.md, reads its TypeScript, JavaScript and Python code and tests, and reports drift.
| Finding | Meaning |
|---|---|
| Ghost requirement | An acceptance criterion with no code evidence |
| Unburied requirement | Code exists, but no test links to it |
| Alive requirement | Code and a test both exist |
| Zombie code | Exported code that no requirement explains |
| Restless test | A test for something no requirement mentions |
| Lying task | A task checked off whose requirement has no code |
Each spec and the whole repo get a haunting score from 0 (peaceful) to 100 (cursed). It has three front ends on one engine:
- Web app. Paste a GitHub URL (
owner/repoalso works) and get a graveyard report. Each requirement is a tombstone, and a floating ghost summarizes the findings in plain words. The scan runs in your browser, with no GraveWatch server. Files go from GitHub to the page and nowhere else. An optional GitHub token handles private repos and rate limits. It's held in memory only and never stored. A built-in sample project works without contacting GitHub. - CLI.
gravewatch scan .prints a summary, writes--htmland--jsonreports, and has--fail-above 40so a CI job can fail when the repo is too haunted. - MCP server. Four read-only tools (
list_ghost_requirements,list_zombie_code,get_requirement_status,get_haunting_summary) let Kiro ask whether a task it just finished really left no ghost behind.
Every verdict shows its evidence: file, line and match confidence. The tool never modifies the scanned repo.
How we built it
We built GraveWatch with Kiro and used each Kiro feature for a specific job. Everything is in .kiro/.
- Specs. We wrote EARS-style requirements, a design and a task list before any code. Each requirement later became a promise the tool had to keep. When the web app came along, we updated the spec first. That added Requirement 8 (the GitHub URL flow), changed the old "no network requests" rule to apply only to the CLI and MCP server, and added Requirement 3.4 (task-file evidence) before we wrote it.
- Steering. Three files shape Kiro's behavior.
product.mdsets the rules: read-only, no backend, explain every verdict, prefer false negatives over noise.tech.mdfixes the stack and limits runtime dependencies to two.spec-traceability.mdactivates when Kiro editssrc/**and tells it to name code after the requirement it serves, or tag it with// @req 4.3. - Hooks. One rescans after every completed spec task. One rescans when
requirements.mdortasks.mdis saved. One checks file writes for secrets before they happen. - MCP. GraveWatch is itself an MCP server, so it plugs back into the tool that builds it.
- Vibe coding. We used it for the graveyard report: tombstone cards, the floating ghost, the epitaphs and the filters.
Architecture. One pure engine takes a map of path → text and returns a report. Two adapters feed it: node-io.ts reads a folder for the CLI and MCP server, and github.ts fetches files for the web app. Because the engine does no I/O, the same code runs in Node and in the browser.
How matching works.
- Each acceptance criterion becomes stemmed keywords, weighted by how rare they are within that spec, so "receipt" counts for more than "order".
- A function or test links to a criterion only when it covers at least half of the most distinctive keywords and reaches a confidence threshold.
- A task that names a file ("Create
assign_labels.ts") links that file to the requirements the task references. - An explicit tag such as
// @req 2.1links at 100% confidence.
Stack. TypeScript in strict mode, Node 20 or newer, @modelcontextprotocol/sdk and zod as the only runtime dependencies, and esbuild to bundle the browser app. The browser app is static files that deploy to GitHub Pages.
Challenges we ran into
- Matching prose to code with no model. Requirements are English and code is names. We chose deterministic keyword matching with confidence scores over an LLM, so results are repeatable, free and local. The cost is accuracy, and we say so openly in the README and the UI.
- False links from shared words. Our first demo run missed a planted ghost: "email a receipt to the shopper" linked to
createOrderFromCartthrough the words "create" and "order". We fixed it with the distinctive-keyword rule. - Our own tool called us cursed. The first self-scan scored 84/100, because entry points like
cli.tsandmcp.tsexport nothing the heuristic could connect. That led to tag anchors for non-exported code. - The first real-world test went badly. On a real Kiro repo (
kirodotdev/Kiro), GraveWatch scored 96/100 with 21 lying tasks, even though the repo is well built. The causes were private helper functions and scripts that no keyword reached. Counting non-exported functions as evidence, and counting files named in tasks, brought the score to 64/100. - Language coverage. The remaining ghosts on that repo are mostly requirements implemented in GitHub Actions YAML, which GraveWatch doesn't read.
- Running safely in a browser. Repository text is untrusted. We escape everything and render the report in a sandboxed iframe (
srcdoc, scripts only, no same-origin access). We also handle GitHub's rate limits, large repos (capped at 300 files and 200 KB each, with skipped files listed) and clear errors for not-found, no-specs, bad-token and rate-limit cases. - Making the engine portable. The first version read the disk directly. We split it into a pure engine and two adapters so the browser app could reuse it.
Accomplishments that we're proud of
- It checks itself. GraveWatch scans its own spec. The result is 0 ghosts, 0 zombies and 0 lying tasks across 32 requirements.
- It's easy to try. Judges can paste a URL and see a result in seconds, with nothing to install and no sign-up.
- Private by design. There's no backend to trust, and the token is never stored.
- Every Kiro surface does real work. Specs drive the build, steering changes Kiro's output, hooks run the scan automatically, and MCP lets Kiro query the tool that checks its work.
- Honest about limits. A "ghost" means "no evidence found". The report footer says so, and tags fix any wrong verdict.
- Real-world tuning. The same fixes moved a real repo from 96 to 64, and the planted demo project still gives exactly the findings we planted (36/100).
What we learned
- A spec is only as good as its link to the code. Kiro's task lists are already a good source of evidence, because they name files and requirements.
- Test on a real project early. Our own demo made the tool look good, and a real repo exposed the weak spots within minutes.
- Heuristics need an escape hatch. Tags are what make a heuristic trustworthy. Users can correct a verdict instead of arguing with a score.
- Steering changes output. A short rule about naming and tagging code after requirements is what gave GraveWatch a clean self-scan.
- Specs-first holds up when scope changes. Updating the requirements before adding the web app kept the build and the documentation consistent.
- Wording matters. We changed "Never built" to "No code found", because a heuristic should not claim certainty it doesn't have.
What's next for GraveWatch - Tool that finds drift between Kiro specs & code
- Tests for GraveWatch itself. The engine has no test suite yet, so its own self-scan shows all 32 requirements as unburied (43/100). A small suite for the parser, matcher and scoring is the first priority.
- More languages and file types. Go, Java, Rust, and YAML or workflow files, so requirements implemented outside TypeScript, JavaScript and Python stop showing as ghosts.
- Better matching. Use symbol bodies, call graphs and test assertions as evidence, and offer an optional, clearly labeled model pass for ambiguous matches. The default stays deterministic and local.
- Spec-scoped tags. Criterion ids aren't namespaced by spec today, so a tag like
1.2applies to every spec that has a1.2. - CI integration. A GitHub Action that comments the haunting score on pull requests and fails past a threshold.
- Drift over time. Track the score per commit and show whether a branch makes the repo more or less haunted.
- A Kiro-native loop. A hook or power that, after each task, uses MCP to list new ghosts and asks Kiro to fix the first one automatically.
- Other spec formats. Support for any structured requirements document, not only Kiro's.
Built With
- command-line
- developer-tools
- ears-requirements
- esbuild
- githubactions
- githubapi
- githubpages
- hooks
- html5
- javascript
- mcp
- mcpsdk
- node.js
- open-source
- sdk
- security
- spec-driven-development
- specs
- static-site
- steering
- typescript
- web-browser
- zod
