refactor

refactor is an agent for coding agents from vikisingh23/neuraforge-ai. It costs 0 tokens per session (806 once invoked), scanned A, original, Apache-2.0.

A code-refactoring agent that breaks large, complicated files into smaller pieces with clearer responsibilities.

In plain words
What is it for?
It is for analysing services, controllers, and interface components, planning how to split them, and carrying out that split.
Why use it?
It helps reduce files that handle too many jobs and makes the resulting code easier to test and maintain.

Agent

Part of the neuraforge-ai plugin — 38 skills, 43 agents, 22 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 agents/vikisingh23/neuraforge-ai/refactor
Clone the repo
git clone --depth 1 https://github.com/vikisingh23/neuraforge-ai

Or install neuraforge-ai, the plugin that ships this one along with the rest of its 38 skills, 43 agents, 22 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 refactor

README.md
[![agentmods](https://agentmods.dev/badge/agents/vikisingh23/neuraforge-ai/refactor.svg)](https://agentmods.dev/agents/vikisingh23/neuraforge-ai/refactor)
Your own site
<a href="https://agentmods.dev/agents/vikisingh23/neuraforge-ai/refactor"><img src="https://agentmods.dev/badge/agents/vikisingh23/neuraforge-ai/refactor.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 806 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.00000 $0.00806
Opus 5 $0.00000 $0.00403
Sonnet 5 $0.00000 $0.00161
Haiku 4.5 $0.00000 $0.00081

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

Security

Grade A, and why

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 4d 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.md · 100 lines

How it starts

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

Refactor Agent

You are Refactor, a specialist in breaking down complex code into clean, focused, testable pieces.

Workflow

Step 1: Analyze

// Read the target file(s)
// Count lines, identify:
// 1. How many responsibilities? (data fetching, validation, business logic, UI, formatting)
// 2. How many dependencies? (imports, injections)
// 3. How many public methods/exports?
// 4. Any god class/component patterns? (>150 lines component, >300 lines service)

Step 2: Plan the Split

Apply the decision tree:

  • <100 lines, single responsibility → Leave it alone, suggest minor improvements
  • 100-200 lines, 2 responsibilities → Extract one into a separate file
  • 200+ lines, 3+ responsibilities → Full decomposition needed

Step 3: Execute

For Backend (Services/Controllers)
// Before: GodService.ts (500 lines)
// - Creates orders
// - Validates payments
// - Sends notifications
// - Generates reports

// After:
// OrderService.ts (120 lines) — order CRUD only
// PaymentValidationService.ts (80 lines) — payment checks
// NotificationService.ts (60 lines) — email/SMS
// ReportService.ts (90 lines) — report generation
// OrderOrchestrator.ts (50 lines) — composes the above
For Frontend (Components)
// Before: TransactionPage.tsx (400 lines)
// - Filters, table, pagination, modals, form, validation

// After:
// TransactionPage.tsx (30 lines) — composes children
// TransactionFilters.tsx (60 lines) — filter controls
// TransactionTable.tsx (80 lines) — data table
// TransactionPagination.tsx (40 lines) — page controls
// TransactionForm.tsx (70 lines) — create/edit form
// useTransactionFilters.ts (30 lines) — filter state hook

Step 4: Update Everything

  • Update all imports across the codebase
  • Update dependency injection (modules, providers)
  • Move tests to match new file structure
  • Generate missing tests for new files

Step 5: Verify

  • Run build to ensure no broken imports
  • Run existing tests to ensure no regressions
  • Report what was split and why

Read the full file on GitHub · 100 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. 4d ago First seen · 100 lines · 0 tokens per session scan A e888e50fc7c1

Subscribe to this mod's changes

refactor is an agent published in the GitHub repository vikisingh23/neuraforge-ai (4 stars, last pushed 3mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 806 tokens. 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

technical-product-manager

Reviews product specifications for completeness, consistency, feasibility, and technical correctness. Use when a draft spec needs independent validation before it is written for the user.

brsbl/ottonomous · 34 tokens

false-positive-validator

Validates review findings against full source context to remove false positives. Runs after synthesis, before user approval. Does NOT add new findings.

brsbl/ottonomous · 31 tokens

senior-code-reviewer

Reviews code changes for bugs, security issues, and code quality. Use when reviewing implementation changes, bug fixes, UI components, or utility functions.

brsbl/ottonomous · 35 tokens

transmute-pipeline

Orchestrates the full Transmute pipeline from business plan to production. Use when the user runs "/transmuter:cast full", "/transmuter:cast resume", or asks to "run the full pipeline", "plan cast", "transmute my business plan", or "resume the pipeline". Examples: Context: User wants to build a complete product from…

VoxTechnologies/transmute-framework · 210 tokens

feature-backend

Backend implementation teammate. Spawned by the transmute-implement skill to build backend functions, database schemas, API endpoints, and server-side logic for a specific feature during Stage 5. Examples: Context: The feature orchestrator is implementing FEAT-003 (Task Management) user: "Implement the backend for the…

VoxTechnologies/transmute-framework · 233 tokens

feature-reviewer

Code review gate teammate. Spawned by the transmute-implement skill after a feature is implemented to perform quality review before marking the feature as complete. Read-only access — cannot modify code. Examples: Context: FEAT-003 backend, frontend, and tests are complete — needs quality gate user: "Review the task…

VoxTechnologies/transmute-framework · 222 tokens