AGENT SKILL

memory-clean

Use when the user explicitly asks to clean, compact, prune, trim, deduplicate, optimize, or reduce Wingman memory, or asks to resolve stale or conflicting memory rules.

License 许可
Apache-2.0
最近更新
2026-11-14
Stars
★ 1.6k
Forks
491

01 前言 Front Matter

name
memory-clean
description
Use when the user explicitly asks to clean, compact, prune, trim, deduplicate, optimize, or reduce Wingman memory, or asks to resolve stale or conflicting memory rules.

02 资源文件 3

03 SKILL.md 正文

Wingman Memory Clean

Clean Wingman memory only when the user explicitly asks. Preserve the ownership model while reducing default-read noise and conflicts.

Ownership Model

brief.md / domains/ = current projection, current binding truth bodies
history/events/     = event log, historical event bodies
history indexes     = projection indexes for historical lookup
context.md          = hot cache, active work state and short pointers

Cleanups should move memory toward one owning body per durable item:

  • current rule body lives in brief.md or domains/;
  • historical event body lives in history/events/;
  • historical lookup entry lives in projection indexes;
  • hot state or short pointer lives in context.md.

Repository Gate

  1. Check .wingman/memory/.
  2. Check .wingman/memory/brief.md and .wingman/memory/context.md.
  3. If core files are missing, stop and report repository memory state.
  4. Read brief.md and context.md first.
  5. Read domain or history files only when the requested cleanup scope points to them.

Never scan all memory files by default.

Scope Selection

Use the smallest scope that matches the request:

Scope Read Use When
context context.md, relevant current truth/history if linked Context contains stale hot state, verbose old logs, or duplicate bodies.
current-truth brief.md, relevant domains Current rules are duplicated, stale, conflicting, missing identity, or missing relations.
history-index relevant projections History projections are bloated, missing useful routing, or copying event bodies.
history-event named event bodies only User explicitly asks to inspect or edit specific history events.
migration target old context logs plus needed destinations Old context logs need conversion into current truth, history, or pointers.
delete-proposal target files only User asks to delete logs or remove noise.

If unclear, choose context unless the user mentions current rules, domains, Project Decisions, or history.

Candidate Types

Clean only when at least one concrete candidate exists:

  • COMPACT_TO_POINTER: context has details already owned by current truth or history.
  • PROMOTE_CURRENT_TRUTH: context contains a durable rule future agents must obey.
  • PROMOTE_HISTORY: context contains a durable change narrative or reasoning event.
  • PROMOTE_BOTH: context contains both current rule and historical explanation.
  • SUPERSEDE: an old current rule was replaced and should become superseded or deprecated.
  • REPAIR_RELATION: same-subject entries need updates, extends, or conflict resolution.
  • REPAIR_INDEX: history projection should be link-only or needs a domain/topic route.
  • DELETE_CANDIDATE: duplicate, obsolete, sensitive, or safely represented elsewhere.
  • NO_ACTION: cleanup cost or ambiguity exceeds benefit.

File size and line count are diagnostics only. They are not cleanup triggers by themselves.

Retention Review

Before changing a candidate, decide what would be lost:

  • Is it current truth, hot state, or history?
  • Is it still valid, replaced, or obsolete?
  • Is it the only evidence explaining a current rule?
  • Is a future task likely to need the rule, reason, failure mode, or pointer?
  • Can the same meaning be recovered from a current truth ID or history event link?

If uncertain, prefer NO_ACTION or a deletion proposal over irreversible cleanup.

Valid Actions

Compact Context

Replace verbose context with a short pointer only after the durable meaning is preserved elsewhere.

Valid pointer shape:

- <one-line state>; current truth: `<id/path or None>`; event: `<path or None>`; next: <immediate action/blocker or None>.

Preserve pending tasks, active blockers, and unresolved current work.

Promote Current Truth

Write durable rules to brief.md or relevant domains/ when future agents must obey them. Include stable ID, Subject, Status, Rule, Applies When, Evidence, Confidence, Relation, Since, and History.

Promote History

Write historical events under history/events/YYYY/MM/ when the old context contains durable rule evolution, old-to-new meaning, important correction, migration, incident, regression fix, or user-requested historical memory. Update only needed projections.

Repair Current Rules

For A -> B requirement changes, make B the only current rule for overlapping scope, mark A as superseded or deprecated, and link with updates <old-id>.

If both rules remain valid, link with extends. If they conflict and evidence does not settle the winner, stop and ask.

Repair History Projections

Projection indexes should contain short summaries and links only. Remove copied event bodies from indexes only when the event body remains linked.

Delete

Never delete without explicit user confirmation after showing a proposal with exact IDs, paths, reasons, preserved locations, and risks.

Do not delete:

  • pending tasks;
  • current work;
  • unresolved bugs;
  • current Project Decisions;
  • current domain truths;
  • user-protected notes;
  • the only evidence explaining a current rule;
  • history event bodies, unless the user explicitly asked to delete those specific records.

Optional Resources

  • Run scripts/memory-stats.sh when heading layout, file size, or candidate discovery is unclear. The script is read-only.
  • Read examples/lossless-compaction.md when compaction safety is unclear.
  • Read examples/deletion-proposals.md when preparing a deletion proposal.

Do not read examples or run scripts by default.

Workflow

  1. Apply Repository Gate.
  2. Select the smallest cleanup scope.
  3. Identify concrete candidates.
  4. Run Retention Review.
  5. Classify candidates.
  6. Apply safe COMPACT_TO_POINTER, PROMOTE_CURRENT_TRUTH, PROMOTE_HISTORY, PROMOTE_BOTH, SUPERSEDE, REPAIR_RELATION, and REPAIR_INDEX changes.
  7. For DELETE_CANDIDATE, present a proposal and wait for explicit confirmation.
  8. Report files read, files changed, compactions, promotions, superseded rules, repaired indexes, and proposed or confirmed deletions.

Do not say memory was cleaned if no file changed. If only a deletion proposal was produced, say cleanup is pending confirmation.

04 同仓库更多 Skills

hashgraph-online
hashgraph-online/awesome-codex-plugins

worktable-review-with-annotations

Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

worktable-find-and-synthesize-context

Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

worktable-create-or-update-docs

Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

worktable-create-or-manage-records

Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

worktable-create-or-manage-interactive-html

Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

worktable-collaborate-threads

Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.

★ 1.6k