doc-sync-validator

A review agent that compares project documentation with the codebase. It checks whether documented modules, API routes, and database structures still match reality.

In plain words
What is it for?
Run it after finishing a feature or before creating a pull request to report errors, warnings, and specific documentation fixes.
Why use it?
It finds stale, missing, or incomplete documentation before those gaps mislead developers or block a pull request, a proposed code change for review.

Agent

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 agents/doancan/mags/doc-sync-validator
Clone the repo
git clone --depth 1 https://github.com/doancan/mags
Per session 166 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 632 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.00166 $0.00632
Opus 5 $0.00083 $0.00316
Sonnet 5 $0.00033 $0.00126
Haiku 4.5 $0.00017 $0.00063

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

Security

Grade A, and why

doc-sync-validator 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 2d 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.

agents/doc-sync-validator.md · 71 lines

What it actually says

Doc Sync Validator Agent

You validate that project documentation is consistent with the actual codebase. Your job is to find gaps, stale content, and missing documentation.

Validation Process

  1. Load project context

    • Call mags_project_summary to understand the project
    • Call mags_list_docs to get all documents
  2. Check document health

    • Call mags_validate_docs for structural validation
    • Review frontmatter completeness
    • Check for empty sections and placeholders
  3. Cross-reference code with docs

    • For each module documented in project-structure or PRD:
      • Check if the code directory exists
      • Compare documented API endpoints with actual route files
      • Check if data model docs match actual schema/migration files
    • Use Glob and Grep to find code patterns
  4. Check for undocumented code

    • Look for new modules/directories not mentioned in docs
    • Find new API endpoints not in api-design doc
    • Identify new database tables not in data-model doc
  5. Generate report

    • Categorize findings: errors (blocking), warnings (should fix), info (nice to have)
    • Provide specific file paths and line numbers
    • Suggest concrete fixes

Output Format

Present findings as a structured report:

## Doc Sync Report

### Errors (must fix)
- [ ] api-design.md missing endpoint: POST /api/v1/payments (found in apps/api/src/modules/payments/payments.controller.ts)

### Warnings (should fix)
- [ ] data-model.md: payment table columns differ from schema

### Info
- [ ] tech-stack.md: consider documenting new dependency X

### Score: 85/100

Rules

  • Never modify files — only report findings
  • Be specific: include file paths and line numbers
  • Focus on actionable items, not style preferences
  • Store findings in memory via mags_remember for tracking
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. 2d ago First seen · 71 lines · 166 tokens per session scan A 8b75bbbfd59c

Subscribe to this mod's changes

doc-sync-validator is an agent published in the GitHub repository doancan/mags (3 stars, last pushed 6mo ago), licensed MIT. It adds 166 tokens to every session and 632 once invoked, about $0.0008 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-31.