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 mystilleef/spae-framework --skill refactorgit clone --depth 1 https://github.com/mystilleef/spae-frameworkWrote 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/mystilleef/spae-framework/refactor)<a href="https://agentmods.dev/skills/mystilleef/spae-framework/refactor"><img src="https://agentmods.dev/badge/skills/mystilleef/spae-framework/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/mystilleef/spae-framework/refactor"><img src="https://agentmods.dev/badge/skills/mystilleef/spae-framework/refactor.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.00021 | $0.02037 |
| Opus 5.5 | $0.00008 | $0.00815 |
| Sonnet 5.5 | $0.00004 | $0.00407 |
| Haiku 4.5 | $0.00002 | $0.00204 |
Grade D, and why
refactor scanned grade D with 2 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 6d 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.
Hidden instructionshighPrompt injection
Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.
<!-- prettier-ignore-start --> Strips warnings and disclaimersmediumAnti-refusal
Omitting safety caveats hides risk from the user and is a common jailbreak preamble.
- Code compiles without warnings or missing dependencies. How it starts
The opening of the file, as written. The whole thing — 215 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactoring agent
When to use
- Rule of Three: third instance triggers extraction. Exception: security and validation logic warrants unification at 2+.
- Adding features: restructure to accommodate the change first.
- Fixing bugs: clarify structure to expose the error.
- Code review: improve unfamiliar code incrementally.
- Smells detected: see the violation catalog in
references/refactoring-guide.md.
Goal
- Execute disciplined, semantics-preserving transformations to remove
DRY,SOLID, andStructureviolations, improving maintainability without altering observable behavior.
Input
Determine scope by the first available source:
- Files or folders provided by the user.
- Current changes in the repository.
Halt if no scope exists.
Current changes: staged and unstaged edits, deletions, and renames
of tracked files, plus new untracked files. Requires a versioned
project.
Testing
See references/testing-guide.md for test structure, isolation,
mocking, assertion, and performance standards, and for selecting
project testing guides (TESTING*.md at the project root). Project
guides override it on conflict.
Shell commands
See references/shell-command-guide.md for command safety, timeouts,
redirects, and non-interactive environment directives.
Cleanup
See references/cleanup-guide.md for the Self-cleanup checklist and
diff-only audit scope.
Workflow
- GATE—Precondition guard. Halt immediately on failure.
- Halt if no scope exists.
- Read
references/testing-guide.mdand each project testing guide covering the files under test. - Read
references/shell-command-guide.md. - Read
references/cleanup-guide.md. - Read relevant production code, adjacent tests, and test commands.
- Confirm automated test suite passes before touching code.
- Detect
antipatternsusing theDRY,SRP,OCP,LSP,ISP,DIP, andStructuresections of the violation catalog inreferences/refactoring-guide.md, plus long methods andprimitiveobsession. - Record one detection line for each section and one for those remaining smells: code examined (or why none applies) and violations found.
- Short-circuit: emit
Result: No Changesonce every line exists and none found a violation. - When detected smells carry high regression risk resisting safe
atomic extraction under existing tests: record in
Findings, omit edits, and emitResult: No Changes.
- ORIENT—Name the smallest production area worth refactoring and
what won't change. Capture pre-task baseline snapshot per
references/cleanup-guide.md. - PLAN—Declare the minimal change and rationale.
- Target one cohesive responsibility boundary (for example, extracting a dedicated collaborator, domain service, or validation module) rather than whole-class overhauls or disconnected micro-edits.
- Declare the ordered sequence of transformations needed to decouple that responsibility.
- Analyze package, module, or class boundaries for cyclic imports and unresolved downstream consumers.
- Select the fix from the playbook, resolving compound violations
with the triage rules in
references/refactoring-guide.md.
- ACT—Apply one transformation at a time. Execute only what PLAN declared.
- VERIFY—Loop over every criterion declared in PLAN:
- Run the full suite after each
ACTstep. - Audit task edits against the pre-task baseline using the
Self-cleanup checklist in
references/cleanup-guide.md, removing every self-introduced artifact before proceeding. - For each unmet criterion: backtrack to last known-good state,
return to
ACT, and re-enterVERIFY. - Exit only when all criteria pass.
- Halt only for out-of-scope blockers (failing baseline tests, compilation errors, or missing runtime environments), never for complex codebase smells.
- Run the full suite after each
- REPORT—Emit the result following the result directives and using the result template.
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.
- 6d ago Changed · +13 lines 3a374b332ee9
- 10d ago Changed · -12 lines 6ead00756f8a
- 13d ago Changed · +2 lines 6aa45dce2599
- 18d ago Changed · +2 lines 4073f81fe3b6
- 21d ago Changed · +7 lines 72396fbcbb62
- 24d ago Changed · +9 lines f85f58d4c680
- 1mo ago Changed 8158d82bf0ca
- 1mo ago Changed · +22 lines 3f074e09e8d1
- 3mo ago First seen · 172 lines · 21 tokens per session scan D 59617178c60a
refactor is a skill published in the GitHub repository mystilleef/spae-framework (2 stars, last pushed 5d ago), licensed MIT. It adds 21 tokens to every session and 2,037 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it D with 2 findings (hidden instructions, strips warnings and disclaimers). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
refactor compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| refactormystilleef/spae-framework | Skill | 2 | 5d ago | MIT | D | 21 | Claude Code |
| ahk-triageenmanuelmag/agent-harness-kit | Skill | 183 | 1mo ago | Apache-2.0 | A | 29 | Claude Code |
| ahk-askenmanuelmag/agent-harness-kit | Skill | 183 | 1mo ago | Apache-2.0 | A | 37 | Claude Code |
| windows-encoding-fixesoleg494/coding-kit | Skill | 3 | 14d ago | MIT | A | 109 | Claude Code, Codex |
| fix-and-verifyRyosukeSAMA/github-ai | Skill | 6 | 22d ago | MIT | A | 38 | Codex |
| systematic-debuggingRobinBeraud/hermes-skills | Skill | 11 | yesterday | none | A | 16 | Claude Code, Codex |
| sitemap-link-checkerRobinBeraud/hermes-skills | Skill | 11 | yesterday | none | A | 46 | Claude Code, Codex |