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 hamakyo/okf-skills --skill refactor-safelygit clone --depth 1 https://github.com/hamakyo/okf-skillsWrote 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/hamakyo/okf-skills/refactor-safely)<a href="https://agentmods.dev/skills/hamakyo/okf-skills/refactor-safely"><img src="https://agentmods.dev/badge/skills/hamakyo/okf-skills/refactor-safely/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/hamakyo/okf-skills/refactor-safely"><img src="https://agentmods.dev/badge/skills/hamakyo/okf-skills/refactor-safely.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.00052 | $0.00515 |
| Opus 5.5 | $0.00021 | $0.00206 |
| Sonnet 5.5 | $0.00010 | $0.00103 |
| Haiku 4.5 | $0.00005 | $0.00052 |
Grade A, and why
refactor-safely 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 — 76 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactor Safely
When to use
Use this Skill when:
- Reducing duplication.
- Improving naming or structure.
- Extracting helpers or simplifying control flow.
- Preparing code for a later change while preserving behavior.
Do not use this Skill when:
- User-visible behavior must change.
- Public APIs, schemas, migrations, or data contracts must change.
- The code is not covered enough to safely refactor and no validation plan exists.
Inputs
- Target files, modules, or code smell.
- Reason for the refactor.
- Available tests or validation commands.
- Relevant OKF docs when architecture or contracts are documented.
Required context
Before editing, read:
- Existing code around the target area.
- Tests that cover the behavior.
- Relevant OKF architecture, data, or feature documents.
- Public API, schema, or integration boundaries.
Workflow
- Define the behavior that must remain unchanged.
- Identify public APIs, schemas, data contracts, and external behavior that must not move.
- Run or identify baseline tests when available.
- Make the smallest meaningful structural change.
- Avoid mixing formatting-only changes with logic movement unless the repository already does so.
- Run targeted tests.
- Compare the diff to confirm behavior was preserved.
- If a behavior change becomes necessary, stop and switch to
implement-featureor ask for confirmation.
Guardrails
- Do not change behavior intentionally or accidentally.
- Do not change public APIs, schemas, migrations, serialized formats, or user-visible text without explicit approval.
- Do not perform broad cleanup outside the requested area.
- Do not introduce new dependencies unless explicitly justified.
- Do not remove tests to simplify the refactor.
- Do not update OKF unless architecture, boundaries, or maintainership knowledge changed.
Completion checklist
- Behavior to preserve was identified.
- Public APIs and schemas were checked.
- Diff is small and scoped.
- Tests or validation were run.
- Any residual risk is stated.
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 · 76 lines · 52 tokens per session scan A aad0a3bbcbbb
refactor-safely is a skill published in the GitHub repository hamakyo/okf-skills (2 stars, last pushed 1mo ago), licensed MIT. It adds 52 tokens to every session and 515 once invoked, about $0.0002 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
ai-slop-cleaner
Clean AI-generated code slop with a regression-safe, deletion-first workflow and optional reviewer-only mode.
debug
Diagnose the current OMC session or repo state using logs, traces, state, and focused reproduction.
hns-lsel-curator
Local Self-Evolution Loop (LSEL) curator — the CLUSTER + drain engine for the GOOS-local PROPOSE→APPLY seam closure (SPEC-LSEL-LOCAL-EVOLUTION-001). Companion-offset drain of .moai/lessons-inbox.jsonl with a drain-side severity filter that drops the 65% Bash-timeout/sandbox noise, eventkey clustering with a frequency…
moai-lane-watchdog
One lane stall watchdog iteration: measure lane progress on three channels, classify the stall cause, apply the remedy or resolve the judgment through the decision ladder — instead of waiting on a reply — then record the outcome and report. Reads the unified --auto doctrine at…
five-whys
Finds the root cause of a bug, failure or recurring problem by asking "why" until the answer is a cause you can fix. Use when the user asks why something keeps happening, or wants the root cause rather than a quick fix.
moai-workflow-loop
Ralph Engine - Automated feedback loop with LSP diagnostics and AST-grep integration for continuous code quality improvement. Use when implementing error-driven development, automated fixing, or continuous quality validation workflows.