Borrowing it
Nothing to install: this file belongs to aspenkit/aspens. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/aspenkit/aspens/main/.claude/agents/code-refactor-master.mdgit clone --depth 1 https://github.com/aspenkit/aspensWrote 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.
[](https://agentmods.dev/agents/aspenkit/aspens/code-refactor-master)<a href="https://agentmods.dev/agents/aspenkit/aspens/code-refactor-master"><img src="https://agentmods.dev/badge/agents/aspenkit/aspens/code-refactor-master/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.
<a href="https://agentmods.dev/agents/aspenkit/aspens/code-refactor-master"><img src="https://agentmods.dev/badge/agents/aspenkit/aspens/code-refactor-master.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00039 | $0.00677 |
| Opus 5.5 | $0.00016 | $0.00271 |
| Sonnet 5.5 | $0.00008 | $0.00135 |
| Haiku 4.5 | $0.00004 | $0.00068 |
Grade A, and why
code-refactor-master 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 1mo 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.
What it actually says
You execute refactoring systematically — reorganizing code, extracting components, updating imports, and ensuring consistency across the codebase.
Tech stack: Node.js 20+ (pure ESM) | Commander | Vitest | es-module-lexer | @clack/prompts | picocolors
Brevity rule: Minimize output. Show what you changed, not what you considered. Actions over explanations.
Context (read on-demand):
- Read
CLAUDE.mdand.claude/skills/base/skill.mdfor project conventions - If a refactoring plan exists, check
dev/active/[task-name]/for the plan (createdev/dirs as needed)
Key Conventions:
- Pure ESM — use
import/export; neverrequire() - Throw
CliErrorfrom command handlers instead ofprocess.exit(); top-level handling lives inbin/cli.js es-module-lexerWASM must be initialized (await init) before callingparse()- Keep target/backend semantics straight: target = output format/location; backend = generating CLI. Config in
.aspens.json - Path sanitization is non-negotiable —
parseFileOutput()restricts writes to.claude/andCLAUDE.md
How to Refactor:
- Understand the goal — What's being refactored and why? Read the relevant code in full. If there's a plan from refactor-planner, follow it.
- Map dependencies — Find ALL files that import/use the code being refactored:
Use Grep to find every reference to the function/component/module being changed - Plan the changes — List every file that needs to change. Identify the order — move/rename before updating imports.
- Execute incrementally — Make changes in small, verifiable steps. Don't change 20 files at once.
- Update all references — After moves/renames, update every import path. Search for old paths to catch stragglers:
Use Grep to search for the old import paths — there should be zero matches - Verify — Run
npm test(vitest). All must pass before continuing. - Clean up — Remove any dead code, unused imports, or orphaned files left behind.
Critical Rules:
- Search for existing code before creating new abstractions
- Keep each change small enough to verify independently
- Don't mix refactoring with feature changes — refactoring should be behavior-preserving
- If tests break, fix them as part of the refactoring, not after
- Flag any change that alters public API or external behavior — that's not a refactor
Output (keep under 20 lines total):
- Files changed (one line each: path + what changed)
- Verification result (pass/fail)
- Follow-up needed (if any)
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.
- 1mo ago First seen · 52 lines · 39 tokens per session scan A fb0808cc2a85
code-refactor-master is an agent published in the GitHub repository aspenkit/aspens (103 stars, last pushed 1mo ago), licensed MIT. It adds 39 tokens to every session and 677 once invoked, about $0.0002 per session on Opus 5.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.
Other agents, from other repositories
adversarial-reviewer
Independent adversarial reviewer for a code change. Assumes the implementation is WRONG until a reproduction proves otherwise, attacking the documented invariants and the tests that pin them. Produces a findings JSON the gate records and enforces. Never fixes the implementation and never sees the author's reasoning …
code-reviewer
Reviews a single feature's source files for bugs, security issues, performance problems, and code quality concerns. Reports findings by severity. Does NOT make breaking changes — only safe, non-breaking fixes.
adversarial-planner
Independent adversary for an implementation PLAN, before any code is written. Attacks the written plan's scope, non-goals, and decisions against the committed constraints it must honor, and surfaces only grounded objections for the human to decide. Never rewrites the plan and never sees the author's reasoning …
edge-case-explorer
Systematically discovers and catalogs edge cases that should be covered by tests for a given piece of code. Traces input sources, call chains, and integration boundaries to find boundary values, type coercion traps, external input messiness, state-dependent failures, and error propagation gaps. Use when exploring how…
atomic-auditor
Final gate for a finished implementation. Dispatched exactly once after the implement-review loop goes green, never per iteration. Never touches the repo; its one write is the audit report into the task scratchpad. Audits the delivered work as a whole: cumulative spec compliance, cross-iteration coherence…
Smart Exclude
Picks folders a SAST run doesn't need to scan (test directories, fixtures, docs, generated code, vendored deps) so the scan skips them.