# Code Improver

Runs an autonomous review-and-fix improvement loop over any code target, a skill...

- Repository: https://github.com/trailofbits/skills (7935 stars)
- Category: AI and agents
- License: CC-BY-SA-4.0
- Last updated: 2026-10-28
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add trailofbits/skills --skill code-improver -g -a claude-code -y`
Codex: `npx skills add trailofbits/skills --skill code-improver -g -a codex -y`
Cursor: `npx skills add trailofbits/skills --skill code-improver -g -a cursor -y`
Gemini CLI: `npx skills add trailofbits/skills --skill code-improver -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add trailofbits/skills`

## Description

Runs an autonomous review-and-fix improvement loop over any code target, a skill, plugin, module, or directory, using a reviewer the user names: any installed skill or agent. Keeps a cross-round findings ledger, escalates when fixes stop converging, and guards scope mechanically. Use when asked to 'improve this code until review passes', 'run an improvement loop with <reviewer>', or to iterate review-and-fix with a specific reviewer. For skills prefer the skill-improver entry; for a branch prefer pr-improver.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Code Improver

Improve any code target by running `/code-improver:improve`, a dynamic workflow that
loops the named reviewer and a fixer subagent until a review reports zero critical/major
findings, then strips its own residue. The loop, its ledger, and its guards live in the
workflow; this skill collects the three inputs the generic entry requires and relays the
outcome.

## Starting the loop

The user provided: `$ARGUMENTS` (if empty, take the details from the conversation).

### 1. Collect the three required inputs, no guessing

1. **Target**: the absolute path to the directory under improvement. Resolve relative
   paths against the working directory; verify the directory exists.
2. **Reviewer**: the installed skill or agent that performs every review. The user must
   name it, there is no default and no bundled reviewer. Determine the kind:
   - a namespaced agent (e.g. `plugin-dev:skill-reviewer`) → `"kind": "agent"`
   - an installed skill (e.g. `pr-review-toolkit:review-pr`) → `"kind": "skill"`
   If the name could be either, check the session's skill listing; if still ambiguous,
   ask the user. If no reviewer was named, ask, do not pick one.
3. **Scope**: repo-relative globs the loop may touch. The generic entry requires it
   explicitly; if the user did not give one, propose the target directory
   (`<repo-relative-target>/**`) and confirm before launching.

### 2. Resolve the loop script

Resolve [`improve.js`](../../workflows/improve.js) from this SKILL.md's installed location
to an absolute path and confirm the file exists. Its plugin directory is `pluginRoot`.
Use this exact plugin copy; if the file is missing, stop.

### 3. Invoke the workflow

Run it with the Workflow tool, `{scriptPath: "<the path from step 2>", args: {...}}`:

The rest: https://github.com/trailofbits/skills/blob/HEAD/plugins/code-improver/skills/code-improver/SKILL.md
