agentleFS
n24q02mn24q02m/mnemo/skills/knowledge-audit/SKILL.md

knowledge-audit

Skill13 starsChanged 9 months agoApache-2.0View on GitHub

Review and clean up stored memories — find duplicates, contradictions, stale entries, and consolidate

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. ch4570/vulpora★ 1same name
    2. YourGPT/yourgpt-claude-plugin★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository6 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. About 0 are common, 12 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If topic specified: memory(action="search", query="[topic]") to find all related memories

    line 14
  2. Very specific:

    If "all": memory(action="list") to get full inventory, then memory(action="stats") for overview

    line 15
  3. Distinctive:

    Search for memories with similar content or overlapping keywords

    line 19
  4. Very specific:

    Use memory(action="delete", id="[duplicate-id]") for removals

    line 22
  5. Distinctive:

    Look for memories that make opposing claims about the same topic

    line 25
  6. Distinctive:

    Update the surviving memory to note it supersedes the old one

    line 31
  7. Very specific:

    Use memory(action="consolidate", ...) if available, otherwise manual merge

    line 43
  8. Distinctive:

    Explicit supersession: If memory B says "switched from A to B", delete memory about using A

    line 73
  9. Distinctive:

    Ambiguous: When unclear, DO NOT delete — ask the user

    line 76
  10. Distinctive:

    When memory search returns confusing or contradictory results

    line 81
  11. Distinctive:

    After a major migration or architecture change

    line 82
  12. Distinctive:

    When starting a new phase of a project

    line 83
  13. Distinctive:

    When memory count grows large and retrieval quality degrades

    line 84
  14. Very specific:

    Audit-trail integrity: every mutation (insert / update / supersede / delete) should write a memory_audit row with prev_state_hash and …

    line 126
  15. Distinctive:

    After running the Phase 1/2 "Knowledge Audit" steps above.

    line 137
  16. Distinctive:

    After importing a Phase 2 passport bundle (legacy schema → can leave bitemporal columns NULL).

    line 138
  17. Very specific:

    After any large memory(action="capture", auto=True) batch with KG_AUTO_ENABLED=true (entity resolution may need tuning).

    line 140
  18. Distinctive:

    Before exporting a Phase 3 passport bundle (so receiver gets a clean KG).

    line 142

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Knowledge Audit

Systematic review of stored memories to maintain quality. Finds duplicates, detects contradictions, flags stale entries, and consolidates overlapping memories.

Steps

  1. Scope the audit:
    • If topic specified: memory(action="search", query="[topic]") to find all related memories
    • If "all": memory(action="list") to get full inventory, then memory(action="stats") for overview
    • Group memories by tag/category for systematic review
  2. Identify duplicates:
    • Search for memories with similar content or overlapping keywords
    • Compare pairs that cover the same topic
    • Decision: keep the more detailed/recent one, delete the other
    • Use memory(action="delete", id="[duplicate-id]") for removals
  3. Detect contradictions:
    • Look for memories that make opposing claims about the same topic
    • Examples: "Use library A" vs "Switched to library B", conflicting conventions
    • Decision tree:
      • Both have dates -> keep the newer one (it supersedes)
      • Neither has date -> ask user which is current
      • Both are valid (context-dependent) -> update both to clarify their scope
    • Update the surviving memory to note it supersedes the old one
  4. Flag stale entries:
    • Memories referencing specific versions that are now outdated
    • Memories about temporary workarounds that may have been resolved
    • Memories about tools/libraries that have been replaced
    • Action: mark as stale with memory(action="update", ...) adding [STALE] prefix, or delete if clearly obsolete
  5. Consolidate overlapping memories:
    • Multiple memories about the same topic that each have partial info
    • Merge into a single comprehensive memory
    • Steps: create new consolidated memory -> verify retrieval -> delete originals
    • Use memory(action="consolidate", ...) if available, otherwise manual merge
  6. Produce audit report:
    ## Knowledge Audit — [topic/all] — [date]
    
    ### Summary
    - Total memories reviewed: [N]
    - Duplicates removed: [N]
    - Contradictions resolved: [N]
    - Stale entries flagged/removed: [N]
    - Memories consolidated: [N merged into M]
    
    ### Actions Taken
    - [list of specific changes]
    
    ### Recommendations
    - [any patterns noticed, e.g., "many memories lack WHY context"]

Staleness Indicators

  • References to specific version numbers (check if still current)
  • Contains "temporary", "workaround", "until X is fixed"
  • References removed/renamed files, deprecated APIs, old URLs
  • Predates a major migration or refactor (check project history)
  • Contains "TODO" or "will be" — was it done?

Contradiction Resolution Rules

  • Explicit supersession: If memory B says "switched from A to B", delete memory about using A
  • Scope difference: "Use X for backend" and "Use Y for frontend" are NOT contradictions
  • Evolution: "Started with X" and "Migrated to Y" — keep Y, delete X (unless X context is still relevant)
  • Ambiguous: When unclear, DO NOT delete — ask the user

When to Use

  • Periodically (monthly or after major project changes)
  • When memory search returns confusing or contradictory results
  • After a major migration or architecture change
  • When starting a new phase of a project
  • When memory count grows large and retrieval quality degrades

Phase 3: Temporal KG Audit (v2.0+)

Phase 3 ships a temporal knowledge graph (entities + edges + bitemporal versioning + supersession). The audit checklist now also covers KG hygiene:

KG-aware audit dimensions

  1. Stale entities: entity rows that no longer link to any active memory (their last memory_entity_links row points at an archived / superseded memory).
    • Detect: memory(action="entity_search", name="<entity>") returning 0 currently-valid hits → candidate stale.
    • Action: confirm with the user, then delete the orphaned entity row (cascade removes edges).
  2. Orphan edges: edges in memory_edges whose source or target memory_entities row was deleted but the edge survived.
    • Detect: server logs show "edge with missing endpoint" warnings, or entity_graph returns nodes referenced from edges that aren't in the nodes list.
    • Action: ask user; either re-extract the originating capture or hand-delete the edge by id.
  3. Contradicting / superseded chains: a memory in a supersession chain still surfaces in default memory.get results because someone left valid_to = NULL on an old fact.
    • Detect: memory(action="history", entity_id=<x>) returning multiple rows with valid_to = NULL for the same entity.
    • Action: pick the most-recent / most-correct row and update valid_to on the others to the supersession timestamp.
  4. Bitemporal drift: capture has no valid_from set, falls outside the bitemporal index. Usually a pre-Phase-3 row that was missed by backfill, or a manual db.add that bypassed the capture pipeline.
    • Detect: SQL spot check SELECT COUNT(*) FROM memories WHERE valid_from IS NULL.
    • Action: re-run the Phase 3 backfill (MemoryDB._backfill_phase3_temporal) or update the rows manually.
  5. Audit-trail integrity: every mutation (insert / update / supersede / delete) should write a memory_audit row with prev_state_hash and new_state_hash. A gap in the chain (audit row absent for an update) signals a bug or out-of-band write.
    • Detect: SELECT m.id FROM memories m LEFT JOIN memory_audit a ON a.memory_id = m.id WHERE a.id IS NULL.
    • Action: investigate which path wrote the row; do NOT rewrite the audit history (preserves tamper-detection guarantees).

When to run the temporal sub-audit

  • After running the Phase 1/2 "Knowledge Audit" steps above.
  • After importing a Phase 2 passport bundle (legacy schema → can leave bitemporal columns NULL).
  • After any large memory(action="capture", auto=True) batch with KG_AUTO_ENABLED=true (entity resolution may need tuning).
  • Before exporting a Phase 3 passport bundle (so receiver gets a clean KG).

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.