docguard-cli 0.36.0 → 0.36.1

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.
@@ -1,13 +1,13 @@
1
1
  # DocGuard — CDD Enforcement Extension for Spec Kit
2
2
 
3
- Enterprise-grade Canonical-Driven Development (CDD) enforcement and **AI-readable project memory** for [Spec Kit](https://github.com/github/spec-kit). DocGuard builds a complete, language-aware documentation memory of any codebase (`generate --plan`), keeps it always up to date as code changes (`sync`), and verifies it (`guard`) — with deterministic mechanical fixes (`fix --write`) where it can and grounded agent prompts where prose is needed.
3
+ Enterprise-grade Canonical-Driven Development (CDD) enforcement and **AI-readable project memory** for [Spec Kit](https://github.com/github/spec-kit). DocGuard builds source-derived documentation context for supported code (`generate --plan`), refreshes generated sections as code changes (`sync`), and checks configured rules (`guard`) — with deterministic mechanical fixes (`fix --write`) where it can and grounded agent prompts where prose is needed.
4
4
 
5
5
  ## Features
6
6
 
7
- - **24 Validators** — Structure, Security, Doc Quality, Test-Spec, Drift-Comments, API-Surface, Freshness, Cross-Reference, and 13 more
8
- - **Language-agnostic** — JS/TS, Python, Rust, Go, Java/Kotlin, Ruby, PHP, C#. Polyglot/monorepo-aware.
7
+ - **Configurable validators** — Structure, Security, Doc Quality, Test-Spec, Drift-Comments, API-Surface, Freshness, Cross-Reference, and more; use `docguard --help` for the current surface
8
+ - **Language-specific extraction** — Supported checks cover several languages and monorepos. Coverage varies by detector; unsupported inputs remain unverified.
9
9
  - **AI-powered Generate** — `generate --plan` builds the code-truth skeleton in `<!-- docguard:section -->` markers and emits a structured agent task manifest; the AI writes the prose.
10
- - **Always up to date** — `sync` surgically refreshes code-truth doc sections in place, **preserves human prose**, flags prose for agent review.
10
+ - **Refresh and review** — `sync` surgically refreshes code-truth doc sections in place, **preserves human prose**, flags prose for agent review.
11
11
  - **Mechanical `fix --write`** — deterministic, no-LLM: remove stale documented endpoints, refresh stale "N validators" counts, replace stale version refs, insert missing `## [Unreleased]`.
12
12
  - **5 AI Skills** — docguard-fix, docguard-guard, docguard-sync, docguard-review, docguard-score (enterprise-grade behavior protocols, not just step-lists)
13
13
  - **Workflow Chaining** — YAML handoffs enable guard → sync → fix → review → score flows
@@ -20,7 +20,7 @@ Enterprise-grade Canonical-Driven Development (CDD) enforcement and **AI-readabl
20
20
  npm install -g docguard-cli
21
21
  ```
22
22
 
23
- Or use via npx:
23
+ Spec Kit orchestration scripts require a local `node_modules/docguard-cli` installation or `docguard` on PATH; they do not implicitly download a CLI. Direct CLI use via npx remains available:
24
24
  ```bash
25
25
  npx docguard-cli guard
26
26
  ```
@@ -45,7 +45,7 @@ docguard score
45
45
 
46
46
  | Command | Alias | Purpose |
47
47
  |---------|-------|---------|
48
- | `speckit.docguard.guard` | `docguard.guard` | Run 19-validator quality gate with severity triage |
48
+ | `speckit.docguard.guard` | `docguard.guard` | Run configurable quality gate with severity triage |
49
49
  | `speckit.docguard.fix` | `docguard.fix` | AI-driven documentation repair with codebase research |
50
50
  | `speckit.docguard.review` | `docguard.review` | Cross-document semantic consistency analysis (read-only) |
51
51
  | `speckit.docguard.score` | `docguard.score` | CDD maturity score with ROI improvement roadmap |
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Keep canonical docs always up to date — refresh code-truth sections in place, preserve human prose
2
+ description: Refresh canonical code-truth sections and flag prose for review — refresh code-truth sections in place, preserve human prose
3
3
  allowed-tools: Bash, Read, Edit
4
4
  ---
5
5
 
@@ -3,7 +3,7 @@ schema_version: "1.0"
3
3
  extension:
4
4
  id: "docguard"
5
5
  name: "DocGuard — CDD Enforcement"
6
- version: "0.36.0"
6
+ version: "0.36.1"
7
7
  description: "Canonical-Driven Development enforcement as a true spec-kit extension. LLM-first design with automated validators, 4 AI behavior skills, spec-kit skill chaining, and workflow hooks. One pinned runtime dependency (@babel/parser); pure Node.js otherwise."
8
8
  author: "Ricardo Accioly"
9
9
  repository: "https://github.com/raccioly/docguard"
@@ -27,7 +27,7 @@ provides:
27
27
  commands:
28
28
  - name: "speckit.docguard.guard"
29
29
  file: "commands/guard.md"
30
- description: "Run 19-validator quality gate with severity triage and remediation plan"
30
+ description: "Run configurable quality gate with severity triage and remediation plan"
31
31
 
32
32
  - name: "speckit.docguard.fix"
33
33
  file: "commands/generate.md"
@@ -23,25 +23,17 @@ find_docguard_root() {
23
23
 
24
24
  find_docguard_cli() {
25
25
  local root="${1:-$(pwd)}"
26
-
27
- # Check for local dev mode first
28
- if [ -f "$root/cli/docguard.mjs" ]; then
29
- echo "node $root/cli/docguard.mjs"
30
- return 0
31
- fi
32
-
33
- # Check for global install
34
- if command -v docguard-cli >/dev/null 2>&1; then
35
- echo "docguard-cli"
36
- return 0
37
- fi
38
-
39
- # Fall back to npx
40
- if command -v npx >/dev/null 2>&1; then
41
- echo "npx docguard-cli"
26
+ local entry
27
+ for entry in "$root/cli/docguard.mjs" "$root/node_modules/docguard-cli/cli/docguard.mjs"; do
28
+ if [ -f "$entry" ] && command -v node >/dev/null 2>&1; then
29
+ printf '%q %q\n' "$(command -v node)" "$entry"
30
+ return 0
31
+ fi
32
+ done
33
+ if command -v docguard >/dev/null 2>&1; then
34
+ printf '%q\n' "$(command -v docguard)"
42
35
  return 0
43
36
  fi
44
-
45
37
  return 1
46
38
  }
47
39
 
@@ -104,17 +104,24 @@ if $JSON_MODE; then
104
104
  # Optionally include score and guard
105
105
  EXTRAS=""
106
106
  if $VERBOSE; then
107
- SCORE_OUTPUT=$(eval $CLI_CMD score --format json 2>/dev/null || echo "")
108
- GUARD_OUTPUT=$(eval $CLI_CMD guard 2>&1 || true)
109
-
110
- # Extract score
111
- SCORE=$(echo "$SCORE_OUTPUT" | grep -o '"total":[0-9]*' | head -1 | sed 's/"total"://' || echo "0")
112
-
113
- # Extract guard pass/total from output like "156/160 passed"
114
- GUARD_PASS=$(echo "$GUARD_OUTPUT" | grep -o '[0-9]*/[0-9]* passed' | sed 's|/.*||' || echo "0")
115
- GUARD_TOTAL=$(echo "$GUARD_OUTPUT" | grep -o '[0-9]*/[0-9]* passed' | sed 's|.*/||; s| .*||' || echo "0")
116
-
117
- EXTRAS=",\"score\":$SCORE,\"guardPass\":$GUARD_PASS,\"guardTotal\":$GUARD_TOTAL"
107
+ SCORE_OUTPUT=$(eval "$CLI_CMD score --format json")
108
+ SCORE=$(printf '%s' "$SCORE_OUTPUT" | node -e '
109
+ const d=JSON.parse(require("fs").readFileSync(0,"utf8"));
110
+ if(!Number.isFinite(d.score) || d.score<0 || d.score>100) throw Error("Invalid DocGuard score");
111
+ process.stdout.write(String(d.score));
112
+ ')
113
+ GUARD_STATUS=0
114
+ GUARD_OUTPUT=$(eval "$CLI_CMD guard --format json") || GUARD_STATUS=$?
115
+ EXTRAS=$(printf '%s' "$GUARD_OUTPUT" | node -e '
116
+ const d=JSON.parse(require("fs").readFileSync(0,"utf8"));
117
+ const exit=Number(process.argv[2]);
118
+ const expected={PASS:0,WARN:2,FAIL:1};
119
+ if(!Object.hasOwn(expected,d.status) || expected[d.status]!==exit ||
120
+ !Number.isInteger(d.passed) || !Number.isInteger(d.total) ||
121
+ d.passed<0 || d.total<d.passed) throw Error("Invalid DocGuard guard report");
122
+ const fields={score:Number(process.argv[1]),guardPass:d.passed,guardTotal:d.total,guardStatus:d.status};
123
+ process.stdout.write(","+JSON.stringify(fields).slice(1,-1));
124
+ ' "$SCORE" "$GUARD_STATUS")
118
125
  fi
119
126
 
120
127
  # Check for spec-kit
@@ -6,10 +6,10 @@ description: AI-driven documentation repair with structured research workflow, t
6
6
  compatibility: Requires DocGuard CLI installed (npm i -g docguard-cli or npx docguard-cli)
7
7
  metadata:
8
8
  author: docguard
9
- version: 0.36.0
9
+ version: 0.36.1
10
10
  source: extensions/spec-kit-docguard/skills/docguard-fix
11
11
  ---
12
- <!-- docguard:version: 0.36.0 -->
12
+ <!-- docguard:version: 0.36.1 -->
13
13
 
14
14
  # DocGuard Fix Skill
15
15
 
@@ -25,7 +25,7 @@ If no arguments, fix ALL issues found by `docguard diagnose`.
25
25
 
26
26
  ## Goal
27
27
 
28
- Research the actual codebase to generate or repair canonical documentation that passes DocGuard's 19-validator guard suite. This skill replaces generic templates with real, project-specific content and iterates until quality checks pass.
28
+ Research the actual codebase to generate or repair canonical documentation that passes DocGuard's configurable guard suite. This skill replaces generic templates with real, project-specific content and iterates until quality checks pass.
29
29
 
30
30
  ## Operating Constraints
31
31
 
@@ -7,10 +7,10 @@ description: Run DocGuard guard validation against Canonical-Driven Development
7
7
  compatibility: Requires DocGuard CLI installed (npm i -g docguard-cli or npx docguard-cli)
8
8
  metadata:
9
9
  author: docguard
10
- version: 0.36.0
10
+ version: 0.36.1
11
11
  source: extensions/spec-kit-docguard/skills/docguard-guard
12
12
  ---
13
- <!-- docguard:version: 0.36.0 -->
13
+ <!-- docguard:version: 0.36.1 -->
14
14
 
15
15
  # DocGuard Guard Skill
16
16
 
@@ -6,10 +6,10 @@ description: Cross-document consistency analysis and quality assessment. Perform
6
6
  compatibility: Requires DocGuard CLI installed (npm i -g docguard-cli or npx docguard-cli)
7
7
  metadata:
8
8
  author: docguard
9
- version: 0.36.0
9
+ version: 0.36.1
10
10
  source: extensions/spec-kit-docguard/skills/docguard-review
11
11
  ---
12
- <!-- docguard:version: 0.36.0 -->
12
+ <!-- docguard:version: 0.36.1 -->
13
13
 
14
14
  # DocGuard Review Skill
15
15
 
@@ -6,10 +6,10 @@ description: CDD maturity assessment with category-aware improvement roadmap. Ru
6
6
  compatibility: Requires DocGuard CLI installed (npm i -g docguard-cli or npx docguard-cli)
7
7
  metadata:
8
8
  author: docguard
9
- version: 0.36.0
9
+ version: 0.36.1
10
10
  source: extensions/spec-kit-docguard/skills/docguard-score
11
11
  ---
12
- <!-- docguard:version: 0.36.0 -->
12
+ <!-- docguard:version: 0.36.1 -->
13
13
 
14
14
  # DocGuard Score Skill
15
15
 
@@ -4,10 +4,10 @@ description: Keep canonical documentation ALWAYS UP TO DATE. Refreshes code-trut
4
4
  compatibility: Requires DocGuard CLI installed (npm i -g docguard-cli or npx docguard-cli)
5
5
  metadata:
6
6
  author: docguard
7
- version: 0.36.0
7
+ version: 0.36.1
8
8
  source: extensions/spec-kit-docguard/skills/docguard-sync
9
9
  ---
10
- <!-- docguard:version: 0.36.0 -->
10
+ <!-- docguard:version: 0.36.1 -->
11
11
 
12
12
  # DocGuard Sync Skill
13
13
 
@@ -35,7 +35,7 @@ jobs:
35
35
  node-version: '20'
36
36
 
37
37
  - name: Install DocGuard
38
- run: npm install --global --ignore-scripts docguard-cli@0.36.0
38
+ run: npm install --global --ignore-scripts docguard-cli@0.36.1
39
39
 
40
40
  - name: Run DocGuard
41
41
  shell: bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docguard-cli",
3
- "version": "0.36.0",
3
+ "version": "0.36.1",
4
4
  "description": "The enforcement tool for Canonical-Driven Development (CDD). Audit, generate, and guard your project documentation.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -31,7 +31,7 @@ jobs:
31
31
  node-version: '20'
32
32
 
33
33
  - name: Install DocGuard
34
- run: npm install --global --ignore-scripts docguard-cli@0.36.0
34
+ run: npm install --global --ignore-scripts docguard-cli@0.36.1
35
35
 
36
36
  - name: Run DocGuard
37
37
  shell: bash