/fff:refactorfrom fff
Identifies refactoring targets using coverage and complexity tools, then refactors under green tests. Generates plan tasks rather than ad-hoc edits.
Ships in fff. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Improve maintainability by finding the right targets first, then refactoring under green tests. Uses the stack's coverage and complexity tools to pick what to touch.
Produces a refactor plan via audit --plan (when invoked through the refactor cartridge) or directly via this skill (when invoked standalone).
/audit --type refactor surfaces findings; audit --plan generates a refactor plan./refactor src/auth/). Default: scan the whole project..ffflow/config.yaml for stack and thresholds./tmp/ffflow-plans/<project-hash>/refactor-<slug>/ (project-hash from sha256(pwd) | head -c 16, same convention as plan-chat/plan-status). Never write plan artifacts into the repo (no ./plan/); the plan dir is transient and plan-status/plan-breakdown locate it by the pwd-hash. Ready for breakdown and capture.work-issue, a list of small in-PR refactors with their justifications.Invoke /audit --type refactor to get the list of refactor candidates. It runs the stack's complexity/coverage/duplication tools and emits findings with severity and impact / (complexity + 1) ordering already applied.
/audit --type refactor
This skill does not reimplement the scanning logic. /audit --type refactor is the single source of truth for "what's worth refactoring." When invoked via audit --plan, the findings are already computed and ready to consume.
If you want to refactor a specific target the auditor didn't surface (e.g., a hunch you have), name it explicitly when invoking refactor and skip the audit step.
Before any refactor, confirm tests are green:
just check-all
If the suite isn't green, refactoring is forbidden until it is. The user's first task becomes "fix the failing tests."
For each target, draft a task. One target ≈ one task ≈ one PR:
# Task: Reduce complexity in src/auth/signup.py
## Behavioral scope
None. Pure refactor; no spec change.
## Implementation scope
- Functions: `signup_user`, `validate_signup_request`, `persist_signup`.
- Pattern: extract methods for validation and persistence phases.
## Out of scope
- Behavior change.
- Touching other modules with similar issues — separate tasks per file.
## Acceptance
- [ ] Complexity warnings on this file cleared.
- [ ] Existing tests pass with no modification.
- [ ] No new public API.
Refactor tasks always include the no spec change flag — they don't trigger spec audits. If a refactor would change observable behavior, it's not a refactor; it's a feature, and goes through plan-chat.
Refactor tasks at L2/L3 have no spec/RID delta — this is expected, not a gap. A pure refactor adds no new .feature Rule, scenario, or RID because behavior doesn't change. The existing RID scenarios are the guardrail: they must pass unmodified through the refactor. So when plan-capture/work-* see a refactor task with an empty "Behavioral scope," that is correct — do not treat the absent spec delta as missing coverage, and do not invent a RID to fill it. The task's acceptance is "existing RIDs still green, complexity/LoC target met," not "new RID added." (See quality-gates on spec liveness — a refactor keeps specs live without adding to them.)
plan-breakdownThe generated /tmp/ffflow-plans/<project-hash>/refactor-<slug>/ flows through the normal pipeline:
/plan-breakdown → /plan-capture → work
Choosing the execution step:
/work-epic: one feature branch, one squashed commit per task, one PR for the whole epic, you approve the merge. This is the right default for a refactor plan with more than one task./work-issue <issue>./work-fanout.Do not default to one-branch-per-task; a refactor epic ships as a unit.
/audit --type architecture findings simultaneously./audit --type refactor)./characterize if it's a black-box module.plan-chat.| When | Mode | Why |
|---|---|---|
During work-issue on an unrelated task | Inline, in-PR, only if small and obvious | Stay scoped. Big refactors are separate tasks. |
Triggered by /audit --type refactor findings | Plan via audit --plan | Findings deserve dedicated PRs. |
| Standalone "let's clean this up" | Plan via this skill | Same. |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub zerotechdebt/ffflow --plugin fffOther plugins' skills for the same job
38 skills in this plugin
/adopt-ffflowEnd-to-end onboarding for a new FFFlow project. Runs init-ffflow, stack-init, then hands off to plan-roadmap to phase out the work (greenfield or brownfield — roadmap figures out the right per-phase entry point). Use `--ui` to adopt FFFlow's view-layer-purity structure (the frontend sibling of hexagonal) on an already-adopted project./auditRun the FFFlow keep-honest auditors against this project. Coordinator with per-type cartridges (CLAUDE.md freshness, spec drift, characterization tests, architecture conformance, complexity/refactor signals, and L3 RID traceability). Use --type to target one; --plan to convert findings into work./autopilotMeta-skill that wraps any interactive skill for unattended execution. Reads project context to stand in for the user on routine decisions, with a decision log.