@pieai/doc-gov 0.3.0

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 PieAI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # @pieai/doc-gov
2
+
3
+ CLI for Project Governance System: a thin documentation-governance layer for
4
+ AI-assisted projects.
5
+
6
+ It checks whether governed Markdown documents have the right frontmatter,
7
+ lifecycle status, links, manifest freshness, agents-routing, and project wiring.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ pnpm add -D @pieai/doc-gov
13
+ ```
14
+
15
+ Then add a script in your project:
16
+
17
+ ```json
18
+ {
19
+ "scripts": {
20
+ "doc-gov": "doc-gov"
21
+ }
22
+ }
23
+ ```
24
+
25
+ ## Common Commands
26
+
27
+ ```bash
28
+ pnpm doc-gov init
29
+ pnpm doc-gov new spec first-spec
30
+ pnpm doc-gov check
31
+ pnpm doc-gov scan --check
32
+ pnpm doc-gov links
33
+ pnpm doc-gov audit
34
+ pnpm doc-gov router-check
35
+ pnpm doc-gov doctor
36
+ pnpm doc-gov migrate --profile doc-only --check
37
+ pnpm doc-gov migrate --profile engineering-runtime --check
38
+ ```
39
+
40
+ ## What It Governs
41
+
42
+ By default, Project Governance System governs:
43
+
44
+ - `docs/**`
45
+ - AI entry files such as `AGENTS.md`, `CLAUDE.md`, and `GEMINI.md`
46
+ - documentation-governance templates, manifest, and agents-routing files
47
+
48
+ It does not try to swallow product artifacts, prompts, generated media,
49
+ runtime notes, or source assets outside `docs/**` unless a project explicitly
50
+ opts them into doc-gov.
51
+
52
+ ## Status
53
+
54
+ The CLI is in public preview. The read-only checks are the stable path:
55
+
56
+ - `check`
57
+ - `scan --check`
58
+ - `links`
59
+ - `audit`
60
+ - `router-check`
61
+ - `doctor`
62
+ - `migrate --profile <profile> --check`
63
+
64
+ Future `migrate --apply` and full init profiles should be added only after more
65
+ real projects prove the same migration shape.
package/cli-guide.md ADDED
@@ -0,0 +1,89 @@
1
+ # @pieai/doc-gov
2
+
3
+ Documentation governance CLI for PieAI projects.
4
+
5
+ This package is the upstream CLI source for Project Governance System. It can
6
+ replace project-local `tools/doc-gov` copies when a project is ready to update
7
+ its scripts and CI together.
8
+
9
+ ## Lifecycle
10
+
11
+ Normal documents:
12
+
13
+ ```text
14
+ draft -> active -> completed -> stable -> superseded -> archived
15
+ ```
16
+
17
+ Decision documents:
18
+
19
+ ```text
20
+ proposed -> accepted -> rejected | superseded
21
+ ```
22
+
23
+ `completed` means an execution artifact is done but still valuable as proof history. It is especially useful for:
24
+
25
+ - `docs/plans/completed/**`
26
+ - `docs/specs/completed/**`
27
+
28
+ Unlike `archived`, a `completed` document may remain `canonical: true`.
29
+
30
+ ## Commands
31
+
32
+ ```bash
33
+ pnpm doc-gov find <topic>
34
+ pnpm doc-gov new <type> <slug>
35
+ pnpm doc-gov check
36
+ pnpm doc-gov scan
37
+ pnpm doc-gov scan --check
38
+ pnpm doc-gov audit
39
+ pnpm doc-gov links
40
+ pnpm doc-gov router-check
41
+ pnpm doc-gov doctor
42
+ pnpm doc-gov migrate --profile doc-only --check
43
+ ```
44
+
45
+ `init` creates the directory skeleton and writes default templates under
46
+ `docs/governance/templates/`, so `doc-gov init` followed by
47
+ `doc-gov new spec test-spec` is a supported first-user path.
48
+
49
+ `router-check` is intentionally thin:
50
+
51
+ - In this upstream repo, it verifies that `AGENTS.md`,
52
+ `docs/governance/agents-routing/`, `profiles/`, and
53
+ `integrations/superpowers.md` stay connected in the expected order.
54
+ - In a downstream project, it verifies the project router block,
55
+ `docs/governance/ssot-v0.9.md`, the selected agents-routing file, and old
56
+ shared SSOT/task-routing leftovers.
57
+ - It also checks that local paths written in backticks inside router-facing
58
+ files such as `AGENTS.md`, `CLAUDE.md`, `README.md`, and the starter
59
+ `AGENTS.template.md` can actually be opened, which catches stale startup
60
+ instructions early.
61
+
62
+ It does not choose a workflow for a specific task.
63
+
64
+ `doctor` is the one-command health check:
65
+
66
+ - It runs router integrity, governed-doc schema, manifest freshness, and local
67
+ Markdown link checks.
68
+ - It checks whether `lefthook.yml` is both present and installed into
69
+ `.git/hooks/`.
70
+ - It checks whether `.github/workflows/docs-check.yml` runs the standard
71
+ doc-gov gate, including `router-check` and `links`.
72
+
73
+ `migrate --profile <engineering-runtime|doc-only> --check` is intentionally
74
+ read-only. It checks whether the target project is structurally ready for the
75
+ selected profile. It does not move files or rewrite local project truth yet.
76
+
77
+ ## Build
78
+
79
+ ```bash
80
+ pnpm --filter @pieai/doc-gov build
81
+ pnpm --filter @pieai/doc-gov test
82
+ pnpm --filter @pieai/doc-gov typecheck
83
+ ```
84
+
85
+ ## Current Status
86
+
87
+ This package is the preferred CLI source for new adoption work. Existing
88
+ projects may keep local `tools/doc-gov` copies until their scripts, local hooks,
89
+ and CI are moved together.