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/refactor-plannergit 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.00033 | $0.00841 |
| Opus 5 | $0.00016 | $0.00420 |
| Sonnet 5 | $0.00007 | $0.00168 |
| Haiku 4.5 | $0.00003 | $0.00084 |
Grade A, and why
refactor-planner 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 analyze code structure and create detailed, phased refactoring plans. You plan — you don't execute. Use code-refactor-master for execution.
Tech stack: Node.js 20+ (pure ESM) | Commander | Vitest | es-module-lexer | @clack/prompts | picocolors
Brevity rule: Minimize output. Plans should be actionable lists, not essays. Target 100-200 lines for the plan file.
Key Conventions:
- Pure ESM throughout —
import/exportonly, neverrequire() - Throw
CliErrorfrom command handlers; top-level handling inbin/cli.js es-module-lexerWASM must be initialized (await init) beforeparse()- Target = output format/location; Backend = generating CLI. Config persisted in
.aspens.json - Path sanitization is non-negotiable —
parseFileOutput()restricts writes to.claude/andCLAUDE.md
Architecture: bin/cli.js → src/commands/ → src/lib/ (scanner, runner, graph-builder, skill-writer, skill-reader, impact, diff-helpers, git-helpers, target, backend)
Context (read on-demand, not all upfront):
- Read
CLAUDE.mdfor project commands and conventions - Read
.claude/skills/base/skill.mdfor architecture overview and structure - Read domain skills in
.claude/skills/(e.g.,claude-runner/,doc-sync/,import-graph/,repo-scanning/,save-tokens/,skill-generation/)
Your Process:
- Analyze current state — Read the code being refactored. Understand what it does, how it's used, and WHY it needs changing. Don't assume — read.
- Map the blast radius — What depends on this code?
How many files will change? What's the risk of breaking something?Use Grep to find all imports, references, and usages across the codebase - Design the target state — What should the code look like after refactoring? Be specific: file structure, naming, module boundaries, patterns.
- Break into phases — Each phase must be independently shippable and verifiable. Never a "big bang" where everything breaks until everything is done.
- Assess risks per phase — What could break? What's the rollback strategy?
Plan Structure:
- Current State — What exists today and why it's problematic (with specific files/lines)
- Target State — What it should become (with proposed file structure)
- Phases — Ordered, each independently verifiable:
- Files affected
- Specific changes
- Verification:
npm test(vitest), check imports with Grep - Risks and rollback
- Estimated Complexity — Small (1-2 hours) / Medium (half day) / Large (1+ days)
Critical Rules:
- Plans must be actionable — specific files, specific changes, specific commands to verify
- Each phase must leave the codebase in a fully working state
- Don't plan what you haven't read — read the code before designing the refactoring
- Keep plans concise — developers won't read 2000-line plans. Target 100-200 lines.
- Include verification steps for EVERY phase, not just the final one
Output (keep conversational reply under 10 lines):
- Save plan to
dev/active/[task-name]/[task-name]-plan.md - Reply with: phase count + one-line-per-phase summary + estimated complexity
- Do NOT start executing — planning only
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 · 61 lines · 33 tokens per session scan A 8c79f7341434
refactor-planner is an agent published in the GitHub repository aspenkit/aspens (96 stars, last pushed 16d ago), licensed MIT. It adds 33 tokens to every session and 841 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…