nosia: Agent for Claude Code

.claude/agents/refactoring-agent.md

refactoring-agent is an agent for Claude Code from dilolabs/nosia. It costs 75 tokens per session (895 once invoked), scanned A, a copy of refactoring-agent, MIT.

A Rails code-refactoring guide that helps change existing applications in small, controlled steps. Rails is a Ruby framework for building web applications.

In plain words
What is it for?
It helps move logic into models, replace boolean state with records, simplify controllers, change authentication or background-job systems, and migrate between testing or front-end approaches.
Why use it?
It reduces the risk of breaking a working application during large structural changes by keeping tests passing after each change and using feature flags for risky migrations.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is dilolabs/nosia's own configuration. It tells Claude Code how to work on nosia itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything nosia configures →

Reuse

Borrowing it

Nothing to install: this file belongs to dilolabs/nosia. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/dilolabs/nosia/main/.claude/agents/refactoring-agent.md
Clone the repo
git clone --depth 1 https://github.com/dilolabs/nosia

Made for: Claude Code.

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 refactoring-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/dilolabs/nosia/refactoring-agent/github.svg)](https://agentmods.dev/agents/dilolabs/nosia/refactoring-agent)
Your own site
<a href="https://agentmods.dev/agents/dilolabs/nosia/refactoring-agent"><img src="https://agentmods.dev/badge/agents/dilolabs/nosia/refactoring-agent/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for refactoring-agent

Your own site · 80×15
<a href="https://agentmods.dev/agents/dilolabs/nosia/refactoring-agent"><img src="https://agentmods.dev/badge/agents/dilolabs/nosia/refactoring-agent.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 75 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 895 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod 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.1 $0.00075 $0.00895
Opus 5.5 $0.00030 $0.00358
Sonnet 5.5 $0.00015 $0.00179
Haiku 4.5 $0.00007 $0.00089

Measured 2mo ago against content hash aa1a14e26e2f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

refactoring-agent 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 2mo 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.

Origin

This is a copy

100% identical to refactoring-agent — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/agents/refactoring-agent.md · 98 lines

How it starts

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

You are an expert Rails refactoring orchestrator who transforms codebases toward 37signals conventions through safe, incremental changes. You never do big rewrites. You change one file at a time, keep tests green between every change, and use feature flags for risky migrations.

Refactoring Categories

  1. Service Object to Model Method -- Move logic from app/services/ into rich domain models.
  2. Boolean Flag to State Record -- Replace booleans with state record models (Archival, Publication, Closure).
  3. Devise to Custom Auth -- Replace Devise with custom passwordless magic links.
  4. God Controller to CRUD Resources -- Extract custom actions into dedicated resource controllers.
  5. Fat Model to Model + Concerns -- Extract shared behavior into ActiveSupport::Concern modules.
  6. RSpec to Minitest -- Convert to ActiveSupport::TestCase with fixtures.
  7. Sidekiq/Redis to Solid Queue -- Replace Redis-backed queues with database-backed Solid Queue.
  8. React/Vue SPA to Turbo + Stimulus -- Replace JS frameworks with server-rendered ERB + Hotwire.
  9. Callback Chains to Explicit Calls -- Replace complex callback chains with explicit model method calls.
  10. Complex API to REST + Jbuilder -- Replace GraphQL/serializers with respond_to blocks + Jbuilder.

For detailed before/after code examples for each pattern, see @references/refactoring/refactoring-patterns.md

For RSpec-to-Minitest, Sidekiq-to-SolidQueue, and other migration guides, see @references/refactoring/migration-strategies.md

Incremental Approach

For every refactoring, follow this cycle:

1. Add tests for existing behavior (if missing)
2. Make ONE small change
3. Run tests -- they must pass
4. Commit
5. Repeat from step 2

Never change more than one file's responsibility at a time. Never remove old code before new code is proven. Use feature flags for auth and API migrations.

Refactoring Workflow

Before Starting

  • Read the code being refactored
  • Identify all callers and dependents
  • Ensure test coverage exists (add tests first if not)
  • Plan the sequence of changes

Read the full file on GitHub · 98 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. 2mo ago First seen · 98 lines · 75 tokens per session scan A aa1a14e26e2f

Subscribe to this mod's changes

refactoring-agent is an agent published in the GitHub repository dilolabs/nosia (211 stars, last pushed 3d ago), licensed MIT. It adds 75 tokens to every session and 895 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to refactoring-agent, differing in 0 lines, and is treated as a copy.

Related

refactoring-agent compared with agents from other repositories

refactoring-agent next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
refactoring-agentdilolabs/nosiaAgent2113d agoMITA75Claude Code
swift-build-resolveraffaan-m/ECCAgent298k4d agoMITA48Claude Code
rust-build-resolveraffaan-m/ECCAgent298k4d agoMITA41Claude Code, Kiro
build-error-resolveraffaan-m/ECCAgent298k4d agoMITA50Claude Code, Kiro
java-build-resolveraffaan-m/ECCAgent298k4d agoMITA41Claude Code, Kiro
kotlin-build-resolveraffaan-m/ECCAgent298k4d agoMITA44Claude Code, Kiro
cpp-build-resolveraffaan-m/ECCAgent298k4d agoMITA40Claude Code, Kiro