/audit-knowledge — Knowledge Repository Audit (cowork variant)
Scan the attached knowledge folder for extractable items, route ideas via the Accept submenu, archive cleared content per the universal audit-cohort conventions, and rebuild the index.
Cowork variant of aria-knowledge's /audit-knowledge. Output schema is byte-identical (archive/audit-{date}/MANIFEST.md, disposition frontmatter, ledger formats) per item #4 archive-cohort conventions. Three input-discovery divergences:
- Memory + plans scan SKIPPED in cowork (#16b, #16c locks): aria-knowledge reads
~/.claude/projects/{cwd}/memory/and~/.claude/plans/to surface extractable items from auto-memory + Plan files. Cowork's persistent-grant model can't reach~/.claude/per probe 12. Cowork's/audit-knowledgeaudits the attached knowledge folder'sintake/subfolder only. If you want memory/plans audited, run aria-knowledge's/audit-knowledgefrom Claude Code. bin/shell-outs replaced with Claude-driven inline logic (per D3 + ADR-013): aria-knowledge sourcesbin/config.shfor shell helpers and usesbin/digest-transcript.shfor snapshot processing. Cowork has nobin/directory; equivalent operations are done inline by Claude reading config + processing snapshot bodies directly.projects_groupsfeatures not consumed in cowork (per ADR-005): aria-knowledge integrates/distill,/stitch, and codemap surfaces into the audit. Cowork excludes those skills; related audit branches are noted as aria-knowledge-only.
Plugin attribution in archive frontmatter uses plugin_version: aria-cowork@{INSTALLED_VERSION} per item #4b. Schema-identical archive outputs mean a knowledge folder receiving audit-cohort writes from both plugins on the same day merges cleanly per item #4h same-day collision handling.
Scan the attached knowledge folder's intake/ subfolder for extractable items, compare against what's already in the knowledge folder and project-level docs, and surface anything worth extracting or routing.
Runtime Gate (per ADR-094)
Canonical resolution: This is the Claude Cowork variant — namespaced-only. When both plugin-claude-code and plugin-claude-cowork are loaded in the same session (most common in Claude Desktop), bare /audit-knowledge resolves to aria-knowledge's variant — Code is the canonical owner of all 24 dual-port skills per ADR-094 §Part 1. To reach this skill, use the namespaced form: /aria-cowork:audit-knowledge. Do NOT match bare /audit-knowledge — that belongs to aria-knowledge.
Before Step 0: Check whether the Bash tool is available in this session. If Bash IS available (you are running in Claude Code or another runtime with shell access), surface the following notification and wait for explicit user confirmation:
⚠️ Runtime mismatch — you invoked aria-cowork's /audit-knowledge from a runtime with shell access.
This variant audits ONLY the attached folder'sintake/and skips~/.claude/projects/.../memory/+~/.claude/plans/— but you appear to be in Claude Code, where those memory + plans paths ARE reachable and the aria-knowledge canonical includes them in the audit scope. For the Code-native variant, use/audit-knowledge(the aria-knowledge canonical).
Use/audit-knowledgeinstead? (y/n)
Wait for an explicit reply:
y/yes— Use theSkilltool to invokeaudit-knowledge(the bare-slash canonical, which routes to aria-knowledge when both ports are loaded) with the same arguments the user provided to this invocation. Do not proceed with this skill's steps; the aria-knowledge variant takes over and runs to completion. This is the default-yes path — auto-redirect is the helpful action.n/no— Proceed with this (aria-cowork) variant anyway despite the runtime mismatch. The user has explicitly opted in.- No response / any other reply — Treat as "do not proceed" and exit cleanly without running either variant.
This gate applies even when mode = auto per ADR-094 §Part 3. Auto mode's "implicit-yes on all gates" rule is suspended for the runtime-mismatch check — auto trusts that the user invoked the correct variant, and this gate enforces that precondition. All other auto-mode gates remain bypassed. The friction cost is now low: on y, the auto-redirect runs the correct variant with the original args.
If Bash is NOT available (normal Cowork runtime), proceed to Step 0.
Step 0: Resolve Config
Read <knowledge_folder>/aria-config.md and extract:
knowledge_folder— required base pathaudit_cadence_knowledge— cadence in days (default 7); safety-net trigger for low-activity periodsaudit_trigger_threshold— backlog-entry count (default 20); primary activity-driven trigger. Tier boundaries derived via fixed offsets:threshold(suggested),threshold + 15(recommended),threshold + 30(overdue)projects_enabled— defaultfalse; controls whether project tier is audited (Step 5e)projects_list— default empty; comma-separatedtag:pathpairs; only relevant ifprojects_enabled: trueprojects_promotion_threshold— default2; minimum projects sharing a similar pattern before Step 5e suggests cross-project promotion
If the config file doesn't exist, stop: "aria-knowledge is not configured. Run /aria-setup to get started."
Use {knowledge_folder} as the base path for all file operations in subsequent steps.
Step 1: Read the Audit Log and Determine Mode
Read {knowledge_folder}/logs/knowledge-audit-log.md.
Note the "Last Audit" date and calculate days since.
Compute the current trigger state by counting ^### entries across the four action-eligible backlogs (insights, decisions, extraction, rules — exclude intake/ideas/, which routes out via the Accept submenu rather than promoting directly). Count only entries below the first --- separator per file, matching the convention used by /stats and /backlog:
for f in {knowledge_folder}/intake/insights-backlog.md \
{knowledge_folder}/intake/decisions-backlog.md \
{knowledge_folder}/intake/extraction-backlog.md \
{knowledge_folder}/intake/rules-backlog.md; do
[ -f "$f" ] && awk '/^---$/{sep++; next} sep>=1 && /^### /{c++} END{print c+0}' "$f"
done | awk '{s+=$1} END{print s+0}'
Record the count — it feeds both the prompt message and Step 8's Trigger: audit-log subfield.
Determine how this skill was invoked:
- User-requested (user said
/audit-knowledge, "audit knowledge", "scan memory", etc.): Always run the full audit, regardless of how recently the last audit was. Skip directly to Step 2. - Session-start check (triggered by the SessionStart hook): Check whether either trigger fired.
- Entry-count trigger (primary): if
backlog_count >= audit_trigger_threshold, prompt per tier: count ≥ threshold + 30→ "Knowledge audit overdue — N entries, plan for multi-pass. Run /audit-knowledge?"count ≥ threshold + 15→ "Knowledge audit recommended — N entries, near one-pass ceiling. Run /audit-knowledge?"count ≥ threshold→ "Knowledge audit suggested — N entries ready for review. Run /audit-knowledge?"- Elapsed-days trigger (safety net): if no entry-count tier fired AND
days_since >= audit_cadence_knowledge, prompt: "Knowledge audit due — N days since last audit. Run /audit-knowledge?" - Neither fired: report the last audit date + current backlog count + days-since, then stop. "Last knowledge audit was N day(s) ago (YYYY-MM-DD). Backlog at M entries (threshold T). Next trigger at M=T entries or N=C days."
Step 1b: Check Index Freshness
Read {knowledge_folder}/index.md if it exists.
Several audit steps depend on index data (Step 5b entity refs + skill-knowledge drift, Step 5c tag matching, Step 6 stale files). Running against a stale or missing index produces incomplete results.
Check:
- If
index.mddoesn't exist