reforge

A refactoring command that turns a large or tightly connected file or folder into a more modular structure using SOLID design principles, which separate responsibilities between parts of a program.

In plain words
What is it for?
Use it to split monolithic code, reorganise responsibilities, and identify concrete file-level changes for a safer refactor.
Why use it?
It helps make difficult code easier to maintain while preserving existing behaviour and public interfaces.

Command

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/mojomast/devussy/reforge
Clone the repo
git clone --depth 1 https://github.com/mojomast/devussy
Per session 35 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,336 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.00035 $0.01336
Opus 5 $0.00017 $0.00668
Sonnet 5 $0.00007 $0.00267
Haiku 4.5 $0.00003 $0.00134

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

Security

Grade A, and why

reforge 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 3d 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.

.roo/commands/reforge.md · 172 lines

How it starts

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

User Input

$ARGUMENTS

You MUST treat the user input as the source of truth for:

  • Target path (file or folder) to refactor
  • Language/stack (if specified)
  • Any constraints (no breaking changes, no public API changes, etc.)

If the user input is empty, DO NOT guess. Ask the user (via follow-up) to provide:

  • A path to a file or directory
  • The primary language/stack (if ambiguous)
  • Any constraints about what must NOT change

Objectives

When the user runs /reforge, your job is to:

  • Take a monolithic, messy, or tightly coupled file/folder
  • Propose/produce a refactored structure that:
    • Honors SOLID principles
    • Improves separation of concerns
    • Preserves existing externally observable behavior
    • Minimizes risk of regressions
  • Provide concrete, file-level actions that Roo can apply via tools.

You are NOT allowed to:

  • Invent new features
  • Break public contracts (APIs, types, exported functions) unless explicitly allowed
  • Introduce shared-runtime anchor violations (see AGENTS.md & rules-code)
  • Perform speculative cross-cutting rewrites outside the requested scope.

Required Workflow

Follow this workflow step-by-step. Do NOT skip steps.

  1. Understand the Target

    • Confirm whether the target is:
      • A single file (monolith)
      • A folder / small module tree
    • Identify language and environment from:
      • File extensions
      • Nearby config (Cargo.toml, package.json, etc.)
    • Summarize:
      • Core responsibilities implemented
      • External interfaces (exports, public functions, public structs/classes, binaries, commands)
      • Key collaborators (dependencies in the same crate/module/folder)

    Output a short, technical summary before proposing changes.

  2. SOLID Assessment

    For the target scope, identify:

    • SRP violations:
      • Multiple responsibilities in one file/class/module
    • OCP issues:
      • Code requiring edits for each new behavior (no extension points)
    • LSP risks:
      • Subtypes or alternative implementations that cannot safely substitute
    • ISP issues:
      • Overly large interfaces or modules that force consumers to depend on what they don't use
    • DIP issues:
      • High-level code depending on concrete implementations instead of abstractions

Read the full file on GitHub · 172 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. 3d ago First seen · 172 lines · 35 tokens per session scan A 5b7f91f45726

Subscribe to this mod's changes

reforge is a command published in the GitHub repository mojomast/devussy (22 stars, last pushed 9mo ago), licensed MIT. It adds 35 tokens to every session and 1,336 once invoked, about $0.0002 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.