/audit
Audit the knowledge base for quality issues: missing frontmatter, broken links, tag inconsistencies, orphaned files, and coverage gaps. Works on any markdown-heavy project.
Steps
Parse focus area from $ARGUMENTS (optional). If provided, focus on that area (e.g., "tags", "frontmatter", "links"). If empty, run full audit.
Find all markdown files: Use Glob to find all .md files, excluding common non-content directories: .venv/, node_modules/, .git/, archive/, .archive_old/.
Frontmatter audit: First, scan a sample of existing files (first 10-20) to detect the frontmatter schema in use (which fields exist, what values are common for type and status). Then for each markdown file, check:
- Has YAML frontmatter (starts with
--- and has closing ---)
- Core fields present:
title, tags (and any other fields consistently used across the KB)
type and status values (if used) are consistent with the detected schema
tags is a non-empty list
Track files missing frontmatter and files with incomplete/invalid frontmatter.
Link check: Look for broken internal links:
- Grep for markdown links
\[.*\]\(.*\.md\) and verify each target file exists
- If a link-checking script exists in the project (e.g.,
scripts/check_links.py), run it as well
Tag consistency audit: Use Grep to find all tags: sections across .md files. Look for:
- Near-duplicate tags (e.g., "ai" vs "AI" vs "artificial-intelligence")
- Tags used only once (potential typos)
- Very common tags that might be too broad
List all unique tags with counts.
Orphaned files: Check which files are NOT referenced in any other file's related: field. Files that exist but are never cross-referenced may be orphaned.
Content quality: Find documents that appear to be ideas or opportunities (based on detected type field or directory location) and check:
- Documents still in
draft status for more than 30 days
- Documents missing key metadata fields that other similar documents have
- Documents with very little content (< 100 words, excluding frontmatter)
Coverage gaps: Check each directory for content:
- Flag any empty or near-empty directories
- Look for directories with only 1-2 files (may need more content)
Output report:
## KB Audit Report
**Date:** [today]
### Summary
- Total .md files: X
- With frontmatter: X (X%)
- Without frontmatter: X
### Frontmatter Issues
| File | Issue |
|------|-------|
| path | Missing field: type |
### Broken Links
[list of broken references]
### Tag Analysis
- Total unique tags: X
- Single-use tags: [list]
- Potential duplicates: [list]
### Orphaned Files
[files not referenced anywhere]
### Content Quality
- Stale drafts (> 30 days): [list]
- Missing metadata: [list]
- Low-content files: [list]
### Coverage
[directory analysis]
### Recommendations
1. [specific action]
2. [specific action]
3. [specific action]
Common Issues
No markdown files found
Cause: Running in wrong directory or all files excluded.
Fix: Ensure you're in the knowledge base root. Check exclude patterns in step 2.
Too many single-use tags
Cause: Inconsistent tagging across documents.
Fix: Pick canonical tags from the most-used list. Run audit again after cleanup.
Frontmatter validation errors
Cause: YAML syntax issues (missing quotes, wrong indentation).
Fix: Ensure --- delimiters are present. Use type: and status: values consistent with your KB's detected schema.
1---
2name: solo-audit
3description: Health check knowledge base for broken links, missing frontmatter, tag inconsistencies, and coverage gaps. Use when user says "audit KB", "check frontmatter", "find broken links", "tag cleanup", or "knowledge base quality". Do NOT use for SEO audits (use /seo-audit) or code reviews.
4license: MIT
5metadata:
6 source: https://skillmd.com/skills/modbender/solo-audit
7 author: fortunto2
8 version: "1.4.1"
9 openclaw:
10 emoji: "🩺"
11allowed-tools: Read, Grep, Bash, Glob, mcp__solograph__kb_search
12argument-hint: "[optional: focus area like 'tags' or 'frontmatter']"
13---
14
15# /audit
16
17Audit the knowledge base for quality issues: missing frontmatter, broken links, tag inconsistencies, orphaned files, and coverage gaps. Works on any markdown-heavy project.
18
19## Steps
20
211. **Parse focus area** from `$ARGUMENTS` (optional). If provided, focus on that area (e.g., "tags", "frontmatter", "links"). If empty, run full audit.
22
232. **Find all markdown files:** Use Glob to find all .md files, excluding common non-content directories: `.venv/`, `node_modules/`, `.git/`, `archive/`, `.archive_old/`.
24
253. **Frontmatter audit:** First, scan a sample of existing files (first 10-20) to detect the frontmatter schema in use (which fields exist, what values are common for `type` and `status`). Then for each markdown file, check:
26 - Has YAML frontmatter (starts with `---` and has closing `---`)
27 - Core fields present: `title`, `tags` (and any other fields consistently used across the KB)
28 - `type` and `status` values (if used) are consistent with the detected schema
29 - `tags` is a non-empty list
30 Track files missing frontmatter and files with incomplete/invalid frontmatter.
31
324. **Link check:** Look for broken internal links:
33 - Grep for markdown links `\[.*\]\(.*\.md\)` and verify each target file exists
34 - If a link-checking script exists in the project (e.g., `scripts/check_links.py`), run it as well
35
365. **Tag consistency audit:** Use Grep to find all `tags:` sections across .md files. Look for:
37 - Near-duplicate tags (e.g., "ai" vs "AI" vs "artificial-intelligence")
38 - Tags used only once (potential typos)
39 - Very common tags that might be too broad
40 List all unique tags with counts.
41
426. **Orphaned files:** Check which files are NOT referenced in any other file's `related:` field. Files that exist but are never cross-referenced may be orphaned.
43
447. **Content quality:** Find documents that appear to be ideas or opportunities (based on detected `type` field or directory location) and check:
45 - Documents still in `draft` status for more than 30 days
46 - Documents missing key metadata fields that other similar documents have
47 - Documents with very little content (< 100 words, excluding frontmatter)
48
498. **Coverage gaps:** Check each directory for content:
50 - Flag any empty or near-empty directories
51 - Look for directories with only 1-2 files (may need more content)
52
539. **Output report:**
54 ```
55 ## KB Audit Report
56
57 **Date:** [today]
58
59 ### Summary
60 - Total .md files: X
61 - With frontmatter: X (X%)
62 - Without frontmatter: X
63
64 ### Frontmatter Issues
65 | File | Issue |
66 |------|-------|
67 | path | Missing field: type |
68
69 ### Broken Links
70 [list of broken references]
71
72 ### Tag Analysis
73 - Total unique tags: X
74 - Single-use tags: [list]
75 - Potential duplicates: [list]
76
77 ### Orphaned Files
78 [files not referenced anywhere]
79
80 ### Content Quality
81 - Stale drafts (> 30 days): [list]
82 - Missing metadata: [list]
83 - Low-content files: [list]
84
85 ### Coverage
86 [directory analysis]
87
88 ### Recommendations
89 1. [specific action]
90 2. [specific action]
91 3. [specific action]
92 ```
93
94## Common Issues
95
96### No markdown files found
97**Cause:** Running in wrong directory or all files excluded.
98**Fix:** Ensure you're in the knowledge base root. Check exclude patterns in step 2.
99
100### Too many single-use tags
101**Cause:** Inconsistent tagging across documents.
102**Fix:** Pick canonical tags from the most-used list. Run audit again after cleanup.
103
104### Frontmatter validation errors
105**Cause:** YAML syntax issues (missing quotes, wrong indentation).
106**Fix:** Ensure `---` delimiters are present. Use `type:` and `status:` values consistent with your KB's detected schema.