Skip to content
Back to skills

Apply Remediation

ASecurity

Applies only the approved plan items of a remediation plan (repo-audit-swarm's plan.md and findings.json, or an audit skill's report), one at a time. Rereads the finding at HEAD, writes the test and watches it fail for the finding's reason, measures before, applies the smallest fix per the origin skill, runs the checks, measures after with the same command and commits on stacked branches, with a before-and-after record per item. Stops if the finding no longer reproduces, the before does not s...

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 17, 2026
developmentgonodegitdatabaseperformance

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned November 17, 2026

npx -y skills add OmarAlex24/audit-skills --skill apply-remediation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Apply Remediation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Apply Remediation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/omaralex24-apply-remediation/badge)](https://www.skillsdirectory.com/skills/omaralex24-apply-remediation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: apply-remediation
description: Applies only the approved plan items of a remediation plan (repo-audit-swarm's plan.md and findings.json, or an audit skill's report), one at a time. Rereads the finding at HEAD, writes the test and watches it fail for the finding's reason, measures before, applies the smallest fix per the origin skill, runs the checks, measures after with the same command and commits on stacked branches, with a before-and-after record per item. Stops if the finding no longer reproduces, the before does not show the problem, a metric gets worse or a check stays red. Opens the PR stack at the end. Use it for "apply the remediation plan", "implement plan items P2.1 and P2.3", "fix the approved findings", "apply findings H2 and H5", even without the word remediation. Not for auditing, writing the plan or reviewing a PR. Also triggers on Spanish requests such as "aplica el plan", "implementa los puntos P2.1 y P2.3", "arregla lo que aprobé del plan de remediación" or "aplica los hallazgos H2 y H5".
---

# Apply the remediation plan

The audit skills report and stop, and `repo-audit-swarm` leaves a plan in waves. This skill does the next step: it implements **only the plan items the user approved**, one at a time, each with its test (fails before, passes after), its before-and-after number measured with the same command, its checks green and its commit on a stacked branch. What cannot be shown stops with its reason, instead of being applied anyway.

Write the report in the user's language.

The measurement contract is [before-after.md](../repo-audit-swarm/references/before-after.md) in `repo-audit-swarm`: read it before starting. If this skill and the contract disagree, the contract prevails.

Material:

- [references/procedure.md](references/procedure.md): the preparation and the six steps per plan item, with the commands.
- [references/record.md](references/record.md): the record `<output>/remediation/<item>.json`, the fields this skill adds and the template of `remediation.md`.
- `scripts/measure.py`: runs the metric N times on the current tree (`run`) and gives the verdict (`compare`). `scripts/validate-record.py`: validates the records against the contract and against git, and rechecks that the test fails on the base with the expected pattern and passes on the commit (`--recheck archive` or `--recheck checkout`). Both print their usage with `-h` and exit with 2 on an unknown option.

In the commands:
- `<skill>` is this skill's folder;
- `<skills>` is the folder that holds the audit skills: `$(dirname "$(realpath <skill>)")`. That is the plugin's `skills/` folder when installed as a plugin, the checkout's `skills/` folder when linked from `~/.claude/skills`, and `~/.claude/skills` when copied there. Installed as a plugin, the skills may show up as `audit-skills:<name>`; `origin_skill` and the folders keep the bare name;
- `<repo>` is the repo being fixed;
- `<output>` is the swarm run's folder, or the one the user says. Never a folder inside the plugin cache or inside `<repo>`.

**Provenance.** The project's videos do not cover this step. What this skill says is **(added)** or comes from the contract and the tools listed in [references/sources.md](references/sources.md).

## Rules

- **Only what was approved.** The user gives the list of plan items. If it is ambiguous ("the wave 1 ones", "the important ones", an id that does not exist, an item that depends on one not approved), ask before touching anything. What was not approved leaves no diff and no record.
- **The plan item's action decides.**
  - `fix` and `refactor-now` are implemented.
  - `issue` and `leave` are not implemented, and neither are wave 0 items, because they are operational containment without code. They stay `stopped` with the reason.
  - A `refactor-now` goes in its own commit and without a behavior change. Its test is structural: it fails on the base and passes after.
- **Do not duplicate the audit skills.** For each plan item, read the "apply" phase of the origin skill (`<skills>/<origin_skill>/SKILL.md`) and follow it: it says what test to write and what to watch for. This skill adds the order, the measurement, the branches and the record.
- **Approving plan items is asking for local commits.** The audit skills' "apply" phases say "no commits unless asked"; approving items for this skill is that request, but only for commits on new branches, never on the trunk. **At the end, open the PR stack** (push only the new branches, never the trunk), unless the user says not to. If the repo has no remote, say so and ask: creating a repo is never implicit.
- **The base is the audited branch**, the one that holds the plan's commit, never `main` by default. **Branch names** are the plan's unless the repo's conventions or the user say otherwise; the record keeps both (`suggested_branch`, `branch`).
- **Stopping is not failing.** An item stops if it no longer reproduces at HEAD, if the test does not fail on the base, if the before does not show the problem, if a metric gets worse or if a check stays red. It is never covered up: the test is not adjusted to pass, no check is skipped, and no other metric is picked after seeing the number. What the item wrote is discarded (keeping the diff), and the items that depend on it stop too.
- **The test fails for the finding's reason.** A failure from a missing command, module or dependency does not count. The record keeps the expected failure pattern (`test.fails_with`), and the recheck requires it.
- **Measured means committed.** Any change after measuring the after (a fix, a test, the formatter, a pre-commit hook) means measuring the after again and checking that the test still fails on the base. Run the formatter before measuring the after.
- **Who implements.** If the user has a rule about who implements (a subagent, a model, an effort; look for it in their CLAUDE.md or AGENTS.md), follow it and pass this procedure and the plan item along. Items that touch the same files go in series. Only independent ones can go in parallel, each in its own worktree and its own stack.
- **Databases and services.** Before touching a database, print which environment it points to. Never write against a shared or production database; a migration only runs against a disposable database the user names. Do not start services: if the test or the metric needs them, ask for them.
- **The output goes outside the repo**, so the records do not dirty the tree being measured.

## Phases

1. **Prepare** ([procedure §1](references/procedure.md#1-prepare)). Print repo, branch, HEAD and `git status`; with uncommitted changes, stop and ask. Find the audited branch that holds the plan's commit: it is the trunk. Read the plan and `findings.json` (or the report), and the records of an earlier application if there are any. Confirm in one line which plan items you will apply, in what order and on which branches (dependencies and the plan's stack), find the project's checks and formatter and run the checks on the base: a failing test gets one isolated rerun and one full rerun; if it stays red, stop and ask; if it passes both, it is flaky and recorded as such.
2. **For each plan item** ([procedure §2](references/procedure.md#2-for-each-plan-item)), in order:
   1. **Reread** at HEAD the finding's `path:line`; if it changed or no longer reproduces, `stopped`.
   2. **Measure before**: write the criterion that shows the problem and any control metric, write and dry-run the harness if one is needed, run the metric on the clean base (the one in the finding's `metric` field or one you define with the contract, or `not_measurable`), write the test and watch it fail for the finding's reason, keeping its pattern in `fails_with`. In performance, if the before does not show the problem, stop.
   3. **Apply** the smallest fix in the plan, following the origin skill's "apply" phase.
   4. **Checks**: the new test passes and the project's checks are green.
   5. **Measure after**: format first, then the same command under the same conditions, on the fix's tree. `worse` stops the item.
   6. **Commit** on the item's branch, stacked on the one of the item it depends on (`gh stack` if installed, git if not), message `<type>: <description>`, and the record `<output>/remediation/<item>.json`.
3. **Close** ([procedure §3](references/procedure.md#3-close)). Validate the records with `validate-record.py --repo <repo> --recheck archive` (or `checkout` when the tests need `node_modules` or another in-tree install), write `<output>/remediation.md` with the table per item ([record.md](references/record.md#remediationmd)) and say what stopped and why. Open the PR stack, look at the first CI check of each PR and say whether it failed because of the code or the runner, and **stop**: the user reviews and merges the stack.

With a single skill's report, without the swarm, everything is the same: the plan items are its ids (`H1`…) and the records go in the folder the user says (if they do not say, ask).

Files in this skill

  • SKILL.md8.8 KB
  • references/procedure.md24.5 KB
  • references/record.md10.1 KB
  • references/sources.md4.3 KB
  • scripts/measure.py10.5 KB
  • scripts/validate-record.py19.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.