ganyuanran/anti-entropy-governance
Use when retiring old logic, collapsing duplicate owners, removing fallbacks, or touching schema, persistence, or source-of-truth boundaries while deciding whether to delete old paths, retain compatibility, or stop for confirmation.
npx skills add https://github.com/GanyuanRan/Aegis --skill anti-entropy-governance
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:
source-of-truth, or external compatibility boundaries
Do not use for:
deletion choice
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 /persistence
systematic-debugging when the tempting fix is fallback growth ordelete-vs-retain
verification-before-completion for cleanup / retirement / compatibility /migration closeout
Do 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 activedependency evidence
confirmation-first
Unknown 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-retirementcontract-carrying codelive-state mutation surfaceor other persistent state
derived-statepersistent-statecode-retirement -> delete-firstcontract-carrying code -> delete-first with high-risk verificationlive-state mutation surface -> inspect and classify; destructive executionstill requires confirmation when it reaches persistent-state
derived-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-retirementmissing-owner-logicstale-internal-consumerbaseline-gapexternal-compatpersistent-state-riskUse 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 ordeferred debt, not clean retirement
bounded compatibility exceptionDo not:
This shape is the anti-entropy workflow's decision surface, not a separate
final completion report. When anti-entropy materially shapes a completed task,
its preserved/retired behavior, deletion class, retained boundary, verification
plan, and residual risk should flow into verification-before-completion's
unified Aegis impact/safety receipt.
Aegis Visibility:
Anti-Entropy Declaration:
Retirement Decision:
Verification Plan:
Gap Closure:
Use the compact shape by default. Expand only when task risk requires it.
Take ganyuanran/anti-entropy-governance from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.