Code Improver
Trail of BitsOfficialPublished by Trail of Bits
- Skill
- Workflow
- Software development
- CC-BY-SA-4.0
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
Code Improver automates the iterative process of reviewing and fixing code. It uses a user-specified reviewer to evaluate a target directory, then employs a fixer subagent to address identified issues. The workflow maintains a ledger of findings across rounds, enforces scope boundaries to prevent unintended changes, and provides escalation paths if the code fails to converge toward a clean state. It is designed to handle complex refactoring or cleanup tasks that require multiple cycles of review and adjustment.
What it does
- Executes a multi-round review-and-fix loop on a specified code target.
- Maintains a persistent ledger of findings to track progress across iterations.
- Enforces strict scope guards to ensure changes remain within defined boundaries.
- Escalates to the user when fixes fail to converge or when blocking issues persist.
- Cleans up temporary artifacts automatically upon successful completion.
- Supports manual intervention and decision-making after loop escalations.
When to use it
- When you need to improve a codebase until it passes a specific set of review criteria.
- When you want to run an automated improvement loop using a specific reviewer agent or skill.
- When you need to iterate on code changes that require multiple rounds of feedback and correction.
- When you have encountered an escalation and need to provide a decision to resume the improvement process.
Advantages
- Reduces manual effort by automating the repetitive review-fix-review cycle.
- Prevents infinite loops or non-converging changes through built-in escalation logic.
- Protects project integrity by enforcing strict file scope constraints.
- Provides transparency through a persistent ledger of all findings and actions taken.
Usage examples
- “Improve this directory until the security-reviewer passes.”
- The agent initiates an autonomous loop using the security-reviewer to identify and fix issues within the target directory until the reviewer reports zero critical findings.
- “Run an improvement loop on ./src with the linter-agent.”
- The agent validates the target and reviewer, confirms the scope, and launches the workflow to iteratively fix linting errors until the code converges.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/trailofbits/code-improver/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip code-improver.zip -d .agents/skills
Documentation by Trail of Bits
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
Target: the absolute path to the directory under improvement. Resolve relative paths against the working directory; verify the directory exists.
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.
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 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: {...}}:
{
"target": "<absolute target path>",
"reviewer": { "kind": "agent|skill", "name": "<namespaced-name>", "notes": "<what the reviewer should know about the target>" },
"scope": ["<repo-relative-glob>/**"],
"pluginRoot": "<the plugin directory from step 2>",
"maxRounds": 5
}maxRoundsonly if the user asked for a different cap.pluginRootis the resolved plugin directory from step 2, for the metrics collector.finalize({"version_bump": bool, "narration_strip": bool, "docs_pass": bool}) only to override the defaults: version bump when the target sits inside a plugin, narration strip and docs pass always.decisiononly on continuation (below).
The workflow runs in the background and needs no babysitting: it reviews, fixes, re-reviews, checks scope after every fix round, and can only complete on a clean review. It never commits; all changes stay in the working tree.
If the Workflow tool is unavailable or denied, stop and say so. Do not improvise the loop inline with direct edits — the ledger, scope guard, and escalation guarantees live in the workflow, and an inline imitation has none of them.
If the result is halted: "reviewer-unavailable", relay it and stop. The named
reviewer is not installed in this session; tell the user which plugin provides it and
re-run after installing. Do not review the target yourself.
Do not end your turn while the loop is running. The Workflow tool returns a task id immediately; the result comes later. In an interactive session the completion notification re-invokes you — wait for it. In a non-interactive run (scripted, CI, eval) there is no later turn: stopping abandons the loop mid-round, so after launching, poll the task (TaskOutput with the returned task id, or sleep-and-recheck) until it completes, then relay the result. A session that answers "the loop is running, I'll report later" has lost the run.
Relaying the result
The workflow returns a structured result. Report it honestly — the distinctions matter:
converged: true— the last action was a review with zero critical/major findings. Report rounds used, remaining minor findings (open_minor_count), and the artifact paths (ledger_path,metrics).capped: true— the fix budget ran out and the FINAL review still found blocking issues. Say plainly: capped, NOT converged, and listopen_blocking. Do not present this as success.escalation— the loop detected it was not converging (recurring findings, non-decreasing counts, or a fix relocating a problem). Relay the escalation message and finding ids to the user: this needs a design decision, not more rounds.halted— a guard fired (scope violation, unregistered new files, a dead or unavailable reviewer, or a finalize pass whose own edits failed the check that follows it). Relay the paths inviolations/new_untracked_files, the sites infinalize_regressions, and the notes.notesalways travel with the result — surface them; they include loud warnings such as "a git repository was initialized".
Continuing after an escalation
The loop stops on escalation by design. When the user decides, start a fresh run with
the same target and reviewer plus:
{ "decision": "<the user's ruling, verbatim>" }The new run reloads the on-disk ledger, so every finding, rejection, and verdict carries over — rounds restart, re-derivation does not.
To stop a running loop, stop the workflow task (TaskStop); the ledger on disk is current to the last round and a re-run resumes from it.
When NOT to use
A Claude Code skill: use the
skill-improverentry — it wires the right reviewerA branch / pull request: use the
pr-improverentry — it derives scope from the diffOne-time review: dispatch the reviewer directly; the loop's value is iteration
Quick single fixes: edit the file directly
Files
- ATTRIBUTION.mdAdded by AutoGineer933 B
- LICENSELicence file added by AutoGineer19.7 KiB
- SKILL.md6.3 KiB
Requirements and compatibility
Written for: Claude Code
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Declares allowed tools, Claude Code frontmatter
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Trail of Bits
- Publisher
- Trail of Bits (Official)
- Source
- trailofbits/skills · plugins/code-improver/skills/code-improver · commit e4dd0bb
- Licence
- Creative Commons Attribution-ShareAlike 4.0 International (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Trail of Bits or Trail of Bits.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download code-improver.zip