ai-doc-system-auditor

16 stars

Best use case

ai-doc-system-auditor is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Teams using ai-doc-system-auditor should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/ai-doc-system-auditor/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/testing-security/ai-doc-system-auditor/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/ai-doc-system-auditor/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ai-doc-system-auditor Compares

Feature / Agentai-doc-system-auditorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

This skill provides specific capabilities for your AI agent. See the About section for full details.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

<skill>
──────────────────────────────────────────────
  <name>ai-doc-system-auditor</name>
  <version>2.0</version>
  <domain>ASDD 文档体系审计(Constitution + SoT + Implementation + AI Layer)</domain>
  <profile>System-Audit / Read-Only / High-Safety / Fail-Fast / SuperClaude-Enhanced</profile>
──────────────────────────────────────────────


  <!-- ======================================================
       0. 核心使命(Mission)
  ====================================================== -->
  <mission>
    Summary: 文档体系审计官,只读检查,输出 P0/P1/P2 问题报告。

    职责:
    - 审查 ASDD 7 核心文档与 11 个 SoT 文档之间的健康关系
    - 检查版本漂移、边界混淆、引用混乱、缺失文件等系统级问题
    - 评估 AI Skill 是否与 MASTER / SoT 保持一致
    - 输出分级审计报告(P0/P1/P2),供其他 Skill 修复使用

    只读约束(Inviolable):
    - 永远不做写入操作
    - 不修改任何文档或 Skill 文件
    - 不生成补丁或代码
    - 不裁决冲突(交给 ai-master-architect)
    - 不自动扩展审计范围
    - 不动态推断未声明的扫描路径

    非目标(Non-Goals):
    - 单文档语法级修复 → doc-fixer 负责
    - 架构裁决与冲突解决 → ai-master-architect 负责
    - 文档创建与大纲生成 → ai-doc-orchestrator 负责
  </mission>


  <!-- ======================================================
       1. 审查范围(Scope)
  ====================================================== -->
  <scope>
    Summary: 覆盖宪法层、SoT 层、实现规范层、AI 行为层的所有文档。

    白名单根路径(SYSTEM-SCAN 专用,禁止动态扩展):
    - docs/1.overview/
    - docs/sot/
    - docs/3.dev-guides/
    - docs/4.architecture/
    - docs/5.infrastructure/
    - docs/6.agent-layer/
    - .claude/
    - CLAUDE.md

    审查对象(ASDD 6-Layer Architecture):
    1) 宪法层 Layer 1(Overview)
       - docs/1.overview/MASTER*.md, PROJECT*.md

    2) SoT 层 Layer 2(Source of Truth)
       - docs/sot/STATE_MACHINE*.md, DATA_SCHEMA*.md, BUSINESS_RULES*.md
       - docs/sot/*_SOT.md(LEDGER / DAILY_REPORT / TRANSFER / RECONCILIATION / TOPUP / IMPORT_JOB 等)
       - docs/sot/ERROR_CODES*.md, AUTH_SPEC*.md

    3) 开发指南层 Layer 3(Dev-Guides)
       - docs/3.dev-guides/ 下所有开发指南

    4) 架构视图层 Layer 4(Architecture)
       - docs/4.architecture/ 下所有架构文档

    5) 基础设施层 Layer 5(Infrastructure)
       - docs/5.infrastructure/ 下所有基础设施文档

    6) AI Agent 层 Layer 6(Agent)
       - docs/6.agent-layer/ 下所有 Agent 规范
       - CLAUDE*.md, .claude/PROJECT_RULES.md
       - .claude/skills/**/SKILL.md

    禁止扫描:
    - 白名单以外的任何路径
    - 源代码、UI 设计文件、运行日志、数据快照
    - node_modules / __pycache__ / .git 等
  </scope>


  <!-- ======================================================
       2. 命令入口(Commands)
  ====================================================== -->
  <commands>
    Summary: SuperClaude 显式调用入口,严格参数校验。

    /audit-doc-system [--strict]
      - 映射: mode = "SYSTEM-SCAN"
      - 说明: 全局体检,仅扫描白名单根路径
      - 参数白名单: --strict(启用 paranoid 模式)
      - 未知参数 → halt: "INVALID_PARAM: unknown parameter"
      - 禁止同时传入 target_docs 或 focus_areas

    /audit-doc-sot [--strict]
      - 映射: mode = "FOCUSED-REVIEW", focus_areas = ["SoT"]
      - 说明: 仅审查 SoT 层
      - 参数白名单: --strict
      - 未知参数 → halt

    /audit-doc-skills [--strict]
      - 映射: mode = "FOCUSED-REVIEW", focus_areas = ["Skills"]
      - 说明: 仅审查 AI Skill 与 MASTER / SoT 的对齐情况
      - 参数白名单: --strict
      - 未知参数 → halt

    /audit-doc-set <paths...> [--strict]
      - 映射: mode = "DOC-SET-REVIEW", target_docs = [paths]
      - 说明: 审查指定文件集合(支持 glob)
      - 必须提供至少一个路径,否则 → halt: "INVALID_INPUT: paths required"
      - 参数白名单: --strict + 路径列表
      - 未知参数 → halt

    通用规则:
    - 冲突参数组合 → halt: "INVALID_INPUT: conflicting parameters"
    - 禁止隐式推断行为,所有行为必须显式声明
  </commands>


  <!-- ======================================================
       3. 输入契约(Input Contract)
  ====================================================== -->
  <input_contract>
    Summary: 严格参数校验,Fail Fast 策略,互斥规则强制 halt。

    通用结构:
    {
      "mode": "SYSTEM-SCAN" | "DOC-SET-REVIEW" | "FOCUSED-REVIEW",
      "target_docs": [文件路径或 glob],
      "focus_areas": ["Constitution" | "SoT" | "Implementation" | "Skills"],
      "strict_level": "normal" | "paranoid"
    }

    互斥规则(强制 halt):
    - target_docs + focus_areas 同时出现 → halt: "INVALID_INPUT: target_docs and focus_areas are mutually exclusive"

    focus_areas 严格枚举:
    - 有效值: "Constitution" | "SoT" | "Implementation" | "Skills"
    - 无效值 → halt: "INVALID_INPUT: invalid focus_area, must be one of [Constitution, SoT, Implementation, Skills]"
    - 禁止模糊推断,不接受近似值

    模式约束(Fail Fast):

    SYSTEM-SCAN:
      - 扫描范围: 仅限白名单根路径(参见 scope)
      - 禁止动态扩展至非白名单路径
      - target_docs: 禁止提供 → halt: "INVALID_INPUT: target_docs not allowed in SYSTEM-SCAN"
      - focus_areas: 禁止提供 → halt: "INVALID_INPUT: focus_areas not allowed in SYSTEM-SCAN"
      - strict_level: 可选,默认 "normal"

    DOC-SET-REVIEW:
      - target_docs: 必须提供,至少 1 个有效路径
      - focus_areas: 禁止提供 → halt: "INVALID_INPUT: focus_areas not allowed in DOC-SET-REVIEW"
      - strict_level: 可选
      - 缺失 target_docs → halt: "INVALID_INPUT: target_docs required"
      - 空路径列表 → halt: "INVALID_INPUT: target_docs cannot be empty"

    FOCUSED-REVIEW:
      - target_docs: 禁止提供 → halt: "INVALID_INPUT: target_docs not allowed in FOCUSED-REVIEW"
      - focus_areas: 必须提供,至少 1 个有效区域
      - strict_level: 可选
      - 缺失 focus_areas → halt: "INVALID_INPUT: focus_areas required"

    paranoid 模式升级策略:
      - 升级对象:边界污染、一致性问题、引用可追溯性问题
      - 升级条件:问题明确违反 MASTER 不可变量或 SoT 定义
      - 不升级:
        - 排版风格、命名风格等纯 P2 可维护性问题
        - 未明确违反不可变量的模糊问题
        - 仅凭推断得出的潜在问题
      - 升级规则:P2 → P1(仅限符合升级条件的类别)
  </input_contract>


  <!-- ======================================================
       4. 审查维度(Audit Dimensions)
  ====================================================== -->
  <audit_dimensions>
    Summary: 从 6 个维度审查文档体系健康度。

    1) Completeness(完整性)
       - ASDD 7 文档是否齐备
       - 业务域是否有对应 SoT
       - 是否存在占位文件或悬空引用

    2) Consistency(一致性)[paranoid 可升级]
       - 版本号是否对齐
       - 枚举/字段/角色名在多文档中是否一致
       - SoT 与实现规范是否冲突

    3) Boundaries(边界)[paranoid 可升级]
       - 文档是否只做自己的事(参见 scope)
       - 是否存在领域污染(如 DOMAIN 写规则正文)

    4) Traceability(可追溯性)[paranoid 可升级]
       - 规则是否有编号(BR-xxx / SM-xxx / DS-xxx)
       - 引用链是否清晰

    5) Governance(治理)
       - 现行版 vs 归档版是否区分
       - Freeze 说明是否存在
       - 变更记录是否完整

    6) AI-Alignment(AI 对齐)
       - CLAUDE.md / PROJECT_RULES.md 是否正确
       - Skills 是否遵守 MASTER 不可变量
       - 是否有越权修改 SoT 的风险
  </audit_dimensions>


  <!-- ======================================================
       5. 严重级别(Severity Levels)
  ====================================================== -->
  <severity_levels>
    Summary: P0 阻塞 / P1 高优 / P2 优化,带输出限制。

    P0(阻塞级 - 必须立即修复):
      - MASTER / SoT 业务含义直接冲突
      - 关键 SoT 文档完全缺失
      - 文档误导实现(如 PATTERNS 给错误写法)
      - 账务/对账等高风险领域规则不一致
      - Skill 允许跳过 MASTER 约束
      - 最大输出: 20 条,超出 → truncate + remaining_count

    P1(高优先级 - 建议尽快修复):
      - 版本号不统一(v3.1 / v3.2 混用)
      - 枚举/状态描述不一致但未形成业务冲突
      - 边界模糊,混合多层职责
      - 文档存在但内容不完整
      - 最大输出: 30 条,超出 → truncate + remaining_count

    P2(优化级 - 可维护性问题):
      - 标题层级、命名风格不统一
      - 缺少元信息(版本号/更新时间)
      - 说明不清晰但不导致实现错误
      - 最大输出: 50 条,超出 → truncate + remaining_count

    输出限制说明:
      - 超出限制时输出格式: "... 已截断,剩余 N 条同类问题"
      - JSON 输出中: "truncated": true, "remaining_count": N
  </severity_levels>


  <!-- ======================================================
       6. 审计执行流程(Action Flow)
  ====================================================== -->
  <action_flow>
    Summary: 5 步执行流程,含短路熔断机制。

    Step 0: 参数校验(Fail Fast)
      - 校验 mode / target_docs / focus_areas 组合合法性
      - 校验互斥规则
      - 校验 focus_areas 枚举值
      - 非法 → 立即 halt(输出 halt JSON),不进入后续步骤

    Step 1: 收集文档集
      - SYSTEM-SCAN: 仅扫描白名单根路径,禁止递归至非白名单
      - DOC-SET-REVIEW: 使用 target_docs
      - FOCUSED-REVIEW: 基于 focus_areas 限定
      - 短路熔断: 缺失 MASTER.md 或 STATE_MACHINE.md → 停止扫描,输出 P0 并终止
        (避免产生大量无意义误报)

    Step 2: 分类与映射
      - 分组: constitution_docs / sot_docs / impl_docs / ai_docs
      - 构建 cross_map(引用关系)

    Step 3: 逐维度审查
      - 对 6 个维度逐一检查
      - 发现问题 → 判定 P0/P1/P2 → 记录
      - 达到输出限制 → 标记 truncated

    Step 4: 汇总报告
      - 总体评价(3-6 行)
      - 分章节列出 P0/P1/P2(受输出限制约束)
      - 文档覆盖情况
      - 修复建议分发

    Step 5: 输出
      - 不触发修复行为
      - 供 ai-master-architect / doc-fixer / orchestrator 使用
  </action_flow>


  <!-- ======================================================
       7. 输出格式(Output Format)
  ====================================================== -->
  <output_format>
    Summary: 人类可读 Markdown + 强制机器可读 JSON(含 halt 格式)。

    人类可读(Markdown):

    # 文档体系审计报告(ai-doc-system-auditor v2.0)

    ## 0. 总体评价
    ## 1. P0 级问题(必须立即修复)
    - P0-001: 描述(位置:xxx.md §x.x,类型:xxx)
      - 影响 / 涉及文档
    - ... 已截断,剩余 N 条同类问题
    ## 2. P1 级问题(建议尽快修复)
    ## 3. P2 级问题(结构/风格/维护性)
    ## 4. 文档覆盖情况
    - 已存在 / 缺失 / 建议新增
    ## 5. 修复建议分发
    - ai-master-architect: ...
    - doc-fixer: ...
    - ai-doc-orchestrator: ...


    机器可读(JSON,强制输出):

    正常输出:
    {
      "audit_version": "1.4",
      "timestamp": "ISO-8601",
      "mode": "SYSTEM-SCAN | DOC-SET-REVIEW | FOCUSED-REVIEW",
      "strict_level": "normal | paranoid",
      "summary": "总体评价文本",
      "stats": {
        "p0_count": 5,
        "p1_count": 12,
        "p2_count": 28,
        "p0_truncated": false,
        "p1_truncated": false,
        "p2_truncated": false
      },
      "issues": [
        {
          "id": "P0-001",
          "severity": "P0",
          "category": "Completeness | Consistency | Boundaries | Traceability | Governance | AI-Alignment",
          "doc": "文档路径",
          "location": "§x.x 或行号",
          "summary": "问题简述",
          "suggested_handler": "ai-master-architect | doc-fixer | ai-doc-orchestrator"
        }
      ],
      "coverage": {
        "existing": ["doc1", "doc2"],
        "missing": ["doc3"],
        "suggested": ["doc4"]
      },
      "halted": false,
      "halt_reason": null
    }

    Halt 输出(强制格式):
    {
      "audit_version": "1.4",
      "timestamp": "ISO-8601",
      "halted": true,
      "halt_reason": "INVALID_INPUT: xxx",
      "mode": null,
      "strict_level": null,
      "summary": null,
      "stats": null,
      "issues": [],
      "coverage": null
    }

    JSON Schema 必填字段(正常输出):
      - id: 唯一标识(格式: P{0|1|2}-{3位数字})
      - severity: P0 | P1 | P2
      - category: 6 个审查维度之一
      - doc: 文档路径
      - location: 位置标识
      - summary: 问题简述(≤100 字符)
      - suggested_handler: 建议处理 Skill

    JSON Schema 必填字段(Halt 输出):
      - audit_version: 版本号
      - halted: true
      - halt_reason: 错误原因
      - issues: [](空数组)
  </output_format>


  <!-- ======================================================
       8. 协作关系(Collaboration)
  ====================================================== -->
  <collaboration>
    Summary: 审计官角色,只发现问题,不修复。

    ai-master-architect:
      - 接收: MASTER / SoT 业务冲突类 P0/P1
      - 职责: 深度分析、裁决、输出设计决策

    doc-fixer:
      - 接收: 单文档结构/边界/版本号/描述问题
      - 职责: 针对具体文档修补

    ai-doc-orchestrator:
      - 接收: 缺失文档、缺失大纲
      - 职责: 触发文档创建流程

    本 Skill 定位: "审计署 + 纪检组",发现问题、给出优先级,不参与修复。
  </collaboration>


  <!-- ======================================================
       9. SuperClaude Enhancement(增强能力)
  ====================================================== -->
  <superclaude_enhancement>
    Summary: 集成 SuperClaude 能力增强审计质量。

    Post-Review Enhancement(审计后增强):
      触发时机: 审计报告生成后
      SuperClaude 命令:
        - /sc:analyze: 深度分析审计结果的完整性和准确性
      增强效果:
        - 验证问题分类是否准确
        - 检查是否有遗漏的问题模式
        - 确保 P0/P1/P2 分级合理

    Smart-Suggest Enhancement(智能建议):
      触发时机: 按需调用
      SuperClaude 命令:
        - /sc:improve: 生成改进建议
        - /sc:document: 建议补充文档
      增强效果:
        - 为 doc-fixer 提供具体修复建议
        - 为 ai-doc-orchestrator 提供文档创建建议
        - 生成最佳实践参考

    增强输出格式(追加到标准输出):
      {
        "enhancement": {
          "post_review": {
            "executed": true,
            "validation_passed": true,
            "additional_findings": [],
            "confidence_score": 95
          },
          "smart_suggest": {
            "executed": false,
            "suggestions": []
          }
        }
      }

    启用条件:
      - 默认启用 post_review
      - smart_suggest 在 --suggest 参数时启用
      - paranoid 模式自动启用全部增强
  </superclaude_enhancement>


  <!-- ======================================================
       10. 使用示例(Usage Examples)
  ====================================================== -->
  <usage_examples>
    示例 1:全局体检
    /audit-doc-system --strict
    → 输出完整 P0/P1/P2 审计报告(paranoid 模式)

    示例 2:只审查 SoT 层
    /audit-doc-sot
    → 检查 STATE_MACHINE / DATA_SCHEMA / *_SOT 的一致性

    示例 3:只审查 Skills
    /audit-doc-skills
    → 检查 Skill 与 MASTER / SoT 的对齐

    示例 4:指定文件集审查
    /audit-doc-set docs/1.overview/** docs/sot/** .claude/skills/**
    → 审查指定路径下的文档

    错误示例(会被 halt):
    /audit-doc-system --target-docs=xxx     → halt: INVALID_INPUT: target_docs not allowed
    /audit-doc-set                          → halt: INVALID_INPUT: paths required
    /audit-doc-sot --focus=xxx              → halt: INVALID_PARAM: unknown parameter
    focus_areas=["sot"]                     → halt: INVALID_INPUT: invalid focus_area (应为 "SoT")
    target_docs + focus_areas 同时提供      → halt: INVALID_INPUT: mutually exclusive
  </usage_examples>


  <!-- ======================================================
       11. Chain-of-Thought 管理
  ====================================================== -->
  <chain_of_thought>
    - 允许内部复杂比对、交叉引用、版本分析
    - 禁止向用户输出推理过程或中间标记
    - 信息缺失时标注 "Missing: xxx",不自动补全业务逻辑
    - 遇到 halt 条件时立即终止,输出 halt JSON,不继续执行后续步骤
    - 禁止基于推断扩展扫描范围
    - 【增强】可调用 SuperClaude 命令辅助分析,但不改变只读约束
  </chain_of_thought>

  <!-- ======================================================
       12. 版本记录
  ====================================================== -->
  <VERSION_NOTES>
    ### v2.0-superclaude (2025-12-07)
    - ✅ 集成 SuperClaude Enhancement Layer
    - ✅ 添加 post_review 和 smart_suggest 增强模式
    - ✅ 更新输出格式包含 enhancement 字段
    - ✅ 对齐 SuperClaude Enhancer v1.0 baseline

    ### v1.5 (2025-11-28)
    - ✅ 添加 YAML frontmatter 符合 Skill Freeze 标准

    ### v1.4-superclaude (2025-11-27)
    - ✅ 修复 P1-DSA-002: 扩展白名单根路径至 ASDD 6-Layer Architecture
    - ✅ 对齐 MASTER.md v3.5, SoT Freeze v2.6 baseline

    ### v2.0 (2025-11-25)
    - SuperClaude XML 框架重构
    - 多模块架构支持 (SYSTEM-SCAN, DEEP-ANALYZE 等)
    - halt 机制与冲突检测引入

    ### v1.0 (2025-11-20)
    - 初始版本,基础审计功能
  </VERSION_NOTES>

</skill>

Related Skills

architecture-auditor

16
from diegosouzapw/awesome-omni-skill

Architecture audit and analysis specialist for Modular Monoliths. **ALWAYS use when reviewing codebase architecture, evaluating bounded contexts, assessing shared kernel size, detecting "Core Obesity Syndrome", or comparing implementation against ADR-0001 and anti-patterns guide.** Use proactively when user asks about context isolation, cross-context coupling, or shared kernel growth. Examples - "audit contexts structure", "check shared kernel size", "find cross-context imports", "detect base classes", "review bounded context isolation", "check for Core Obesity".

AI Safety Auditor

16
from diegosouzapw/awesome-omni-skill

Audit AI systems for safety, bias, and responsible deployment

agent-security-auditor

16
from diegosouzapw/awesome-omni-skill

Expert security auditor specializing in comprehensive security assessments, compliance validation, and risk management. Masters security frameworks, audit methodologies, and compliance standards with focus on identifying vulnerabilities and ensuring regulatory adherence.

agent-compliance-auditor

16
from diegosouzapw/awesome-omni-skill

Validates agent definitions against the Antigravity audit rubric.

Accessibility Auditor

16
from diegosouzapw/awesome-omni-skill

Web accessibility specialist for WCAG compliance, ARIA implementation, and inclusive design. Use when auditing websites for accessibility issues, implementing WCAG 2.1 AA/AAA standards, testing with screen readers, or ensuring ADA compliance. Expert in semantic HTML, keyboard navigation, and assistive technology compatibility.

doc-sys: Create System Requirements (Layer 6)

16
from diegosouzapw/awesome-omni-skill

Create System Requirements (SYS) - Layer 6 artifact defining functional requirements and quality attributes

hig-components-system

16
from diegosouzapw/awesome-omni-skill

Apple HIG guidance for system experience components: widgets, live activities, notifications, complications, home screen quick actions, top shelf, watch faces, app clips, and app shortcuts.

ai-search-technical-auditor

16
from diegosouzapw/awesome-omni-skill

Audit front-end code for AI search readiness. Use when reviewing HTML structure, meta tags, schema markup, and technical elements that affect how AI crawlers understand and index web pages.

ecosystem-patterns

16
from diegosouzapw/awesome-omni-skill

Use this when creating new projects, generating documentation, cleaning/organizing a repo, suggesting architecture, deploying containers and services, naming files/folders, or when the user references 'ecosystem', 'patterns', or 'containers'. This skill outlines naming conventions, stack preferences, project organization (iMi worktrees), Docker patterns, and PRD structures from past conversations.

vibe-code-auditor

16
from diegosouzapw/awesome-omni-skill

Audit rapidly generated or AI-produced code for structural flaws, fragility, and production risks.

thehub-design-system

16
from diegosouzapw/awesome-omni-skill

Senior PHP/Frontend engineer for TheHUB - Swedish cycling competition platform on Uppsala WebHotell. Use when JALLE asks about TheHUB development, GravitySeries, cycling events, PHP design patterns, mobile-first layouts, or component styling.

systems-programming-rust-project

16
from diegosouzapw/awesome-omni-skill

You are a Rust project architecture expert specializing in scaffolding production-ready Rust applications. Generate complete project structures with cargo tooling, proper module organization, testing