solo-audit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/audit
/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.
对知识库进行质量问题审计:缺失前置元数据(frontmatter)、失效链接、标签不一致、孤立文件以及内容覆盖缺口。适用于任何以Markdown为主的项目。
Steps
步骤
-
Parse focus area from(optional). If provided, focus on that area (e.g., "tags", "frontmatter", "links"). If empty, run full audit.
$ARGUMENTS -
Find all markdown files: Use Glob to find all .md files, excluding common non-content directories:,
.venv/,node_modules/,.git/,.embeddings/,archive/..archive_old/ -
Frontmatter audit: For each markdown file, read it and check:
- Has YAML frontmatter (starts with and has closing
---)--- - Required fields present: ,
type,status,titletags - is valid: one of
type,principle,methodology,agent,opportunity,captureresearch - is valid: one of
status,active,draft,validatedarchived - is a non-empty list Track files missing frontmatter and files with incomplete/invalid frontmatter.
tags
- Has YAML frontmatter (starts with
-
Link check: Look for broken internal links:
- If exists, run it:
scripts/check_links.pyuv run python scripts/check_links.py - Otherwise: Grep for markdown links and verify each target exists
\[.*\]\(.*\.md\)
- If
-
Tag consistency audit: Use Grep to find allsections across .md files. Look for:
tags:- 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'sfield. Files that exist but are never cross-referenced may be orphaned.
related: -
Opportunity quality: Find all documents withand check:
type: opportunity- Missing field
opportunity_score - = 0 or missing
evidence_sources - Status still for more than 30 days
draft
- Missing
-
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] ### Opportunity Quality - Without opportunity_score: [list] - Without evidence_sources: [list] ### Coverage [directory analysis] ### Recommendations 1. [specific action] 2. [specific action] 3. [specific action]
-
解析聚焦领域(来自,可选)。若提供该参数,则仅针对指定领域进行审计(例如:"tags"、"frontmatter"、"links")。若为空,则执行全面审计。
$ARGUMENTS -
查找所有Markdown文件:使用Glob查找所有.md文件,排除常见非内容目录:、
.venv/、node_modules/、.git/、.embeddings/、archive/。.archive_old/ -
前置元数据(Frontmatter)审计:对每个Markdown文件,读取并检查:
- 是否包含YAML前置元数据(以开头并以
---结尾)--- - 是否存在必填字段:、
type、status、titletags - 取值有效:必须是
type、principle、methodology、agent、opportunity、capture中的一个research - 取值有效:必须是
status、active、draft、validated中的一个archived - 为非空列表 记录缺失前置元数据的文件,以及前置元数据不完整或无效的文件。
tags
- 是否包含YAML前置元数据(以
-
链接检查:查找失效的内部链接:
- 若存在,则运行该脚本:
scripts/check_links.pyuv run python scripts/check_links.py - 若不存在:使用Grep查找Markdown链接,并验证每个目标文件是否存在
\[.*\]\(.*\.md\)
- 若
-
标签一致性审计:使用Grep查找所有.md文件中的部分。检查:
tags:- 近似重复的标签(例如:"ai" vs "AI" vs "artificial-intelligence")
- 仅使用过一次的标签(可能是拼写错误)
- 过于宽泛的高频标签 列出所有唯一标签及其使用次数。
-
孤立文件检查:检查哪些文件未在其他任何文件的字段中被引用。存在但从未被交叉引用的文件可能是孤立文件。
related: -
机会类文档质量检查:查找所有的文档,并检查:
type: opportunity- 缺失字段
opportunity_score - 为0或缺失
evidence_sources - 状态为且超过30天
draft
- 缺失
-
内容覆盖缺口检查:检查每个目录下的内容:
- 标记空目录或接近空的目录
- 查找仅包含1-2个文件的目录(可能需要补充更多内容)
-
输出报告:
## 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] ### Opportunity Quality - Without opportunity_score: [list] - Without evidence_sources: [list] ### Coverage [directory analysis] ### Recommendations 1. [specific action] 2. [specific action] 3. [specific action]