Skip to content
Security
Command

/remediate

Generate code patches that fix one or more findings. Outputs as a unified diff and (optionally) applies it.

From plugin
rugproof
1145 skills23 agents45 commands4 hooks
> /plugin marketplace add omermaksutii/RugProof
> /plugin install rugproof@rugproof

Command definition

remediate.md
description: Generate code patches that fix one or more findings. Outputs as a unified diff and (optionally) applies it.
argument-hint: "<finding-id>...  [--apply]"
allowed-tools: Read, Edit, Write, Bash, Agent, Skill

/remediate — write the fix

For each finding ID in `$ARGUMENTS`, produce a concrete code patch.

Procedure

Step 1 — Resolve finding(s)

Pull the finding(s) from the most recent audit. If not available, ask the user to re-run `/audit` or pipe in a findings.json.

Step 2 — Dispatch `remediation-suggester` subagent

For each finding, the subagent:

  • Reads the affected file and the relevant skill from `skills/`
  • Generates the fix as a unified diff against the file
  • Cross-references known-good implementations (OZ, Solady) for the canonical fix shape
  • Adds a `// rugproof: fixed REENT-001` comment? **No** — do not add comments about the fix. Just fix it. (CLAUDE.md rule: no "fixed X" comments.)

Step 3 — Validate the patch

Before output:

  • Check the patch compiles (run `forge build` if Foundry project).
  • Run any existing tests (`forge test` or `npm test`) to make sure the fix doesn't break them.
  • Re-run the relevant vuln skill against the patched file — confirm the finding is gone.

Step 4 — Output

Remediation for REENT-001:

--- a/src/Vault.sol
+++ b/src/Vault.sol
@@ -140,10 +140,10 @@ function withdraw() external {
-    uint256 amt = balance[msg.sender];
-    (bool ok,) = msg.sender.call{value: amt}("");
-    require(ok);
-    balance[msg.sender] = 0;
+    uint256 amt = balance[msg.sender];
+    balance[msg.sender] = 0;
+    (bool ok,) = msg.sender.call{value: amt}("");
+    require(ok, "withdraw failed");
}

Verification:
  forge build:    ✓
  forge test:     12 passing, 0 failing
  re-audit:       REENT-001 no longer reported

If `--apply` flag passed, also apply the patch to the file in place. Otherwise just print it.

Notes

  • One patch per finding by default. If multiple findings are in the same function, you may combine them in one diff with a clear note.
  • If the fix requires architectural change (e.g. "move from push to pull payments"), the patch may span multiple files. Tell the user.
  • Never add comments to the patched code beyond what was there.
  • If the fix isn't safely automatable (e.g. needs a multi-sig deployment), output advice instead of a diff.
Read more
@omermaksutii
Ships withrugproof

Rugproof your code before someone else does. 🌐 Live site: omermaksutii.github.io/RugProof 📦 Latest: v1.0.0 — 45 commands · 23 agents · 45 skills · 13 MCP servers · tested, offline-first, with rule packs, a benchmark, non-EVM coverage, and post-deploy

1152 skills23 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
11
Star history of omermaksutii/RugProof on GitHub, a chart by star-history.com

Other commands on rugproof.

audit-deep

audit-deep

Command

Deep audit — same as /audit but spawns more parallel subagents, runs multi-pass review, and chases exploit chains across files.

@omermaksutii@omermaksutiiInstall Command
audit-deps

audit-deps

Command

Audit third-party dependencies — resolve installed versions, cross-reference known-vulnerable releases, and flag vendored code…

@omermaksutii@omermaksutiiInstall Command
audit-diff

audit-diff

Command

Diff two Rugproof audit reports (before vs after) to track regressions — what's new, what's fixed, and whether the grade moved.

@omermaksutii@omermaksutiiInstall Command
audit-history

audit-history

Command

Pull past public audits (Code4rena, Sherlock, Spearbit, etc.) for a deployed contract or known protocol.

@omermaksutii@omermaksutiiInstall Command
audit-live

audit-live

Command

Audit a deployed contract on a live chain. Pulls verified source from the block explorer, optionally forks the chain for…

@omermaksutii@omermaksutiiInstall Command

More commands from other plugins.

deslop-reborn

deslop-reborn

Command

One iteration of the IronClaw Reborn de-slop loop — take ONE Reborn crate, fan out parallel review sub-agents (thermo-nuclear…

@nearai@nearaiInstall Command
audit

audit

Command

Audit a file, directory, or whole repo for insecure default configuration: fallback secrets, default credentials, fail-open…

@trailofbits@trailofbitsInstall Command
arsenal

arsenal

Command

Show which external bug-bounty tools are installed on this machine and print install hints for the missing ones. Curated from…

@awarexone@awarexoneInstall Command