Stats

From mikeprasad/aria-knowledge · View interactive version

Stats is an AI agent skill from the GitHub repository mikeprasad/aria-knowledge. Show knowledge base health metrics — file counts, backlog depth, audit status, tag stats, and coverage gaps. Use when user says "/aria-cowork:stats", "knowledge stats", "how is my knowledge base", "show stats", "knowledge health", "dashboard". (Cowork variant — namespaced-only.)

How to use this skill

Skill file

/stats — Knowledge Base Health

Read-only dashboard showing the current state of the knowledge repository.

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 /stats 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:stats. Do NOT match bare /stats — that belongs to aria-knowledge.

Before Step 0 — runtime self-correction. 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), this invocation reached the wrong variant for the runtime. Do not ask — redirect. Announce it in one line, then use the Skill tool to invoke stats with the same arguments the user provided, and do not run this skill's steps:

↪️ Redirecting to /stats — you invoked the aria-cowork variant, but you are running in Claude Code or another runtime with shell access.

Behavior is largely the same in both runtimes; for the Code-native variant (includes codemap-date metrics), use /stats (the aria-knowledge canonical).

⛔ The redirect is unconditional — every mode including auto, and no opt-out. Reaching this variant under that condition is always a mis-invocation, so there is nothing for the user to decide. Design record: docs/superpowers/specs/2026-08-28-runtime-gate-auto-redirect-design.md (D2 auto-redirect, D3 no escape hatch, D6 announce-don't-swap-silently).

If Bash is NOT available (normal Cowork runtime), proceed to Step 0.

Step 0: Resolve config

The default knowledge folder is ~/Projects/knowledge/ (expand ~ to your home directory's absolute path). Read <knowledge_folder>/aria-config.md and extract knowledge_folder and last_setup_date. If aria-config.md doesn't exist, stop: "aria-cowork is not configured. Run /aria-setup to get started."

Use <knowledge_folder> for all file operations during this session.

Step 1: Count promoted files

Count .md files (excluding README.md) in each promoted folder:

Record counts per category and total.

Step 2: Count backlog items

For each backlog file, count its live entries below the --- separator by the rule in /aria-cowork:audit-knowledge Step 1 — ### entries, plus ## headings with content under them, plus #### YYYY-MM-DD headings dated on or after the last audit pass whose heading carries no disposition marker (a ### -only count under-reports). This is the same rule aria-knowledge's shared counter script applies in Code; Cowork has no shell, so apply it by reading the files. A missing backlog file is reported as missing, never counted as 0:

Also count .md files in <knowledge_folder>/intake/clippings/ (unreviewed clippings).

Step 3: Read audit dates

Extract the **Date:** from:

Calculate days since each. If a date is missing or "never", note "never".

Step 4: Index health (if index.md exists)

If <knowledge_folder>/index.md exists, read it and extract:

If index.md doesn't exist, note: "No index — run /aria-cowork:index to build."

Step 5: Coverage gaps

Check which promoted folders have zero .md files (excluding README.md):

These suggest areas where knowledge capture hasn't started yet.

Step 6: Present

Output policy: emit every section defined in the format below with all fields, even when counts are zero. Zero counts are meaningful data points — "Pending insights: 0" confirms the backlog is clear, "Stale files: 0" confirms the index is current. Do not collapse the dashboard into prose or shorten sections for brevity. The Index Health and Coverage Gaps sections have explicit conditional branches embedded in the template; all other sections are always-emit.

## Knowledge Stats (aria-cowork view)

### Repository
- Promoted files: N total
  - Rules: N
  - Approaches: N
  - Decisions: N
  - Guides: N
  - References: N
- Archived: N

### Intake
- Pending insights: N
- Pending decisions: N
- Pending extractions: N
- Pending rules: N
- Unreviewed clippings: N

### Audit Status
- Knowledge audit: [YYYY-MM-DD (N days ago) | never]  *(populated when /audit-knowledge ships in v0.2.0)*
- Config audit: [YYYY-MM-DD (N days ago) | never]  *(populated when /audit-config ships in v0.2.0)*
- Last /aria-setup: YYYY-MM-DD (N days ago)

### Index Health
[If index exists:]
- Known tags: N
- Top tags: tag1 (N files), tag2 (N files), tag3 (N files), tag4 (N files), tag5 (N files)
- Untagged files: N
- Stale files: N
- Semantic-hints coverage: N of M files (P%)
[If no index:]
- No index built yet — run /aria-cowork:index

### Coverage Gaps
[List empty categories, or "All categories have content."]

Phase 1 notes

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.