Get the FREE Ultimate OpenClaw Setup Guide →

ln-612-semantic-content-auditor

Scanned
npx machina-cli add skill levnikolaevich/claude-code-skills/ln-612-semantic-content-auditor --openclaw
Files (1)
SKILL.md
7.1 KB

Paths: File paths (shared/, references/, ../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.

Semantic Content Auditor (L3 Worker)

Specialized worker auditing semantic accuracy of project documentation.

Purpose & Scope

  • Worker in ln-610 coordinator pipeline - invoked by ln-610-docs-auditor for each project document
  • Verify document content matches stated SCOPE (document purpose)
  • Check content aligns with project goals (value contribution)
  • Validate facts against codebase (accuracy and freshness)
  • Return structured findings to coordinator with severity, location, fix suggestions

Target Documents

Called ONLY for project documents (not reference/tasks):

DocumentVerification Focus
CLAUDE.mdInstructions match project structure, paths valid
docs/README.mdNavigation accurate, descriptions match reality
docs/documentation_standards.mdStandards applicable to this project
docs/principles.mdPrinciples reflected in actual code patterns
docs/project/requirements.mdRequirements implemented or still valid
docs/project/architecture.mdArchitecture matches actual code structure
docs/project/tech_stack.mdVersions/technologies match package files
docs/project/api_spec.mdEndpoints/contracts match controllers
docs/project/database_schema.mdSchema matches actual DB/migrations
docs/project/design_guidelines.mdComponents/styles exist in codebase
docs/project/runbook.mdCommands work, paths valid

Excluded: docs/tasks/, docs/reference/, docs/presentation/, tests/

Inputs (from Coordinator)

MANDATORY READ: Load shared/references/task_delegation_pattern.md#audit-coordinator--worker-contract for contextStore structure.

Receives from coordinator per invocation:

FieldDescription
doc_pathPath to document to audit (e.g., docs/project/architecture.md)
output_dirDirectory for report output (from contextStore)
project_rootProject root path
tech_stackDetected technology stack

Workflow

Phase 1: SCOPE EXTRACTION

  1. Read document first 20 lines
  2. Parse <!-- SCOPE: ... --> comment
  3. If no SCOPE tag, infer from document type (see Verification Rules)
  4. Record stated purpose/boundaries

Phase 2: CONTENT-SCOPE ALIGNMENT

Analyze document sections against stated scope:

CheckFinding Type
Section not serving scopeOFF_TOPIC
Scope aspect not coveredMISSING_COVERAGE
Excessive detail beyond scopeSCOPE_CREEP
Content duplicated elsewhereSSOT_VIOLATION

Scoring:

  • 10/10: All content serves scope, scope fully covered
  • 8-9/10: Minor off-topic content or small gaps
  • 6-7/10: Some sections not aligned, partial coverage
  • 4-5/10: Significant misalignment, major gaps
  • 1-3/10: Document does not serve its stated purpose

Phase 3: FACT VERIFICATION

Per document type, verify claims against codebase:

DocumentVerification Method
architecture.mdCheck layers exist (Glob for folders), verify imports follow described pattern (Grep)
tech_stack.mdCompare versions with package.json, go.mod, requirements.txt
api_spec.mdMatch endpoints with controller/route files (Grep for routes)
requirements.mdSearch for feature implementations (Grep for keywords)
database_schema.mdCompare with migration files or Prisma/TypeORM schemas
runbook.mdValidate file paths exist (Glob), test command syntax
principles.mdSample code files for principle adherence patterns
CLAUDE.mdVerify referenced paths/files exist

Finding Types:

  • OUTDATED_PATH: File/folder path no longer exists
  • WRONG_VERSION: Documented version differs from package file
  • MISSING_ENDPOINT: Documented API endpoint not found in code
  • BEHAVIOR_MISMATCH: Described behavior differs from implementation
  • STALE_REFERENCE: Reference to removed/renamed entity

Scoring:

  • 10/10: All facts verified against code
  • 8-9/10: Minor inaccuracies (typos, formatting)
  • 6-7/10: Some paths/names outdated, core info correct
  • 4-5/10: Functional mismatches (wrong behavior described)
  • 1-3/10: Critical mismatches (architecture wrong, APIs broken)

Phase 4: SCORING & REPORT

Calculate final scores and compile findings:

scope_alignment_score = weighted_average(coverage, relevance, focus)
fact_accuracy_score = (verified_facts / total_facts) * 10

overall_score = (scope_alignment * 0.4) + (fact_accuracy * 0.6)

Fact accuracy weighted higher because incorrect information is worse than scope drift.

Scoring Algorithm

MANDATORY READ: Load shared/references/audit_scoring.md for unified scoring formula.

Output Format

MANDATORY READ: Load shared/templates/audit_worker_report_template.md for file format.

Write report to {output_dir}/612-semantic-{doc-slug}.md where doc-slug is derived from document filename (e.g., architecture, tech_stack, claude_md).

With category: "Semantic Content" and checks: scope_alignment, fact_accuracy.

Return summary to coordinator:

Report written: docs/project/.audit/ln-610/{YYYY-MM-DD}/612-semantic-architecture.md
Score: X.X/10 | Issues: N (C:N H:N M:N L:N)

Verification Rules by Document Type

MANDATORY READ: Load references/verification_rules.md for per-document verification patterns.

Critical Rules

  • Read before judge: Always read full document and relevant code before reporting issues
  • Evidence required: Every finding must include evidence field with verification command/result
  • Code is truth: When docs contradict code, document is wrong (unless code is a bug)
  • Scope inference: If no SCOPE tag, use document filename to infer expected scope
  • No false positives: Better to miss an issue than report incorrectly
  • Location precision: Always include line number for findings
  • Actionable fixes: Every finding must have concrete fix suggestion

Definition of Done

  • Document read completely
  • SCOPE extracted or inferred
  • Content-scope alignment analyzed
  • Facts verified against codebase (with evidence)
  • Score calculated using penalty algorithm
  • Report written to {output_dir}/612-semantic-{doc-slug}.md (atomic single Write call)
  • Summary returned to coordinator

Reference Files

  • Worker report template: shared/templates/audit_worker_report_template.md
  • Audit scoring formula: shared/references/audit_scoring.md
  • Audit output schema: shared/references/audit_output_schema.md
  • Verification rules: references/verification_rules.md

Version: 2.0.0 Last Updated: 2026-03-01

Source

git clone https://github.com/levnikolaevich/claude-code-skills/blob/master/ln-612-semantic-content-auditor/SKILL.mdView on GitHub

Overview

The Semantic Content Auditor (L3) validates that each project document matches its stated SCOPE, supports project goals, and accurately reflects the current codebase. It is invoked by the ln-610 coordinator for every project document and outputs a file-based report with scope_alignment and fact_accuracy scores.

How This Skill Works

On invocation, the auditor loads inputs (doc_path, output_dir, project_root, tech_stack) from the coordinator. It extracts the scope from the first 20 lines using a <!-- SCOPE: ... --> tag (or infers scope from document type), then checks sections for alignment and verifies facts against the codebase with filesystem queries (grep, glob). The result is a structured report including scope_alignment and fact_accuracy.

When to Use It

  • When validating CLAUDE.md for instruction alignment with project structure and valid paths
  • When auditing docs/README.md for accurate navigation and reality-aligned descriptions
  • When verifying docs/project/architecture.md reflects the actual code structure
  • When checking docs/project/api_spec.md endpoints match the controller/route implementations
  • When ensuring docs/project/design_guidelines.md and runbook.md align with the codebase

Quick Start

  1. Step 1: Load inputs from the coordinator (doc_path, output_dir, project_root, tech_stack)
  2. Step 2: Parse the <!-- SCOPE: ... --> tag from the first 20 lines or infer scope from document type
  3. Step 3: Run scope_alignment and fact_verification checks and write the report to output_dir

Best Practices

  • Anchor checks on the declared SCOPE to ensure consistent scope interpretation
  • Prefer exact path validation and real code references over guesses
  • Run audits per document in CI to prevent drift between docs and code
  • Flag SSOT_VIOLATION when content is duplicated across multiple documents
  • Provide clear severity, location, and fix suggestions for each finding

Example Use Cases

  • Detected SSOT_VIOLATION where content is duplicated across CLAUDE.md and docs/README.md
  • Scope CREEP identified in docs/project/architecture.md due to excessive implementation detail
  • MISSING_COVERAGE found in docs/project/api_spec.md where routes are not described
  • OFF_TOPIC sections in docs/project/runbook.md not contributing to project goals
  • Fact mismatch where architecture.md claims a module exists that the codebase no longer includes

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers