Borrowing it
Nothing to install: this file belongs to actionhero/keryx. 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/actionhero/keryx/main/.claude/skills/refactor/SKILL.mdgit clone --depth 1 https://github.com/actionhero/keryxWrote 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/actionhero/keryx/refactor)<a href="https://agentmods.dev/skills/actionhero/keryx/refactor"><img src="https://agentmods.dev/badge/skills/actionhero/keryx/refactor/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/skills/actionhero/keryx/refactor"><img src="https://agentmods.dev/badge/skills/actionhero/keryx/refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00087 | $0.00949 |
| Opus 5.5 | $0.00035 | $0.00380 |
| Sonnet 5.5 | $0.00017 | $0.00190 |
| Haiku 4.5 | $0.00009 | $0.00095 |
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 2mo 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 — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactoring Workflow
Refactoring means changing code structure without changing behavior. Every step must preserve the existing test suite and public API contracts.
Phase 1: Understand Before Touching
- Read the target code — understand what it does, who calls it, and what depends on it
- Check for tests — find existing test coverage for the code being refactored
- Search in
packages/keryx/__tests__/for framework code - Search in
example/backend/__tests__/for app code
- Search in
- Run the existing tests to establish a green baseline before making changes:
cd packages/keryx && bun test # framework code cd example/backend && bun test # app code - Check for stale processes if tests behave unexpectedly:
ps aux | grep "bun keryx" | grep -v grep
Phase 2: Plan the Refactoring
Before writing code, state the plan concisely:
- What structural change you're making and why it improves the code
- Which files will be created, modified, or deleted
- Any import paths that will change
- Whether the public API surface changes (it shouldn't)
If the refactoring is large (touches more than 5 files), break it into incremental steps where tests pass after each step.
Phase 3: Make Changes
Apply changes incrementally. After each logical step, verify nothing broke.
Import Conventions (must follow)
- In
packages/keryx/— use relative imports:import { api } from "../api"; import { Action } from "../classes/Action"; - In
example/backend/— use"keryx"for framework, relative for app-local:import { api, Action, type ActionParams, HTTP_METHOD } from "keryx"; import { SessionMiddleware } from "../middleware/session";
Code Quality Rules
- No
as any— use@ts-expect-errorwith a comment if the type system can't express something - JSDoc annotations on any new or modified public APIs in
packages/keryx/ - Don't add unnecessary abstractions — three similar lines are better than a premature helper
- Don't add comments, docstrings, or type annotations to code you didn't change
- If something is unused after the refactor, delete it completely — no
_unusedrenames or// removedcomments
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.
- 2mo ago First seen · 102 lines · 87 tokens per session scan A 5b398fc043dd
refactor is a skill published in the GitHub repository actionhero/keryx (46 stars, last pushed 8d ago), licensed MIT. It adds 87 tokens to every session and 949 once invoked, about $0.0003 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 skills, from other repositories
refactor
A code-refactoring aid for changing several files, finding code smells, and applying established design patterns. Code smells are signs that code may be hard to maintain.
mk:simplify
Post-implementation simplification pass. Reduces complexity without changing behavior. Use after Phase 3 (Build GREEN) and before Phase 4 (Review). Catches dead code, unnecessary abstractions, over-engineering, and redundant patterns. Triggers on "simplify", "clean up", "reduce complexity", "too complex". NOT for…
Code Simplifier
Rewrites code to its simplest possible form while preserving exact external behavior (KISS, YAGNI).
code-simplifier
Review RTK Rust code for idiomatic simplification. Detects over-engineering, unnecessary allocations, verbose patterns. Applies Rust idioms without changing behavior.
clean-code-dotnet
Clean Code principles adapted for C#/.NET including naming, variables, functions, SOLID, error handling, and async patterns. Use when: (1) reviewing C# code, (2) refactoring for clarity, (3) writing new code, (4) code review feedback.
pdf-toolkit
PDF processing - extract text, merge, split, OCR, info, watermark.