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 byx-darwin/gitflow-cli --skill gf-refactorgit clone --depth 1 https://github.com/byx-darwin/gitflow-cliWrote 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/byx-darwin/gitflow-cli/gf-refactor)<a href="https://agentmods.dev/skills/byx-darwin/gitflow-cli/gf-refactor"><img src="https://agentmods.dev/badge/skills/byx-darwin/gitflow-cli/gf-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/byx-darwin/gitflow-cli/gf-refactor"><img src="https://agentmods.dev/badge/skills/byx-darwin/gitflow-cli/gf-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.00100 | $0.04504 |
| Opus 5.5 | $0.00040 | $0.01802 |
| Sonnet 5.5 | $0.00020 | $0.00901 |
| Haiku 4.5 | $0.00010 | $0.00450 |
Grade A, and why
gf-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 24d 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 — 321 lines — stays where its author put it; the contents beside it link to each section on GitHub.
gf-refactor — Fowler Catalog-Driven Behavior-Preserving Refactoring
Executes RED→GREEN→REFACTOR's third stage: applies Fowler's refactoring
catalog to code that already has test coverage, one technique at a time,
verifying build and tests after every step. Downstream of /gf-smell
(finds problems) — this skill fixes them structurally, never behaviorally.
Preconditions
- Target code has test coverage; if not, do not refactor it — see When NOT to Refactor
- Language layer's build/test tooling installed — see
references/<lang>.md - Clean working tree before starting (uncommitted changes make the Safety Protocol's revert step ambiguous)
When to Use
| English | 中文 | Context |
|---|---|---|
| refactor this function | 重构这个函数 | apply a technique, not rewrite |
| extract function / method | 提炼函数 | reduce size/complexity |
| replace conditional with polymorphism | 以多态取代条件表达式 | eliminate type-code branching |
| clean up while keeping tests green | 边清理边保绿 | TDD REFACTOR stage |
| is this refactor safe | 这个重构安全吗 | semantic risk question |
When NOT to Use
| Scenario | Why Not | Use Instead |
|---|---|---|
| Finding smells/candidates in the first place | This skill acts on candidates, it does not hunt for them | /gf-smell |
| Pre-delivery quality gate | This skill changes structure, not gate pass/fail | /gf-quality |
| Any change to observable behavior is wanted | Not a refactor by definition | Regular TDD RED→GREEN change, separate commit |
When NOT to Refactor
| Scenario | Why Not |
|---|---|
| Code path has 无测试覆盖 | Nothing verifies behavior was preserved; write the test first, or refuse |
| The technique is tagged 条件等价/可能变更 and its precondition is unverified | Downgrade to suggestion per Semantic Safety Boundary — do not touch the code |
| A behavior change is also wanted alongside | Split into two changes; refactor first (green), then the behavior change as its own commit |
| Code is about to be deleted | No return on refactoring investment |
What ships with it
1 file 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.
- 24d ago Changed · +1 lines 2595be74d11b
- 28d ago First seen · 320 lines · 100 tokens per session scan A b7b7dc4495a3
gf-refactor is a skill published in the GitHub repository byx-darwin/gitflow-cli (3 stars, last pushed 22d ago), licensed MIT. It adds 100 tokens to every session and 4,504 once invoked, about $0.0004 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-09-19.
Other skills, from other repositories
adk-go-self-review
Review an ADK Go change the way a maintainer will — a fresh-context pass over the whole diff, five lenses (correctness and tests, scope, simplicity, style, adk-python parity), and the mutation check that proves your tests pin the change. Use before opening a PR, before any later push that changes code, and when asked…
software-test-review
Evaluate the quality of TDD tests against slice acceptance criteria, codebase conventions, and Red-phase execution results, producing a structured review with Accept or Revise recommendations. Use when tests written during the Red phase of red-green-refactor need quality review — checking coverage of acceptance…
software-code-refactoring
Improve production code quality while preserving all existing test behavior. Commonly used for the Refactor phase of TDD red-green-refactor, but applicable to any codebase with tests. Use when production code works but needs cleanup — reducing duplication, improving naming, simplifying complexity, aligning with…
ring:running-dev-cycle
Running the backend dev cycle: implements every task in a rolling-wave plan.md (ring:writing-plans format) for a Go/TS service, driving specialist agents through Gate 0 implementation/TDD, Gate 8 parallel review, and Gate 9 validation per epic, elaborating later phases at each phase boundary. Use when starting or…
gentle-ai
Use Gentle AI harness discipline for Pi work: clarify first, preserve OpenSpec artifacts, use strict TDD where available, delegate through subagents when useful, and protect review workload.
ring:instrumenting-streaming-events
Instrumenting streaming events: wires lib-streaming event emission end-to-end into a Lerian Go service via a 13-gate cycle (catalog, Builder bootstrap, Emit sites, outbox, HTTP manifest, NoopEmitter fallback, integration and chaos tests), dispatching ring:backend-go under TDD. Consumes the validated…