docs-validate

A command that checks documentation files for problems before they are previewed or built with Docusaurus, a tool for creating documentation websites. It checks YAML, MDX, links, and file names, and can fix some issues.

In plain words
What is it for?
Use it to validate internal or public documentation, a chosen path, or to apply available automatic fixes before previewing or building.
Why use it?
Documentation build errors can be difficult to understand and may appear only after the build starts. Early validation identifies common formatting and linking problems first.

Command

Part of the specweave plugin — 37 commands, 4 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/anton-abyzov/specweave/docs-validate
Clone the repo
git clone --depth 1 https://github.com/anton-abyzov/specweave

Or install specweave, the plugin that ships this one along with the rest of its 37 commands, 4 agents.

Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,533 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00038 $0.01533
Opus 5 $0.00019 $0.00766
Sonnet 5 $0.00008 $0.00307
Haiku 4.5 $0.00004 $0.00153

Measured 3d ago against content hash cb07724f50ec, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

docs-validate scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/specweave/commands/docs-validate.md · 250 lines

How it starts

The opening of the file, as written. The whole thing — 250 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Documentation Validation Command

Validate your documentation for Docusaurus compatibility BEFORE starting the preview server or building.

Why This Matters

Docusaurus compilation errors are often cryptic:

  • Unexpected character → unquoted HTML attribute
  • Unterminated JSX contents → unclosed tag
  • Could not parse expression → bad YAML frontmatter

This validator catches these issues before you see webpack errors.

Usage

# Validate internal docs (default)
/docs:validate

# Validate with auto-fix
/docs:validate --fix

# Validate public docs
/docs:validate public

# Validate specific path
/docs:validate --path .specweave/docs/internal/specs

Your Task

CRITICAL: Run validation BEFORE starting preview or build!

Step 1: Determine Docs Path

# Check which docs to validate
DOCS_TYPE="${1:-internal}"  # internal or public

if [ "$DOCS_TYPE" = "public" ]; then
  DOCS_PATH=".specweave/docs/public"
else
  DOCS_PATH=".specweave/docs/internal"
fi

# Verify path exists
if [ ! -d "$DOCS_PATH" ]; then
  echo "❌ Documentation path not found: $DOCS_PATH"
  exit 1
fi

Step 2: Run Validation

Execute the validation using the DocsValidator:

import { DocsValidator } from '../../../src/utils/docs-validator.js';
import * as path from 'path';

// Get options from command args
const autoFix = process.argv.includes('--fix');
const docsType = process.argv.find(a => a === 'public') ? 'public' : 'internal';
const docsPath = path.resolve(`.specweave/docs/${docsType}`);

// Create validator
const validator = new DocsValidator({
  docsPath,
  autoFix,
});

// Run validation
console.log(`\n📋 Validating ${docsType} documentation...`);
console.log(`   Path: ${docsPath}\n`);

const result = await validator.validate();

// Display formatted result
console.log(DocsValidator.formatResult(result));

// Exit with error code if invalid (for CI integration)
if (!result.valid && !autoFix) {
  console.log('💡 Tip: Run with --fix to auto-repair fixable issues\n');
  process.exit(1);
}

Read the full file on GitHub · 250 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 250 lines · 38 tokens per session scan A cb07724f50ec

Subscribe to this mod's changes

docs-validate is a command published in the GitHub repository anton-abyzov/specweave (159 stars, last pushed 3d ago), licensed MIT. It adds 38 tokens to every session and 1,533 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.