Safe refactoring rules

From Bottelet/DaybydayCRM · View interactive version

Safe refactoring rules is an AI agent skill from the GitHub repository Bottelet/DaybydayCRM. Ensures all refactoring is deterministic, behavior-preserving, and non-breaking

How to use this skill

Skill file

Safe Refactoring Rules

Purpose

Ensure all refactoring is deterministic, non-breaking, and behavior-preserving.

This skill enforces how changes are made, not how the system is structured.


1. Behavior Preservation


2. Existing Code Respect


3. Dependency Integrity


4. Public API Stability


5. Idempotency Requirement


6. Uncertainty Handling

If any of the following is unclear:

Then:


7. Abstraction Reuse Rule (Local Scope Only)

This skill only enforces reuse during refactoring operations.

Global abstraction policy is defined in application-architecture-standard.

Before introducing:

Search for an existing implementation.

Reuse existing abstractions whenever practical.

Duplicate abstractions are architectural defects.


8. Scope Discipline

This skill does NOT define:

It ONLY defines safe transformation rules.


9. Enforcement Priority

If this skill conflicts with others:

  1. application-architecture-standard
  2. domain-specific skills
  3. execution workflows
  4. this skill (always subordinate to architecture)
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.