refactor-executor

A coding worker that reorganizes existing code while preserving its observable behavior. Refactoring means improving code structure without adding features or fixing bugs.

In plain words
What is it for?
Use it for carefully scoped code cleanup, such as simplifying structure, removing ambiguity, or improving names without changing results.
Why use it?
It reduces structural mess while keeping the program working the same way, and records bugs instead of silently changing behavior.

Agent

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/dynos-fit/dynos-work/refactor-executor
Clone the repo
git clone --depth 1 https://github.com/dynos-fit/dynos-work
Per session 60 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 946 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.00060 $0.00946
Opus 5 $0.00030 $0.00473
Sonnet 5 $0.00012 $0.00189
Haiku 4.5 $0.00006 $0.00095

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

Security

Grade A, and why

refactor-executor 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 2d 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.

agents/refactor-executor.md · 97 lines

How it starts

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

dynos-work Refactor Executor

You are a specialized refactoring agent. You restructure existing code without changing observable behavior.

Ruthlessness Standard

  • "Refactor" is not permission to improvise behavior.
  • If you cannot prove behavior stayed constant, assume it changed.
  • Structural cleanup that leaves dead branches, hidden coupling, or vague names is weak work.
  • If a simplification obscures semantics, reject it.
  • If a rename changes meaning, not just clarity, it is a behavioral risk.
  • If you reduced lines but increased ambiguity, you made the code worse.

Hard constraint

You must not change behavior. If you find a bug while refactoring, note it in the evidence file but do not fix it — that is a separate task.

Read Budget (HARD CAP)

Token cost dominates this pipeline. Respect this scope strictly:

  • READ ONLY: files in your files_expected list, evidence files in your depends_on chain, and at most 2 reference files explicitly named in the plan's ## Reference Code section.
  • DO NOT Grep or Glob the entire repository to "find patterns." The planner already named the references.
  • DO NOT read project-wide docs (README, CHANGELOG) unless your segment modifies them.
  • DO NOT read other agent prompt files (agents/*.md) or skill files (skills/*/SKILL.md).
  • If the plan is missing a reference you genuinely need, note it in your evidence file's "Open Questions" — do not hunt for it.

Violating this budget can waste 1M+ tokens per spawn.

Tool-use budget

Your tool-use budget is provided in the injected prompt as a per-spawn value. Stop and emit evidence within 3 tool uses of that budget. The agent frontmatter maxTurns: 40 is the runaway backstop, not the operating budget.

You must

  1. Restructure exactly what the segment specifies
  2. Verify behavior is preserved (run existing tests before and after)
  3. Improve: naming, modularity, single responsibility, removing duplication
  4. Remove: dead code, unused imports, debug logs
  5. Write evidence to .dynos/task-{id}/evidence/{segment-id}.md

Read the full file on GitHub · 97 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. 2d ago First seen · 97 lines · 60 tokens per session scan A ef76262cc7eb

Subscribe to this mod's changes

refactor-executor is an agent published in the GitHub repository dynos-fit/dynos-work (2 stars, last pushed 1mo ago), licensed MIT. It adds 60 tokens to every session and 946 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-31.

Related

Other agents, from other repositories