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.
npx agentmods add agents/aspenkit/aspens/code-refactor-mastergit clone --depth 1 https://github.com/aspenkit/aspensWhat 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 | $0.00039 | $0.00677 |
| Opus 5 | $0.00019 | $0.00338 |
| Sonnet 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 yesterday.
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.
- yesterday First seen · 52 lines · 39 tokens per session scan A fb0808cc2a85
code-refactor-master is an agent published in the GitHub repository aspenkit/aspens (96 stars, last pushed 16d ago), licensed MIT. It adds 39 tokens to every session and 677 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.
Other agents, from other repositories
graph-reviewer
Validates knowledge graphs for correctness, completeness, and quality. Runs systematic checks and renders approval or rejection decisions.
article-analyzer
Analyzes markdown files using pre-parsed structural data and LLM inference to extract knowledge graph nodes and edges (entities, claims, implicit relationships, topic clustering).
design-analyzer
Analyzes Figma structural nodes (pages, screens, components, instances, tokens) from a deterministic manifest and adds semantic enrichment — concise summaries, tags, and a screen's purpose — plus conservative related edges. Does NOT invent structural nodes or edges.
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…
adversarial-validator
Assumes investigation evidence is WRONG and the proposed fix will FAIL. Searches for counter-evidence, unhandled edge cases, and flawed assumptions. Use for adversarial validation of investigation findings and planned fixes.
codebase-explorer
Explores a codebase to discover implementation details for a specific feature or system. Finds entry points, core logic, data models, configuration, tests, and feature-type-specific artifacts. Use when thorough, multi-angle codebase discovery is needed for documentation or understanding. Does not research options or…