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 Razaib-khan/ForgeWeave --skill refactor-enginegit clone --depth 1 https://github.com/Razaib-khan/ForgeWeaveWrote 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/razaib-khan/forgeweave/refactor-engine)<a href="https://agentmods.dev/skills/razaib-khan/forgeweave/refactor-engine"><img src="https://agentmods.dev/badge/skills/razaib-khan/forgeweave/refactor-engine/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/razaib-khan/forgeweave/refactor-engine"><img src="https://agentmods.dev/badge/skills/razaib-khan/forgeweave/refactor-engine.svg" alt="Reviewed on agentmods" width="80" 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.00023 | $0.00607 |
| Opus 5.5 | $0.00009 | $0.00243 |
| Sonnet 5.5 | $0.00005 | $0.00121 |
| Haiku 4.5 | $0.00002 | $0.00061 |
Grade A, and why
Refactor Engine 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 1mo 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 — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactor Engine
Purpose
Restructure existing code to improve readability, performance, and maintainability while preserving exact external behavior. Every refactor is verified by ensuring existing tests continue to pass and no observable behavior changes.
When to Use
- Code has duplicated logic that should be extracted
- A function or module is too long or does too many things
- Naming is unclear or inconsistent with project conventions
- Performance can be improved by algorithmic changes
- Dead code, commented-out code, or unused imports need removal
When Not to Use
- The code has a bug — use
debuggerfirst - New features need to be added — use
code-builder - The code works fine and doesn't need changes
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
target |
string | Yes | File, module, or code area to refactor |
goal |
enum | Yes | clarity, performance, maintainability, or all |
constraints |
string | No | What must NOT change (public API, performance bounds) |
Expected Outputs
| Output | Description |
|---|---|
| Refactored code | Restructured code preserving external behavior |
| Diff summary | What changed and why |
| Verification | Test results confirming no behavior change |
Exact Workflow Steps
- Read and understand the target code fully
- Run existing tests to establish baseline
- Identify refactoring opportunities (duplication, complexity, naming)
- Apply one refactoring at a time (small, atomic changes)
- Run tests after each change to confirm no regression
- Repeat until all planned refactorings are applied
Required Checks
- All existing tests pass before and after
- No public API changed unless explicitly requested
- Each change is atomic (one concern per change)
- No dead code or debug artifacts left behind
Failure Modes
| Failure Condition | Response |
|---|---|
| Test fails after refactor | Revert last change and re-approach differently |
| Refactor touches too many files | Break into smaller, focused refactors |
| Goal is unclear | Ask for specific examples of what to improve |
What ships with it
2 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.
- 1mo ago First seen · 84 lines · 23 tokens per session scan A de34351916f0
Refactor Engine is a skill published in the GitHub repository Razaib-khan/ForgeWeave (1 stars, last pushed 4mo ago), licensed MIT. It adds 23 tokens to every session and 607 once invoked, about $0.0001 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-31.
Other skills, from other repositories
pr-writing-review
Extract and analyze writing improvements from GitHub PR review comments. Use when asked to show review feedback, style changes, or editorial improvements from a GitHub pull request URL. Handles both explicit suggestions and plain text feedback. Produces structured output comparing original phrasing with reviewer…
bloat-detector
Detects codebase bloat via dead code, duplication, complexity, and doc bloat scans. Use when codebase feels large or before a release.
brooks-lint
AI code reviewer grounded in classic software engineering books for catching design smells, coupling issues, and architectural risks.
auto-review
A code-review skill that examines changed code using the TRUST 5 criteria and automated checks. It can review files, commit ranges, or changes assigned a risk level, with optional review strategies and providers.
ax-annotation
@AX code annotation workflow skill for agent-driven tag application.
ddd
A development method for improving existing code while preserving its current behavior. It follows an analyze, preserve, and improve cycle, using tests and small changes to reduce unintended effects.