refactor-workflow
Apply when changing the STRUCTURE of code while preserving its observable behavior exactly — extracting a unit, renaming, reshaping a module, splitting a god-function, moving a boundary, detangling coupling. Use this whenever the task is "refactor X", "clean up", "extract", "restructure", "detangle", or "preserve behavior but change how it is organized". The dominant failure mode is SILENT REGRESSION, so the rule is: capture a GREEN characterization net that pins current behavior BEFORE touching anything, change under that net, and prove behavior is identical after. This is the refactor instance of the one-spine change loop in feature-workflow; it delegates to that skill's change_new.py/change_check.py/verify.py gate-runners with --kind refactor. Do NOT use for new behavior (feature-workflow), bug fixes (fix-workflow), or approach-unknown problems (spike-workflow). For a boundary-level refactor, use boundary-discipline REFACTOR mode as the tool inside this loop.
What this skill does
# Refactor Workflow Change structure; preserve behavior **exactly**. The existing behavior *is* the spec — but it is `unknown` until proven, because you *believe* it does X without having pinned it. So the parse is a **characterization test net**, captured GREEN before any edit. Refactoring without it is editing on unparsed input. ## The loop (the feature-workflow spine, refactor instance) 1. **STEP 0 already classified this as a refactor.** Scaffold the manifest: `change_new.py --kind refactor --name "..."`. 2. **Parse the unknown (STAGE 0.5 equivalent):** capture characterization tests that pin the *current* observable behavior and run them GREEN. If you cannot make them green first, you do not yet understand the behavior you are about to preserve — stop. (See `references/characterize.md`.) 3. **Gate:** `change_check.py --kind refactor <manifest>` — blocks until the net is declared. 4. **Change under the net**, one behavior-preserving move at a time. A boundary move → use `boundary-discipline` REFACTOR mode. 5. **Verify obligation:** the same net is GREEN after, behavior identical, no new behavior added. `verify.py` gates ship. 6. **Record/ratchet:** a refactor that paid down real coupling is shelf signal; a near-regression the net caught is a `knowledge-ratchet` observation. ## The one law here A refactor changes exactly one thing — *structure* — and holds *behavior* invariant. If behavior must change too, it is not a refactor: split it into a refactor (under the net) plus a feature or fix (its own loop). ## Files - `references/characterize.md` — how to capture a behavior-pinning net cheaply.
Related in Productivity
gitea-workflow
IncludedOrchestrate agile development workflows for Gitea repositories using the tea CLI. Use when working with Gitea-hosted repos and asking to 'run the workflow', 'continue working', 'what's next', 'complete the task cycle', 'start my day', 'end the sprint', 'implement the next task', or wanting guided step-by-step development assistance. Keywords: workflow, orchestrate, agile, task cycle, sprint, daily, implement, review, PR, standup, retrospective, gitea, tea.
microsoft-graph-gateway
IncludedRoute Microsoft Graph work in this workspace. Use when users want to read or write Outlook mail, calendar events, contacts, OneDrive or SharePoint files, Teams, Planner, To Do, users, groups, directory data, or arbitrary Microsoft Graph endpoints from VS Code. Prefer WorkIQ for common read scenarios. Use Microsoft Graph for write actions and gap-read scenarios that need exact Graph properties, filters, permissions, or endpoints.
copilotkit
IncludedUse when building with CopilotKit — setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.
wordly-wisdom
IncludedProvides calibrated decision analysis using Charlie Munger-style multiple mental models, inversion, incentive mapping, circle-of-competence checks, misjudgment audits, second-order effects, and forecast updates. Use when the user asks for an oracle take, a hard call, a decision memo, a premortem, an outside view, a red-team, a sanity-check, what am I missing, think this through, or wants a strategy, hire, investment, plan, product, partnership, or major life choice analysed. Avoid for simple factual lookups or time-sensitive legal, medical, or market questions without fresh evidence.
swain-session
IncludedSession management and project status dashboard. Owns the full session lifecycle (start/work/close/resume), focus lane, bookmarks, worktree detection, and tab naming. Also serves as the project status dashboard — shows active epics, progress, actionable next steps, blocked items, tasks, GitHub issues, and recommendations. Worktree creation is deferred to swain-do task dispatch (SPEC-195). Triggers on: 'session', 'status', 'what's next', 'dashboard', 'overview', 'where are we', 'what should I work on', 'show me priorities', 'bookmark', 'focus on', 'session info'.
gandi
IncludedComprehensive Gandi domain registrar integration for domain and DNS management. Register and manage domains, create/update/delete DNS records (A, AAAA, CNAME, MX, TXT, SRV, and more), configure email forwarding and aliases, check SSL certificate status, create DNS snapshots for safe rollback, bulk update zone files, and monitor domain expiration. Supports multi-domain management, zone file import/export, and automated DNS backups. Includes both read-only and destructive operations with safety controls.