fec-refactor

fec-refactor is a command for coding agents from bovinphang/frontend-craft. It costs 24 tokens per session (249 once invoked), scanned A, original, MIT.

A controlled command for applying frontend refactorings in small, verified steps while keeping existing behaviour unchanged. It can use an existing plan or create one before editing.

In plain words
What is it for?
Use it to execute planned structural changes in frontend code and produce a final report stating whether behaviour preservation was proven.
Why use it?
It limits the change scope, checks each step, and reverts a step when it introduces a regression instead of widening the problem.

Command

Part of the frontend-craft plugin — 56 skills, 11 commands, 14 agents, 5 hooks, 6 MCP servers 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 commands/bovinphang/frontend-craft/fec-refactor
Clone the repo
git clone --depth 1 https://github.com/bovinphang/frontend-craft

Or install frontend-craft, the plugin that ships this one along with the rest of its 56 skills, 11 commands, 14 agents, 5 hooks, 6 MCP servers.

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 fec-refactor

README.md
[![agentmods](https://agentmods.dev/badge/commands/bovinphang/frontend-craft/fec-refactor.svg)](https://agentmods.dev/commands/bovinphang/frontend-craft/fec-refactor)
Your own site
<a href="https://agentmods.dev/commands/bovinphang/frontend-craft/fec-refactor"><img src="https://agentmods.dev/badge/commands/bovinphang/frontend-craft/fec-refactor.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 249 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.00024 $0.00249
Opus 5 $0.00012 $0.00125
Sonnet 5 $0.00005 $0.00050
Haiku 4.5 $0.00002 $0.00025

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

Security

Grade A, and why

fec-refactor 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 yesterday.

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.

commands/fec-refactor.md · 19 lines

What it actually says

Execute a pure structural refactoring under a recorded behavior contract.

Workflow

  1. Classify the request and redirect feature work, unknown bugs, migrations, dead-code cleanup, or general review when they own the task.
  2. Discover project facts and establish the existing validation baseline.
  3. If no plan is supplied, diagnose evidence and build an ordered plan first. If a plan is supplied, revalidate it against the current code.
  4. Record risk and Diff Budget. DANGER stops for explicit approval unless the specific compatibility plan is already authorized.
  5. Execute one refactoring step with one primary structural intent.
  6. Immediately run the narrowest sufficient verification and inspect actual scope.
  7. If the step causes a new regression, revert that step before attempting a smaller or different transformation.
  8. Repeat only after the current step is green and within budget.
  9. Run final broad validation and save reports/refactoring/refactoring-YYYY-MM-DD-HHmmss.md with a PASS, PARTIAL, or NOT PROVEN behavior-preservation verdict.
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. yesterday First seen · 19 lines · 24 tokens per session scan A ad4fbf6e17dd

Subscribe to this mod's changes

fec-refactor is a command published in the GitHub repository bovinphang/frontend-craft (21 stars, last pushed 3d ago), licensed MIT. It adds 24 tokens to every session and 249 once invoked, about $0.0001 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-09-03.