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.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.00052 | $0.00515 |
| Opus 5 | $0.00026 | $0.00258 |
| Sonnet 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 8d 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.
- 8d 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 18d ago), licensed MIT. It adds 52 tokens to every session and 515 once invoked, about $0.0003 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
dev-doctor
Run a development-focused health check on the AIWG repository structure.
config-validator
Validate AIWG configuration files and project setup for correctness and completeness.
mulmoterminal-bug-report
Help desk for "MulmoTerminal is broken". Hears out the symptom, then checks whether the behaviour is actually configuration or by design — reading the real config, schema and version rather than guessing — searches the existing issues, and only files a GitHub issue for what survives all of that, with the environment…
aiwg-doctor
Run a comprehensive health check on the AIWG installation and workspace with pass/fail diagnostics and remediation steps.
browser-doctor
Read-only health check on browser-control setup. Verifies browser binary, Playwright MCP Bridge extension presence, token file mode/contents, AIWG MCP registration, provider config injection, and optional workspace allow-list. Outputs pass/fail per check with remediation commands.
debug
Systematic 4-phase debugging with escalation protocol. Use when saying "debug", "investigate bug", "find root cause", "why is this failing", or "fix this bug".