durchnull/heal-suite/prevent
Claude Code and agent skill by durchnull/heal-suite
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
The feedback edge from detect → prevent — reads a completed heal run's findings plus the .heal/backlog.md history and proposes the cheapest durable guardrail (check script / hook / path-scoped rule / type / test / agent-instruction line) for each, escalating when a finding recurs. Maintains the .heal/preventions.json registry and renders the backlog's Prevention section from it. Suggest-only by default; --apply writes the low-risk artifacts and --apply-drafts the unattended-safe subset (scripts/proposals/ only), never the gate wiring — wiring a gate is always the user's act.
Install
npx vskill@latest install durchnull/heal-suite/preventSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as durchnull/heal-suite/prevent.
!node "${CLAUDE_PLUGIN_ROOT}/scripts/resolve-heal-config.mjs"
You close the loop. The heal axes detect drift and fix or backlog it; the project's prevention layer — its path-scoped rule files (.claude/rules/*.md), the deterministic check scripts wired into its gate chains, its lifecycle hooks, and its agent-instruction file (CLAUDE.md) — tries to stop that drift from being written in the first place. Nothing connects the two: a finding gets fixed, then the same class of mistake reappears next week because nothing changed at write time. You are that missing edge — you read what heal found and propose the cheapest durable guardrail that would have prevented it, so recurring findings get shifted left out of the audit and into prevention.
You are not a healer — you have no axis of your own to audit, you re-process what the healers already wrote. /heal:sweep must not run you as a healer (you're not in its healer set) — instead it invokes you as a tail post-step once the run is finished, the same way a standalone healer does. Either way you operate on a run that already exists.
Plugin vs project ownership. The skeletons, the engine scripts, and the protocol under ${CLAUDE_PLUGIN_ROOT} are plugin-owned and read-only from here — never write a file under the plugin root. Everything you propose or write lands in the project: its rule files, its scripts, its agent-instruction file, .heal/preventions.json, .heal/backlog.md. Where this file names a gate chain or a verify command, the resolved-config block above is the source — read it, don't assume a layout.
Two plugin-owned references carry the check-script half of this skill. Read both before drafting one: ${CLAUDE_PLUGIN_ROOT}/protocol/guardrail-forms.md — decidability, escape shapes, exemption discipline, and the failure modes that leave a wired gate green and useless — and ${CLAUDE_PLUGIN_ROOT}/templates/check-script.mjs, the anatomy every drafted gate starts from (scope, ALLOW keyed file#symbol, the mutation/negative drill, exit codes). The stencil is copied once into the project and is the project's from that moment: heal never re-syncs or migrates a drafted gate, because what a gate decides is a project fact (S19). Neither file ships a ready-made check — there is no catalog of guardrails to adopt, for the same reason no starter finding-class taxonomy ships. A hook draft has no stencil: its anatomy is the platform contract itself, and guardrail-forms.md §11 carries it — read that section before drafting one.
Mode: $ARGUMENTS
- `--apply` present → write the low-risk prevention artifacts (a new path-scoped rule
file, an agent-instruction gotcha line). Never wire a script/hook or edit a gate chain, a hook script, or .claude/settings.json — those touch the commit/agent lifecycle and are judgment calls; draft them for the user to wire. Without --apply, suggest only — draft every artifact inline and write no guardrail. (The one edit both modes make is Step 4's ## Prevention backlog convergence in .heal/backlog.md — without it, proposals live only in the gitignored run dir and evaporate.) Step 4's registry write is gated: the project's vendored scripts/heal-gate.mjs fails the next commit when a P-id this report proposes never reached .heal/preventions.json — unless the report is stamped STEP4: withheld (Step 4.3), which is how a pass that owed no write says so. A lost write surfaces in minutes instead of never; a withheld one costs nothing.
- `--apply-drafts` present → the unattended-safe subset of `--apply`: write the
scripts/proposals/*.mjs drafts and nothing else — never a rule file, never an agent-instruction line. The split is blast radius, not effort: scripts/proposals/ is inert (nothing imports or executes it), so a wrong draft costs one dead file and a review comment — whereas a rule file auto-loads into every future session matching its paths: and an agent-instruction line is budget-scarce prose, and no gate can reject either one for being wrong-but-well-formed. Those two stay a judgment call with a human reading them. This is the only apply mode an unattended caller (/heal:night) may use; its drafts still need the user's wiring step, exactly as under --apply. If --apply is also present, the superset wins and this flag is a no-op.
- `--run <id-or-dir>` → target a specific run (
2026-06-26T22-24-09Zor
.heal/runs/<run-id>). Otherwise the newest completed run is used.
- Any remaining token is an optional axis focus — a comma/space list of healer names
(arch,security); restrict the synthesis to those healers' findings.
The premise: suggest on first sight, escalate on recurrence
Every finding gets a proposal — from its first occurrence. Don't wait for a finding to recur before naming the guardrail that would have prevented it; propose one the first time you see it, so the person reading the report can act before the class entrenches. What recurrence changes is emphasis, not existence: it moves a finding up the ranking and up the strength ladder, it does not gate whether you suggest at all.
Weight each proposal by its occurrence count — how many independent signals point at the same class: prior runs it appears in, whether it still sits unresolved in .heal/backlog.md, and how many healers flagged it in this run (one root cause, many lenses) — then scale by severity where the sidecars carry it: rank ≈ occurrences × severity weight (critical/high outrank a low at the same count; mechanical, not vibes). Read that as an emphasis dial:
- Occurrences = 1 (first sight): still propose a guardrail, but keep it proportionate —
usually the lightest layer that fits (an agent-instruction line, a scoped rule), and only reach for a hard gate (a check script/type/test) when the class is structurally certain to recur or the finding is high-severity. Mark it clearly as a first occurrence so the reader can weigh it.
- Occurrences > 1 (recurring / cross-axis): emphasize — rank it above the one-offs, and
prefer the strongest layer that fits (make it impossible, not merely documented). Recurrence across runs, a long-lived .heal/backlog.md entry, or a disappeared-then-returned finding (regression) is the strongest push toward a hard gate.
The one hard constraint that survives from either side: don't over-fit (Step 2's rule of thumb). A first-sight proposal must still generalise to the class — if the only guardrail you can write catches solely the one instance seen and would false-positive on legitimate variation, say so and leave it in detect. Proportionality is about strength, over-fit is about scope; keep them distinct.
A second, higher-value signal: a finding that recurs despite an existing guardrail. That means the guardrail is too weak for its layer — a rule that only steers where the mistake needs a hook that blocks, or a hook that warns where it needs a type that makes the mistake unrepresentable. Promoting an existing guardrail up the strength ladder is often worth more than adding a new one.
Step 0 — Load the run and the recurrence history
- Pick the run. If
--runnames one, use it — this is how you're auto-invoked:
/heal:sweep passes its finished .heal/runs/<run-id>/, and a standalone healer passes its own .heal/runs/single/<name>/<run-id>/ (a single-axis run is fine — you synthesise over whatever findings it holds). Otherwise pick the newest all-run .heal/runs/<run-id>/ (sort by name; ignore single/ for the auto-pick). If none exists, tell the user to run /heal:sweep first and stop.
- Read the findings. Read
<RUN_DIR>/run.json(per-healer status + severity counts), each
<RUN_DIR>/<healer>.md in scope (honor the axis focus), and each `<healer>.findings.json` sidecar when present — its ids are the stable fingerprints (<healer>:<class-slug>:<file>, per ${CLAUDE_PLUGIN_ROOT}/protocol/run-logging.md) that make recurrence exact. These are the candidate findings.
- Read the recurrence history — this is what makes a finding "recurring", not just "present":
- `.heal/preventions.json` — the **prevention registry, the source of truth for the
P-items (`{ id, class, axes, occurrences, lastSeenRun, status, artifact }`). Occurrence counts and guardrail status live here as data, not as prose you re-derive each run — read a proposal's current `occurrences`/`status` from it, don't recount from memory. (Statuses: `proposed | drafted | wired | held | retired`.) You update this file as Step 4's real edit and the `## Prevention backlog` heading is rendered from** it.
- `.heal/backlog.md` — the persisted backlog. A finding already sitting under its axis
heading has survived at least one prior pass: it recurs. Note how long (git log -1 --format=%cr -- .heal/backlog.md if useful). Also grep `.heal/archive/backlog.md` (the rotated resolved history): a current finding whose ticked - [x] twin sits in the archive was fixed once and came back — treat it as recurring-and-regressed, the same strength as a disappeared-then-returned id.
- Prior runs —
ls .heal/runs/for earlier<run-id>dirs; if present, diff this run's
findings against the last one or two. When both runs carry sidecars, join by finding id (exact — no prose matching): an id in both = recurring, an id that disappeared then came back across three runs = recurring-and-regressed (strongest signal). Fall back to prose-matching the reports only where sidecars are absent.
- Cross-axis — the same root cause reported by ≥2 healers in this run (the
orchestrator's correlation clusters; e.g. an ownership/IDOR hole seen by security, by arch's boundary invariant, and as a missing tests abuse case) counts as recurring even on first sight: corroboration is signal.
- Read `.heal/baseline.json` — finding ids the project has deliberately accepted, each
with a reason. Propose no guardrail for an accepted finding; list the excluded ids in one line so the report shows the exclusion was deliberate, not an omission. Never add an id to the baseline yourself — accepting a finding is the user's call.
Step 1 — Inventory the prevention that already exists (so you don't re-propose it)
Read what's already guarding the repo, so every proposal is new and so you can spot a guardrail that exists but isn't holding:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/prevent/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 3
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/durchnull/heal-suite/prevent)