All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
This release reshapes DocGuard from a documentation linter into an AI-readable, always-current project memory builder — for any language project, not just JS/web. The four-mode lifecycle (generate → guard → sync → fix) is now coherent end-to-end.
docguard generate --plan— the "killer feature" from the v2 vision, now real. Scans any project (JS/TS, Python, Rust, Go, Java/Kotlin, Ruby, PHP, C#; polyglot/monorepo-aware) and emits a structured agent task manifest + writes the code-truth skeleton inside<!-- docguard:section -->markers. The AI agent writes the prose grounded in scanned facts; human writing is preserved.--plan --format jsonmachine-readable manifest for agent consumption.--plan --writescaffolds the skeleton docs (code sections filled, prose sections as agent-task placeholders).- Language-aware doc set: a Rust CLI gets ARCHITECTURE; a webapp gets ARCHITECTURE + API-REFERENCE + SCREENS + FEATURES + INTEGRATIONS + ENVIRONMENT + docs-implementation/{KNOWN-GOTCHAS,CURRENT-STATE,RUNBOOKS}.
docguard sync— refreshessource=codedoc sections in place when code changes. Mechanical, idempotent, preserves human prose. Flags the prose sections to review when their adjacent code changed.--since <ref>adds git-diff context.--writeapplies; default is a dry-run preview.--forceoverrides thedocguard:generatedmarker gate.
cli/writers/sections.mjs— marker format<!-- docguard:section id=X source=code|human -->.parseSections/replaceSection/upsertSectionfor surgical regen that never clobbers human prose. The keystone the rest of the program builds on.
cli/scanners/project-type.mjsdetects every ecosystem from manifests:package.json,pyproject.toml/requirements.txt/setup.py/Pipfile,Cargo.toml,go.mod,pom.xml/build.gradle,Gemfile,composer.json,*.csproj. Polyglot-aware: returns each ecosystem's language, framework, kind, deps, entry points.- Multi-language route scanners in
routes.mjs: Spring Boot (Java/Kotlin, class-level base + verb annotations), Rails (verb DSL +resources7-action expansion), Go (Gin/Echo/Chi/Fiber/mux), Rust (Axum, Actix, Rocket). - Multi-language schema/model scanners in
schemas.mjs: Python (SQLAlchemy + relationships + Pydantic/SQLModel), Rust Dieseltable!, Go structs withjson/gorm/dbtags, Java/Kotlin JPA@Entity, Rails ActiveRecordcreate_tablemigrations.
cli/scanners/frontend.mjscaptures the UI surface: screens/routes (React Router, Next App + Pages with wrapper-unwrapping), components, state stores (Zustand/Redux Toolkit/Jotai/MobX), custom hooks (incl.export { X as useY }aliases), React Contexts, API-client→endpoint mapping (axios/fetch/custom client), and i18n keys (used vs. defined in locale files, with missing-keys reported as drift).
cli/scanners/integrations.mjs— 30+ SDK registry covering Cloud (AWS, GCP, Azure, Cloudflare), Databases, Payments (Stripe/Braintree), Auth (Auth0/Clerk/NextAuth/Cognito), AI (OpenAI/Anthropic/LangChain), Messaging (Twilio/SendGrid/Slack/MessageBird), Observability (Sentry/Datadog/OpenTelemetry), Search, Queues, Storage. Surfaces asINTEGRATIONS.mdin the memory plan.
cli/writers/mechanical.mjsgeneralizesdocguard fix --writeinto a deterministic, no-LLM applier covering:remove-endpoint(API-Surface),replace-count(Metrics-Consistency stale "N validators"),replace-version(Metadata-Sync stale refs — only in actionable contexts, never prose),insert-changelog-unreleased.- Validators emit structured
fixes[]arrays surfaced throughguard --format json,diagnose --format json, and applied byfix --write/diagnose --auto. The 9 previously detect-only validators now have realFIX_INSTRUCTIONSroutes (no more generic "Manual review needed").
- New extension commands:
extensions/spec-kit-docguard/commands/fix.md,commands/sync.md.generate.mdupdated to document--plan. - New skill:
extensions/spec-kit-docguard/skills/docguard-sync/SKILL.md— teaches the agent the refresh-and-review-prose loop. Extension README modernized to the memory-first vocabulary.
- PHILOSOPHY.md rewritten from v1 governance-first ("not machine-generated") to the v2 memory-first reality (generate + guard + sync, bidirectional, language-agnostic). Honest about what the tool actually does.
docguard scoredisplaysMemory: Completeness X% · Accuracy Y%derived from the existing category scores;--format jsonaddsmemory.{completeness, accuracy}and per-categoryaxisfield. No weight changes.- CLI
--helpreframed around the memory lifecycle (audit/generate/guard/sync).
- Tightened a self-inflicted false positive (a literal
TODOin a generate.mjs placeholder string was tripping DocGuard's own TODO-Tracking validator). - Fixed several scanner bugs caught by new tests: React Router wrapper-component unwrapping (
<RequireAuth><XPage/>), Next.js base-path double-append, Go single-line struct regex, Spring Boot@RequestMappingclass-level vs method-level disambiguation, locale-dir deduplication.
- CI: bumped
actions/checkoutandactions/setup-nodeto@v5across all four workflows (ahead of the June 2026 Node 24 default).
- Tests: 175 → 285 (+110). New test files:
api-doc,api-surface,shared-source,guard-classify,monorepo-scanning,sections,frontend,frontend-deep,i18n,project-type,memory-plan,integrations,routes-multilang,schemas-multilang,mechanical,api-write,multi-spec,sync. All green.
- API-Surface validator (
cli/validators/api-surface.mjs) — compares endpoints documented indocs-canonical/API-REFERENCE.mdagainst the project's real API surface (OpenAPI spec, monorepo-aware code route scan). Flags documented-but-deleted endpoints (HIGH/error when confirmed by a spec; warning on heuristic code-scan) and present-but-undocumented endpoints (warning). Brings the validator count to 20. N/Aresult state inguard— a validator that finds nothing to check now renders a neutral➖ [N/A]with a reason instead of a misleading green ✅. "Nothing to check" is no longer indistinguishable from "checked and clean". Exposed viaclassifyResult(); surfaced in text,--format json,diagnose, andci.cli/shared-source.mjs— monorepo-aware source resolution honoringconfig.sourceRoot, npmworkspaces, andpnpm-workspace.yaml:resolveSourceRoots(),collectPackageJsons(),detectDocker(),grepEnvUsage().cli/scanners/api-doc.mjs— robust API-REFERENCE.md parser (headings + table rows) with path normalization (:id ≡ {id}, strips backticks/pipes/trailing slashes) and exact-match endpoint comparison.docguard fix --doc api-reference— generates an AI prompt to reconcile API-REFERENCE.md with the real API surface.- 39 new tests (api-doc, api-surface, shared-source, monorepo-scanning, guard-classify). Total: 214.
- Monorepo awareness across validators —
schema-sync,docs-coverage,docs-sync,test-spec,metadata-sync, and test-file discovery now honorconfig.sourceRoot/workspaces instead of hardcoded root-relative paths. Previously these silently passed on monorepos whose code lives under e.g.backend/src. - Environment validator now checks code truth — compares documented env vars against actual
process.env/import.meta.envusage (.env.examplecounts as documentation), replacing the prior section-heading-presence heuristic. - Test-Spec verifies files, not glyphs — a Source-to-Test/Journey row passes only if the referenced test file actually exists; the author-typed ✅ is no longer trusted as proof of coverage.
- Changelog validator now implements the documented staged-change check: warns when staged code files exist but
CHANGELOG.mdis not staged (git-aware; N/A otherwise). Driftvalidator renamed toDrift-Commentsto clarify it checks// DRIFT:comment ↔ DRIFT-LOG.md bookkeeping, not doc/code drift. Config key (drift) is unchanged.- Doc Sections uses anchored heading matching instead of substring (no longer satisfied by a table-of-contents link or code block).
guardno longer reports a confident green ✅ for checks that validated nothing — removed hand-rolledpassed=1/total=1auto-passes indrift,architecture,test-spec, andsecurity(empty scan).- Eliminated false positives that previously masked real drift: tech-stack/env-var "documented but not found" on monorepos, parser-garbage "data entities" (
table,index,foreign), the greedy route regex emitting/api/+ stray backticks, and the test-file path/basename and glob-pattern mismatches ("N documented but not found"). Documented endpoints/tests that genuinely no longer exist are now reported as real drift. - Security scan anchored to a scanned-file count — an empty scan now warns ("no source files were scanned") instead of reporting a false "no secrets" pass.
globMatch()inshared-ignore.mjs— Purpose-built positive file matching with hardcodednode_modulesexclusion at any depth. Distinct frombuildIgnoreFilter()(which is for ignore/skip filtering).- 6 new tests —
globMatchnode_modules rejection (2), valid path matching (1), multi-pattern (1), CI detection (1), function load (1). Total tests: 46.
- Docs-Diff no longer scans
node_modulesfor test files —getTestFilesFromPatterns()now usesglobMatch()instead of repurposingbuildIgnoreFilter(). The**glob no longer matches throughnode_modules/directories. - CI detection supports enterprise systems —
calcTestingScore()now recognizesbuildspec.yml,amplify.yml,Jenkinsfile,.circleci/config.yml,.gitlab-ci.yml,.travis.yml, andturbo.jsonwith a"test"task. - Multi-pattern test resolution works correctly —
testPatternsarray resolves files from all patterns with proper deduplication via Set.
cli/shared-ignore.mjs— New shared ignore utility withbuildIgnoreFilter()andshouldIgnore(). All validators now share consistent glob matching forconfig.ignore,securityIgnore, andtodoIgnore.testPatternsconfig — New array field in.docguard.jsonfor multiple test location patterns. Backward-compatible:testPattern(string) auto-normalizes totestPatterns(array).- 7 new tests — Shared ignore utility (4 unit tests), securityIgnore integration (1), placeholder exclusions (1), testPatterns config (1). Total tests: 40.
securityIgnoreglobs now functional — Security validator reads and appliessecurityIgnorepatterns from.docguard.json. Previously, all ignore config was silently discarded. (Bug #1)todoIgnoreglobs now functional — TODO-tracking validator reads and appliestodoIgnorepatterns. (Bug #2)- Docs-Diff no longer scans
node_modules— Test file discovery usestestPatternsconfig and shared ignore filter instead of unchecked recursive walk. (Bug #3) - Testing score reflects co-located tests —
calcTestingScore()now detects__tests__/underbackend/,server/,packages/in addition tosrc/. Also checkstestPatternsconfig. (Bug #4 & #5) - Security score aligns with guard —
calcSecurityScore()now runsvalidateSecurity()inline and deducts points for findings. 100% security score is no longer possible when guard reports secret detections. (Bug #6) - Placeholder/example values not flagged — Security scanner skips AWS example keys (
AKIAIOSFODNN7EXAMPLE), HTMLplaceholder=attributes, OpenAPIexample:blocks, andpassword123test fixtures. (Bug #7) - ROADMAP.md matching improved — TODO-tracking now matches full text + file location context instead of a 30-char substring. (Bug #8)
- Architecture respects
ignorearray — Architecture validator filters files throughconfig.ignorebefore building import graph. (Bug #9)
- Constitution v1.0.0 → v1.1.0 — Principle IV updated: validators MAY import shared utility modules for infrastructure (file walking, ignore filtering). Commands MAY compose validator results.
- Security scoring weights — Redistributed from 30/20/20/15/15 to 25/15/15/10/10/25 (25 pts now from actual secret scanning).
- Testing suggestion — Context-aware: suggests
testPatternsconfig instead of "Add tests/ directory" when co-located tests exist. findColocatedTests()— Source roots expanded:backend/,server/added alongsidesrc/,app/,lib/,packages/,modules/.
ensureSpecKit()— Runs on every command. Auto-initializes spec-kit whenspecifyCLI is available. Shows a prominent yellow-box reminder every time when spec-kit is not installed (persistent, no dismiss).detectAIAgent(projectDir)— Maps 12 filesystem signals to spec-kit--aiflag values:.cursor/→cursor-agent,.claude/orCLAUDE.md→claude,.gemini/→gemini,.agents/→agy(Antigravity),.github/copilot-instructions.md→copilot,.windsurf/→windsurf,.codex/→codex,.roo/→roo,.amp/→amp,.kiro/→kiro-cli,.tabnine/→tabnine. Falls back to--ai genericwhen no agent detected.- Strong init push —
docguard initnow shows a prominent red-bordered box when spec-kit is missing, listing exactly what users miss: 9 AI skills, constitution, SDD workflow, agent detection. Provides bothuvandpipinstall commands. - Guard footer reminder —
docguard guardshows a 1-line spec-kit install nudge after results when not initialized. - Skill auto-update —
ensureSkills()now compares installed SKILL.mddocguard:versionagainst package version. Automatically overwrites stale skills on DocGuard update.
detectAgentMode(projectDir)— Returns'llm'or'cli'based on filesystem signals and.specify/init-options.json. All adaptive commands check this.diagnose.mjs— AllFIX_INSTRUCTIONSnow includellmCommandfields (e.g.,/docguard.fix --doc architecture). Issue collection propagatesllmCommandto output. Remediation plan, verification checklist, and debate prompts all adapt to agent mode.guard.mjs— "Next step" hint now shows/docguard.diagnosein LLM mode.init.mjs— Next steps show skill commands (/docguard.guard,/docguard.fix) in LLM mode, CLI commands (docguard diagnose) in CLI mode.setup.mjs— Next steps adapt to agent mode.
docguard-guardSKILL.md — Now chains to/speckit.specify,/speckit.plan,/speckit.clarify, and checksconstitution.md.docguard-reviewSKILL.md — Offers spec-kit skills for specification-level issues.extension.yml— Declaresframework: spec-kitandspecifyas optional tool.
npx docguard guard→npx docguard-cli guard— The npm package name isdocguard-cli, notdocguard. Fixed inhooks.mjs,setup.mjs,fix.mjs,docguard.mjs(pre-existing bug).- Hardcoded
--ai agy→ DynamicdetectAIAgent()—init.mjsandsetup.mjsno longer hardcode Antigravity as the agent. llmCommandnever propagated —collectIssues()indiagnose.mjswas not copyingllmCommandfromFIX_INSTRUCTIONSto issue objects, so LLM-first fix hints silently fell back to CLI commands.- Debate prompt not LLM-aware —
outputDebatePrompt()now receivesagentModeand adapts verification commands. - Basic-tier checklist hardcoded — Verification checklist for basic-tier agents now adapts to LLM/CLI mode.
- Stale "Zero dependencies" doc comments — Updated 6 files to "Zero NPM runtime dependencies" matching the constitution.
- Platform-aware
--script—specify initnow uses--script pson Windows,--script shon Unix.
- Constitution — Principle II amended from "Zero Dependencies" to "Zero NPM Runtime Dependencies" (spec-kit is a framework convention, not a code dependency).
- SKILL.md metadata — All 4 skills updated from
0.9.5/0.9.8to0.9.9. Addeddocguard:versioncomment for auto-update mechanism. ensure-skills.mjs— Full rewrite: 6 exports (ensureSkills,ensureSpecKit,detectAgentMode,detectAIAgent,getDetectedAgent,isSpecKitAvailable,isSpecKitInitialized).- 22 files changed, +567/−203 lines.
- 4 enterprise-grade SKILL.md files modeled after spec-kit's AI behavior protocol pattern:
docguard-guard(155 lines) — 6-step execution with severity triage matrix, structured reportingdocguard-fix(195 lines) — 7-step research workflow with per-document codebase research, 3-iteration validation loopsdocguard-review(170 lines) — Read-only semantic cross-document analysis with 6 analysis passesdocguard-score(165 lines) — CDD maturity assessment with ROI-based improvement roadmap
- Skills differ from commands: commands tell agents what to run, skills tell agents how to think, validate, and iterate
common.sh— Shared utilities (root detection, CLI detection, JSON helpers)docguard-check-docs.sh— Discover project docs, return JSON inventory with metadatadocguard-suggest-fix.sh— Run guard, parse results, output prioritized fixes as JSONdocguard-init-doc.sh— Initialize canonical doc with metadata header and template
- All 10 commands upgraded with YAML
handoffsfor workflow chaining (guard → fix → review → score) - 3 spec-kit workflow hooks:
after_implement(mandatory guard),before_tasks(optional review),after_tasks(optional score) extensions.ymltemplate for spec-kit hook registration
extension.ymlupdated withskills,scripts, andhookssections- Extension README rewritten with complete skills, scripts, hooks, and workflow documentation
extensions/directory now included in npm package (package.jsonfiles array)
- Correct file paths: Now checks
.specify/specs/NNN-feature/spec.md(v3+ standard) with fallback to legacyspecs/*/spec.md - Constitution detection: Checks
.specify/memory/constitution.md(v3+) with fallback to rootconstitution.md - Spec quality validation: Validates mandatory sections (User Scenarios, Requirements, Success Criteria), FR-IDs, SC-IDs per spec-kit spec-template.md
- Plan quality validation: Checks for Summary, Technical Context, Project Structure sections
- Tasks quality validation: Verifies phased breakdown (Phase 1, 2+) and T-xxx task IDs
- Informational warning: Spec-Kit validator now suggests
specify initwhen no spec-kit artifacts found (was silent0/0)
- SC-xxx (Success Criteria) added to requirement ID patterns — aligns with spec-kit SC-001 format
- T-xxx (Task IDs) added — recognizes spec-kit T001, T002 task identifiers
- Scans
.specify/specs/path in addition to legacyspecs/
- New
commands/directory with 4 AI agent slash commands:/docguard.guard,/docguard.review,/docguard.fix,/docguard.score - Shipped as part of npm package — available via
specify extension add docguard - Works with Claude Code, Copilot, Cursor, Gemini, Antigravity, and more
- New
REQUIREMENTS.md.templatealigned with spec-kit FR-xxx, SC-xxx, Given/When/Then standards - Added to
docguard inittemplate catalog (defaultYes: true)
pyproject.tomlanddocguard_cli/wrapper.pyforpip install docguard-cli- Thin Python wrapper delegates to
npx docguard-cli— requires Node.js 18+ - Python developers can now use
docguard guard,docguard score, etc.
speckit.mjswriteFileSync → safeWrite (backup safety, same as v0.9.4 pattern)
diagnose --autono longer passes--forcetogenerate: This was the root cause of silent doc overwriting.diagnose --autonow only creates missing files, never overwrites existing ones..bakbackup on--force: Whengenerate --forceis explicitly used, all existing files are backed up as.bakbefore being overwritten. Content is never permanently lost.--forcewarning banner: Shows how many existing files will be overwritten before proceeding.safeWrite()helper: All 9 write operations in generate now go through a single safety wrapper.
extractProse()replacesstripMarkdown(): Instead of stripping markdown and measuring residue (where table cells became "146-word sentences"), the new engine identifies and extracts only actual prose paragraphs. Reference docs (mostly tables/code) with <50 words of prose skip readability scoring entirely.- Technical vocabulary normalization: 80+ tech terms (DynamoDB, WebSocket, middleware, TypeScript, etc.) are treated as simple 2-syllable words for Flesch scoring. Known terms don't penalize readability.
- Markdown-aware sentence detection: File paths (
src/auth.ts), version numbers (v0.9.2), URLs, and abbreviations (e.g.,i.e.) no longer cause false sentence splits. - Relaxed thresholds for technical docs: Flesch 30→15, grade 16→18, sentence length 25→30, passive voice 20→25%, negation 15→20%.
- Impact: Doc-Quality scores improved from 81% (13/16) to 95% (38/40) on DocGuard itself. API reference docs that scored 0/100 now skip gracefully or score fairly.
- Flesch readability false positives: Improved
stripMarkdown()to remove mermaid diagrams, HTML tags, definition-style lines, and lines with >60% special characters. Docs with tables no longer score 0/100. - Flesch threshold: Lowered from 30→20 for technical documentation — developer docs inherently score lower than prose.
- NUL file on macOS:
findUnderstandingCli()used Windows2>NULredirect which created a strayNULfile on Mac/Linux. Now uses platform-specificwhich/where. - Unused import: Removed
mkdirSyncfromdiagnose.mjs(was imported but never used).
diagnoseis read-only by default — file creation only happens with explicit--autoflag.metrics-consistencyproperly reads.docguardignorepatterns.
- Test detection:
calcTestingScorenow detects co-located tests insrc/,app/,lib/,packages/,modules/— not just top-leveltests/directories. Projects usingsrc/**/__tests__/orsrc/**/*.test.*patterns now score correctly. - Test-spec fallback: Validator fallback check now scans for co-located test files and checks vitest/jest config presence.
- Vitest config support: Score calculation now reads
vitest.config.ts/jest.config.tsinclude patterns to detect custom test directories.
- Doc Quality Validator — 8 deterministic writing quality metrics (passive voice, readability, atomicity, sentence length, negation/conditional load). Inspired by IEEE 830/ISO 29148.
- Understanding Integration — Optional deep scan via the Understanding CLI for full 31-metric doc quality analysis. Runs automatically when
understandingCLI is installed, providing actionable insights alongside DocGuard's native 8 metrics. Credit: Testimonial/understanding project. - Spec Kit Integration — Auto-detects Spec Kit projects (
.specify/,specs/,constitution.md,memory/), maps Spec Kit artifacts to CDD canonical docs, and supportsdocguard generate --from-speckitfor one-command conversion. Validates spec.md requirement IDs trace to tests. Credit: GitHub Spec Kit framework. - Requirement Traceability (V-Model) — scans docs for requirement IDs (REQ-001, FR-001, US-001, etc.) and validates they trace to test files. Opt-in by convention: just add IDs and DocGuard auto-enforces. Inspired by spec-kit-v-model and IEEE 1016.
- TODO/FIXME Tracking — detects untracked code annotations and skipped tests without explanation. Inspired by spec-kit-cleanup.
- Schema Sync Validator — detects database models from 7 ORM frameworks (Prisma, Drizzle, TypeORM, Sequelize, Knex, Django, Rails) and validates they're documented in DATA-MODEL.md.
docguard llmscommand — generatesllms.txtfrom canonical docs following the llms.txt standard (Jeremy Howard, Answer.AI, 2024).- ALCOA+ Compliance Scoring — maps existing validators to the 9 FDA data integrity attributes (Attributable, Legible, Contemporaneous, Original, Accurate, Complete, Consistent, Enduring, Available). Always shown in
docguard scoreoutput with per-attribute evidence, gaps, and fix recommendations. enterprise-aiprofile — EU AI Act Annex IV compliance profile with stricter freshness (14-day threshold), required DATA-MODEL.md, and Risk Assessment section in SECURITY.md.- OpenAPI cross-check — if route files and an OpenAPI spec exist, validates routes have matching paths in the spec. Warns to re-run spec generator if out of sync.
- Validator count: 14 → 18 validators, 108 → 130+ automated checks
docguard scorenow always shows ALCOA+ compliance breakdown
- Docs-Coverage Validator — detects undocumented code features: config files on disk, code-referenced configs (resolve/existsSync calls), source dirs not in ARCHITECTURE.md, README section completeness per Standard README spec.
- Metadata-Sync Validator — cross-checks package.json version against extension.yml and markdown file references; context-aware matching (URLs, install commands, YAML only).
- Metrics-Consistency Validator — catches stale hardcoded numbers in docs ("92 checks" when actual is 114); requires 2+ digit numbers and negative lookbehind for ratio patterns.
.docguardignoresupport — per-project file exclusions (like.gitignore), parsed byloadIgnorePatterns()inshared.mjs, integrated with Metrics-Consistency and Metadata-Sync validators.
- Co-located test detection —
generatenow recursively scanssrc/**/__tests__/and*.test.*/*.spec.*files; readsvitest.config.ts/jest.config.tsfor custom patterns. - Test files as source files — test files are now filtered out of all source lists (services, routes, models, components, middlewares) before mapping.
- Diagnose suggest-only —
diagnoseno longer auto-creates files by default; pass--autoto enable auto-fix. Shows actionable suggestions when not in auto mode. - Diagnose score cap — target score in AI prompt now capped at 100 (was showing 105/100).
- Guard checks — increased from 86 to 114 with 5 new validators (docs-coverage, metadata-sync, metrics-consistency, docs-diff, freshness).
- Validators — increased from 9 to 14.
- Docs-Diff Validator — New validator checks for entity/route/field drift between code and canonical docs. Integrated into
guardanddiagnoseruns. - File Existence Checks —
test-specvalidator now verifies that source files and test files referenced in the Source-to-Test Map actually exist on disk (catches stale references). - Dynamic Score Suggestions — Score output now shows specific, AI-actionable suggestions per doc (e.g., "TEST-SPEC.md: missing section: ## Coverage Rules → Run
docguard fix --doc test-spec") instead of generic advice. - Recommended Test Patterns — TEST-SPEC.md template now includes guidance on config-awareness tests, regression guards, edge cases.
- Mermaid Diagram — ARCHITECTURE.md now includes a visual architecture diagram.
- Scoring: Config-Awareness —
calcEnvironmentScoreandcalcSecurityScorenow respectneedsEnvExample: false— CLI projects no longer penalized for missing.env.example. - Scoring: node:test Recognition —
calcTestingScorenow checks.docguard.jsontestFrameworkandpackage.jsonscripts fornode --test, giving full marks for built-in test runners. - Scoring: Fake Bonus Removed — Removed
docguard:versionmetadata bonus fromcalcDocQualityScore— it was inflating scores by awarding points for a non-existent feature. - Circular Dependencies — Extracted
c(colors) andPROFILESinto newcli/shared.mjs, breaking 14 circular import cycles betweendocguard.mjsand all command files. - CI Workflow — Fixed failing CI by removing deleted
auditcommand steps, adding--forceto interactiveinit, and addingdiagnosestep.
auditcommand — Now an alias forguard(oldaudit.mjsdeleted).- Architecture + Security validators — Enabled by default in
.docguard.json. - Guard checks — Increased from 52 to 86 with all validators enabled.
- Test suite — 30 → 33 tests, including config-awareness and regression guards.
- Spec-Kit Extension — DocGuard is now available as a GitHub Spec Kit community extension. 6 commands registered (
guard,diagnose,score,trace,generate,init) withafter_taskshook for automatic validation. Located inextensions/spec-kit-docguard/.
- Config-aware traceability —
guard,diagnose, andtracenow respect.docguard.jsonrequiredFiles.canonical. Excluded docs are skipped entirely. - Orphan detection — Warns when files exist in
docs-canonical/but are excluded from config, with actionable cleanup instructions: "Delete them or add to .docguard.json".
- Trace no longer hardcodes all 6 docs — only evaluates what the user's config requires.
- Traceability Validator — New
validateTraceabilityruns automatically inguardanddiagnose. Checks that each canonical doc (ARCHITECTURE, DATA-MODEL, TEST-SPEC, SECURITY, ENVIRONMENT) has matching source code artifacts. Reports PARTIAL/UNLINKED/MISSING coverage. - DocGuard in Generated Tech Stacks —
docguard generatenow always includes DocGuard in the Documentation Tools table of generated ARCHITECTURE.md.
- Guard warnings resolved — TEST-SPEC.md
watch.mjspartial coverage justified with ISO 29119 §7.2; DRIFT-LOG.md populated with template-string entries. - Test file regex —
.test.mjsand.spec.mjsfiles now match in traceability and trace commands. - 51 guard checks (was 46) — all passing on DocGuard itself.
- Quality Labels in Guard — Each validator now displays
[HIGH],[MEDIUM], or[LOW]quality labels for actionable triage. Inspired by CJE quality stratification (Lopez et al., TRACE, IEEE TMLCN 2026). - Standards Citations in Generated Docs — All 6 generated canonical docs now include a standards reference footer citing the governing industry standard (arc42/C4, ISO 29119, OWASP ASVS, OpenAPI 3.1, 12-Factor App). Inspired by RAG-grounded standards alignment (Lopez et al., AITPG, IEEE TSE 2026).
docguard traceCommand — New requirements traceability matrix generator. Maps canonical docs ↔ source code ↔ tests with TRACED/PARTIAL/UNLINKED/MISSING coverage signals. Supports--format json.docguard score --signalsFlag — Multi-signal quality breakdown showing per-signal contribution bars with quality labels. Inspired by CJE composite scoring.docguard diagnose --debateFlag — Multi-perspective AI prompts using three-agent Advocate/Challenger/Synthesizer pattern. Inspired by AITPG multi-agent role specialization and TRACE adversarial debate.- Agent-Aware Prompt Complexity —
diagnoseauto-detects AI agent tier from AGENTS.md and adjusts prompt verbosity (concise for advanced models, step-by-step for smaller models). Inspired by CJE equalizer effect (Lopez et al., TRACE 2026). - Research & Academic Credits — Added full IEEE-style citations for AITPG and TRACE papers, ORCID, and concept attribution table to CONTRIBUTING.md. Added research credits to README.md and academic foundations to PHILOSOPHY.md.
- 15 commands total: added
trace(alias:traceability) - Version bump: 0.6.0 → 0.7.0
- Doc Tool Detection —
generatenow detects 8 existing doc tools (OpenAPI, TypeDoc, JSDoc, Storybook, Docusaurus, Mintlify, Redocly, Swagger). Built-in YAML parser for OpenAPI specs (zero deps). Leverages existing tools instead of replacing them. - Deep Route Scanning — Parses actual route definitions from source code across 6 frameworks: Next.js (App Router + Pages Router), Express, Fastify, Hono, Django, FastAPI. OpenAPI-first: uses spec if available, falls back to code scanning.
- Deep Schema Scanning — Parses schema definitions from 4 ORMs: Prisma (fields, types, relations, enums), Drizzle, Zod, Mongoose. Generates mermaid ER diagrams automatically.
API-REFERENCE.mdGenerator — New canonical doc generated from deep route scanning. Groups endpoints by resource, shows auth status, handler names, and per-endpoint parameter/response tables.docguard publish --platform mintlify— Scaffolds Mintlify v2 docs from canonical documentation. Generatesdocs.json,introduction.mdx,quickstart.mdx, and maps all canonical docs to.mdxpages with proper frontmatter.- AGENTS.md Standard Compliance — Enhanced AGENTS.md template with Permissions & Guardrails section, Monorepo Support, Safety Rules, and
agents.mdstandard tags. - Scanner Modules — New
cli/scanners/directory withdoc-tools.mjs,routes.mjs,schemas.mjs.
- ARCHITECTURE.md — Now arc42-aligned (all 12 sections: §1-§12) with C4 Model mermaid diagrams (Level 1 Context, Level 2 Container), Runtime View sequence diagrams, Deployment View, and Glossary.
- DATA-MODEL.md — Enhanced with field-level detail from ORM parsing (types, required, PK/UK, defaults), relationship tables, enum sections, and auto-generated mermaid ER diagrams.
- Dynamic Version — Banner and
--versionnow read frompackage.json(no more stale hardcoded version strings). - Version bump: 0.5.2 → 0.6.0
- 14 commands total: added
publish(alias:pub)
docguard diagnose— The AI orchestrator. Chains guard→fix in one command. Runs all validators, maps every failure to an AI-actionable fix prompt, and outputs a complete remediation plan. Three output modes:text(default),json(for automation),prompt(AI-ready). Alias:dx.guard --format json— Structured JSON output for CI/CD and AI agents. Includes profile, validator results, and timestamps.- Compliance Profiles — Three presets (
starter,standard,enterprise) that adjust required docs and validators. Set via--profileflag on init or"profile"in.docguard.json. score --tax— Documentation tax estimate: tracks doc count, code churn, and outputs estimated weekly maintenance time with LOW/MEDIUM/HIGH rating.init --profile starter— Minimal CDD setup (just ARCHITECTURE.md + CHANGELOG) for side projects.- GitHub Actions CI template — Ships in
templates/ci/github-actions.yml, ready-to-use workflow. watch --auto-fix— When guard finds issues, auto-outputs AI fix prompts.- Init auto-populate — After creating skeletons, outputs
docguard diagnoseprompt instead of manual instructions. - Guard → Diagnose hint — Guard output now prompts
Run docguard diagnosewhen issues exist.
- Guard refactored:
runGuardInternal()extracted for reuse by diagnose, CI, and watch (no subprocess needed). - CI rewritten: Uses
runGuardInternaldirectly instead of spawning subprocess. Includes profile and validator data in JSON. - Watch rewritten: Uses
runGuardInternal(no process.exit killing the watcher). Proper debounced re-runs. - Version bump: 0.4.0 → 0.5.0
- 13 commands total: audit, init, guard, score, diagnose, diff, agents, generate, hooks, badge, ci, fix, watch
- 30 tests across 17 suites (up from 24/14)
docguard badge— Generate shields.io CDD score badges for README (score, type, guarded-by)docguard ci— Single command for CI/CD pipelines (guard + score, JSON output, exit codes).npmignorefor clean npm publish--threshold <n>flag for minimum CI score enforcement--fail-on-warningflag for strict CI mode- npm publish dry-run in CI workflow on tag push
- Score command refactored with
runScoreInternalfor reuse by badge/ci - CI workflow now runs actual test suite + dogfoods DocGuard on itself
- 10 total commands (audit, init, guard, score, diff, agents, generate, hooks, badge, ci)
docguard hooks— Install pre-commit (guard), pre-push (score enforcement), and commit-msg (conventional commits) git hooks- GitHub Action (
action.yml) — Reusable marketplace action with score thresholds, PR comments, and fail-on-warning support - Import analysis in architecture validator — Builds full import graph, detects circular dependencies (DFS), auto-parses layer boundaries from ARCHITECTURE.md
- Project type intelligence — Auto-detect cli/library/webapp/api from package.json
.docguard.jsonwithprojectTypeConfig(needsE2E, needsEnvVars, etc.)- 15 real tests covering all commands (node:test)
- Architecture validator now auto-detects layer violations from ARCHITECTURE.md (no config needed)
- Validators respect projectTypeConfig — no false positives for CLI tools
- Environment validator no longer warns about .env.example for CLI tools
- Test-spec validator no longer warns about E2E journeys for CLI tools
docguard score— Weighted CDD maturity score (0-100) with bar charts, grades A+ through Fdocguard diff— Compares canonical docs against actual code (routes, entities, env vars)docguard agents— Auto-generates agent-specific config files for Cursor, Copilot, Cline, Windsurf, Claude Code, Geminidocguard generate— Reverse-engineer canonical docs from existing codebase (15+ frameworks, 8+ databases, 6 ORMs)- Freshness validator — Uses git commit history to detect stale documentation
- Full document type registry — All 16 CDD document types with required/optional flags and descriptions
- 8 new templates: KNOWN-GOTCHAS, TROUBLESHOOTING, RUNBOOKS, VENDOR-BUGS, CURRENT-STATE, ADR, DEPLOYMENT, ROADMAP
- Diff command false positives — entity extraction no longer picks up table headers
- Initial release of DocGuard CLI
docguard audit— Scan project, report documentation statusdocguard init— Initialize CDD docs from professional templatesdocguard guard— Validate project against canonical documentation- 9 validators: structure, doc-sections, docs-sync, drift, changelog, test-spec, environment, security, architecture
- 8 core templates with docguard metadata headers
- Stack-specific configs: Next.js, Fastify, Python, generic
- Zero dependencies — pure Node.js
- GitHub CI workflow (Node 18/20/22 matrix)
- MIT license
- Added missing tests for the
watchCLI command to verify it runs and reacts properly.