pi-healing
v0.2.0
Published
The heal skill chain for pi — scan → plan → fix → verify: a durable, multi-phase workflow that hunts bugs, plans fixes, applies them one at a time, and verifies the codebase, passing state through a file on disk so it survives across sessions.
Readme
pi-healing
A 4-phase skill chain for pi that finds bugs and heals a codebase, with human review between every phase.
/heal-scan find bugs, write findings (read-only)
↓ (you review)
/heal-plan rank bugs, propose fixes (read-only)
↓ (you approve)
/heal-fix apply fixes one bug at a time (edits code)
↓
/heal-verify full test suite + HEAL-REPORT.md (read-only)Install
Install as a pi package:
npm i -g @earendil-works/pi-coding-agent # pi itself, if you don't have it
pi install pi-healingOr straight from git:
pi install git:github.com/KcAnom/pi-healingpi-healing uses only plain pi tools — no other packages required.
Use
cd into any project and run /heal-scan (or say "find bugs in this project").
Each phase ends with a handoff line telling you what to run next.
How it works
- All phases share one state file,
.heal-state.md, at the root of the project being healed — the chain survives across sessions and context windows. - Each phase validates the previous phase's status (and
chain_version) before doing any work, writes the state file atomically (temp file + rename), and guards against concurrent sessions with a.heal-state.lock. heal-scanrecords a baseline (exact test/type/lint/build commands and their counts) and hunts with per-language patterns for silent failures plus a churn-guided deep read of the hottest files. Every finding must carry reproducible evidence — no vague smells. Works on projects with zero test tooling: the missing test suite becomes a finding and verification goes manual.heal-planconfirms each finding is real before it can be fixed (false positives become won't-fix, with reasons) and gives every fix a named Verify method — an existing test, a new regression test, or a manual command.- Only
heal-fixmodifies code, one bug at a time: regression test first where the project supports it, then the fix, then that bug's Verify method. A fix that breaks a previously-passing test is auto-reverted. Optional per-fix git commits (asked once, never without a yes). heal-verifyre-runs the baseline commands, diffs before vs after, and writesHEAL-REPORT.mdwith the proof table and a follow-up list that seeds the next run.
Chain version: 1
The state file format is identical to the Claude Code edition at elev8tion/cc-healing — a run started by one agent can be resumed by the other (the lock file prevents concurrent runs).
