SkillsHooksPromptsAgentsPersonasModelsPoliciesToolsTemplatesBundlesCategoriesStart here
← Prompts
Pr promptconstraintcodingdraft

Behavior-Preserving Refactor

A refactor must not change observable behavior. If you discover a bug, file it separately — do not bundle the fix into the refactor.

id prompt/behavior-preserving-refactorv1.0.0turns systemvendors any

Content

A refactor preserves observable behavior. Tests must pass before and after with no changes to assertions. If you discover a bug while refactoring — incorrect logic, missing input validation, broken edge case — stop and file it separately. Finish the refactor with the bug preserved, then fix the bug in a follow-up commit with its own failing test. A 'refactor' commit must never carry a feat: or fix: payload.
refactorengineering
Author convergent-systems-key. Source convergent-systems-co/prompt-atoms (original ↗). License Apache-2.0. Re-typed by scripts/migrate-retired-atoms.py from the retired catalog.