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 sd0xdev/sd0x-harness --skill refactorgit clone --depth 1 https://github.com/sd0xdev/sd0x-harnessWrote 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/sd0xdev/sd0x-harness/refactor)<a href="https://agentmods.dev/skills/sd0xdev/sd0x-harness/refactor"><img src="https://agentmods.dev/badge/skills/sd0xdev/sd0x-harness/refactor.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.00065 | $0.02898 |
| Opus 5 | $0.00032 | $0.01449 |
| Sonnet 5 | $0.00013 | $0.00580 |
| Haiku 4.5 | $0.00006 | $0.00290 |
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 3d 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 — 268 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactor — Multi-Target Refactoring Orchestrator
Trigger
- Keywords: refactor, cleanup, clean up, simplify code, restructure, tidy up, reduce complexity, batch refactor
- zh-TW: 重構, 整理, 清理, 簡化
When NOT to Use
| Scenario | Alternative |
|---|---|
| New feature development | /feature-dev |
| Bug fix | /bug-fix |
| Code understanding | /code-explore |
| Doc review only | /codex-review-doc |
| Single file simplify (known target) | /simplify directly |
| Remove AI artifacts (known doc) | /de-ai-flavor directly |
Prohibited Actions
❌ git add | git commit | git push — per @rules/git-workflow.md
budget:token_budget150000</budget:token_budget>
Arguments
| Flag | Default | Description |
|---|---|---|
--target <path> |
— | Specific file or directory (repo-relative) |
--auto |
— | Auto-detect targets using inline metrics |
--max-targets N |
10 | Maximum targets per run |
--mode reference-stability |
— | Narrow pointer-conversion pass (see § Reference-Stability Targets). Requires explicit --target files — repeat the flag for multiple files (--target a.md --target b.js, ≤ 5); incompatible with --auto |
Workflow
Phase 0: Target Detection → Phase 2: Incremental Refactor Loop → Phase 3: Report
(Phase 1: reserved for v2 — parallel exploration)
Phase 0: Target Detection & Planning
--mode reference-stability Branch (checked first)
When this mode is passed, Phase 0 takes this branch and bypasses the generic pipeline
below entirely — no AI-artifact heuristic, no refactor-catalog classification, and no v2
type skip (the mode accepts any maintained text file its transformation table covers: docs,
code, tests, instruction surfaces — a *.test.js target is valid here even though the
generic path skips test files as v2). In code and test files, only comment and
documentation regions are conversion candidates: executable strings, assertion
expectations, fixtures, snapshots, generated content, and ordinary data are never touched —
that is INV-005's boundary, and it is what makes skipping the behavioral gate sound (an
eligible prose-only comment cannot change runtime behavior — tool-consumed directives and
pragmas such as lint/type-checker directives or source-map metadata are not eligible
regions, since comments can carry machine semantics; anything that could change behavior is
out of this mode's reach):
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.
- 3d ago First seen · 268 lines · 65 tokens per session scan A 4458b29ae759
refactor is a skill published in the GitHub repository sd0xdev/sd0x-harness (188 stars, last pushed yesterday), licensed MIT. It adds 65 tokens to every session and 2,898 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-09-03.
Other skills, from other repositories
code-review
Two-mode skill: (1) adversarial review — spec compliance + code quality + security, confidence-scored findings with file:line evidence; (2) receiving review — verify-before- agreeing discipline for acting on external/human review feedback.
codebase-hygiene
Two-mode skill: (1) find semantic duplicates — functions doing the same thing under different names, invisible to copy-paste detectors; (2) deepen shallow modules — thin wrappers and pass-through layers that spread complexity. Advisory and read-only; changes route through BUILD with full gates.
evaluator-review-contract
Internal Auto-Harness evaluator skill for sprint contract review before implementation. Use only inside the Evaluator subagent during review mode.
comet-verify
Comet Phase 4: Verify and Close. Invoke with /comet-verify. Verify implementation matches design, handle development branch.
comet-review
A read-only review guide for checking the current Comet change, a managed software-change workflow. It focuses on correctness, security, and boundary problems without changing files or advancing the workflow.
comet-github-pr-review
A read-only review process for pull requests in Comet's GitHub repositories. A pull request is a proposed code change; the review checks its current code, related issue, comments, merge status, and automated checks.