canon-refactor

Automate governed refactor runs that preserve existing behavior via Canon.

1|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/apply-the/canon --skill canon-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: canon-refactor
Source: https://github.com/apply-the/canon/tree/main/.agents/skills/canon-refactor
Command: npx skills add https://github.com/apply-the/canon --skill canon-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates and standardizes governed refactor runs to preserve existing system behavior while collecting no-feature-addition evidence, ensuring auditability and safety.

Core Features & Use Cases

  • Preserved Behavior: Canon runs preserve existing behavior during refactors, minimizing regression risk.
  • Evidence & Persistence: Packets and evidence are persisted for traceability and review.
  • Input-Driven: Requires a risk, zone, and an authored input (brief or inline note) to guide the refactor.

Quick Start

Start a governed refactor by supplying risk, zone, and an authored input to canon run --mode refactor --system-context existing.

Frequently Asked Questions about canon-refactor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a governed refactor to preserve existing behavior?

Run a governed refactor by supplying risk, zone, and an authored input to the system, which then performs preflight checks and executes the refactor body safely without introducing new behavior.

What is an AI-assisted change management packet in a refactor workflow?

An AI-assisted change management packet is a persisted record of refactor evidence and system context that ensures auditability and traceability during governed system modifications.

How do I start a refactor run with a bounded preservation brief?

Start a refactor run by supplying a bounded preservation brief as an authored input along with the designated risk and zone parameters to guide the automated execution.

Does this refactoring approach work for scenarios where no new features should be added?

Yes, this approach is specifically designed for scenarios requiring behavior preservation, ensuring the refactor collects evidence and persists packets without introducing any new system behavior.

What inputs are required to execute a safe governed refactor?

Executing a safe governed refactor requires three authored inputs: a risk assessment, a designated zone, and a brief or inline note to guide the preservation-focused execution.

When should I not use a behavior-preserving refactor approach?

Avoid this behavior-preserving refactor approach when the goal involves adding new features or functionality, as it is strictly designed to standardize existing system modifications and collect no-feature-addition evidence.