docguard-cli 0.9.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. docguard_cli-0.9.5/.docguard.json +40 -0
  2. docguard_cli-0.9.5/.docguardignore +9 -0
  3. docguard_cli-0.9.5/.github/ISSUE_TEMPLATE/bug_report.md +30 -0
  4. docguard_cli-0.9.5/.github/ISSUE_TEMPLATE/feature_request.md +27 -0
  5. docguard_cli-0.9.5/.github/workflows/ci.yml +89 -0
  6. docguard_cli-0.9.5/.github/workflows/spec-kit-extension.yml +40 -0
  7. docguard_cli-0.9.5/.gitignore +30 -0
  8. docguard_cli-0.9.5/.npmignore +28 -0
  9. docguard_cli-0.9.5/AGENTS.md +54 -0
  10. docguard_cli-0.9.5/CHANGELOG.md +276 -0
  11. docguard_cli-0.9.5/CODE_OF_CONDUCT.md +52 -0
  12. docguard_cli-0.9.5/COMPARISONS.md +242 -0
  13. docguard_cli-0.9.5/CONTRIBUTING.md +139 -0
  14. docguard_cli-0.9.5/DRIFT-LOG.md +11 -0
  15. docguard_cli-0.9.5/LICENSE +21 -0
  16. docguard_cli-0.9.5/PHILOSOPHY.md +172 -0
  17. docguard_cli-0.9.5/PKG-INFO +403 -0
  18. docguard_cli-0.9.5/README.md +379 -0
  19. docguard_cli-0.9.5/ROADMAP.md +124 -0
  20. docguard_cli-0.9.5/SECURITY.md +40 -0
  21. docguard_cli-0.9.5/STANDARD.md +751 -0
  22. docguard_cli-0.9.5/SUPPORT.md +51 -0
  23. docguard_cli-0.9.5/action.yml +166 -0
  24. docguard_cli-0.9.5/cli/commands/agents.mjs +221 -0
  25. docguard_cli-0.9.5/cli/commands/badge.mjs +72 -0
  26. docguard_cli-0.9.5/cli/commands/ci.mjs +80 -0
  27. docguard_cli-0.9.5/cli/commands/diagnose.mjs +471 -0
  28. docguard_cli-0.9.5/cli/commands/diff.mjs +371 -0
  29. docguard_cli-0.9.5/cli/commands/fix.mjs +611 -0
  30. docguard_cli-0.9.5/cli/commands/generate.mjs +1353 -0
  31. docguard_cli-0.9.5/cli/commands/guard.mjs +214 -0
  32. docguard_cli-0.9.5/cli/commands/hooks.mjs +227 -0
  33. docguard_cli-0.9.5/cli/commands/init.mjs +288 -0
  34. docguard_cli-0.9.5/cli/commands/llms.mjs +159 -0
  35. docguard_cli-0.9.5/cli/commands/publish.mjs +246 -0
  36. docguard_cli-0.9.5/cli/commands/score.mjs +739 -0
  37. docguard_cli-0.9.5/cli/commands/trace.mjs +338 -0
  38. docguard_cli-0.9.5/cli/commands/watch.mjs +143 -0
  39. docguard_cli-0.9.5/cli/docguard.mjs +443 -0
  40. docguard_cli-0.9.5/cli/scanners/doc-tools.mjs +351 -0
  41. docguard_cli-0.9.5/cli/scanners/routes.mjs +461 -0
  42. docguard_cli-0.9.5/cli/scanners/schemas.mjs +567 -0
  43. docguard_cli-0.9.5/cli/scanners/speckit.mjs +465 -0
  44. docguard_cli-0.9.5/cli/shared.mjs +141 -0
  45. docguard_cli-0.9.5/cli/validators/architecture.mjs +380 -0
  46. docguard_cli-0.9.5/cli/validators/changelog.mjs +39 -0
  47. docguard_cli-0.9.5/cli/validators/doc-quality.mjs +675 -0
  48. docguard_cli-0.9.5/cli/validators/docs-coverage.mjs +387 -0
  49. docguard_cli-0.9.5/cli/validators/docs-diff.mjs +185 -0
  50. docguard_cli-0.9.5/cli/validators/docs-sync.mjs +163 -0
  51. docguard_cli-0.9.5/cli/validators/drift.mjs +101 -0
  52. docguard_cli-0.9.5/cli/validators/environment.mjs +70 -0
  53. docguard_cli-0.9.5/cli/validators/freshness.mjs +224 -0
  54. docguard_cli-0.9.5/cli/validators/metadata-sync.mjs +179 -0
  55. docguard_cli-0.9.5/cli/validators/metrics-consistency.mjs +166 -0
  56. docguard_cli-0.9.5/cli/validators/schema-sync.mjs +219 -0
  57. docguard_cli-0.9.5/cli/validators/security.mjs +101 -0
  58. docguard_cli-0.9.5/cli/validators/structure.mjs +88 -0
  59. docguard_cli-0.9.5/cli/validators/test-spec.mjs +195 -0
  60. docguard_cli-0.9.5/cli/validators/todo-tracking.mjs +295 -0
  61. docguard_cli-0.9.5/cli/validators/traceability.mjs +351 -0
  62. docguard_cli-0.9.5/commands/docguard.fix.md +45 -0
  63. docguard_cli-0.9.5/commands/docguard.guard.md +27 -0
  64. docguard_cli-0.9.5/commands/docguard.review.md +35 -0
  65. docguard_cli-0.9.5/commands/docguard.score.md +42 -0
  66. docguard_cli-0.9.5/configs/fastify.json +37 -0
  67. docguard_cli-0.9.5/configs/generic.json +22 -0
  68. docguard_cli-0.9.5/configs/nextjs.json +37 -0
  69. docguard_cli-0.9.5/configs/python.json +37 -0
  70. docguard_cli-0.9.5/docguard_cli/__init__.py +1 -0
  71. docguard_cli-0.9.5/docguard_cli/wrapper.py +101 -0
  72. docguard_cli-0.9.5/docs/ai-integration.md +179 -0
  73. docguard_cli-0.9.5/docs/commands.md +239 -0
  74. docguard_cli-0.9.5/docs/configuration.md +96 -0
  75. docguard_cli-0.9.5/docs/faq.md +155 -0
  76. docguard_cli-0.9.5/docs/installation.md +81 -0
  77. docguard_cli-0.9.5/docs/profiles.md +103 -0
  78. docguard_cli-0.9.5/docs/quickstart.md +79 -0
  79. docguard_cli-0.9.5/docs-canonical/ARCHITECTURE.md +177 -0
  80. docguard_cli-0.9.5/docs-canonical/DATA-MODEL.md +150 -0
  81. docguard_cli-0.9.5/docs-canonical/ENVIRONMENT.md +70 -0
  82. docguard_cli-0.9.5/docs-canonical/SECURITY.md +111 -0
  83. docguard_cli-0.9.5/docs-canonical/TEST-SPEC.md +97 -0
  84. docguard_cli-0.9.5/extensions/spec-kit-docguard/LICENSE +21 -0
  85. docguard_cli-0.9.5/extensions/spec-kit-docguard/README.md +93 -0
  86. docguard_cli-0.9.5/extensions/spec-kit-docguard/commands/diagnose.md +36 -0
  87. docguard_cli-0.9.5/extensions/spec-kit-docguard/commands/generate.md +43 -0
  88. docguard_cli-0.9.5/extensions/spec-kit-docguard/commands/guard.md +48 -0
  89. docguard_cli-0.9.5/extensions/spec-kit-docguard/commands/init.md +31 -0
  90. docguard_cli-0.9.5/extensions/spec-kit-docguard/commands/score.md +46 -0
  91. docguard_cli-0.9.5/extensions/spec-kit-docguard/commands/trace.md +49 -0
  92. docguard_cli-0.9.5/extensions/spec-kit-docguard/extension.yml +66 -0
  93. docguard_cli-0.9.5/package.json +59 -0
  94. docguard_cli-0.9.5/pyproject.toml +41 -0
  95. docguard_cli-0.9.5/templates/ADR.md.template +64 -0
  96. docguard_cli-0.9.5/templates/AGENTS.md.template +88 -0
  97. docguard_cli-0.9.5/templates/ARCHITECTURE.md.template +78 -0
  98. docguard_cli-0.9.5/templates/CHANGELOG.md.template +16 -0
  99. docguard_cli-0.9.5/templates/CURRENT-STATE.md.template +64 -0
  100. docguard_cli-0.9.5/templates/DATA-MODEL.md.template +66 -0
  101. docguard_cli-0.9.5/templates/DEPLOYMENT.md.template +66 -0
  102. docguard_cli-0.9.5/templates/DRIFT-LOG.md.template +18 -0
  103. docguard_cli-0.9.5/templates/ENVIRONMENT.md.template +43 -0
  104. docguard_cli-0.9.5/templates/KNOWN-GOTCHAS.md.template +69 -0
  105. docguard_cli-0.9.5/templates/REQUIREMENTS.md.template +68 -0
  106. docguard_cli-0.9.5/templates/ROADMAP.md.template +82 -0
  107. docguard_cli-0.9.5/templates/RUNBOOKS.md.template +115 -0
  108. docguard_cli-0.9.5/templates/SECURITY.md.template +42 -0
  109. docguard_cli-0.9.5/templates/TEST-SPEC.md.template +68 -0
  110. docguard_cli-0.9.5/templates/TROUBLESHOOTING.md.template +96 -0
  111. docguard_cli-0.9.5/templates/VENDOR-BUGS.md.template +74 -0
  112. docguard_cli-0.9.5/templates/ci/github-actions.yml +39 -0
  113. docguard_cli-0.9.5/templates/commands/docguard.fix.md +65 -0
  114. docguard_cli-0.9.5/templates/commands/docguard.guard.md +40 -0
  115. docguard_cli-0.9.5/templates/commands/docguard.init.md +62 -0
  116. docguard_cli-0.9.5/templates/commands/docguard.review.md +44 -0
  117. docguard_cli-0.9.5/templates/commands/docguard.update.md +44 -0
  118. docguard_cli-0.9.5/tests/commands.test.mjs +374 -0
  119. docguard_cli-0.9.5/vscode-extension/.vscodeignore +4 -0
  120. docguard_cli-0.9.5/vscode-extension/README.md +49 -0
  121. docguard_cli-0.9.5/vscode-extension/extension.js +493 -0
  122. docguard_cli-0.9.5/vscode-extension/package.json +93 -0
@@ -0,0 +1,40 @@
1
+ {
2
+ "projectName": "docguard",
3
+ "version": "0.3",
4
+
5
+ "projectType": "cli",
6
+
7
+ "requiredFiles": {
8
+ "canonical": [
9
+ "docs-canonical/ARCHITECTURE.md",
10
+ "docs-canonical/DATA-MODEL.md",
11
+ "docs-canonical/SECURITY.md",
12
+ "docs-canonical/TEST-SPEC.md",
13
+ "docs-canonical/ENVIRONMENT.md"
14
+ ],
15
+ "agentFile": ["AGENTS.md", "CLAUDE.md"],
16
+ "changelog": "CHANGELOG.md",
17
+ "driftLog": "DRIFT-LOG.md"
18
+ },
19
+
20
+ "projectTypeConfig": {
21
+ "needsEnvVars": false,
22
+ "needsEnvExample": false,
23
+ "needsE2E": false,
24
+ "needsDatabase": false,
25
+ "testFramework": "node:test",
26
+ "runCommand": "node cli/docguard.mjs"
27
+ },
28
+
29
+ "validators": {
30
+ "structure": true,
31
+ "docsSync": true,
32
+ "drift": true,
33
+ "changelog": true,
34
+ "architecture": true,
35
+ "testSpec": true,
36
+ "security": true,
37
+ "environment": true,
38
+ "freshness": true
39
+ }
40
+ }
@@ -0,0 +1,9 @@
1
+ # DocGuard Ignore — files to exclude from validation
2
+ # Format: one pattern per line, # comments, blank lines skipped
3
+
4
+ # Research documents (external/archival — not project source docs)
5
+ Research/
6
+ Research/**
7
+
8
+ # VS Code extension build artifacts
9
+ vscode-extension/out/
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: 🐛 Bug Report
3
+ about: Report a bug in DocGuard
4
+ title: '[BUG] '
5
+ labels: bug
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Describe the bug
10
+ <!-- A clear description of what the bug is -->
11
+
12
+ ## To Reproduce
13
+ 1. Run `docguard ...`
14
+ 2. See error
15
+
16
+ ## Expected behavior
17
+ <!-- What you expected to happen -->
18
+
19
+ ## Environment
20
+ - **OS**: <!-- e.g. macOS 15, Ubuntu 24 -->
21
+ - **Node.js**: <!-- e.g. 20.x -->
22
+ - **DocGuard**: <!-- e.g. 0.1.0 -->
23
+
24
+ ## DocGuard config
25
+ ```json
26
+ <!-- Paste your .docguard.json here -->
27
+ ```
28
+
29
+ ## Additional context
30
+ <!-- Screenshots, error output -->
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: ✨ Feature Request
3
+ about: Suggest a new feature for DocGuard
4
+ title: '[FEATURE] '
5
+ labels: enhancement
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Is your feature request related to a problem?
10
+ <!-- A clear description of what the problem is -->
11
+
12
+ ## Describe the solution you'd like
13
+ <!-- What you want to happen -->
14
+
15
+ ## Describe alternatives you've considered
16
+ <!-- Any alternative solutions you've considered -->
17
+
18
+ ## Which CDD phase does this relate to?
19
+ - [ ] Phase 1: DEFINE (documentation creation)
20
+ - [ ] Phase 2: BUILD (code generation/implementation)
21
+ - [ ] Phase 3: GUARD (validation/enforcement)
22
+ - [ ] Phase 4: EVOLVE (drift tracking/maintenance)
23
+ - [ ] CLI/tooling
24
+ - [ ] Standard/spec
25
+
26
+ ## Additional context
27
+ <!-- Screenshots, examples, links -->
@@ -0,0 +1,89 @@
1
+ name: DocGuard CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ node-version: [18, 20, 22]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ with:
19
+ fetch-depth: 0 # Full git history for freshness validator
20
+
21
+ - uses: actions/setup-node@v4
22
+ with:
23
+ node-version: ${{ matrix.node-version }}
24
+
25
+ # ── Automated Test Suite ──
26
+ - name: Run Tests
27
+ run: npm test
28
+
29
+ # ── Self-validation (dogfooding) ──
30
+ - name: CLI Version
31
+ run: node cli/docguard.mjs --version
32
+
33
+ - name: Guard (self-check)
34
+ run: |
35
+ # Exit 0 = pass, Exit 1 = errors (fail CI), Exit 2 = warnings only (allow)
36
+ node cli/docguard.mjs guard || [ $? -eq 2 ]
37
+
38
+ - name: Score
39
+ run: node cli/docguard.mjs score
40
+
41
+ - name: Score JSON
42
+ run: node cli/docguard.mjs score --format json
43
+
44
+ - name: Diff
45
+ run: node cli/docguard.mjs diff
46
+
47
+ - name: Badge
48
+ run: node cli/docguard.mjs badge
49
+
50
+ - name: Diagnose
51
+ run: node cli/docguard.mjs diagnose
52
+
53
+ # ── Cross-project tests ──
54
+ - name: Init in temp dir
55
+ run: |
56
+ mkdir -p /tmp/docguard-test
57
+ node cli/docguard.mjs init --dir /tmp/docguard-test --force
58
+
59
+ - name: Guard after init (exit 2 = warnings OK for empty projects)
60
+ run: |
61
+ node cli/docguard.mjs guard --dir /tmp/docguard-test || [ $? -eq 2 ]
62
+
63
+ - name: Generate in empty dir
64
+ run: |
65
+ mkdir -p /tmp/docguard-gen
66
+ node cli/docguard.mjs generate --dir /tmp/docguard-gen
67
+
68
+ - name: Generate --force
69
+ run: node cli/docguard.mjs generate --dir /tmp/docguard-gen --force
70
+
71
+ - name: Agents
72
+ run: node cli/docguard.mjs agents --dir /tmp/docguard-test
73
+
74
+ - name: Hooks --list
75
+ run: node cli/docguard.mjs hooks --list
76
+
77
+ # ── npm publish dry-run on tags ──
78
+ publish-check:
79
+ runs-on: ubuntu-latest
80
+ if: startsWith(github.ref, 'refs/tags/v')
81
+ needs: test
82
+ steps:
83
+ - uses: actions/checkout@v4
84
+ - uses: actions/setup-node@v4
85
+ with:
86
+ node-version: 20
87
+ registry-url: 'https://registry.npmjs.org'
88
+ - name: Publish dry-run
89
+ run: npm publish --dry-run
@@ -0,0 +1,40 @@
1
+ name: Build Spec Kit Extension Asset
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: write
9
+
10
+ jobs:
11
+ build-extension:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Get release tag
17
+ id: tag
18
+ run: echo "version=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
19
+
20
+ - name: Sync version in extension.yml
21
+ run: |
22
+ sed -i "s/version: \".*\"/version: \"${GITHUB_REF_NAME#v}\"/" extensions/spec-kit-docguard/extension.yml
23
+ echo "Updated extension.yml to version ${GITHUB_REF_NAME#v}"
24
+ grep 'version:' extensions/spec-kit-docguard/extension.yml
25
+
26
+ - name: Build extension ZIP
27
+ run: |
28
+ cd extensions/spec-kit-docguard
29
+ zip -r "../../spec-kit-docguard-${{ steps.tag.outputs.version }}.zip" . -x ".*"
30
+ cd ../..
31
+ echo "--- ZIP contents ---"
32
+ unzip -l "spec-kit-docguard-${{ steps.tag.outputs.version }}.zip"
33
+
34
+ - name: Upload to release
35
+ env:
36
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37
+ run: |
38
+ gh release upload "${{ steps.tag.outputs.version }}" \
39
+ "spec-kit-docguard-${{ steps.tag.outputs.version }}.zip" \
40
+ --clobber
@@ -0,0 +1,30 @@
1
+ # Dependencies
2
+ node_modules/
3
+
4
+ # Internal research (not part of the public package)
5
+ Research/
6
+
7
+ # Environment files
8
+ .env
9
+ .env.local
10
+ .env.development
11
+ .env.production
12
+
13
+ # OS files
14
+ .DS_Store
15
+ Thumbs.db
16
+
17
+ # IDE
18
+ .vscode/
19
+ .idea/
20
+ *.swp
21
+ *.swo
22
+
23
+ # Build artifacts
24
+ dist/
25
+ build/
26
+ coverage/
27
+
28
+ # SpecGuard generated docs (for THIS project testing)
29
+ # Note: In real projects, docs-canonical/ SHOULD be committed.
30
+ # These are excluded here because they're template-generated test files.
@@ -0,0 +1,28 @@
1
+ # Development
2
+ .git/
3
+ .github/
4
+ .specguard.json
5
+ Research/
6
+ docs-canonical/
7
+ docs-implementation/
8
+
9
+ # Generated docs (templates are included via templates/)
10
+ DRIFT-LOG.md
11
+ ROADMAP.md
12
+ COMPARISONS.md
13
+
14
+ # Tests
15
+ tests/
16
+
17
+ # Config
18
+ .gitignore
19
+ .eslintrc*
20
+ .prettierrc*
21
+
22
+ # IDE
23
+ .vscode/
24
+ .idea/
25
+
26
+ # OS
27
+ .DS_Store
28
+ Thumbs.db
@@ -0,0 +1,54 @@
1
+ # AI Agent Instructions — docguard
2
+
3
+ > This project follows **Canonical-Driven Development (CDD)**.
4
+ > Documentation is the source of truth. Read before coding.
5
+
6
+ ## Workflow
7
+
8
+ 1. **Read** `docs-canonical/` before suggesting changes
9
+ 2. **Check** existing patterns in the codebase
10
+ 3. **Run** `docguard diagnose` to see what needs fixing
11
+ 4. **Confirm** your approach before writing code
12
+ 5. **Implement** matching existing code style
13
+ 6. **Log** any deviations in `DRIFT-LOG.md` with `// DRIFT: reason`
14
+ 7. **Verify** with `docguard guard` — all checks must pass
15
+
16
+ ## Project Stack
17
+
18
+ - **Language**: JavaScript (ES modules)
19
+ - **Runtime**: Node.js 18+
20
+ - **Dependencies**: Zero (pure Node.js built-ins)
21
+ - **Testing**: `node:test` (built-in)
22
+ - **Version**: 0.5.0
23
+
24
+ ## Key Files
25
+
26
+ | File | Purpose |
27
+ |------|---------|
28
+ | `docs-canonical/ARCHITECTURE.md` | System design |
29
+ | `docs-canonical/DATA-MODEL.md` | Database schemas |
30
+ | `docs-canonical/SECURITY.md` | Auth & secrets |
31
+ | `docs-canonical/TEST-SPEC.md` | Test requirements |
32
+ | `docs-canonical/ENVIRONMENT.md` | Environment setup |
33
+ | `CHANGELOG.md` | Change tracking |
34
+ | `DRIFT-LOG.md` | Documented deviations |
35
+
36
+ ## Commands (13 total)
37
+
38
+ | Command | Purpose |
39
+ |---------|---------|
40
+ | `diagnose` | **Primary** — identify issues + generate AI fix prompts |
41
+ | `guard` | Validate project (CI gate) |
42
+ | `fix --doc <name>` | AI prompt for specific document |
43
+ | `score` | CDD maturity score (0-100) |
44
+ | `init` | Initialize CDD docs |
45
+ | `generate` | Reverse-engineer docs from code |
46
+ | `ci` | CI/CD pipeline check |
47
+
48
+ ## Rules
49
+
50
+ - Never commit without updating CHANGELOG.md
51
+ - If code deviates from docs, add `// DRIFT: reason`
52
+ - Security rules in SECURITY.md are mandatory
53
+ - Test requirements in TEST-SPEC.md must be met
54
+ - Run `docguard guard` before pushing — all checks must pass
@@ -0,0 +1,276 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.9.5] - 2026-03-14
11
+
12
+ ### Added — Spec Kit Alignment (Mega Release)
13
+
14
+ #### Spec Kit Scanner Rewrite
15
+ - **Correct file paths**: Now checks `.specify/specs/NNN-feature/spec.md` (v3+ standard) with fallback to legacy `specs/*/spec.md`
16
+ - **Constitution detection**: Checks `.specify/memory/constitution.md` (v3+) with fallback to root `constitution.md`
17
+ - **Spec quality validation**: Validates mandatory sections (User Scenarios, Requirements, Success Criteria), FR-IDs, SC-IDs per spec-kit spec-template.md
18
+ - **Plan quality validation**: Checks for Summary, Technical Context, Project Structure sections
19
+ - **Tasks quality validation**: Verifies phased breakdown (Phase 1, 2+) and T-xxx task IDs
20
+ - **Informational warning**: Spec-Kit validator now suggests `specify init` when no spec-kit artifacts found (was silent `0/0`)
21
+
22
+ #### Traceability Enhancement
23
+ - **SC-xxx** (Success Criteria) added to requirement ID patterns — aligns with spec-kit SC-001 format
24
+ - **T-xxx** (Task IDs) added — recognizes spec-kit T001, T002 task identifiers
25
+ - Scans `.specify/specs/` path in addition to legacy `specs/`
26
+
27
+ #### Slash Commands (Spec Kit Extension)
28
+ - New `commands/` directory with 4 AI agent slash commands: `/docguard.guard`, `/docguard.review`, `/docguard.fix`, `/docguard.score`
29
+ - Shipped as part of npm package — available via `specify extension add docguard`
30
+ - Works with Claude Code, Copilot, Cursor, Gemini, Antigravity, and more
31
+
32
+ #### REQUIREMENTS.md Template
33
+ - New `REQUIREMENTS.md.template` aligned with spec-kit FR-xxx, SC-xxx, Given/When/Then standards
34
+ - Added to `docguard init` template catalog (defaultYes: true)
35
+
36
+ #### Python Support (PyPI)
37
+ - `pyproject.toml` and `docguard_cli/wrapper.py` for `pip install docguard-cli`
38
+ - Thin Python wrapper delegates to `npx docguard-cli` — requires Node.js 18+
39
+ - Python developers can now use `docguard guard`, `docguard score`, etc.
40
+
41
+ ### Fixed
42
+ - `speckit.mjs` writeFileSync → safeWrite (backup safety, same as v0.9.4 pattern)
43
+
44
+ ## [0.9.4] - 2026-03-13
45
+
46
+ ### Fixed — Critical: Generate File Safety (Data Loss Prevention)
47
+ - **`diagnose --auto` no longer passes `--force` to `generate`**: This was the root cause of silent doc overwriting. `diagnose --auto` now only creates missing files, never overwrites existing ones.
48
+ - **`.bak` backup on `--force`**: When `generate --force` is explicitly used, all existing files are backed up as `.bak` before being overwritten. Content is never permanently lost.
49
+ - **`--force` warning banner**: Shows how many existing files will be overwritten before proceeding.
50
+ - **`safeWrite()` helper**: All 9 write operations in generate now go through a single safety wrapper.
51
+
52
+ ## [0.9.3] - 2026-03-13
53
+
54
+ ### Changed — Prose-Only Extraction Engine (Breaking improvement)
55
+ - **`extractProse()` replaces `stripMarkdown()`**: 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.
56
+ - **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.
57
+ - **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.
58
+ - **Relaxed thresholds for technical docs**: Flesch 30→15, grade 16→18, sentence length 25→30, passive voice 20→25%, negation 15→20%.
59
+ - **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.
60
+
61
+ ## [0.9.2] - 2026-03-13
62
+
63
+ ### Fixed
64
+ - **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.
65
+ - **Flesch threshold**: Lowered from 30→20 for technical documentation — developer docs inherently score lower than prose.
66
+ - **NUL file on macOS**: `findUnderstandingCli()` used Windows `2>NUL` redirect which created a stray `NUL` file on Mac/Linux. Now uses platform-specific `which`/`where`.
67
+ - **Unused import**: Removed `mkdirSync` from `diagnose.mjs` (was imported but never used).
68
+
69
+ ### Verified
70
+ - `diagnose` is read-only by default — file creation only happens with explicit `--auto` flag.
71
+ - `metrics-consistency` properly reads `.docguardignore` patterns.
72
+
73
+ ## [0.9.1] - 2026-03-13
74
+
75
+ ### Fixed
76
+ - **Test detection**: `calcTestingScore` now detects co-located tests in `src/`, `app/`, `lib/`, `packages/`, `modules/` — not just top-level `tests/` directories. Projects using `src/**/__tests__/` or `src/**/*.test.*` patterns now score correctly.
77
+ - **Test-spec fallback**: Validator fallback check now scans for co-located test files and checks vitest/jest config presence.
78
+ - **Vitest config support**: Score calculation now reads `vitest.config.ts`/`jest.config.ts` include patterns to detect custom test directories.
79
+
80
+ ## [0.9.0] - 2026-03-13
81
+
82
+ ### Added
83
+ - **Doc Quality Validator** — 8 deterministic writing quality metrics (passive voice, readability, atomicity, sentence length, negation/conditional load). Inspired by IEEE 830/ISO 29148.
84
+ - **Understanding Integration** — Optional deep scan via the [Understanding](https://github.com/Testimonial/understanding) CLI for full 31-metric doc quality analysis. Runs automatically when `understanding` CLI is installed, providing actionable insights alongside DocGuard's native 8 metrics. Credit: Testimonial/understanding project.
85
+ - **Spec Kit Integration** — Auto-detects [Spec Kit](https://github.com/github/spec-kit) projects (`.specify/`, `specs/`, `constitution.md`, `memory/`), maps Spec Kit artifacts to CDD canonical docs, and supports `docguard generate --from-speckit` for one-command conversion. Validates spec.md requirement IDs trace to tests. Credit: GitHub Spec Kit framework.
86
+ - **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](https://github.com/leocamello/spec-kit-v-model) and IEEE 1016.
87
+ - **TODO/FIXME Tracking** — detects untracked code annotations and skipped tests without explanation. Inspired by [spec-kit-cleanup](https://github.com/dsrednicki/spec-kit-cleanup).
88
+ - **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.
89
+ - **`docguard llms` command** — generates `llms.txt` from canonical docs following the [llms.txt standard](https://llmstxt.org/) (Jeremy Howard, Answer.AI, 2024).
90
+ - **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 score` output with per-attribute evidence, gaps, and fix recommendations.
91
+ - **`enterprise-ai` profile** — EU AI Act Annex IV compliance profile with stricter freshness (14-day threshold), required DATA-MODEL.md, and Risk Assessment section in SECURITY.md.
92
+ - **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.
93
+
94
+ ### Changed
95
+ - Validator count: 14 → 18 validators, 108 → 130+ automated checks
96
+ - `docguard score` now always shows ALCOA+ compliance breakdown
97
+
98
+ ## [0.8.2] - 2026-03-13
99
+
100
+ ### Added
101
+ - **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.
102
+ - **Metadata-Sync Validator** — cross-checks package.json version against extension.yml and markdown file references; context-aware matching (URLs, install commands, YAML only).
103
+ - **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.
104
+ - **`.docguardignore` support** — per-project file exclusions (like `.gitignore`), parsed by `loadIgnorePatterns()` in `shared.mjs`, integrated with Metrics-Consistency and Metadata-Sync validators.
105
+
106
+ ### Fixed
107
+ - **Co-located test detection** — `generate` now recursively scans `src/**/__tests__/` and `*.test.*`/`*.spec.*` files; reads `vitest.config.ts`/`jest.config.ts` for custom patterns.
108
+ - **Test files as source files** — test files are now filtered out of all source lists (services, routes, models, components, middlewares) before mapping.
109
+ - **Diagnose suggest-only** — `diagnose` no longer auto-creates files by default; pass `--auto` to enable auto-fix. Shows actionable suggestions when not in auto mode.
110
+ - **Diagnose score cap** — target score in AI prompt now capped at 100 (was showing 105/100).
111
+
112
+ ### Changed
113
+ - **Guard checks** — increased from 86 to 114 with 5 new validators (docs-coverage, metadata-sync, metrics-consistency, docs-diff, freshness).
114
+ - **Validators** — increased from 9 to 14.
115
+
116
+ ## [0.8.0] - 2026-03-13
117
+
118
+ ### Added
119
+ - **Docs-Diff Validator** — New validator checks for entity/route/field drift between code and canonical docs. Integrated into `guard` and `diagnose` runs.
120
+ - **File Existence Checks** — `test-spec` validator now verifies that source files and test files referenced in the Source-to-Test Map actually exist on disk (catches stale references).
121
+ - **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.
122
+ - **Recommended Test Patterns** — TEST-SPEC.md template now includes guidance on config-awareness tests, regression guards, edge cases.
123
+ - **Mermaid Diagram** — ARCHITECTURE.md now includes a visual architecture diagram.
124
+
125
+ ### Fixed
126
+ - **Scoring: Config-Awareness** — `calcEnvironmentScore` and `calcSecurityScore` now respect `needsEnvExample: false` — CLI projects no longer penalized for missing `.env.example`.
127
+ - **Scoring: node:test Recognition** — `calcTestingScore` now checks `.docguard.json` `testFramework` and `package.json` scripts for `node --test`, giving full marks for built-in test runners.
128
+ - **Scoring: Fake Bonus Removed** — Removed `docguard:version` metadata bonus from `calcDocQualityScore` — it was inflating scores by awarding points for a non-existent feature.
129
+ - **Circular Dependencies** — Extracted `c` (colors) and `PROFILES` into new `cli/shared.mjs`, breaking 14 circular import cycles between `docguard.mjs` and all command files.
130
+ - **CI Workflow** — Fixed failing CI by removing deleted `audit` command steps, adding `--force` to interactive `init`, and adding `diagnose` step.
131
+
132
+ ### Changed
133
+ - **`audit` command** — Now an alias for `guard` (old `audit.mjs` deleted).
134
+ - **Architecture + Security validators** — Enabled by default in `.docguard.json`.
135
+ - **Guard checks** — Increased from 52 to 86 with all validators enabled.
136
+ - **Test suite** — 30 → 33 tests, including config-awareness and regression guards.
137
+
138
+ ## [0.7.3] - 2026-03-13
139
+
140
+ ### Added
141
+ - **Spec-Kit Extension** — DocGuard is now available as a GitHub Spec Kit community extension. 6 commands registered (`guard`, `diagnose`, `score`, `trace`, `generate`, `init`) with `after_tasks` hook for automatic validation. Located in `extensions/spec-kit-docguard/`.
142
+
143
+ ## [0.7.2] - 2026-03-13
144
+
145
+ ### Added
146
+ - **Config-aware traceability** — `guard`, `diagnose`, and `trace` now respect `.docguard.json` `requiredFiles.canonical`. Excluded docs are skipped entirely.
147
+ - **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".
148
+
149
+ ### Fixed
150
+ - Trace no longer hardcodes all 6 docs — only evaluates what the user's config requires.
151
+
152
+ ## [0.7.1] - 2026-03-13
153
+
154
+ ### Added
155
+ - **Traceability Validator** — New `validateTraceability` runs automatically in `guard` and `diagnose`. Checks that each canonical doc (ARCHITECTURE, DATA-MODEL, TEST-SPEC, SECURITY, ENVIRONMENT) has matching source code artifacts. Reports PARTIAL/UNLINKED/MISSING coverage.
156
+ - **DocGuard in Generated Tech Stacks** — `docguard generate` now always includes DocGuard in the Documentation Tools table of generated ARCHITECTURE.md.
157
+
158
+ ### Fixed
159
+ - **Guard warnings resolved** — TEST-SPEC.md `watch.mjs` partial coverage justified with ISO 29119 §7.2; DRIFT-LOG.md populated with template-string entries.
160
+ - **Test file regex** — `.test.mjs` and `.spec.mjs` files now match in traceability and trace commands.
161
+ - **51 guard checks** (was 46) — all passing on DocGuard itself.
162
+
163
+ ## [0.7.0] - 2026-03-13
164
+
165
+ ### Added
166
+ - **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).
167
+ - **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).
168
+ - **`docguard trace` Command** — New requirements traceability matrix generator. Maps canonical docs ↔ source code ↔ tests with TRACED/PARTIAL/UNLINKED/MISSING coverage signals. Supports `--format json`.
169
+ - **`docguard score --signals` Flag** — Multi-signal quality breakdown showing per-signal contribution bars with quality labels. Inspired by CJE composite scoring.
170
+ - **`docguard diagnose --debate` Flag** — Multi-perspective AI prompts using three-agent Advocate/Challenger/Synthesizer pattern. Inspired by AITPG multi-agent role specialization and TRACE adversarial debate.
171
+ - **Agent-Aware Prompt Complexity** — `diagnose` auto-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).
172
+ - **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.
173
+
174
+ ### Changed
175
+ - **15 commands total**: added `trace` (alias: `traceability`)
176
+ - **Version bump**: 0.6.0 → 0.7.0
177
+
178
+ ## [0.6.0] - 2026-03-13
179
+
180
+ ### Added
181
+ - **Doc Tool Detection** — `generate` now 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.
182
+ - **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.
183
+ - **Deep Schema Scanning** — Parses schema definitions from 4 ORMs: Prisma (fields, types, relations, enums), Drizzle, Zod, Mongoose. Generates mermaid ER diagrams automatically.
184
+ - **`API-REFERENCE.md` Generator** — New canonical doc generated from deep route scanning. Groups endpoints by resource, shows auth status, handler names, and per-endpoint parameter/response tables.
185
+ - **`docguard publish --platform mintlify`** — Scaffolds Mintlify v2 docs from canonical documentation. Generates `docs.json`, `introduction.mdx`, `quickstart.mdx`, and maps all canonical docs to `.mdx` pages with proper frontmatter.
186
+ - **AGENTS.md Standard Compliance** — Enhanced AGENTS.md template with Permissions & Guardrails section, Monorepo Support, Safety Rules, and `agents.md` standard tags.
187
+ - **Scanner Modules** — New `cli/scanners/` directory with `doc-tools.mjs`, `routes.mjs`, `schemas.mjs`.
188
+
189
+ ### Changed
190
+ - **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.
191
+ - **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.
192
+ - **Dynamic Version** — Banner and `--version` now read from `package.json` (no more stale hardcoded version strings).
193
+ - **Version bump**: 0.5.2 → 0.6.0
194
+ - **14 commands total**: added `publish` (alias: `pub`)
195
+
196
+ ## [0.5.0] - 2026-03-13
197
+
198
+ ### Added
199
+ - **`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`.
200
+ - **`guard --format json`** — Structured JSON output for CI/CD and AI agents. Includes profile, validator results, and timestamps.
201
+ - **Compliance Profiles** — Three presets (`starter`, `standard`, `enterprise`) that adjust required docs and validators. Set via `--profile` flag on init or `"profile"` in `.docguard.json`.
202
+ - **`score --tax`** — Documentation tax estimate: tracks doc count, code churn, and outputs estimated weekly maintenance time with LOW/MEDIUM/HIGH rating.
203
+ - **`init --profile starter`** — Minimal CDD setup (just ARCHITECTURE.md + CHANGELOG) for side projects.
204
+ - **GitHub Actions CI template** — Ships in `templates/ci/github-actions.yml`, ready-to-use workflow.
205
+ - **`watch --auto-fix`** — When guard finds issues, auto-outputs AI fix prompts.
206
+ - **Init auto-populate** — After creating skeletons, outputs `docguard diagnose` prompt instead of manual instructions.
207
+ - **Guard → Diagnose hint** — Guard output now prompts `Run docguard diagnose` when issues exist.
208
+
209
+ ### Changed
210
+ - **Guard refactored**: `runGuardInternal()` extracted for reuse by diagnose, CI, and watch (no subprocess needed).
211
+ - **CI rewritten**: Uses `runGuardInternal` directly instead of spawning subprocess. Includes profile and validator data in JSON.
212
+ - **Watch rewritten**: Uses `runGuardInternal` (no process.exit killing the watcher). Proper debounced re-runs.
213
+ - **Version bump**: 0.4.0 → 0.5.0
214
+ - **13 commands total**: audit, init, guard, score, diagnose, diff, agents, generate, hooks, badge, ci, fix, watch
215
+ - **30 tests** across 17 suites (up from 24/14)
216
+
217
+ ## [0.4.0] - 2026-03-12
218
+
219
+ ### Added
220
+ - **`docguard badge`** — Generate shields.io CDD score badges for README (score, type, guarded-by)
221
+ - **`docguard ci`** — Single command for CI/CD pipelines (guard + score, JSON output, exit codes)
222
+ - `.npmignore` for clean npm publish
223
+ - `--threshold <n>` flag for minimum CI score enforcement
224
+ - `--fail-on-warning` flag for strict CI mode
225
+ - npm publish dry-run in CI workflow on tag push
226
+
227
+ ### Changed
228
+ - Score command refactored with `runScoreInternal` for reuse by badge/ci
229
+ - CI workflow now runs actual test suite + dogfoods DocGuard on itself
230
+ - 10 total commands (audit, init, guard, score, diff, agents, generate, hooks, badge, ci)
231
+
232
+ ## [0.3.0] - 2026-03-12
233
+
234
+ ### Added
235
+ - **`docguard hooks`** — Install pre-commit (guard), pre-push (score enforcement), and commit-msg (conventional commits) git hooks
236
+ - **GitHub Action** (`action.yml`) — Reusable marketplace action with score thresholds, PR comments, and fail-on-warning support
237
+ - **Import analysis** in architecture validator — Builds full import graph, detects circular dependencies (DFS), auto-parses layer boundaries from ARCHITECTURE.md
238
+ - **Project type intelligence** — Auto-detect cli/library/webapp/api from package.json
239
+ - `.docguard.json` with `projectTypeConfig` (needsE2E, needsEnvVars, etc.)
240
+ - 15 real tests covering all commands (node:test)
241
+
242
+ ### Changed
243
+ - Architecture validator now auto-detects layer violations from ARCHITECTURE.md (no config needed)
244
+ - Validators respect projectTypeConfig — no false positives for CLI tools
245
+
246
+ ### Fixed
247
+ - Environment validator no longer warns about .env.example for CLI tools
248
+ - Test-spec validator no longer warns about E2E journeys for CLI tools
249
+
250
+ ## [0.2.0] - 2026-03-12
251
+
252
+ ### Added
253
+ - **`docguard score`** — Weighted CDD maturity score (0-100) with bar charts, grades A+ through F
254
+ - **`docguard diff`** — Compares canonical docs against actual code (routes, entities, env vars)
255
+ - **`docguard agents`** — Auto-generates agent-specific config files for Cursor, Copilot, Cline, Windsurf, Claude Code, Gemini
256
+ - **`docguard generate`** — Reverse-engineer canonical docs from existing codebase (15+ frameworks, 8+ databases, 6 ORMs)
257
+ - **Freshness validator** — Uses git commit history to detect stale documentation
258
+ - **Full document type registry** — All 16 CDD document types with required/optional flags and descriptions
259
+ - 8 new templates: KNOWN-GOTCHAS, TROUBLESHOOTING, RUNBOOKS, VENDOR-BUGS, CURRENT-STATE, ADR, DEPLOYMENT, ROADMAP
260
+
261
+ ### Fixed
262
+ - Diff command false positives — entity extraction no longer picks up table headers
263
+
264
+ ## [0.1.0] - 2026-03-12
265
+
266
+ ### Added
267
+ - Initial release of DocGuard CLI
268
+ - `docguard audit` — Scan project, report documentation status
269
+ - `docguard init` — Initialize CDD docs from professional templates
270
+ - `docguard guard` — Validate project against canonical documentation
271
+ - 9 validators: structure, doc-sections, docs-sync, drift, changelog, test-spec, environment, security, architecture
272
+ - 8 core templates with docguard metadata headers
273
+ - Stack-specific configs: Next.js, Fastify, Python, generic
274
+ - Zero dependencies — pure Node.js
275
+ - GitHub CI workflow (Node 18/20/22 matrix)
276
+ - MIT license