Communitygithub.com

zhaidewei/keep-or-sweep

Keep it, fix it, archive it, or sweep it away—an evidence-first Agent Skill

keep-or-sweep 是什么?

keep-or-sweep is a Claude Code agent skill that keep it, fix it, archive it, or sweep it away—an evidence-first Agent Skill.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add zhaidewei/keep-or-sweep

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Keep or Sweep

Audit one clearly bounded asset. Do not turn this into an estate-wide deduplication or canonical-home exercise.

Workflow

  1. Bound the asset. Name the exact target, owner or authority, allowed operations, and impact boundary. If the request contains multiple independent assets, select one clear target for this audit and list the others as out of scope. Do not continue through the list in the same audit.
  2. Inventory read-only. Find actual consumers, callers, triggers, dependencies, inputs, outputs, contracts, generated copies, history, retention duties, and runtime use. Search names and behavior; dynamic use and unavailable permissions remain unknown.
  3. Test the deletion counterfactual. State which observable user or agent behavior would worsen if the asset vanished. A name match or similar shape does not prove redundancy.
  4. Classify its role. A source of truth, projection, and adapter are roles, not verdicts. For a projection, verify consumer-specific value, consistency with its source, regeneration or synchronization, and a maintenance mechanism with an owner, trigger, drift detection, and repair path.
  5. Choose exactly one disposition.
    • Keep: it has evidenced value and a credible maintenance mechanism.
    • Repair or replace: it has evidenced users but its current mechanism is unreliable.
    • Archive: live use is absent, but a legal, historical, audit, or contractual retention duty exists.
    • Delete: no observable behavior worsens and no retention duty applies. This is a recommendation; it does not authorize execution.
    • Pause: evidence, permissions, authorization, recoverability, or irreversible-risk analysis is insufficient.
  6. Execute only within authority. Read-only audit never implies permission to delete, overwrite, mutate remote state, or make an irreversible change. Before deletion, name the recovery method. After deletion, verify the expected consumers and report anything still unproven.

Decision tree

flowchart TD
    A["Bound one asset<br/>and inventory read-only"] --> B{"Evidence sufficient?"}
    B -- "No" --> P["Pause and name<br/>the missing evidence"]
    B -- "Yes" --> C{"Would deletion worsen<br/>observable behavior?"}
    C -- "Unknown" --> P
    C -- "No" --> D{"Retention duty?"}
    D -- "Yes" --> R["Archive"]
    D -- "No" --> X["Recommend deletion"]
    C -- "Yes" --> F{"Maintenance mechanism<br/>credible?"}
    F -- "Yes" --> K["Keep"]
    F -- "No" --> N["Repair or replace"]

Unknown consumers, dynamic calls, missing access, and absent evidence do not mean unused. When uncertain, pause and identify the smallest next check that could change the disposition.

相关技能