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 skills add adonai-labs/agent-runway --skill refactorgit clone --depth 1 https://github.com/adonai-labs/agent-runwayWrote 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/adonai-labs/agent-runway/refactor)<a href="https://agentmods.dev/skills/adonai-labs/agent-runway/refactor"><img src="https://agentmods.dev/badge/skills/adonai-labs/agent-runway/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.00095 | $0.01382 |
| Opus 5 | $0.00048 | $0.00691 |
| Sonnet 5 | $0.00019 | $0.00276 |
| Haiku 4.5 | $0.00010 | $0.00138 |
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 7d 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.
How it starts
The opening of the file, as written. The whole thing — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactor
Invoke Command
/refactor <description or file reference>
Examples:
/refactor OrderService is too large/refactor extract validation logic from CreateOrderHandler/refactor replace switch on payment type with strategy pattern/refactor this method is doing too much(with file open)
Not sure which skill to use? Start with
/start— it classifies intent and routes to the right skill.
Core Principle
Change structure, not behaviour. Every refactoring step must leave tests green.
If there are no tests, write characterisation tests first — they are the safety net.
Workflow
Step 1 — Understand Before Touching
Read safe-refactoring.md before starting any refactoring session.
- What does this code do end-to-end?
- Why does it need refactoring? Name the specific problem — see complexity-signals.md to confirm refactoring is justified.
- Are there existing tests? If not, write characterisation tests first — see the safety net section in safe-refactoring.md.
- What is the blast radius — what else depends on this?
Step 2 — Detect Smells Systematically
Run the relevant searches from systematic-smells.md against the target code. Document what you find.
Then name the specific problem using the smell table in reference.md before proposing a fix. If the smell is not in the table, describe it in terms of the complexity signals from complexity-signals.md.
Step 3 — Decide Scope and Priority
Use complexity-signals.md to determine:
- Is this a micro, targeted, or structural refactoring?
- Is this code a change hotspot (changes frequently + high complexity)?
- For structural refactors, consult the
architectskill before proceeding.
Priority order:
- Remove duplication — it multiplies every other problem
- Improve naming — often reveals deeper design issues
- Extract methods — restore readability and testability
- Introduce abstractions — only when a pattern clearly repeats
- Restructure to correct layer — move misplaced logic to where it belongs
What ships with it
4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 7d ago First seen · 134 lines · 95 tokens per session scan A 869bacf9468e
refactor is a skill published in the GitHub repository adonai-labs/agent-runway (2 stars, last pushed 17d ago), licensed MIT. It adds 95 tokens to every session and 1,382 once invoked, about $0.0005 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.
Other skills, from other repositories
next-action
Use when the user wants a next-action recommendation based on current state — reads handoff/git/lessons/STATE and proposes top-3 by impact. Trigger: '/next', 'what should I do next', 'next action'. Proposes only, never executes.
pull-request-automation
Audits and improves the pull request workflow for a GitHub repository. Covers PR description templates, auto-labelling, CODEOWNERS, PR size checks, and branch protection rules. Invoked when the user asks to improve the PR process, set up PR automation, or add a PR template.
PR Description Writer
Writes clear, thorough pull request descriptions from a diff or list of changes.
libretranslate-markdown-i18n
Machine-translate Markdown / Obsidian / Quartz content into other languages using a self-hosted LibreTranslate instance, preserving frontmatter, headings, emojis, bold/italic, wikilinks (![[...]]/[[...]]) and internal links. Use whenever a user wants to auto-translate a Markdown vault, Obsidian notes, or a…
apple-notes
Manage Apple Notes via memo CLI: create, search, edit.
himalaya
Himalaya CLI: IMAP/SMTP email from terminal.