Skip to content

New skill: refactor, behaviour-preserving and proven rather than asserted #6

Description

@ms-shashank

A refactor is the one change where "it still works" is the entire acceptance criterion, and it is the change most likely to be claimed rather than proven.

Scope

plugins/refactor/skills/refactor/SKILL.md, tools: full.

  • Establish the baseline FIRST. Run the suite before touching anything and record the result. A refactor with no green baseline is not a refactor, it is a rewrite with optimism.
  • One behaviour-preserving change at a time, each with the suite run after it. Bundling is how a refactor smuggles in a bug nobody can find later.
  • Refuse to bundle a behaviour change. If a fix is spotted along the way, name it and leave it. "I noticed X and did not change it" is the correct output.
  • Say what the tests do NOT cover. If a module has no tests, a refactor of it is unproven, and the honest report says so instead of "all tests pass".
  • Report the diff by intent, not by file: what moved, what was renamed, what was extracted, and what stayed identical.

Acceptance

  • Requires a recorded green baseline before the first edit
  • Requires the suite between changes, not only at the end
  • Explicitly forbids folding a fix into a refactor, with the wording to use instead
  • Requires stating the coverage gap when the touched code is untested
  • plugin.json and marketplace.json updated

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions