Back to Browse

Docguard MCP Server

Developer ToolsLow Risk10.0MCP RegistryLocal
Free

Server data from the Official MCP Registry

Deterministic doc-drift detection and exact doc navigation as read-only MCP tools.

About

Deterministic doc-drift detection and exact doc navigation as read-only MCP tools.

Security Report

10.0
Low Risk10.0Low Risk

Valid MCP server (0 strong, 2 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry.

12 files analyzed ยท 1 issue found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

file_system

Check that this permission is expected for this type of plugin.

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "docguard-cli": {
      "command": "npx",
      "args": [
        "-y",
        "docguard-cli@0.51.0"
      ]
    }
  }
}

Some servers take additional arguments. See the repository for details.

Documentation

View on GitHub

From the project's GitHub README.

๐Ÿ›ก๏ธ DocGuard

English ยท Portuguรชs (BR) ยท Espaรฑol

The enforcement layer for Spec-Driven Development. Validate. Score. Enforce. Ship documentation that AI agents can actually use.

CI npm npm downloads PyPI License: MIT Node.js Runtime deps Spec Kit Extension Glama MCP Registry mcp.market

Watch the 79-second DocGuard explainer

โ–ถ๏ธ Watch the 79-second explainer (sound on, with captions): what DocGuard checks, how it guards the merge, and how to start.


โœจ See what DocGuard catches in 30 seconds โ€” no install, no setup:

npx docguard-cli demo

Runs against a built-in sample project with planted drift. It shows you the findings and how to fix them.

DocGuard demo

๐Ÿ“š Documentation: Installation ยท Existing projects ยท Spec Kit ยท CI ยท Languages and frameworks ยท Coding agents ยท Finding codes ยท Troubleshooting


Table of Contents


What is DocGuard?

DocGuard enforces Canonical-Driven Development (CDD). In CDD, the documentation is the source of truth, not an afterthought. An agent writes the docs, and DocGuard checks them.

Traditional DevelopmentCanonical-Driven Development
Code first, docs maybeDocs first, code conforms
Docs rot silentlyDrift is tracked and enforced
Docs are optionalDocs are required and validated
One agent, one contextAny agent, with shared context from canonical docs

DocGuard is an official GitHub Spec Kit community extension. It checks the files that Spec Kit creates. Your specs stay in good shape from the start to the end of the project.

๐Ÿงญ How it works (10-page brief) (PDF) ยท ๐Ÿ“– Philosophy ยท ๐Ÿ“‹ CDD Standard ยท โš–๏ธ Comparisons ยท ๐Ÿ”ฌ Validation ยท ๐Ÿ—บ๏ธ Roadmap

Architecture

graph TD
    CLI["CLI Entry<br/>docguard.mjs"] --> Commands["Commands (28)"]
    Commands --> guard["guard"]
    Commands --> generate["generate"]
    Commands --> score["score"]
    Commands --> diagnose["diagnose"]
    Commands --> setup["setup wizard"]
    Commands --> other["diff ยท init ยท fix ยท trace ยท impact ยท sync ยท reconcile ยท retire ยท specs ยท ignore<br/>explain ยท memory ยท upgrade ยท agents ยท hooks ยท badge ยท ci ยท watch"]

    guard --> Validators["Validators (37)"]
    generate --> Scanners["Scanners (4)<br/>routes ยท schemas ยท doc-tools ยท speckit"]
    score --> Scoring["Weighted Scoring<br/>8 categories"]
    diagnose --> Validators
    diagnose --> AIPrompts["AI-Ready<br/>Fix Prompts"]

    Validators --> Output["Output"]
    Scanners --> Output
    Scoring --> Output
    Output --> Terminal["Terminal"]
    Output --> JSON["JSON"]
    Output --> Badge["Badge"]

    style CLI fill:#2d5016,color:#fff
    style Validators fill:#1a3a5c,color:#fff
    style Scanners fill:#1a3a5c,color:#fff
    style Output fill:#5c3a1a,color:#fff

Distribution: Node.js core (npm) ยท Python wrapper (PyPI) ยท GitHub Action (action.yml) ยท Spec Kit Extension (ZIP)


Why DocGuard?

DocGuard reads what your documentation says and checks it against your code. When a statement is wrong, DocGuard gives your agent a repair task with the file and the line. The checks are deterministic. They cover supported facts, references and generated sections.

DocGuard never changes a requirement or a decision that a person wrote. When the code differs from such a document, DocGuard reports the difference, and a person decides.

DocGuard checks only what it can prove. Each guard result lists the checks that ran. The CDD grade shows how complete your documentation structure is. It does not show whether the statements are true.

To check an exact statement, declare it in .docguard-evidence.json. DocGuard then compares that statement with current local evidence. A statement that DocGuard cannot check stays marked as unchecked. Coverage gaps and open claims stay visible, so your team can choose how strictly to enforce.

A 2026 study found that repository context files did not usually make agents more successful, and each run cost more, in the settings it tested. The same study found that agents follow the instructions they get. So keep the context short and correct, and measure the results. The study does not prove that DocGuard works. Evaluating AGENTS.md, revised June 2026.

The current roadmap puts four things first: accurate detection, reproducible evidence, document lifecycle management, and regression cases from contributors. DocGuard removes released plans and superseded specs from the active agent context. You can recover them from Git.


โšก Quick Start

Package names: the repository is raccioly/docguard. The package is docguard-cli on both npm and PyPI. The command you run is docguard. All three are the same project. The -cli suffix is only the registry name. The package runs no install scripts, so npm i -g docguard-cli --ignore-scripts does the same thing.

Node.js (npm)

# No install needed โ€” run directly
npx docguard-cli diagnose

# Or install globally
npm i -g docguard-cli
docguard diagnose

Strict is the default. docguard guard exits 4 when a check that applies to your project examined nothing. For example, you have routes but no API reference. DocGuard then prints what to add. DocGuard skips a check that does not apply. It reports a layout that it cannot read, and the run does not fail. Did a red build appear after you upgraded? Read Upgrading to Strict (also in docs/upgrading-to-strict.md). To keep the earlier behavior, set "enforcement": "standard" in .docguard.json. Under strict, a "validators": { "<key>": false } entry no longer switches a check off.

Python (PyPI)

pip install docguard-cli
docguard diagnose

Note: The Python package is a thin wrapper that runs npx. You need Node.js 18+ on the system.

Docker (MCP server)

The MCP server is a container image on GHCR. You do not need Node.js. The image is public, so you do not need to sign in to pull it:

# Run the MCP server against the current directory
docker run -i --rm -v "$PWD":/workspace ghcr.io/raccioly/docguard:latest

The entrypoint uses the stdio MCP transport. Stdout carries the JSON-RPC messages, so keep every other output off it. Mount the project you want checked at /workspace. The tools check it by default. A projectDir in a tool call must be /workspace or a directory inside it. To serve another mounted tree, add --root <dir> after the image name.

In CI, pin a version instead of using latest:

docker run -i --rm -v "$PWD":/workspace ghcr.io/raccioly/docguard:0.34.9

The server is read-only: it only reads the mounted project.

More ways to integrate

  • pre-commit โ€” runs guard on the changed files at every commit:
    repos:
      - repo: https://github.com/raccioly/docguard
        rev: v0.51.0
        hooks: [{ id: docguard-guard }]   # docguard-guard-full for pre-push
    
  • MCP (Claude, Cursor, any MCP client) โ€” claude mcp add docguard -- npx -y docguard-cli mcp; read-only tools that check docs (guard, score, diagnose, โ€ฆ) and that read them one section at a time. The full list is in docs/ai-integration.md. The registry manifest is in the repository (server.json, ready for Smithery).
  • GitLab CI โ€” a component at templates/ci/gitlab-component.yml (a guard, score or ci job with a SARIF artifact).
  • Homebrew โ€” brew install raccioly/tap/docguard. The release workflow builds the formula from the template in packaging/homebrew/ and the published npm tarball. It then pushes the formula to the tap.

Core Workflow

# 1. Initialize docs for your project
npx docguard-cli init

# 2. Or reverse-engineer docs from existing code
npx docguard-cli generate

# 3. AI diagnoses issues and generates fix prompts
npx docguard-cli diagnose

# 4. Validate โ€” use as CI gate
npx docguard-cli guard

# 5. Check maturity score
npx docguard-cli score

The AI Loop

diagnose  โ†’  AI reads prompts  โ†’  AI fixes docs  โ†’  guard verifies
   โ†‘                                                       โ†“
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ issues found? โ†โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

diagnose is the main command. It runs all validators and turns every failure into a fix prompt for an agent. It prints a plan to fix them. Your agent runs it, fixes the docs, and runs guard to check the fixes.

Mechanical vs. agent fixes

DocGuard splits drift into two kinds and labels each one:

KindExampleHow it's fixed
Mechanical (deterministic)An endpoint documented in API-REFERENCE.md that the OpenAPI spec shows is gonedocguard fix --write deletes the row + detail block itself โ€” no AI
Agent (needs judgment)Rewriting an X-Ray prose section as CloudWatch; writing a new endpoint's request/responseSent to an agent through diagnose / fix --doc prompts

docguard fix --write changes only docs marked `` (override with --force). Running it again has no extra effect. It prints exactly what it changed. The agent handles prose.

Continuous documentation workflow

guard โ”€โ”€โ–ถ fix --write (mechanical, auto) โ”€โ”€โ–ถ guard โ”€โ”€โ–ถ diagnose (agent prompts for the rest)
  • CI / pre-commit: docguard hooks --type pre-commit --auto-fix installs a hook. The hook applies mechanical fixes, stages the docs again, and runs guard. DocGuard shows anything left as agent prompts.
  • Agent-driven: docguard diagnose --auto creates missing docs and applies mechanical fixes. It then prints prompts for the rewrites that remain.
  • JSON for automation: guard/diagnose --format json include a mechanicalFixes array and tag each finding mechanical or agent. An agent can then apply the fix or hand it off.

โ˜๏ธ AWS AI-DLC Integration

DocGuard reads AWS AI-DLC workspaces directly. It reports traceability targets that no longer exist, gaps left in completed stages, deliverables removed after a unit, and agent memory that names something that is gone (AID001โ€“AID004, MEM001โ€“MEM002). DocGuard also ships as an AI-DLC plugin. Its docguard-guard sensor fails a construction gate when the stage introduced drift. See the AI-DLC guide.

๐ŸŒฑ Spec Kit Integration

DocGuard is a community extension for GitHub's Spec Kit framework. Spec Kit creates specs with slash commands such as /speckit.specify and /speckit.plan. DocGuard checks their quality.

How They Work Together

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚    Spec Kit      โ”‚          โ”‚    DocGuard       โ”‚
โ”‚                  โ”‚          โ”‚                   โ”‚
โ”‚  /speckit.specifyโ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ†’  โ”‚  docguard guard   โ”‚
โ”‚  Creates specs   โ”‚          โ”‚  Validates specs  โ”‚
โ”‚  (AI-driven)     โ”‚          โ”‚  (automated)      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
PhaseToolWhat happens
1. Initializespecify initCreates .specify/ directory and templates
2. Write specs/speckit.specifyAI creates spec.md with FR-IDs, user stories
3. Validatedocguard guardChecks spec quality (mandatory sections, FR/SC IDs)
4. Plan/speckit.planAI creates plan.md with technical context
5. Validatedocguard guardChecks plan quality (sections, structure)
6. Tasks/speckit.tasksAI creates tasks.md with phased breakdown
7. Validatedocguard guardChecks task quality (phases, T-IDs)
8. Implement/speckit.implementAI writes code
9. Enforcedocguard guardFinal check in CI/CD

What DocGuard Validates in Spec Kit Projects

  • spec.md โ€” Mandatory sections (User Scenarios, Requirements, Success Criteria), FR-xxx IDs, SC-xxx IDs
  • plan.md โ€” Summary, Technical Context, Project Structure sections
  • tasks.md โ€” Phased task breakdown (Phase 1, 2, 3+), T-xxx task IDs
  • constitution.md โ€” Detected at .specify/memory/constitution.md or project root
  • Requirement traceability โ€” FR, SC, NFR, US, AC, UC, SYS, ARCH, MOD, T IDs

Installing as a Spec Kit Extension

docguard init does this for you. It needs the specify CLI on your PATH (Spec Kit โ‰ฅ 0.11.2, the minimum version the extension declares). init sets up Spec Kit for the coding agent that the repository already uses. Then it registers the DocGuard extension that ships inside the installed package. The registration downloads nothing.

If the registered extension comes from another DocGuard release, init re-registers it when the versions differ, and it keeps the priority. docguard upgrade --apply does the same. init says the workflow hooks are active only when each mandatory hook resolves to a command file that your agent can run. The mandatory hooks are speckit.docguard.brief (before specify), speckit.docguard.preflight (before tasks) and speckit.docguard.guard (after implement). If a hook does not resolve, init names the missing one.

Spec Kit registers no extension commands for its generic integration. For generic, DocGuard writes them next to Spec Kit's own commands (.agent/commands/ by default). DocGuard prints every failure with Spec Kit's own error and the command to run by hand. Only init and upgrade --apply change Spec Kit. Other commands print a one-line hint at most.

DocGuard puts its own skills where your agent reads them: in .claude/skills/ for Claude Code (or in the skills directory of another skills-based integration), and in .agent/ for the generic integration or for an agent that DocGuard cannot place. A commands-only integration such as Gemini gets Spec Kit's speckit.docguard.* commands and no extra copies. The command and skill files run docguard from your PATH when it is installed. Otherwise they run npx --yes docguard-cli@<version>, pinned to the release they shipped with. They never fetch @latest.

DocGuard prints suggestions (Next: โ€ฆ, Fix: โ€ฆ). A suggestion names a slash command only when the command file exists for your agent. It uses the form your agent uses: /speckit-docguard-guard in Claude Code, /speckit.docguard.guard for generic. Otherwise it prints the CLI command.

docguard init registers the copy of the extension inside the installed package. To register it yourself, use a release ZIP or a local checkout. A bare specify extension add docguard does not work on a default Spec Kit setup. DocGuard is in Spec Kit's community catalog, and Spec Kit uses that catalog only to find extensions.

specify extension add docguard --from https://github.com/raccioly/docguard/releases/download/vX.Y.Z/spec-kit-docguard-vX.Y.Z.zip
specify extension add ./node_modules/docguard-cli/extensions/spec-kit-docguard --dev

See the Spec Kit guide for the hooks, the spec lifecycle registry and an end-to-end flow.

The registration adds the speckit.docguard.* commands listed in extension.yml and the workflow hooks that run them. Skills-based agents such as Claude Code invoke the commands as /speckit-docguard-guard and so on.


Usage

DocGuard ships 28 commands: the "Daily 5" and 23 situational tools. The tools include lifecycle reconciliation, doc dependency review, requirement anchors, agent-rule resolution, the suppression listing, retirement and spec tracking, the zero-install demo, the mcp server, and the ci pipeline gate. Six more one-shot scaffolders are available with docguard init --with <name>. Legacy command forms still work until v1.0 and print their replacements.

The Daily 5 โ€” what you use 95% of the time:

CommandWhat It Does
initSet up a project (--wizard for interactive ยท --with <name> for scaffolders)
guardCheck against canonical docs โ€” 37 validators
diffShow gaps between docs and code (--since <ref> for impact mode)
syncRefresh the doc sections that come from code, including the module-graph and entity-diagram mermaid diagrams drawn from code. This keeps memory up to date
scoreCDD maturity score for the doc structure (0-100; not a guard verdict; --diff shows the change between refs; --dora shows DORA documentation-quality and AI-capability evidence)

Tools (situational, but day-to-day useful):

CommandPurpose
demoZero-install demo โ€” runs guard on a built-in sample project that has drift (npx docguard-cli demo)
diagnoseRuns guard and prints fix prompts for an agent, in one command
fixPrint fix instructions for an agent, for specific docs (--doc <name> --format prompt)
fix --writeApply deterministic fixes (no AI โ€” version bumps, counts, anchors, sections)
fix --historyLog of every mechanical fix applied (from .docguard/fixed.json)
generateWrite docs from your existing code (--plan for an agent scan). It also draws Mermaid ER diagrams in DATA-MODEL.md from the schemas it detects (Prisma/Drizzle/TypeORM/Sequelize/Django/Rails). --spec <area> writes an as-built Spec Kit spec for one code area. The spec has one requirement candidate for each route, exported symbol, env var or entity found there. The agent writes every statement. DocGuard registers the spec as origin: as_built. Guard then reports new or vanished facts (SPR007)
agentOne-shot agent task graph, or a size-limited packet of current evidence for one task (--task <text>, --format json)
explain <warning|CODE>Paste any warning, or a finding code like SEC001. You get the validator's docstring, the fix, and how to suppress it
verify --evidenceCheck exact declarations that link a statement to its source. The sources can be typed JSON values, counts of bounded collections, saved oasdiff JSON, and saved Buf JSON Lines. The result tells apart these cases: verified within scope, contradiction, stale inputs, inconclusive evidence, and unsupported formats.
verify --semanticList the documented numbers, limits and enums (retention days, rate limits, GSI/role counts, status enums) as tasks for an agent to check against the code. Regex and AST checks cannot see this kind of drift
verify --instructionsCheck AGENTS.md and CLAUDE.md for drift: duplicate rules, never-versus-always contradictions, stale file pointers and unknown commands. It also gives clustered rule pairs to an agent as tasks to judge
feedbackReview any finding, or a synthetic false-positive, false-negative or unsupported fixture. The command checks its opposite control, reduces it the same way every time, searches open and closed duplicates, and can write a test-only contribution. Nothing is submitted automatically.
retireFind planning material that is finished or replaced (--plan/--check; --fail-on-warning fails on advisory candidates). Then, when you ask, remove clean tracked docs from the active agent context. .docguard-archive.json records the data needed to recover them and the identities of retired requirements. --retention-ref proves that the source revision is still reachable. This is separate from the Spec Kit Archive extension, which consolidates feature documents.
reconcileBuild a read-only codeโ†”spec review graph since a Git ref. It sorts changes into mechanical facts, approved intent, decisions, unrelated changes and unsupported evidence. --write applies only mechanical refreshes of generated sections.
reviewLists doc sections whose covered code changed since their last review (--accept <doc>#<id> --reason, --prune, --suggest)
anchorsLists every @implements/@req tag, the requirement it resolves to, and the symbol, statement, route or file it anchors to. It also shows the tier that resolved the tag (--spec <id>, --file <path>, --format json)
ignoreLists every suppression in the project (.docguardignore entries with their # reason and expires: date, .docguard.json ignore arrays, inline pragmas, N/A markers, the baseline) with its state. --format claimspec exports the .docguardignore entries that have a reason as a claimspec ignore document, and reports what it left out
rulesShows which agent instruction files each harness (Codex, Claude Code, Cursor, Copilot, OpenHands) loads for a path, why, and how many bytes (--for <path>, --harness)
specsKeep the versioned spec registry, run preflight on new specs, and complete specs through transactions that need evidence, with bounded outcomes and a regenerated active context. A verified living spec can record later reviewed maintenance, and you do not reopen it or copy it. specs require is the spec-first gate: a change to governed paths must name its spec or declare Spec-Exempt: <kind> โ€” <reason>.
specs --check / specs --writeCheck or refresh .docguard-specs.json. This file is the byte-stable index of immutable spec IDs, reviewed lifecycle, lineage and scope, artifact digests, task state, test evidence with an explicit scope, and archive tombstones. A refresh keeps the reviewed block.
specs preflight [--path <spec>]Before you write a spec, print the current spec lifecycle and evidence. Before planning, check the generated draft for structural blockers, and report overlap in meaning as evidence for review only.
specs approve --id <spec-id>Record a person's approval of a spec in the registry. With --delivery, record its planned, in_progress or implemented state. By default the command only shows its plan, and --write records it. --persistence and a repeatable --canonical-doc record the reviewed scope. specs complete does the verification.
mcpMCP server. It gives Claude, Cursor and any MCP client native tools for checking (guard, score, explain, verify, report, diagnose) and for exact doc navigation (docs for a file, document outline, one section, task context). docguard_guard returns each fact once, unless you call it with detail: "full". Stdio: claude mcp add docguard -- npx docguard-cli mcp. Team-shared HTTP: docguard mcp --transport http --port 8585 (loopback by default; a bind to another address needs --api-key)
reportCompliance evidence bundle for audits: combined readiness, guard verdict, structural maturity, ALCOA+ attributes and fix history. It carries the git commit and a sha256 integrity hash that shows tampering (--format json, --out <file>). It is evidence, not a gate: it always exits 0
ciPipeline gate: guard and structural maturity in one command, with a READY/ATTENTION/BLOCKED assessment. It never creates files or changes your source. It writes only its own .docguard/history.jsonl (opt out: --no-history). --threshold <n> fails below a score, --fail-on-warning is strict mode, --format json is for parsers
score --trendScore history from recorded ci runs: sparkline, change, and the last 10 runs with their commits
memoryAccuracy summary for each domain (endpoints / entities / env / tech)
memory --diffShows which claims do not match the code
policyThe enforcement ladder: which advisory finding codes, judging by CI history, are ready to become warnings or errors
sensor --aidlcAWS AI-DLC's sensor contract, in one JSON line. It passes when the work in progress added no drift since HEAD. The DocGuard AI-DLC plugin runs it at construction gates. --help does not list it, because it is for machines
memory --packWrite .docguard/context-pack.md โ€” short session-start context for agents, stamped with code truth
score --diffShows which checks pulled each category down
trace / trace --reverse <file>Requirements traceability โ€” forward AND reverse
trace --featuresSpec-adherence score for each feature (requirement coverage, task completion, task evidence, artifacts), worst first, with fix hints
upgrade [--apply] [--pr]Check npm for a newer CLI (the only command that contacts a registry) and migrate the .docguard.json schema; --pr opens a PR. When the installed release is over 14 days old, guard's text output, the MCP server and the context pack suggest running docguard upgrade. Nothing upgrades by itself (DOCGUARD_NO_UPDATE_HINT=1 hides the note)
watchLive mode: runs guard again when files change

init --with <name> scaffolders โ€” picked at init time:

ScaffolderWhat It Generates
agentsAGENTS.md, CLAUDE.md, .cursor/rules/, .github/copilot-instructions.md
hooksGit pre-commit / pre-push hooks
ciGitHub Actions / pipeline YAML
badgeShields.io score badges for README
llmsllms.txt (AI-friendly summary)
publishExternal doc-site config (Mintlify) โ€” experimental

Run one (docguard init --with hooks) or several together (docguard init --with agents,hooks,badge,ci).

To declare an exact fact, copy templates/evidence-manifest.json to .docguard-evidence.json. Point its literal Markdown template at one unique statement. Then link that value to a supported local source. Run docguard verify --evidence --format json before you turn on the guard in CI. External compatibility declarations read saved oasdiff or Buf output. They need a current SHA-256 identity for every declared repository input.

Deprecation aliases โ€” setup ยท agents ยท hooks ยท badge ยท llms ยท publish ยท impact still work until v1.0 and print a yellow warning on stderr. audit โ†’ guard is permanent and silent. ci is a current command for pipelines.

CLI Flags

FlagDescriptionCommands
--dir <path>Project directory (default: .). If you set it, DocGuard does not suggest a parent rootAll
--verboseShow detailed outputAll
--quiet / -qHide the banner, for hooks, CI loops and scriptsAll
--format jsonOutput for machines (clean JSON, no ANSI codes)guard, score, diff, trace, diagnose, memory, impact, explain, verify, reconcile, retire, specs, ignore
--format claimspecclaimspec v1 ignore document on stdout, checked against the bundled schema; anything that could not be exported goes to stderrignore
--format sarifSARIF 2.1.0 output โ€” findings as rules/results for GitHub Code Scanning and SARIF dashboardsguard
--format junitJUnit XML output โ€” one testcase per validator, for GitLab CI (artifacts:reports:junit), Jenkins, Azure DevOps, CircleCIguard
--update-baselineAdopt DocGuard on a legacy repo with no red build on day one. It saves today's findings in a committed .docguard.baseline.json. Guard and ci then fail only on NEW drift. DocGuard always shows what it hides ("N pre-existing finding(s) suppressed"), and --no-baseline shows everythingguard
--fullGenerate llms-full.txt (full doc text included) instead of the llms.txt link indexllms
--compactWith --format json: each fact once. The MCP guard tool returns this form by defaultguard
--packWrite .docguard/context-pack.md: session-start context for agentsmemory
--symbolsWith --pack: add a symbol map (the most central files and their exported names, within memory.symbolMap.maxBytes). It is off by default, because the frozen agent-context benchmark (protocol v3) found no regression and no benefitmemory
--syncRegenerate the agent files (CLAUDE.md, Copilot, Cursor, โ€ฆ) from AGENTS.md. Each file carries a hash marker. DocGuard never changes hand-written files without --forceagents
--checkCI check for the synced agent files. It exits 2 when one is staleagents
--forceOverwrite existing files (creates .bak backups)generate, agents, init
--force-redoBypass ping-pong suppression in .docguard/fixed.jsonfix --write
--profile <name>Starter / standard / enterpriseinit
--no-spec-kitSkip Spec Kit: no specify call and no .specify/; DocGuard's own agent skills still installinit
--spec-kitWith --profile starter, initialize Spec Kit too (starter skips it by default)init
--changed-only [--since <ref>]Light pre-commit mode: runs the fast validators (including covered-doc dependencies) on changed files onlyguard
--timingsRun time of each validator, slowest firstguard
--show-failingShow warnings/errors even when status is PASSguard
--pinSave the running CLI version in .docguard.json, so results can be reproducedguard
--diffDetail for each categoryscore, memory
--check-onlyExit 1 if behind (for CI)upgrade
--applyActually run the migrationupgrade
--prOpen a PR with the migrationupgrade
--reverse <file>Reverse traceability (code โ†’ docs)trace
--no-indirectSkip the reverse-import-graph analysis (docs about modules that import a changed file)impact, diff --since
--prsDoc-conflict analysis of open PRs. Two PRs that affect the same canonical doc risk a merge-order problem (needs the gh CLI)impact
--transport http --port --host --api-key --pathServe MCP over Streamable HTTP instead of stdio (a server for the team; loopback only unless you set an api-key)mcp
--root <dir>Serve another directory tree. Tool calls can pass a projectDir inside it (repeatable). Without this flag, projectDir must stay inside the served directorymcp
--historyShow fix audit logfix

When you run DocGuard from a nested package without --dir, it checks only that directory. DocGuard scans the parent directories up to a limit. If it finds a .docguard.json or an npm/pnpm workspace declaration that owns the package, it prints on stderr the exact command that reruns the check for the whole repository. DocGuard never changes the scope by itself. JSON, SARIF and JUnit output on stdout stay valid. Machine runs get one typed docguard.repository-root-guidance JSON diagnostic on stderr. DocGuard prints no suggestion when there is a local config, an explicit --dir, an unmatched workspace, or a nested Git boundary.

Example Output

$ npx docguard-cli generate

๐Ÿ”ฎ DocGuard Generate โ€” my-project
   Scanning codebase to generate canonical documentation...

  Detected Stack:
    language: TypeScript ^5.0
    framework: Next.js ^14.0
    database: PostgreSQL
    orm: Drizzle 0.33
    testing: Vitest
    hosting: AWS Amplify

  โœ… ARCHITECTURE.md (4 components, 6 tech)
  โœ… DATA-MODEL.md (12 entities detected)
  โœ… ENVIRONMENT.md (18 env vars detected)
  โœ… TEST-SPEC.md (45 tests, 8/10 services mapped)
  โœ… SECURITY.md (auth: NextAuth.js)
  โœ… REQUIREMENTS.md (spec-kit aligned)
  โœ… AGENTS.md
  โœ… CHANGELOG.md
  โœ… DRIFT-LOG.md

  Generated: 9  Skipped: 0

๐Ÿ” Validators

DocGuard runs 37 automated validators on every guard run. Validators that read source code know the language where their evidence model applies. Validators for the repository and for documents work with any source language.

Counting note: guard prints one row for each check. Structure produces a second check (Doc Sections) under the same validator key, so the table below has one row more than there are validators. The published number is the count of shipped cli/validators/*.mjs modules, and tests enforce it. Count those modules, not output rows.

Documentation truncated โ€” see the full README on GitHub.

Reviews

No reviews yet

Be the first to review this server!