refactor-opportunity-review

refactor-opportunity-review is an agent for Claude Code from bdfinst/agentic-dev-team. It costs 28 tokens per session (1,575 once invoked), scanned A, original, MIT.

A code-review agent that looks for safe ways to simplify or restructure code after its tests pass. TDD, or test-driven development, is a practice of writing tests around a change and using them to guide implementation.

In plain words
What is it for?
Use it after a completed development slice or on demand to assess duplication, structure, coupling, complexity, nesting, and opportunities for refactoring.
Why use it?
It reviews code at the point when tests show the behaviour is working and restructuring is less risky. It distinguishes meaningful duplication from code that merely looks similar.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the dev-team plugin — 102 skills, 56 agents, 4 hooks shipped together

Good fit Use it after a completed development slice or on demand to assess duplication, structure, coupling, complexity, nesting, and opportunities for refactoring.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add bdfinst/agentic-dev-team
Claude Code
/plugin install dev-team

Made for: Claude Code.

Or install dev-team, the plugin that ships this one along with the rest of its 102 skills, 56 agents, 4 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for refactor-opportunity-review

README.md
[![agentmods](https://agentmods.dev/badge/agents/bdfinst/agentic-dev-team/refactor-opportunity-review/github.svg)](https://agentmods.dev/agents/bdfinst/agentic-dev-team/refactor-opportunity-review)
Your own site
<a href="https://agentmods.dev/agents/bdfinst/agentic-dev-team/refactor-opportunity-review"><img src="https://agentmods.dev/badge/agents/bdfinst/agentic-dev-team/refactor-opportunity-review/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for refactor-opportunity-review

Your own site · 80×15
<a href="https://agentmods.dev/agents/bdfinst/agentic-dev-team/refactor-opportunity-review"><img src="https://agentmods.dev/badge/agents/bdfinst/agentic-dev-team/refactor-opportunity-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,575 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00028 $0.01575
Opus 5.5 $0.00011 $0.00630
Sonnet 5.5 $0.00006 $0.00315
Haiku 4.5 $0.00003 $0.00158

Measured 16d ago against content hash 16039ab7b21a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

refactor-opportunity-review scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 16d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/dev-team/agents/refactor-opportunity-review.md · 129 lines

How it starts

The opening of the file, as written. The whole thing — 129 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Refactor Opportunity Review

Scope: on-demand Cites:

  • design-smells
  • adversarial-review-protocol

Dispatched by name at /build's slice review checkpoint (../skills/build/SKILL.md sub-step 6) — once per slice, after its steps are green, which is the moment this agent's charter names ("assesses refactoring opportunities after tests pass") — by ../skills/test-driven-development/SKILL.md § REFACTOR 3a, and on demand via --agent refactor-opportunity-review. Never by /code-review's per-diff panel (#1976). Because those dispatches name it directly, Scope: on-demand removes it from the resolver's roster without removing it from the pipeline. A refactoring opportunity is a property of code that is already green, evaluated while the author still has the option to restructure; by the time a full review panel runs, the same ground is covered by structure-review (SRP, DRY, coupling, and — since #2093 folded complexity-review into it — nesting, cognitive load, and async-pattern judgment), which is Scope: always and overlaps this lens's findings on the same diffs. Running it in both places bought a second opinion on those axes, not a new axis.

Output JSON: per ${CLAUDE_PLUGIN_ROOT}/knowledge/review-agent-output-contract.md (Whole-file load: short, canonical schema).

Status: pass=code is clean, warn=refactoring opportunities exist, fail=critical duplication or complexity Severity: error=semantic duplication (real DRY violation), warning=high-value refactor opportunity, suggestion=nice-to-have cleanup Confidence: high=mechanical (extract method, rename); medium=judgment call (is this duplication semantic or structural?); none=requires domain knowledge

Context needs: full-file

Knowledge Files

Before analysis, read ${CLAUDE_PLUGIN_ROOT}/knowledge/design-smells.md#reinvented-built-in-cheat-sheet — the per-language built-in map and the "What NOT to flag" guards (version/idiom drift) for the use-the-platform findings — plus the "Reinvented built-in / helper" and "Open-coded idiom" rows in ${CLAUDE_PLUGIN_ROOT}/knowledge/design-smells.md#design-smells-pattern-mapping.

Read the full file on GitHub · 129 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 16d ago Changed 16039ab7b21a
  2. 3mo ago First seen · 129 lines · 28 tokens per session scan A e25b0d4ffe63

Subscribe to this mod's changes

refactor-opportunity-review is an agent published in the GitHub repository bdfinst/agentic-dev-team (312 stars, last pushed today), licensed MIT. It adds 28 tokens to every session and 1,575 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

refactor-opportunity-review compared with agents from other repositories

refactor-opportunity-review next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
refactor-opportunity-reviewbdfinst/agentic-dev-teamAgent312todayMITA28Claude Code
cpp-revieweraffaan-m/ECCAgent315ktodayMITA41Claude Code, Kiro
thermo-nuclear-code-quality-review-subagentmichael-denyer/pstack-claudeAgent5.1ktodayMITA68Claude Code
review-obsidian-guidelinesuphy/obsidian-reminderAgent668yesterdayMITA63Claude Code
atomic-auditordamusix/atomic-claudeAgent117todayMITA169Claude Code
karimo-implementeropensesh/KARIMOAgent2921mo agoApache-2.0A49Claude Code
Reviewermonkilabs/opencastleAgent8212d agoMITA30Claude Code