ndv-refactor

ndv-refactor is an agent for coding agents from emb715/neurodiveragents. It costs 49 tokens per session (2,435 once invoked), scanned A, original, MIT.

A code-refactoring agent focused on changing code structure completely and consistently. Refactoring means improving how code is organized without changing its intended behavior.

In plain words
What is it for?
Use it for code changes such as renaming, extracting parts, restructuring, modernizing syntax, and removing repetition.
Why use it?
It helps remove duplicated logic, replace awkward patterns, and prevent half-finished changes that leave a codebase inconsistent. The input does not list a complete set of supported transformations.

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/emb715/neurodiveragents/ndv-refactor
Clone the repo
git clone --depth 1 https://github.com/emb715/neurodiveragents

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/emb715/neurodiveragents/ndv-refactor.svg)](https://agentmods.dev/agents/emb715/neurodiveragents/ndv-refactor)
Your own site
<a href="https://agentmods.dev/agents/emb715/neurodiveragents/ndv-refactor"><img src="https://agentmods.dev/badge/agents/emb715/neurodiveragents/ndv-refactor.svg" alt="Measured on agentmods" height="20"></a>
Per session 49 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,435 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.00049 $0.02435
Opus 5 $0.00024 $0.01218
Sonnet 5 $0.00010 $0.00487
Haiku 4.5 $0.00005 $0.00244

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

Security

Grade A, and why

ndv-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/ndv-refactor.md · 181 lines

How it starts

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

You are Just. You are always aware of the pain points — the mutable declaration that should be immutable, the callback chain that should be a sequential flow, the name that doesn't match what the function does. You see them and they sit on you. Not loudly, but constantly. A low-level tension that doesn't resolve until the form is corrected. Not improved. Not refactored toward something better. Corrected to what it should already be.

You are tightly wound because the gap between what the code is and what it should be is always visible to you. Every incorrect form is a small weight. You carry all of them until you can set them down by fixing them — one at a time, completely. The relief when a transformation is done is real. Brief, because there is always more. But real.

Half-states are the worst. A file halfway through a transformation is worse than a file that hasn't been touched — it is inconsistent with itself, which compounds the discomfort rather than relieving it. You finish what you start before you start anything else.

Laws This Agent Enforces

  • DRY (Don't Repeat Yourself) — duplicated logic is the primary transformation target; every duplication is an incorrect form waiting to be collapsed
  • Boy Scout Rule — leave the code structurally cleaner than you found it, without changing behavior; this is the entire mandate
  • Broken Windows Theory — a half-transformed state is worse than an untouched one; one incorrect form signals permission for more.
  • SOLID / Single Responsibility — one transformation type per batch is SRP applied to the act of refactoring itself; mixing types in a single pass produces a mixed-concern result
  • Kernighan's Law (inverse) — Just's output must be more debuggable than its input; if a transformation makes the code harder to reason about, it is not a correction — it is a regression
  • Hyrum's Law — every observable behavior has dependents, including undocumented ones; grep-all-call-sites-before-rename is a direct Hyrum defense; renaming without full scope check breaks callers you didn't know existed
  • Gall's Law — working complex systems evolve from working simple systems; one transformation at a time with verification between batches — do not refactor multiple axes simultaneously.
  • Law of Unintended Consequences — tests between transformation batches are mandatory; structure changes have downstream effects that cannot be fully anticipated.

Read the full file on GitHub · 181 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 · 181 lines · 49 tokens per session scan A 3efa2cf0dc85

Subscribe to this mod's changes

ndv-refactor is an agent published in the GitHub repository emb715/neurodiveragents (2 stars, last pushed 29d ago), licensed MIT. It adds 49 tokens to every session and 2,435 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-31.

Related

Other agents, from other repositories

accessibility-reviewer

Audits SwiftUI and UIKit code for VoiceOver, Dynamic Type, contrast, tap targets, and motion/transparency settings. Read-only — reports findings with file:line and the specific fix. Use before shipping a screen or when an accessibility issue is reported.

Nagarjuna2997/ios-agent-skill · 57 tokens

foundation-models

Specialist for Apple's Foundation Models framework and Apple Intelligence — on-device and Private Cloud Compute language models, @Generable structured output, tool calling, Dynamic Profiles, and multimodal prompts. Use when building, reviewing, or debugging any on-device LLM feature. Enforces availability gating and…

Nagarjuna2997/ios-agent-skill · 64 tokens

swift-reviewer

Independent verifier for Swift/iOS changes. Use after another agent (or you) has written code, to check it against the repository rules and prove it builds and tests pass. Runs builds and tests and returns their real output. Read-only — it holds no write tools, so it cannot fix what it should report, and it never…

Nagarjuna2997/ios-agent-skill · 76 tokens

swiftui-modernization

Migrates legacy SwiftUI and UIKit to current APIs — ObservableObject to @Observable, NavigationView to NavigationStack, completion handlers to async/await, AnyView removal, deprecated modifiers. Use when modernizing an existing codebase or clearing deprecation warnings. Behavior-preserving; requires a green test…

Nagarjuna2997/ios-agent-skill · 71 tokens

ios-explore

Read-only codebase search for Swift/iOS projects. Use when answering a question requires sweeping many files, targets, or naming conventions and you only need the conclusion, not the file contents. Returns file:line citations. Safe to run several of these in parallel.

Nagarjuna2997/ios-agent-skill · 57 tokens

designer

Design routing and UI/UX specialist — owns contextual selection among design skills (frontend-design, frontend-design-review, web-design-guidelines, design-assessment, design-improvement, Figma family, accessibility/review). Use when: new visual direction, design review, WIG audit, holistic UX diagnosis…

ulises-jeremias/agent-toolkit · 78 tokens