← 返回
安全合规 中文

Audit

Health check knowledge base for broken links, missing frontmatter, tag inconsistencies, and coverage gaps. Use when user says "audit KB", "check frontmatter"...
检测知识库中的坏链、缺失前置数据、标签不一致及覆盖盲区。当用户说“审计知识库”、“检查前置数据”时调用。
fortunto2
安全合规 clawhub v1.4.1 1 版本 99916.2 Key: 无需
★ 0
Stars
📥 1,193
下载
💾 16
安装
1
版本
#latest

概述

/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

  1. Parse focus area from $ARGUMENTS (optional). If provided, focus on that area (e.g., "tags", "frontmatter", "links"). If empty, run full audit.
  1. Find all markdown files: Use Glob to find all .md files, excluding common non-content directories: .venv/, node_modules/, .git/, archive/, .archive_old/.
  1. 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.

  1. 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
  1. 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.

  1. 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.
  1. 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)
  1. 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)
  1. 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 个版本

  • v1.4.1 当前
    2026-03-29 08:10 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,215 📥 266,539
data-analysis

Research

fortunto2
深度市场调研——竞品分析、用户痛点、SEO/ASO关键词、命名/域名可用性及TAM/SAM/SOM市场规模估算。当用户说“resea...”时使用。
★ 0 📥 2,033
security-compliance

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 89 📥 30,609