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 skills/hamr0/liteagents/refactornpx skills add hamr0/liteagents --skill refactorgit clone --depth 1 https://github.com/hamr0/liteagentsWrote 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/skills/hamr0/liteagents/refactor)<a href="https://agentmods.dev/skills/hamr0/liteagents/refactor"><img src="https://agentmods.dev/badge/skills/hamr0/liteagents/refactor.svg" alt="Measured on agentmods" 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.00010 | $0.02303 |
| Opus 5 | $0.00005 | $0.01151 |
| Sonnet 5 | $0.00002 | $0.00461 |
| Haiku 4.5 | $0.00001 | $0.00230 |
Grade A, and why
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 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.
How it starts
The opening of the file, as written. The whole thing — 170 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactor $ARGUMENTS. A targeted refactor includes the performance pass below — it is on by default, not a separate command.
Guardrails
- Spawn a worker and explicitly select your tool's mid tier. State the tier on the spawn — do not omit it and rely on a default. An omitted tier inherits the parent's tier, which is not the same thing as the balanced one. Pick the judgment-capable tier that is cheaper and faster than your top reasoning tier. Not the cheapest/fastest tier: on judgment work it measurably degrades (misclassification rates several times higher). Choose by tier, not by a vendor model name copied from this file — names drift, and this command ships to several tools. Fall back to running inline if your tool has no subagent mechanism.
- Escalate, never assume. Anything you cannot decide, cannot verify, or that this spec does not cover → stop and report it to the orchestrator (the main session). Never improvise, never widen scope, never fix a side issue you noticed along the way.
- The worker does the work itself — no delegation. The fixer must not spawn subagents of its own. Every edit it reports, and every test run it cites, has to be one it made or ran with its own tool calls: a relayed "I fixed it and the suite is green" from a sub-worker is hearsay, and this command's whole output is the claim that a change landed and the tests still pass. A fix that delegates its work is a report about a report.
- The HITL gates below belong to the orchestrator, not the worker. A subagent cannot hold a conversation with the user, so it cannot run a gate that ends in stop and ask. When one trips — a failing test, a crossed public API boundary, a change bigger than the bullet asked for — the worker stops there and hands the situation back, with the options and its reasoning but no choice made. The orchestrator asks. A worker that picks revert / patch / update-test on the user's behalf has answered a question it was never allowed to ask.
- Edit only what a surviving bullet names. Ledger mode's scope is the bullets that survive revalidation, one change per bullet — not the neighbouring code, not the formatting, not a second finding noticed on the way past. Anything else goes back to the orchestrator to become a new bullet.
- Prove the blast radius with two checks, because neither sees what the
other does.
git status --porcelainat exit must list only files a surviving bullet named — that is this command's scope guarantee, and unlike/branch-reviewit is not expected to be empty. It cannot police the memory directory:.amp/is normally gitignored, so porcelain stays empty whether you deleted a fixed bullet, wrote nothing, or overwroteMEMORY.md. So also takemd5sum .amp/remember/*before you start and again before you report, and show the comparison: onlyfix-ledger.mdmay differ.last-review.mdin particular is/branch-review's to write — a fixer that touches it forges the gate that judges its own work.
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 · 170 lines · 10 tokens per session scan A 4064aea25551
refactor is a skill published in the GitHub repository hamr0/liteagents (22 stars, last pushed yesterday), licensed Apache-2.0. It adds 10 tokens to every session and 2,303 once invoked, about $0.0001 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-09-05.
Other skills, from other repositories
winui-session-report
Analyze the current or a recent agent session (GitHub Copilot CLI or Claude Code) and generate a diagnostic report. Use only when the user explicitly asks for session feedback, agent debugging, or a review of what happened during a build session. Do not inspect session data automatically.
spm-build-analysis
Analyze Swift Package Manager dependencies, package plugins, module variants, and CI-oriented build overhead that slow Xcode builds. Use when a developer suspects packages, plugins, or dependency graph shape are hurting clean or incremental build performance, mentions SPM slowness, package resolution time, build…
xcode-compilation-analyzer
Analyze Swift and mixed-language compile hotspots using build timing summaries and Swift frontend diagnostics, then produce a recommend-first source-level optimization plan. Use when a developer reports slow compilation, type-checking warnings, expensive clean-build compile phases, long CompileSwiftSources tasks…
code-explorer
Use this skill when exploring, analyzing, or understanding project/code structure. Required for tasks like "analyze project", "explore codebase", "understand how X works".
xcode-project-analyzer
Audit Xcode project configuration, build settings, scheme behavior, and script phases to find build-time improvements with explicit approval gates. Use when a developer wants project-level build analysis, slow incremental builds, guidance on target dependencies, build settings review, run script phase analysis…
webflow-code-component:troubleshoot-deploy
Debug deployment failures for Webflow Code Components. Analyzes error messages, identifies root causes, and provides specific fixes for common issues.