agentleFS
GanyuanRanGanyuanRan/Aegis/skills/anti-entropy-governance/SKILL.md

anti-entropy-governance

Skill1.3k starsChanged 7 months agoMITView on GitHub

Use when touching retiring old logic, collapsing duplicate owners, removing fallbacks, or schema/persistence/source-of-truth boundaries; identify opportunities automatically; destructive execution requires explicit confirmation.

  • Deletes or force-pushes

Trending

Quiet since October.about the whole repository

Jan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 4 mentionsJun 2026: 1 mentionJul 2026: 0 mentionsAug 2026: 3 mentionsSep 2026: 3 mentionsOct 2026: 4 mentionsNov 2026: 0 mentionsDec 2026: 0 mentions
Jan 2026Jul 2026Dec 2026
Mentions a month of the GanyuanRan/Aegis repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about GanyuanRan/Aegis

The biggest 5 of 15 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 15

Talked about on GitHub (15 times).

On GitHub · 15

10 more on GitHub

The file

Show its rules and text

We split this skill into the rules it gives an agent

33 rules. About 0 are common, 28 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈28

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when the task is not merely "change code" but "remove old paths safely without growing entropy".

    line 10
  2. Distinctive:

    Use when any of these are true:

    line 27
  3. Distinctive:

    Do not use for:

    line 37
  4. Distinctive:

    Default to reducing internal entropy, not preserving internal history.

    line 64
  5. Distinctive:

    no irreversible deletion is executed

    line 92
  6. Distinctive:

    no destructive tool call is made

    line 93
  7. Distinctive:

    no runnable destructive command is emitted as the next action

    line 94
  8. Distinctive:

    no broad assent is reinterpreted as deletion approval

    line 95
  9. Very specific:

    If the target is persistent-state or another irreversible source-of-truth object:

    line 146
  10. Distinctive:

    do not execute deletion automatically

    line 149
  11. Distinctive:

    do not emit a runnable destructive command as the next action

    line 150
  12. Distinctive:

    do not call a destructive tool

    line 151
  13. Distinctive:

    do not interpret generic agreement as confirmation

    line 152
  14. Distinctive:

    ask for explicit scoped user confirmation

    line 153
  15. Very specific:

    When confirmation-first protects persistent-state or an irreversible source-of-truth object, stop normal retirement flow and emit:

    line 168
  16. Distinctive:

    Only explicit scoped confirmation can continue.

    line 184
  17. Very specific:

    If User Confirmation Required: yes, stop normal delete-first flow.

    line 213
  18. Very specific:

    If Path = confirmation-first, no destructive execution may happen until scoped confirmation is established.

    line 235
  19. Distinctive:

    Do not only state that confirmation is required or quote the words needed.

    line 240
  20. Distinctive:

    Do not verify only by "tests are green".

    line 244
  21. Distinctive:

    If a gap appears after deletion, classify it before repairing:

    line 266
  22. Distinctive:

    update tests, docs, or caller expectations

    line 282
  23. Distinctive:

    stop and ask for user confirmation

    line 292
  24. Very specific:

    If Gap Type = persistent-state-risk, stop and return to the confirmation gate.

    line 306
  25. Distinctive:

    treat unknown dependency as proof of dependency

    line 335
  26. Distinctive:

    treat missing active-dependency evidence as proof that deletion is safe across a proven external boundary

    line 336
  27. Distinctive:

    keep both owners active "for safety"

    line 338
  28. Distinctive:

    add a fallback before checking whether the gap belongs in the new owner

    line 339
  29. Distinctive:

    treat source-of-truth data cleanup as ordinary code retirement

    line 341
  30. Distinctive:

    call a task "cleaned up" when old logic still carries main-path behavior

    line 342
  31. Distinctive:

    delete a carrier merely because one authority on it was invalid when a separately evidenced legitimate role remains

    line 343
  32. Distinctive:

    treat a warning or guard card as destructive authorization

    line 345
  33. Distinctive:

    Use the compact shape by default.

    line 363

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Anti-Entropy

Overview

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 retirement
  • compat-exception for proven external dependency boundaries
  • confirmation-first for irreversible state or an external contract whose distributed consumers cannot be observed

It 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.

When to Use

Use when any of these are true:

  • old logic, duplicate owners, or stale fallbacks should be retired
  • a candidate fix is "delete old path" vs "add another fallback"
  • internal keyword / phrase / trigger logic is being replaced by structured logic
  • a new canonical owner exists and the old owner may still carry real behavior
  • a cleanup, migration, or deprecation task touches schema, persistence, source-of-truth, or external compatibility boundaries
  • the task risks confusing code retirement with live data deletion

Do not use for:

  • pure additive feature work with no retirement decision
  • tiny wording edits
  • simple status or read-only Q&A
  • normal bug fixes that do not involve owner collapse, fallback cleanup, or deletion choice

Auto-Compose Boundary

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 risk
  • writing-plans for plans that delete old paths or touch schema / migration / persistence
  • systematic-debugging when the tempting fix is fallback growth or delete-vs-retain
  • verification-before-completion for cleanup / retirement / compatibility / migration closeout

Load automatically when the task touches owner collapse, fallback removal, or schema/persistence/source-of-truth boundaries. Automatic loading identifies and advises only; destructive execution still requires explicit scoped user confirmation.

Core Principle

Default to reducing internal entropy, not preserving internal history.

Retirement is responsibility-scoped before it is carrier-scoped. Name the obsolete or duplicated authority first. If the same carrier has a separately evidenced legitimate role, remove the invalid responsibility and keep only that role-scoped capability; this is not a compatibility exception. Apply delete-first to the carrier once no legitimate responsibility remains. Unknown consumers alone still do not justify retaining an internal carrier.

Use this rule:

  • internal code retirement -> delete-first
  • external compatibility boundary -> compat-exception with active dependency evidence; confirmation-first when distribution is proven but consumers cannot be observed
  • persistent-state or irreversible source-of-truth object -> confirmation-first

Unknown alone neither proves an external dependency nor blocks internal delete-first. Once distribution is proven, unobservable consumers also do not prove deletion safe: inspect read-only. Before editing, require user-authored, scoped authorization that explicitly accepts the concrete external risk. An informed instruction may already supply it; otherwise disclose the risk and request scoped confirmation.

Mentioning, loading, or discussing destructive-action rules never authorizes destructive execution. Without explicit scoped user confirmation:

  • no irreversible deletion is executed
  • no destructive tool call is made
  • no runnable destructive command is emitted as the next action
  • no broad assent is reinterpreted as deletion approval

Deletion Classes

Classify the deletion target first:

  • code-retirement
    • source code
    • internal triggers
    • duplicate owners
    • stale fallback branches
    • compat-only carriers
    • dead tests/config tied to removed internal behavior
  • contract-carrying code
    • schema definition files
    • migration files
    • public API contract code
    • host install/discovery code
    • persistence read/write logic
  • live-state mutation surface
    • code or commands that would mutate live databases, object stores, queues, or other persistent state
  • derived-state
    • rebuildable caches
    • generated indexes
    • temporary exports
    • recomputable artifacts
  • persistent-state
    • live database tables / columns / rows
    • source-of-truth object storage files
    • user records
    • permission / identity / membership records
    • audit / billing / irreversible business records
    • non-rebuildable queue or event contents

Default Path By Class

  • code-retirement -> delete-first
  • contract-carrying code -> classify by the Core Principle; internal-only retirement uses delete-first with high-risk verification
  • live-state mutation surface -> inspect and classify; destructive execution still requires confirmation when it reaches persistent-state
  • derived-state -> verify rebuildability first, then decide
  • persistent-state -> confirmation-first

Hard Stops

If the target is persistent-state or another irreversible source-of-truth object:

  • do not execute deletion automatically
  • do not emit a runnable destructive command as the next action
  • do not call a destructive tool
  • do not interpret generic agreement as confirmation
  • ask for explicit scoped user confirmation
  • request backup / rollback / migration note when relevant

Examples that require confirmation:

  • DROP TABLE
  • DROP COLUMN
  • TRUNCATE
  • bulk delete of real business data
  • deleting source-of-truth uploaded files
  • deleting permission, identity, audit, billing, or membership records
  • purging non-rebuildable queues or event streams

Data Destruction Guard

When confirmation-first protects persistent-state or an irreversible source-of-truth object, 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.

Anti-Entropy Declaration

Before deletion, state:

Anti-Entropy Declaration:
- Deletion Class:
- Old Path/Object:
- Invalid Responsibility / Authority:
- Legitimate Capability Remaining on Carrier:
- 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

For external-unknown code, fill User Confirmation Required with yes unless the user's own instruction already names the concrete external risk, accepts its possible breakage, and authorizes the exact retirement scope, or the user later gives scoped confirmation after your disclosure. A generic original deletion request does not satisfy this slot. Do not infer acceptance from mere awareness of external use or from your own risk summary.

If User Confirmation Required: yes, stop normal delete-first flow. Persistent-state or irreversible targets enter Data Destruction Guard; external-unknown code stays in the Retirement Decision hold below.

Retirement Decision

Choose one path only:

Retirement Decision:
- Path: delete-first | compat-exception | confirmation-first
- Why:
- Non-edits:

Rules:

  • choose delete-first for internal retirement unless a stronger boundary blocks it
  • choose compat-exception only when external dependency is proven
  • choose confirmation-first for irreversible targets or proven distribution whose consumers cannot be observed

If Path = confirmation-first, no destructive execution may happen until scoped confirmation is established. For external-unknown code, earlier generic deletion instructions do not count. An informed, scoped user instruction may establish confirmation before your disclosure; otherwise disclose the risk and directly ask the user to confirm the exact retirement scope before editing. Do not only state that confirmation is required or quote the words needed.

Verification Plan

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 behavior
  • Lingering-reference check: the retired responsibility is no longer active; when its carrier was deleted, the old path is no longer referenced on the main path
  • Negative check: retired trigger/path really stopped working
  • Boundary check: host/API/schema/persistence boundary was not accidentally broken

Gap Taxonomy

If a gap appears after deletion, classify it before repairing:

  • expected-retirement
  • missing-owner-logic
  • stale-internal-consumer
  • baseline-gap
  • external-compat
  • persistent-state-risk

persistent-state-risk is a stop condition, not a normal repair branch.

Gap Closure

Repair order:

  • expected-retirement
    • update tests, docs, or caller expectations
  • missing-owner-logic
    • fix the new canonical owner
  • stale-internal-consumer
    • migrate the internal consumer
  • baseline-gap
    • correct requirement / spec / baseline first
  • external-compat
    • allow compat only if active external dependency evidence exists
  • persistent-state-risk
    • stop and ask for user confirmation

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.

Compat Exception Gate

Retention is allowed only if all are true:

  • an external boundary is touched
  • current active dependency evidence exists
  • deletion would break a published or documented contract
  • the current slice cannot complete owner repair or consumer migration
  • an observation metric exists
  • a retirement trigger exists

Without these, do not retain compat.

Completion Semantics

Completion claims must reflect the real outcome:

  • internal retirement with old compat preserved -> bounded mitigation or deferred debt, not clean retirement
  • external compat retained with full evidence -> bounded compatibility exception
  • persistent-state deletion without scoped confirmation -> not complete

Common Mistakes

Do not:

  • treat unknown dependency as proof of dependency
  • treat missing active-dependency evidence as proof that deletion is safe across a proven external boundary
  • keep both owners active "for safety"
  • add a fallback before checking whether the gap belongs in the new owner
  • confuse migration-file deletion with live database deletion
  • treat source-of-truth data cleanup as ordinary code retirement
  • call a task "cleaned up" when old logic still carries main-path behavior
  • delete a carrier merely because one authority on it was invalid when a separately evidenced legitimate role remains
  • treat a warning or guard card as destructive authorization

Minimal Reporting Shape

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.