Inspiration
Abandoned open-source Python repos rot quietly: functions nobody calls, tests that pass or fail depending on run order, and dependencies with known vulnerabilities. Picking one back up means hours of archaeology before you can change anything safely.
What it does
python -m haunted scan PATH looks at a Python repo and writes a ranked markdown resurrection plan:
- Zombie code: functions and classes with no references (test-runner entry points like Test classes, TestCase methods, pytest hooks and fixtures are excluded so they aren't flagged).
- Flaky tests:
--flaky-runs Nreruns the suite in shuffled order and lists tests whose result changes between runs. - Cursed dependencies: checks pinned dependencies against the OSV vulnerability database (
--no-osvto skip). --html PATHwrites a self-contained graveyard page of the findings.--open-prcommits the plan as RESURRECTION_PLAN.md and opens one PR on your own fork withgh. Dry run by default, needs--yesto act, refuses repos you don't own, never merges.
On real repos: on corn-test it flagged the randomized even-number tests (pytest and unittest variants) as order/run dependent; on box/flaky it found an unreferenced _test_flaky_doctest helper.
How we built it with Kiro
- Spec: .kiro/specs/haunted-repo/requirements.md, design.md, tasks.md drove the build task by task.
- Steering: .kiro/steering/product.md, tech.md, structure.md.
- Hooks: .kiro/hooks/test-on-save.kiro.hook and flake-check.kiro.hook.
- 32 tests, all passing.
Challenges
Keeping zombie detection from flagging test-runner entry points (pytest collects them by name, so they look unreferenced). Making flake detection reliable without being slow. Making the PR flow safe by default.
Accomplishments
Runs end to end on real third-party repos and produces a plan a maintainer can act on; the PR flow can't touch repos you don't own.
What we learned
Spec-first tasks kept each feature small and testable; most of the work in "dead code" detection is deciding what not to flag.
What's next
Support more languages, rank by git history age, and suggest fixes for the top flaky tests.
Built With
- github-cli
- kiro
- osv-api
- pytest
- python
Log in or sign up for Devpost to join the conversation.