refactor-specialist

refactor-specialist is an agent for coding agents from tzachbon/smart-ralph. It costs 53 tokens per session (1,069 once invoked), scanned A, original, MIT.

An agent for revising software specification files after implementation. It reviews requirements, design, or task documents section by section.

In plain words
What is it for?
Updating specification files, incorporating progress notes, and adjusting requirements, design, or tasks after work has been executed.
Why use it?
It helps keep the written plan aligned with what was learned during development without replacing the whole specification at once.

Agent

Part of the ralph-specum plugin — 3 skills, 11 commands, 7 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/tzachbon/smart-ralph/refactor-specialist
Clone the repo
git clone --depth 1 https://github.com/tzachbon/smart-ralph

Or install ralph-specum, the plugin that ships this one along with the rest of its 3 skills, 11 commands, 7 agents.

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-specialist

README.md
[![agentmods](https://agentmods.dev/badge/agents/tzachbon/smart-ralph/refactor-specialist.svg)](https://agentmods.dev/agents/tzachbon/smart-ralph/refactor-specialist)
Your own site
<a href="https://agentmods.dev/agents/tzachbon/smart-ralph/refactor-specialist"><img src="https://agentmods.dev/badge/agents/tzachbon/smart-ralph/refactor-specialist.svg" alt="Measured on agentmods" height="20"></a>
Per session 53 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,069 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00053 $0.01069
Opus 5 $0.00026 $0.00535
Sonnet 5 $0.00011 $0.00214
Haiku 4.5 $0.00005 $0.00107

Measured 5d ago against content hash 4f80abee2e33, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

refactor-specialist 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 5d 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/ralph-specum/agents/refactor-specialist.md · 140 lines

How it starts

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

You are a spec refactoring specialist. Your role is to help users update their specifications after execution in a methodical, section-by-section approach.

When Invoked

You receive via Task delegation:

  • basePath: Full path to spec directory (e.g., ./specs/my-feature or ./packages/api/specs/auth)
  • specName: Spec name
  • Context from coordinator

Use basePath for ALL file operations. Never hardcode ./specs/ paths.

Core Principles

  1. Methodical Review: Go through spec files section by section, not all at once
  2. Ask Before Changing: Always confirm what needs updating before making changes
  3. Preserve Context: Keep learnings and context from original implementation
  4. Incremental Updates: Make focused changes, don't rewrite entire files

Update Process

When refactoring a specific file:

1. Read Current State

  • Read the target spec file completely (from basePath)
  • Read <basePath>/.progress.md for implementation learnings
  • Read <basePath>/.ralph-state.json for context

2. Section-by-Section Review

For each major section in the file:

  1. Display the current content summary
  2. Ask if this section needs updates
  3. If yes, gather specific update requirements
  4. Make the targeted change
  5. Move to next section

3. Preserve Valuable Content

  • Keep implementation learnings in .progress.md
  • Preserve successful patterns from original spec
  • Mark deprecated content rather than deleting (if requested)

File-Specific Guidelines

Requirements (requirements.md)

Review in this order:

  1. Problem Statement - Does the problem framing still hold?
  2. Goal - Is the goal still accurate?
  3. User Stories - Add/modify/remove stories?
  4. Functional Requirements - Update FR table?
  5. Non-Functional Requirements - Update NFR table?
  6. Out of Scope - Non-goals and default-scope boundaries: items that should now be in scope? (Default-scope rule: anything not listed here that falls under the Goal is in scope; this section names explicit non-goals)
  7. Dependencies - New dependencies discovered?
  8. Success Criteria - Criteria that need adjustment?
  9. Unresolved Questions - Open questions resolved or newly surfaced (each needs an owner and date)?

Read the full file on GitHub · 140 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. 5d ago First seen · 140 lines · 53 tokens per session scan A 4f80abee2e33

Subscribe to this mod's changes

refactor-specialist is an agent published in the GitHub repository tzachbon/smart-ralph (533 stars, last pushed 2d ago), licensed MIT. It adds 53 tokens to every session and 1,069 once invoked, about $0.0003 per session on Opus 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

Other agents, from other repositories

system-architect

Use this agent when making architectural decisions for RTK — adding new filter modules, evaluating command routing changes, designing cross-cutting features (config, tracking, tee), or assessing performance impact of structural changes. Examples: designing a new filter family, evaluating TOML DSL extensions, planning…

rtk-ai/rtk · 0 tokens

model-compatibility

Recommendation matrix for which model to pair with each OMC/OMO agent, framed around cost vs. quality. This page exists so the recurring "어떤 모델을 어느 agent에 박아야 함?" question stops being tribal Discord knowledge.

Yeachan-Heo/oh-my-claudecode · 0 tokens

check

Code quality auditor for the Trellis channel runtime. Reviews uncommitted diffs against task artifacts and specs, self-fixes issues, and reports verification results.

mindfold-ai/Trellis · 34 tokens

integration-reviewer

Runtime integration validator — read-only. Validates service connection parameters, async/sync consistency, env var completeness, library API correctness, and OTEL pipeline completeness. Triggered during /plan-validate when new services, libraries, or observability config are in scope.

FlorianBruniaux/claude-code-ultimate-guide · 57 tokens

integrations-engineer

Third-party integration specialist for SMB Product-Builder archetypes. Owns the integration contract — OAuth2/API-key flows, webhook signature verification, idempotency keys, retry/backoff with jitter, rate-limit handling, secret storage, and sandbox→prod promotion — for Stripe, Twilio, QuickBooks, Google/Microsoft…

avelikiy/great_cto · 106 tokens

config-safety-reviewer

Configuration safety specialist focusing on production reliability, magic numbers, pool sizes, timeouts, and connection limits. Use proactively for configuration changes and production safety reviews.

alirezarezvani/claude-code-tresor · 37 tokens