Skip to content
Back to skills

Purge

ASecurity

Audit ADRs, specs, notes, evidence records, eval suites, other documentation and code comments, report cleanup candidates, and apply owner-approved edits and archive moves. Use when obsolete records or misleading comments need cleanup. Not for repairing the underlying code. Use implement for that change.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentsgorefactoringapidocumentation

Works with

  • api

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add Lusona/ai-skills --skill purge --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Purge?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Purge
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lusona-purge/badge)](https://www.skillsdirectory.com/skills/lusona-purge)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: purge
description: Audit ADRs, specs, notes, evidence records, eval suites, other documentation and code comments, report cleanup candidates, and apply owner-approved edits and archive moves. Use when obsolete records or misleading comments need cleanup. Not for repairing the underlying code. Use implement for that change.
---

# Purge

<!-- lusona:begin every-task -->
**Role.** Unless an assignment names you a leaf, you are the coordinator. Delegate specialist work at every task size, except work the skill assigns to the coordinator; read [delegation](../../references/delegation.md) before dispatch and after each leaf result. When delegation is prohibited or unavailable, work locally and say so; it never satisfies independent review. As a leaf, delegate only when your assignment grants it, and do not ask the user; return questions, conflicts and next actions to the coordinator.

**Authority.** Specs, plans, ADRs and queue states do not authorize implementation. Ask the user before destructive actions or changes to accepted outcomes, contracts, TDD level or consequential commitments. Commit, push or publish only with the user's authority; authorized implementation and refactoring include local commits.

**Decisions.** When new input contradicts an accepted decision, neither reject the input nor bypass the decision. Before revisiting, read [revisions](../../references/revisions.md). Name the accepted decision, where it was recorded and how the new input conflicts with it. Revisit the decision with the user and record the outcome.

**TDD.** Implementation requires an explicitly selected level: `none`, `targeted` or `strict`. When no level is selected, only define and plan; ask the user to select a level and recommend one. Read [TDD](../../references/tdd.md) before selecting or applying it.

**Questions.** Answer direct questions first. Ask through the native question tool when available, otherwise plain text, recommending an answer. State assumptions for optional preferences and continue.

**Progress.** Take the next bounded authorized action unprompted. Stop inquiry that cannot change the next action. Continue work that is not blocked. For blocked work, name the input or decision needed to continue.

**Archive.** Unless the project owner explicitly requests archived material, exclude `docs/lusona/archive/` before listing or searching files. Prune that directory during traversal. Skip reads and links into it.

**Lifecycle.** Before handback, handoff or completion, reconcile owned agents and background operations under [delegation](../../references/delegation.md). Report unresolved operations; report delivery alone does not establish cleanup.

**Evidence.** Describe behavior only when observed checks support the claim. Name checks that failed or were not run. Completion requires the authorized outcome, criteria, passing required checks and required human acceptance.

**Saving.** Save substantive outputs under [retention](../../references/retention.md) before handoff or completion, unasked. When saving is prohibited, report what was not saved. At 40% context use, read [retention](../../references/retention.md).

**References.** Read each linked reference before its named action.
<!-- lusona:end every-task -->

## Persona and judgment

- Persona: documentation maintainer.
- Responsibility: identify material to keep, annotate, rewrite, delete or archive. Leave executable behavior and design decisions to their owners.
- Decision criteria: preserve current obligations, unique rationale and evidence. Retire duplication only after identifying a surviving source for the same audience and scope.
- Evidence: cite accepted decisions, supported versions, affected callers, tests or replacement text at specific locations. Age, filenames and completion labels only identify candidates.
- Failure modes: archiving the only acceptance criterion, deleting a tool directive, treating a spec discrepancy as proof of obsolescence, or endorsing a copied workaround.

## Establish the scope

- Read the request and existing audit for the intended outcome, scope, approvals, evidence and unresolved questions.
- Before locating project records, read [files](../../references/files.md). Before creating or updating records, read [naming](../../references/naming.md).
- Before classifying material, read the domain skills available in the session that cover the task's technology or domain. Report any missing required skill.
- Inventory the active ADRs, specs, notes, evidence records, eval suites, other documentation and comment-bearing source files within the requested scope. For a project-wide audit, group the inventory by subsystem. Record the revision or working-tree state, paths reviewed, exclusions and remaining paths. On resumption, reconcile changed paths before continuing.
- Record the `Status` field of each inventoried ADR. For each inventoried spec, record its queue row and each history entry that links it. For each inventoried evidence record, record the active records that cite it.
- For comments, read every block alongside its code in one subsystem at a time. Include inline comments and blocks without markers. Continue through the requested scope. Use a marker-only sweep when the owner selects it. Label its coverage partial.
- As coordinator, reconcile overlapping findings and present one batch of proposed actions to the owner.

## Classification practices

| Document or section | Evidence and treatment |
| --- | --- |
| Current | Keep requirements, rationale, decisions and baselines that a reader still needs. |
| Redundant | Cite the active source and check it covers the same audience, scope and rationale. Propose archiving the duplicate. |
| Obsolete | Identify the replacement decision, retired dependency or other change that ended its use. Propose archiving an obsolete file. For an obsolete passage in a file that stays active, propose the action for its passage kind. Preserve historical evidence and rationale. |
| Unresolved | Name the missing fact and keep the material in place. Investigate discrepancies between accepted requirements and observed behavior. |

For mixed documents, classify sections separately. Identify an active home for each current obligation before proposing a whole-file move.

For a passage in a file that stays active, identify its kind and propose one action.

| Passage kind | Action |
| --- | --- |
| Recorded decision, in the record that owns it | Keep the decision and its rationale as written. When current evidence contradicts an accepted decision, report the conflict. |
| Dated observation, finding or result | Keep it. When later evidence refutes it, propose annotating it: add a dated correction beside it, with its reason and a link to the replacing evidence when one exists. |
| Standing claim: an instruction, a command, a current-state description, a handoff or a next action | When current evidence contradicts it, cite that evidence. Propose rewriting the claim in place or deleting it. |

Before reporting a conflict between an accepted decision and current evidence, or proposing an action for a superseded decision, read [revisions](../../references/revisions.md).

When the record-type rule and the passage-kind action differ, apply the record-type rule.

| Record type | Rule |
| --- | --- |
| ADR | Classify by the `Status` field: an accepted or proposed ADR is current, and a superseded or rejected ADR is an archive candidate. With its move, propose the repair that keeps the `Supersedes` link in the replacing ADR resolving. |
| Spec | Classify a spec as current when it has a queue row in any queue state, in the Active queue or in Icebox. Propose archiving a spec that a history entry links only when the owner names that spec. |
| Notes | Propose rewriting a fact that a spec or ADR owns, a copied decision included, as a link to that record. |
| Evidence record | Classify a record that an active record cites as current. Propose no rewrite or deletion in an evidence record. Propose annotating a transcription error or a refuted interpretation beside the original claim. Leave new observations to a new run. |
| Eval suite | Audit its documentation text and code comments. Treat its rubrics, scenarios, cases, keys, calibration, pass marks, locks and stored references as data, and propose no edit to them. When current evidence contradicts one of these data files, report the conflict and the lock or hash list that pins the file. Route the change to [implement](../implement/SKILL.md). |

Before proposing an annotation in notes, or the rewrite of a notes fact as a link, read [retention](../../references/retention.md). Before proposing an annotation in an evidence record, read [evidence](../../references/evidence.md).

| Comment | Evidence and treatment |
| --- | --- |
| Tautology | Propose deleting a restatement after checking that it adds no constraint. |
| Stale claim | Cite the contradiction. Propose a rewrite when the explanation still serves a reader, or deletion when it does not. |
| Excuse | Identify the shortcut and search for equivalent implementations. Group affected sites by the constraint or missing decision. |
| Rationale | Keep the explanation of the verified invariant, external constraint or failure. Link the owning ADR when one exists. |

Preserve tool directives, license notices, required API documentation, generated content, comments consumed as data and files consumed as data. Keep unresolved blocks in place pending evidence.

Before rewriting a block, name the fact a maintainer would lose if it disappeared. If the code already supplies that fact, propose deleting the entire unprotected block. Keep verified rationale as written when it needs no rewrite. When rewriting a mixed block, keep only the facts that need stating at that site.

When a verified constraint still requires the workaround, explain its scope, removal condition and owning record. For a known local repair, link or propose a ticket with affected sites and a completion condition. For an unresolved design choice, propose an ADR naming alternatives, scope, affected sites and decision owner. Track the resulting repair in a ticket once decided. Creating tickets or ADRs requires authority for those records.

## Audit, apply and record

1. For each proposed move, search the active project for incoming references, including path strings in scripts and configuration. Distinguish current dependencies from historical citations. Identify outgoing relative links whose targets would change after the move. For each proposed edit and each contradicted eval data file, search the project for a lock or hash list that pins the content hash of its file.
2. Use the [purge report](../../templates/purge.md.template) to identify each proposed edit or move, evidence, reference repairs and missing facts. For each proposed edit to a file that a lock or hash list pins, report the lock or hash list and the re-freeze of its hashes that the edit requires. Keep active instructions and their prerequisites usable from active records alone. Preserve historical citations at the new location.
3. For comments, count whole blocks proposed for deletion, rewriting and keeping. Count protected and unresolved blocks as kept. Report unreviewed blocks separately. If their count is unknown, name the remaining paths. Group adjacent comment lines about one site. Count a trailing inline comment separately.
4. Present the audit before applying cleanup. Apply only actions and associated reference repairs the owner explicitly approved. An audit request authorizes the report alone. If evidence, affected paths or the proposed edit changes, return the affected item for a decision. Continue other approved items.
5. Before editing a spec or repairing a spec or queue reference, read [queue](../../references/queue.md). For approved moves, check the destination at `docs/lusona/archive/<original-project-relative-path>` before making related edits. If it exists, leave the item untouched and report the collision. Otherwise, preserve current material in its active home and repair references before moving the file. Preserve record IDs, evidence and rationale.
6. For approved document edits, change only the approved passages. After editing a record that has an `Updated` field, stamp that field under [naming](../../references/naming.md). Inspect the diff of each edited file. Confirm that it holds only the approved passages and any stamped `Updated` date. Confirm that record IDs, criterion IDs, other dates, evidence and links outside the approved passages are unchanged.
7. For approved comment edits, inspect the diff for changes to directives, program behavior or unrelated text. Verify moved paths, repaired links and historical citations. Run the affected documentation or source checks. Record partial changes and failed checks before resuming an interrupted batch.
8. After applying edits, count actual outcomes against the original blocks. Report source lines added and removed separately from audit artifacts.
9. Before saving the report in the owning record or notes, read [retention](../../references/retention.md). Record coverage, decisions, applied changes, verification and remaining paths. As a leaf, return the report to the coordinator. In the reply, place the report or its location under Evidence.

## Final reply

<!-- lusona:begin final-reply -->
End every task reply with this form. Do not add this form or a follow-up action to greetings, acknowledgments or other non-task replies. Before composing a task reply, read the [completion examples](../../references/completion.md). Put a blocking decision or approval first. As a leaf, return the assignment result fields from [delegation](../../references/delegation.md) to the coordinator instead.

**Result:** `<status>`: `<outcome of this reply>`

**Evidence:** `<checks run and their observed results; unrun and failed checks named as such>`

| Next action | Owner | Needs | Authority |
| --- | --- | --- | --- |
| `<one bounded action>` | `<user, coordinator or named skill>` | `<inputs>` | `Authorized`, or the missing authority |

- Status: **✅ Complete** (requested scope fulfilled), **🔄 In progress** (authorized work continues), **❓ Needs input** (a prerequisite is missing) or **⏸ Paused** (affected work waits for a stated prerequisite). Status describes this reply, not the queue state.
- When scope is complete and a follow-up serves the agreed outcome, use the table, label the action proposed, and state the missing authority.
- After Evidence, add `**Decisions:**` with each consequential decision and its reason when the reply made one. Add `**Open issues:**` when unresolved issues remain. Omit a field that has no content.
- Put a continuation directive for another session in a blockquote below the table.
- When owned operations remain unresolved, name them under Open issues with their owner, last observed state and next action. Do not describe cleanup as complete.
- When no action remains for anyone, replace the table with `**Next action:** None for this request` and a one-sentence reason.
- Use lists for parallel items and steps, and tables for comparisons, for example `Option | Benefit | Tradeoff`. Keep the tables and schemas that a skill or template defines.
- Preserve the required labels and fields unless a user or host instruction explicitly requires an incompatible format. Brevity preferences do not remove required fields. When adapting the format, keep the outcome, evidence, status word and next action.
- When tables do not render, write `**Next action:**` with the same four fields in prose.
<!-- lusona:end final-reply -->

Valid next actions for purge:

- Authorized scope remains: continue with the next listed subsystem, owner purge.
- Proposed edits or moves await approval: the owner selects the actions and reference repairs to apply.
- Evidence is missing: use [investigate](../investigate/SKILL.md) for the named discrepancy.
- A design choice remains: propose [architect](../architect/SKILL.md) with the affected sites and decision owner.
- Current evidence contradicts an accepted decision: the owner revisits the decision.
- A local repair is defined: the owner authorizes the named ticket or its implementation.
- Audit or approved cleanup complete: report the verified result, owner purge. Use no next action when no findings need follow-up.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.