Audit the knowledge base for quality issues: missing frontmatter, broken links, tag inconsistencies, orphaned files, and coverage gaps. Works on any markdown-heavy project.
$ARGUMENTS (optional). If provided, focus on that area (e.g., "tags", "frontmatter", "links"). If empty, run full audit..venv/, node_modules/, .git/, archive/, .archive_old/.type and status). Then for each markdown file, check:--- and has closing ---)title, tags (and any other fields consistently used across the KB)type and status values (if used) are consistent with the detected schematags is a non-empty listTrack files missing frontmatter and files with incomplete/invalid frontmatter.
\[.\]\(.\.md\) and verify each target file existsscripts/check_links.py), run it as welltags: sections across .md files. Look for:List all unique tags with counts.
related: field. Files that exist but are never cross-referenced may be orphaned.type field or directory location) and check:draft status for more than 30 days```
## KB Audit Report
Date: [today]
### Summary
### Frontmatter Issues
| File | Issue |
|------|-------|
| path | Missing field: type |
### Broken Links
[list of broken references]
### Tag Analysis
### Orphaned Files
[files not referenced anywhere]
### Content Quality
### Coverage
[directory analysis]
### Recommendations
```
Cause: Running in wrong directory or all files excluded.
Fix: Ensure you're in the knowledge base root. Check exclude patterns in step 2.
Cause: Inconsistent tagging across documents.
Fix: Pick canonical tags from the most-used list. Run audit again after cleanup.
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 个版本