From aegis
Governs safe retirement of old logic, fallback collapse, duplicate-owner cleanup, and deletion decisions at schema/persistence boundaries.
How this skill is triggered — by the user, by Claude, or both
Slash command
/aegis:anti-entropy-governanceThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill when the task is not merely "change code" but "remove old paths
Use this skill when the task is not merely "change code" but "remove old paths safely without growing entropy".
This skill chooses between:
delete-first for internal code retirementcompat-exception for proven external dependency boundariesconfirmation-first for persistent-state or irreversible object deletionIt does not replace brainstorming, writing-plans,
systematic-debugging, or verification-before-completion. It is a narrow
governance owner for retirement, fallback collapse, duplicate-owner cleanup,
and deletion safety.
Use when any of these are true:
Do not use for:
This skill should be composed by other owners. It should not become a new global hot-path entry.
Prefer composition from:
brainstorming for approach selection involving retirement or persistence riskwriting-plans for plans that delete old paths or touch schema / migration /
persistencesystematic-debugging when the tempting fix is fallback growth or
delete-vs-retainverification-before-completion for cleanup / retirement / compatibility /
migration closeoutDo not load this directly from using-aegis unless explicitly requested.
Default to reducing internal entropy, not preserving internal history.
Use this rule:
delete-firstcompat-exception only with active
dependency evidenceconfirmation-firstUnknown dependency is not active dependency evidence.
Mentioning, loading, or discussing destructive-action rules never authorizes destructive execution. Without explicit scoped user confirmation:
Classify the deletion target first:
code-retirement
contract-carrying code
live-state mutation surface
derived-state
persistent-state
code-retirement -> delete-firstcontract-carrying code -> delete-first with high-risk verificationlive-state mutation surface -> inspect and classify; destructive execution
still requires confirmation when it reaches persistent-statederived-state -> verify rebuildability first, then decidepersistent-state -> confirmation-firstIf the target is persistent-state or another irreversible source-of-truth
object:
Examples that require confirmation:
DROP TABLEDROP COLUMNTRUNCATEWhen confirmation-first is required, stop normal retirement flow and emit:
Data Destruction Guard:
- Target Class:
- Exact Target(s):
- Environment:
- Why Irreversible:
- Backup / Rollback Note:
- Allowed Read-Only Next Steps:
- Blocked Destructive Steps:
- Confirmation Required: yes
- Status: awaiting scoped confirmation
Only explicit scoped confirmation can continue. Broad assent such as "OK", "continue", or "sounds good" is insufficient. If scope changes at all, previous confirmation is invalid and fresh confirmation is required.
Before deletion, state:
Anti-Entropy Declaration:
- Deletion Class:
- Old Path/Object:
- New Canonical Owner:
- Expected Preserved Behavior:
- Expected Retired Behavior:
- External Boundary Touched: no | yes
- Source-of-Truth Data Risk: none | possible | confirmed
- User Confirmation Required: no | yes
If User Confirmation Required: yes, stop normal delete-first flow and enter
Data Destruction Guard.
Choose one path only:
Retirement Decision:
- Path: delete-first | compat-exception | confirmation-first
- Why:
- Non-edits:
Rules:
delete-first for internal retirement unless a stronger boundary blocks itcompat-exception only when external dependency is provenconfirmation-first for persistent-state or irreversible targetsIf Path = confirmation-first, no destructive execution may happen until
scoped confirmation is received.
Do not verify only by "tests are green". Verify that the old logic actually died and the new owner actually carries the behavior.
Verification Plan:
- Main-path check:
- Lingering-reference check:
- Negative check:
- Boundary check:
Meaning:
Main-path check: new canonical owner still satisfies intended behaviorLingering-reference check: old path is no longer referenced on the main pathNegative check: retired trigger/path really stopped workingBoundary check: host/API/schema/persistence boundary was not accidentally brokenIf a gap appears after deletion, classify it before repairing:
expected-retirementmissing-owner-logicstale-internal-consumerbaseline-gapexternal-compatpersistent-state-riskpersistent-state-risk is a stop condition, not a normal repair branch.
Repair order:
expected-retirement
missing-owner-logic
stale-internal-consumer
baseline-gap
external-compat
persistent-state-risk
Use this contract:
Gap Closure:
- Gap Found:
- Gap Type:
- Repair Action:
- Reintroduced Compat: no | yes
- If yes, External Dependency Evidence:
- Retirement Trigger:
If Gap Type = persistent-state-risk, stop and return to the confirmation
gate. Do not improvise destructive repair.
Retention is allowed only if all are true:
Without these, do not retain compat.
Completion claims must reflect the real outcome:
bounded mitigation or
deferred debt, not clean retirementbounded compatibility exceptionDo not:
Anti-Entropy Declaration:
Retirement Decision:
Verification Plan:
Gap Closure:
Use the compact shape by default. Expand only when task risk requires it.
npx claudepluginhub ganyuanran/aegis --plugin aegisGuides deprecation and migration: removing old systems, APIs, or features and migrating users to new implementations.
Manages deprecation and migration of old systems, APIs, or features. Guides removal of legacy code, sunsetting features, consolidating duplicates, and lifecycle planning.
Identifies and dismantles stale assumptions, dead code, and accumulated noise to clear space for new approaches. Useful before major pivots or when failed approaches linger.