@ghostbyte/agent-docs-kit 5.0.1 → 5.1.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/CHANGELOG.md +19 -0
- package/README.md +26 -0
- package/docs/ARCHITECTURE.md +3 -1
- package/docs/PURPOSE.md +8 -0
- package/package.json +2 -2
- package/scripts/build-site.mjs +3 -1
- package/scripts/public-docs.mjs +8 -0
- package/scripts/smoke-package.mjs +10 -10
- package/site/app.js +1 -1
- package/site/index.html +78 -14
- package/site/styles.css +41 -1
- package/skills/manage-project-quality/SKILL.md +12 -1
- package/skills/manage-project-quality/agents/openai.yaml +2 -2
- package/src/api/index.mjs +1 -0
- package/src/cli/help.mjs +9 -1
- package/src/cli/main.mjs +23 -8
- package/src/commands/audit.mjs +13 -0
- package/src/commands/setup.mjs +26 -0
- package/src/commands/skill.mjs +11 -0
- package/src/commands/workflow.mjs +228 -0
- package/tests/cli.test.mjs +89 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,25 @@ Notable user-visible changes are recorded here. Versions follow semantic version
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 5.1.0 - 2026-10-14
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Guided `start new|existing|agent|manual` onboarding paths for first-time users.
|
|
12
|
+
- A read-only `next` command that derives the current workflow stage from repository state.
|
|
13
|
+
- Terminal continuation instructions after setup, skill installation, documentation audits, and worksheet creation.
|
|
14
|
+
- A website guide explaining how the CLI, repository skill, coding agent, and durable project records work together.
|
|
15
|
+
- A targeted-loading explanation showing how focused references can reduce unnecessary AI context and token usage.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- The interactive menu is organized around starting, continuing, focused workflows, and maintenance instead of a flat command list.
|
|
20
|
+
- The unified skill now detects first-use and post-setup requests and ends with one evidence-bounded next action.
|
|
21
|
+
- Local website preview now builds the current source before starting the server.
|
|
22
|
+
- Website builds use the same explicit public-document allowlist as the npm package.
|
|
23
|
+
|
|
24
|
+
## 5.0.1 - 2026-10-14
|
|
25
|
+
|
|
7
26
|
### Fixed
|
|
8
27
|
|
|
9
28
|
- Local documentation workspaces and generated audit records are excluded from the npm archive by an explicit public-document allowlist.
|
package/README.md
CHANGED
|
@@ -35,6 +35,32 @@ The no-argument command opens a guided menu in an interactive terminal. Installa
|
|
|
35
35
|
|
|
36
36
|
The canonical library contains seven documentation areas, 12 security phases, and 14 engineering topics under `content/`. The generated skill loads only the selected reference instead of placing all 33 areas in context.
|
|
37
37
|
|
|
38
|
+
## Choose a starting path
|
|
39
|
+
|
|
40
|
+
The kit now separates first-time onboarding from the individual tools:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Show all paths without changing files
|
|
44
|
+
npx @ghostbyte/agent-docs-kit@latest start
|
|
45
|
+
|
|
46
|
+
# Show one complete path
|
|
47
|
+
npx @ghostbyte/agent-docs-kit@latest start new
|
|
48
|
+
npx @ghostbyte/agent-docs-kit@latest start existing
|
|
49
|
+
npx @ghostbyte/agent-docs-kit@latest start agent
|
|
50
|
+
npx @ghostbyte/agent-docs-kit@latest start manual
|
|
51
|
+
|
|
52
|
+
# Inspect an initialized project and receive its next action
|
|
53
|
+
npx @ghostbyte/agent-docs-kit@latest next
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`next` derives progress from the repository: configuration, required documents, scaffold prompts, saved documentation audits, and open security or engineering worksheets. It does not depend on terminal-session memory and does not write files.
|
|
57
|
+
|
|
58
|
+
For AI-assisted work, install the repository-scoped skill, restart the AI session if needed, then prompt:
|
|
59
|
+
|
|
60
|
+
> Use `$manage-project-quality`. Inspect this repository, determine the current Agent Docs stage, and guide me through the next safe step. Do not infer facts without evidence.
|
|
61
|
+
|
|
62
|
+
If a user gives only the npm package or skill to an AI, the agent should inspect before acting, explain proposed writes, distinguish planned behavior from implemented behavior, and request authorization before active security testing. Package installation alone does not initialize files, run reviews, or grant authority.
|
|
63
|
+
|
|
38
64
|
## Install the command
|
|
39
65
|
|
|
40
66
|
Project-local installation:
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -16,7 +16,7 @@ Agent_Docs_Kit/
|
|
|
16
16
|
├─ src/
|
|
17
17
|
│ ├─ api/index.mjs # programmatic exports
|
|
18
18
|
│ ├─ cli/ # parsing, help, and routing
|
|
19
|
-
│ ├─ commands/ #
|
|
19
|
+
│ ├─ commands/ # onboarding, state detection, setup, audits, templates, skill
|
|
20
20
|
│ └─ core/ # catalog, config, filesystem, and package paths
|
|
21
21
|
├─ content/
|
|
22
22
|
│ ├─ catalog.json # versioned selectors and review dates
|
|
@@ -43,6 +43,8 @@ Agent_Docs_Kit/
|
|
|
43
43
|
|
|
44
44
|
`content/` is the single canonical library for all three workflows. `agent-docs setup` creates `.agent-docs/config.json` and a project documentation tree. Reports are written beneath configured directories; the reference library stays in the npm package and installed skill rather than being duplicated into each project.
|
|
45
45
|
|
|
46
|
+
`agent-docs start` is a read-only onboarding router for new, existing, AI-assisted, and manual use. `agent-docs next` is a read-only state detector: it derives the current stage from configuration, required documents, starter prompts, saved audits, and open worksheets. It intentionally does not maintain a hidden progress file, so terminal sessions, humans, and coding agents see the same repository-backed state.
|
|
47
|
+
|
|
46
48
|
Generated outputs under `build/`, package archives, dependencies, and the maintainer’s local monthly AI prompt are ignored by Git. Local consumer-style documentation under the configured `docs/` workspace is also ignored in this repository.
|
|
47
49
|
|
|
48
50
|
Git ignore rules are not treated as a publishing boundary. `package.json` explicitly lists the six public maintainer guides, `docs/.npmignore` excludes local workspace records, and the packed-installation smoke test rejects every unexpected `docs/` path and every missing declared entry point.
|
package/docs/PURPOSE.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Agent Docs & Quality Kit is a library and command-line interface for establishing repeatable project-quality practices. It unifies three related activities without pretending they have the same consequences.
|
|
4
4
|
|
|
5
|
+
## Agentic coding
|
|
6
|
+
|
|
7
|
+
The kit provides durable project context and review instructions for humans and compatible coding agents. It does not include an AI model, start a background process, or perform a review merely because the npm package was installed.
|
|
8
|
+
|
|
9
|
+
The CLI creates and checks the project workspace. The optional repository skill under `.agents/skills/manage-project-quality/` teaches a supported agent how to select focused references, inspect evidence, preserve safety boundaries, and write maintainable results. The user still starts the agent session, supplies the goal, and authorizes any active testing.
|
|
10
|
+
|
|
11
|
+
Projects that do not use a skill-aware agent can follow the same process manually through `start`, `next`, focused guides, and generated worksheets.
|
|
12
|
+
|
|
5
13
|
## Documentation
|
|
6
14
|
|
|
7
15
|
The documentation workflow preserves project memory. It creates a predictable place for system facts, current scope, decisions, development records, test evidence, operations, future proposals, and superseded material. Its audit detects gaps and drift.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ghostbyte/agent-docs-kit",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Documentation governance, evidence-based security audits, and engineering-quality reviews for software projects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "node scripts/build-site.mjs && node scripts/build-skill.mjs",
|
|
34
|
-
"site:preview": "node scripts/preview-site.mjs",
|
|
34
|
+
"site:preview": "npm run build && node scripts/preview-site.mjs",
|
|
35
35
|
"doctor": "node bin/agent-docs.mjs doctor",
|
|
36
36
|
"test": "node --test",
|
|
37
37
|
"validate": "node scripts/validate-content.mjs && node scripts/check-links.mjs && node bin/agent-docs.mjs validate",
|
package/scripts/build-site.mjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { cp, mkdir, rm, writeFile } from "node:fs/promises";
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
|
+
import { publicDocs } from "./public-docs.mjs";
|
|
3
4
|
|
|
4
5
|
const root = resolve(import.meta.dirname, "..");
|
|
5
6
|
const output = resolve(root, "build/site");
|
|
6
7
|
await rm(output, { recursive: true, force: true });
|
|
7
8
|
await mkdir(output, { recursive: true });
|
|
8
9
|
await cp(resolve(root, "site"), output, { recursive: true });
|
|
9
|
-
await
|
|
10
|
+
await mkdir(resolve(output, "docs"));
|
|
11
|
+
for (const name of publicDocs) await cp(resolve(root, "docs", name), resolve(output, "docs", name));
|
|
10
12
|
await cp(resolve(root, "README.md"), resolve(output, "README.md"));
|
|
11
13
|
await cp(resolve(root, "LICENSE"), resolve(output, "LICENSE"));
|
|
12
14
|
await writeFile(resolve(output, ".nojekyll"), "", "utf8");
|
|
@@ -2,6 +2,7 @@ import { execFileSync, spawnSync } from "node:child_process";
|
|
|
2
2
|
import { access, mkdtemp, mkdir, readFile, rm } from "node:fs/promises";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
|
+
import { publicDocs as publicDocNames } from "./public-docs.mjs";
|
|
5
6
|
|
|
6
7
|
const root = resolve(import.meta.dirname, "..");
|
|
7
8
|
const scratch = await mkdtemp(resolve(tmpdir(), "agent-docs-kit-smoke-"));
|
|
@@ -13,14 +14,7 @@ try {
|
|
|
13
14
|
const cache = resolve(scratch, "npm-cache");
|
|
14
15
|
const packed = JSON.parse(runNpm(["pack", "--json", "--cache", cache, "--pack-destination", scratch], { cwd: root, encoding: "utf8" }));
|
|
15
16
|
const archivePaths = new Set(packed[0].files.map((entry) => entry.path.replaceAll("\\", "/")));
|
|
16
|
-
const publicDocs = new Set(
|
|
17
|
-
"docs/ARCHITECTURE.md",
|
|
18
|
-
"docs/CONTENT_MAINTENANCE.md",
|
|
19
|
-
"docs/GITHUB_AND_NPM_SETUP.md",
|
|
20
|
-
"docs/PURPOSE.md",
|
|
21
|
-
"docs/RELEASE_PROCESS.md",
|
|
22
|
-
"docs/SECURITY_MODEL.md"
|
|
23
|
-
]);
|
|
17
|
+
const publicDocs = new Set(publicDocNames.map((name) => `docs/${name}`));
|
|
24
18
|
for (const required of ["scripts/validate-content.mjs", "site/index.html", "tests/cli.test.mjs", "skills/manage-project-quality/references/security-protocol.md", "skills/manage-project-quality/references/engineering-protocol.md", "skills/manage-project-quality/references/documentation-governance.md"]) {
|
|
25
19
|
if (!archivePaths.has(required)) throw new Error(`Packed archive is missing ${required}.`);
|
|
26
20
|
}
|
|
@@ -52,9 +46,15 @@ try {
|
|
|
52
46
|
const cli = resolve(packageRoot, "bin", "agent-docs.mjs");
|
|
53
47
|
const runCli = (...arguments_) => execFileSync(process.execPath, [cli, ...arguments_], { cwd: consumer, encoding: "utf8" });
|
|
54
48
|
const help = execFileSync(process.execPath, [cli, "--help"], { cwd: consumer, encoding: "utf8" });
|
|
55
|
-
if (!help.includes("documentation guide") || !help.includes("security worksheet") || !help.includes("template create")) throw new Error("Packed CLI help is incomplete.");
|
|
49
|
+
if (!help.includes("start [new|existing|agent|manual]") || !help.includes("Detect project state") || !help.includes("documentation guide") || !help.includes("security worksheet") || !help.includes("template create")) throw new Error("Packed CLI help is incomplete.");
|
|
50
|
+
const agentStart = runCli("start", "agent");
|
|
51
|
+
if (!agentStart.includes("$manage-project-quality") || !agentStart.includes("does not grant authority")) throw new Error("Packed CLI agent onboarding is incomplete.");
|
|
52
|
+
const emptyNext = runCli("next");
|
|
53
|
+
if (!emptyNext.includes("Stage 1: Initialize safely")) throw new Error("Packed CLI did not detect an uninitialized project.");
|
|
56
54
|
runCli("setup", "--dry-run");
|
|
57
55
|
runCli("setup");
|
|
56
|
+
const initializedNext = runCli("next");
|
|
57
|
+
if (!initializedNext.includes("Stage 3: Build the documentation baseline")) throw new Error("Packed CLI did not detect the generated baseline.");
|
|
58
58
|
runCli("audit", "documentation", "--strict", "--report", "--format", "json");
|
|
59
59
|
const securityOutput = runCli("security", "worksheet", "api-layer");
|
|
60
60
|
const engineeringOutput = runCli("engineering", "worksheet", "testing-types");
|
|
@@ -68,7 +68,7 @@ try {
|
|
|
68
68
|
runCli("skill", "install", "--target", "project");
|
|
69
69
|
runCli("validate");
|
|
70
70
|
await access(resolve(consumer, ".agents/skills/manage-project-quality/SKILL.md"));
|
|
71
|
-
execFileSync(process.execPath, ["--input-type=module", "--eval", "const api = await import('@ghostbyte/agent-docs-kit'); if (typeof api.auditDocumentation !== 'function' || typeof api.createTemplate !== 'function') process.exit(1);"], { cwd: consumer });
|
|
71
|
+
execFileSync(process.execPath, ["--input-type=module", "--eval", "const api = await import('@ghostbyte/agent-docs-kit'); if (typeof api.auditDocumentation !== 'function' || typeof api.createTemplate !== 'function' || typeof api.startWorkflow !== 'function' || typeof api.nextWorkflow !== 'function') process.exit(1);"], { cwd: consumer });
|
|
72
72
|
const invalid = spawnSync(process.execPath, [cli, "doctor", "unexpected"], { cwd: consumer, encoding: "utf8" });
|
|
73
73
|
if (invalid.status === 0 || !invalid.stderr.includes("Invalid arguments")) throw new Error("CLI accepted an unexpected positional argument.");
|
|
74
74
|
runNpm(["run", "validate"], { cwd: packageRoot, stdio: "ignore" });
|
package/site/app.js
CHANGED
|
@@ -53,7 +53,7 @@ const commandPrefixes = {
|
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
const commandExamples = {
|
|
56
|
-
setup: ["list documentation", "documentation guide system-documentation", "audit documentation --strict"],
|
|
56
|
+
setup: ["start existing", "", "next", "", "list documentation", "", "documentation guide system-documentation", "", "audit documentation --strict"],
|
|
57
57
|
security: ["list security", "security worksheet api-layer --style learning"],
|
|
58
58
|
engineering: ["list engineering", "engineering worksheet testing-types"],
|
|
59
59
|
skill: ["skill install --target project", "", "# Creates:", "# .agents/skills/manage-project-quality"]
|
package/site/index.html
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
<span>Agent Docs & Quality</span>
|
|
21
21
|
</a>
|
|
22
22
|
<div class="nav-links">
|
|
23
|
+
<a href="#getting-started">Start here</a>
|
|
23
24
|
<a href="#workflows">Workflows</a>
|
|
24
|
-
<a href="#how-it-works">How it works</a>
|
|
25
25
|
<a href="#commands">Commands</a>
|
|
26
26
|
<a class="nav-install" href="#quick-start">Install guide</a>
|
|
27
27
|
</div>
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
<div class="hero-copy">
|
|
32
32
|
<div class="status-pill"><i aria-hidden="true"></i> Quality infrastructure for human + AI teams</div>
|
|
33
33
|
<h1>One project memory.<br><em>Three quality lenses.</em></h1>
|
|
34
|
-
<p class="hero-lead">
|
|
34
|
+
<p class="hero-lead">Want to review and improve your project’s documentation, security posture, and engineering quality? Try Agent Docs & Quality Kit. You can initialize it in a new project or safely add it to an existing project without overwriting existing files.</p>
|
|
35
35
|
<div class="actions">
|
|
36
36
|
<a class="button primary" href="#quick-start">Start locally <span aria-hidden="true">→</span></a>
|
|
37
|
-
<a class="button secondary" href="#
|
|
37
|
+
<a class="button secondary" href="#getting-started">Choose your path</a>
|
|
38
38
|
</div>
|
|
39
39
|
<dl class="hero-facts" aria-label="Toolkit facts">
|
|
40
40
|
<div><dt>3</dt><dd>Focused workflows</dd></div>
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
<p><span class="prompt">$</span> <span data-command>npx @ghostbyte/agent-docs-kit@latest</span></p>
|
|
50
50
|
<p class="console-title">Agent Docs & Quality Kit</p>
|
|
51
51
|
<ol>
|
|
52
|
-
<li><i>01</i>
|
|
53
|
-
<li><i>02</i>
|
|
54
|
-
<li
|
|
55
|
-
<li><i>04</i>
|
|
56
|
-
<li><i>05</i>
|
|
57
|
-
<li><i>06</i>
|
|
58
|
-
<li><i>07</i>
|
|
52
|
+
<li class="active"><i>01</i> Choose a starting path <b>start here</b></li>
|
|
53
|
+
<li><i>02</i> Continue from project state</li>
|
|
54
|
+
<li><i>03</i> Documentation workflow</li>
|
|
55
|
+
<li><i>04</i> Security workflow</li>
|
|
56
|
+
<li><i>05</i> Engineering workflow</li>
|
|
57
|
+
<li><i>06</i> Templates and records</li>
|
|
58
|
+
<li><i>07</i> Validate and maintain</li>
|
|
59
59
|
</ol>
|
|
60
|
-
<p class="console-result"><span>✓</span>
|
|
60
|
+
<p class="console-result"><span>✓</span> New, existing, AI, and manual paths<br><span>→</span> One clear next action at every stage</p>
|
|
61
61
|
</div>
|
|
62
62
|
</div>
|
|
63
63
|
</div>
|
|
@@ -73,6 +73,60 @@
|
|
|
73
73
|
</div>
|
|
74
74
|
</section>
|
|
75
75
|
|
|
76
|
+
<section class="section shell journey-section" id="getting-started">
|
|
77
|
+
<header class="section-heading split-heading">
|
|
78
|
+
<div><p class="eyebrow">Start with your situation</p><h2>Choose a path, then let the kit show what comes next.</h2></div>
|
|
79
|
+
<p>You do not need to memorize the command catalog. Start with one of four paths. After every stage, <code>next</code> inspects the project and gives you one evidence-based continuation.</p>
|
|
80
|
+
</header>
|
|
81
|
+
|
|
82
|
+
<div class="journey-start"><span>First command</span><code data-command="start">npx @ghostbyte/agent-docs-kit@latest start</code><p>Read-only. It explains the paths and does not change the project.</p></div>
|
|
83
|
+
|
|
84
|
+
<div class="journey-grid">
|
|
85
|
+
<article>
|
|
86
|
+
<span class="journey-number">01</span><p class="journey-label">New or empty</p><h3>Establish the project memory.</h3>
|
|
87
|
+
<p>Create the structure, document intended behavior as planned, and avoid presenting designs as implemented facts.</p>
|
|
88
|
+
<code data-command="start new">npx @ghostbyte/agent-docs-kit@latest start new</code>
|
|
89
|
+
</article>
|
|
90
|
+
<article>
|
|
91
|
+
<span class="journey-number">02</span><p class="journey-label">Existing project</p><h3>Reconcile docs with reality.</h3>
|
|
92
|
+
<p>Preview the safe scaffold, preserve existing files, then use code, configuration, tests, and operations as evidence.</p>
|
|
93
|
+
<code data-command="start existing">npx @ghostbyte/agent-docs-kit@latest start existing</code>
|
|
94
|
+
</article>
|
|
95
|
+
<article>
|
|
96
|
+
<span class="journey-number">03</span><p class="journey-label">AI-assisted</p><h3>Give the agent a bounded workflow.</h3>
|
|
97
|
+
<p>Install the repository skill, restart the AI session if needed, and ask it to inspect the project without guessing unavailable facts.</p>
|
|
98
|
+
<code data-command="start agent">npx @ghostbyte/agent-docs-kit@latest start agent</code>
|
|
99
|
+
</article>
|
|
100
|
+
<article>
|
|
101
|
+
<span class="journey-number">04</span><p class="journey-label">Manual</p><h3>Use the library yourself.</h3>
|
|
102
|
+
<p>Read one focused guide, complete records by hand, and change Unverified only when your evidence supports it.</p>
|
|
103
|
+
<code data-command="start manual">npx @ghostbyte/agent-docs-kit@latest start manual</code>
|
|
104
|
+
</article>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div class="journey-continue">
|
|
108
|
+
<div><p class="eyebrow">Already started?</p><h3>Continue from the real project state.</h3><p>The CLI checks configuration, required documents, starter prompts, saved audits, and open worksheets. It does not rely on memory from the previous terminal session.</p></div>
|
|
109
|
+
<div><code data-command="next">npx @ghostbyte/agent-docs-kit@latest next</code><ul><li>Stage 1: initialize safely</li><li>Stage 2-3: complete the scaffold and baseline</li><li>Stage 4: verify documentation</li><li>Stage 5-6: review and maintain</li></ul></div>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<aside class="agent-handoff">
|
|
113
|
+
<div><span>When another user gives the kit to an AI</span><h3>The package is context, not automatic authority.</h3></div>
|
|
114
|
+
<p>The AI should inspect the repository, determine the current stage, explain proposed writes, keep unknowns explicit, and ask for authorization before active security testing. Installing the package or skill alone does not initialize files or perform an audit.</p>
|
|
115
|
+
</aside>
|
|
116
|
+
|
|
117
|
+
<div class="agentic-guide" id="agentic-coding">
|
|
118
|
+
<header><p class="eyebrow">How agentic coding fits</p><h3>The kit supplies project memory and review rules. Your coding agent performs the work you request.</h3><p>Agent Docs & Quality Kit does not bundle an AI model or start a background service. It prepares a durable workspace that humans and compatible coding agents can read, update, and verify together.</p></header>
|
|
119
|
+
<ol>
|
|
120
|
+
<li><span>1</span><div><strong>Initialize the workspace</strong><p><code>setup</code> creates the configuration and documentation structure. Existing files are protected by default.</p></div></li>
|
|
121
|
+
<li><span>2</span><div><strong>Install the project skill</strong><p><code>skill install --target project</code> adds the focused instructions and references under <code>.agents/skills/</code>.</p></div></li>
|
|
122
|
+
<li><span>3</span><div><strong>Start the coding agent</strong><p>Open or restart a supported agent in the repository, invoke <code>$manage-project-quality</code>, and give it a specific documentation, security, or engineering goal.</p></div></li>
|
|
123
|
+
<li><span>4</span><div><strong>Keep the result with the project</strong><p>The agent cites repository evidence and writes review records into <code>docs/</code>, where the team can inspect and maintain them.</p></div></li>
|
|
124
|
+
</ol>
|
|
125
|
+
<div class="agentic-prompt"><span>Suggested first prompt</span><code>Use $manage-project-quality. Inspect this repository, determine the current Agent Docs stage, and guide me through the next safe step. Do not infer facts without evidence.</code></div>
|
|
126
|
+
<p class="agentic-note"><strong>Using another AI tool?</strong> If it supports repository skills, point it to <code>.agents/skills/manage-project-quality/SKILL.md</code>. If it does not, the generated <code>docs/README.md</code>, focused CLI guides, and worksheets still provide a complete manual workflow.</p>
|
|
127
|
+
</div>
|
|
128
|
+
</section>
|
|
129
|
+
|
|
76
130
|
<section class="section shell" id="workflows">
|
|
77
131
|
<header class="section-heading split-heading">
|
|
78
132
|
<div><p class="eyebrow">Three jobs, clear boundaries</p><h2>Choose the quality lens that matches the work.</h2></div>
|
|
@@ -158,6 +212,10 @@
|
|
|
158
212
|
<span class="route-arrow" aria-hidden="true">→</span>
|
|
159
213
|
<div class="route-node report"><small>Durable output</small><strong>Evidence-based report</strong><code>docs/04-testing/…</code></div>
|
|
160
214
|
</div>
|
|
215
|
+
<aside class="token-note">
|
|
216
|
+
<div><span>Why targeted loading matters</span><strong>Less unrelated context for each review</strong></div>
|
|
217
|
+
<p>Instead of placing all 33 review areas into every AI session, the skill loads shared evidence rules plus only the selected documentation area, security phase, or engineering topic. This can reduce unnecessary context and token usage while keeping the review focused. Actual token use still depends on the agent, repository, and requested scope.</p>
|
|
218
|
+
</aside>
|
|
161
219
|
</section>
|
|
162
220
|
|
|
163
221
|
<section class="section command-section" id="commands">
|
|
@@ -165,7 +223,7 @@
|
|
|
165
223
|
<div>
|
|
166
224
|
<p class="eyebrow">Interactive or automatable</p>
|
|
167
225
|
<h2>Use the menu once. Use direct commands everywhere else.</h2>
|
|
168
|
-
<p>
|
|
226
|
+
<p>Use <code>start</code> once to select a path. Use <code>next</code> whenever you return. Direct commands remain available for scripts and experienced users.</p>
|
|
169
227
|
<div class="command-mode-card" aria-labelledby="command-mode-title">
|
|
170
228
|
<strong id="command-mode-title">How are you running it?</strong>
|
|
171
229
|
<div class="command-mode-switch" role="group" aria-label="Command format">
|
|
@@ -187,7 +245,11 @@
|
|
|
187
245
|
<button id="code-tab-engineering" role="tab" aria-selected="false" aria-controls="code-panel-engineering" tabindex="-1" data-code-tab="engineering">Engineering</button>
|
|
188
246
|
<button id="code-tab-skill" role="tab" aria-selected="false" aria-controls="code-panel-skill" tabindex="-1" data-code-tab="skill">Skill</button>
|
|
189
247
|
</div>
|
|
190
|
-
<div id="code-panel-setup" class="code-panel" role="tabpanel" aria-labelledby="code-tab-setup" data-code-panel="setup"><pre><code data-command-example="setup">npx @ghostbyte/agent-docs-kit@latest
|
|
248
|
+
<div id="code-panel-setup" class="code-panel" role="tabpanel" aria-labelledby="code-tab-setup" data-code-panel="setup"><pre><code data-command-example="setup">npx @ghostbyte/agent-docs-kit@latest start existing
|
|
249
|
+
|
|
250
|
+
npx @ghostbyte/agent-docs-kit@latest next
|
|
251
|
+
|
|
252
|
+
npx @ghostbyte/agent-docs-kit@latest list documentation
|
|
191
253
|
|
|
192
254
|
npx @ghostbyte/agent-docs-kit@latest documentation guide system-documentation
|
|
193
255
|
|
|
@@ -222,7 +284,7 @@ npm --version</code><button class="copy-button light" data-copy="node --version\
|
|
|
222
284
|
<ol>
|
|
223
285
|
<li><div><strong>Confirm the CLI is available</strong><small>This fetches the current published version and prints its help.</small></div><div class="install-code"><code>npx @ghostbyte/agent-docs-kit@latest --help</code><button class="copy-button light" data-copy="npx @ghostbyte/agent-docs-kit@latest --help">Copy</button></div></li>
|
|
224
286
|
<li><div><strong>Preview the documentation setup</strong><small>The dry run reports intended writes without changing files.</small></div><div class="install-code"><code>npx @ghostbyte/agent-docs-kit@latest setup --dry-run</code><button class="copy-button light" data-copy="npx @ghostbyte/agent-docs-kit@latest setup --dry-run">Copy</button></div></li>
|
|
225
|
-
<li><div><strong>
|
|
287
|
+
<li><div><strong>Choose your starting path</strong><small>Get complete instructions for a new project, existing project, AI-assisted workflow, or manual workflow.</small></div><div class="install-code"><code>npx @ghostbyte/agent-docs-kit@latest start</code><button class="copy-button light" data-copy="npx @ghostbyte/agent-docs-kit@latest start">Copy</button></div></li>
|
|
226
288
|
</ol>
|
|
227
289
|
</article>
|
|
228
290
|
|
|
@@ -303,6 +365,8 @@ npx agent-docs --help</code><button class="copy-button light" data-copy="npm ins
|
|
|
303
365
|
|
|
304
366
|
<div class="command-reference" role="list">
|
|
305
367
|
<article role="listitem"><div class="command-meta"><span class="read-label">Interactive</span><code data-command>npx @ghostbyte/agent-docs-kit@latest</code></div><div><h3>Open the guided menu</h3><p>Choose documentation setup, documentation audit, security audit, engineering review, project-skill installation, or package validation. In a non-interactive shell, it prints help instead of waiting for input.</p></div></article>
|
|
368
|
+
<article role="listitem"><div class="command-meta"><span class="read-label">Read-only</span><code data-command="start [new|existing|agent|manual]">npx @ghostbyte/agent-docs-kit@latest start [new|existing|agent|manual]</code></div><div><h3>Show a complete onboarding path</h3><p>Explains the ordered steps, safety boundary, and exact commands for a new project, an existing project, AI-assisted work, or manual work. With no path argument, it shows all four choices.</p></div></article>
|
|
369
|
+
<article role="listitem"><div class="command-meta"><span class="read-label">Read-only</span><code data-command="next">npx @ghostbyte/agent-docs-kit@latest next</code></div><div><h3>Continue from project state</h3><p>Inspects the configured workspace, starter prompts, saved audits, and open worksheets, then prints the current stage and one concrete set of next actions. It does not write files.</p></div></article>
|
|
306
370
|
<article role="listitem"><div class="command-meta"><span class="write-label">Writes</span><code data-command="setup">npx @ghostbyte/agent-docs-kit@latest setup</code></div><div><h3>Create the documentation workspace</h3><p>Adds `.agent-docs/config.json` and the initial `docs/` hierarchy for system, project, development, testing, operations, future work, and archives. Use `--dry-run` first; existing files are skipped.</p></div></article>
|
|
307
371
|
<article role="listitem"><div class="command-meta"><span class="read-label">Read-only*</span><code data-command="audit documentation">npx @ghostbyte/agent-docs-kit@latest audit documentation</code></div><div><h3>Check documentation health</h3><p>Checks configured required documents, duplicate headings, placeholders, relative links, anchors, and optional metadata. Add <code>--strict</code> for CI, <code>--format</code> for text, Markdown, or JSON, and <code>--report</code> to persist the result.</p></div></article>
|
|
308
372
|
<article role="listitem"><div class="command-meta"><span class="read-label">Read-only</span><code data-command="list documentation">npx @ghostbyte/agent-docs-kit@latest list documentation</code></div><div><h3>List documentation areas</h3><p>Prints the seven canonical documentation area IDs, slugs, and names from the same catalog used by security and engineering.</p></div></article>
|
package/site/styles.css
CHANGED
|
@@ -66,6 +66,43 @@ h3 { letter-spacing: -.025em; }
|
|
|
66
66
|
.principle-strip .shell { display: grid; grid-template-columns: repeat(4, 1fr); }
|
|
67
67
|
.principle-strip p { margin: 0; padding: 1.1rem; border-right: 1px solid var(--line); color: var(--muted); font: 600 .71rem ui-monospace, monospace; text-align: center; text-transform: uppercase; letter-spacing: .08em; }.principle-strip p:first-child { border-left: 1px solid var(--line); }.principle-strip span::before { content: "●"; margin-right: .55rem; color: var(--lime); font-size: .55rem; }
|
|
68
68
|
|
|
69
|
+
.journey-section { padding-bottom: 0; }
|
|
70
|
+
.journey-start { display: grid; grid-template-columns: auto minmax(280px, 1fr) 1fr; gap: 1.25rem; align-items: center; margin-bottom: 1rem; padding: 1.1rem 1.3rem; border: 1px solid #53653c; border-radius: 12px; background: linear-gradient(90deg, rgba(200,244,107,.1), rgba(200,244,107,.025)); }
|
|
71
|
+
.journey-start span, .journey-label { color: var(--lime); font: 700 .65rem ui-monospace, monospace; text-transform: uppercase; letter-spacing: .09em; }
|
|
72
|
+
.journey-start code, .journey-grid code, .journey-continue code { color: #dfe9e2; font: .74rem/1.55 ui-monospace, monospace; overflow-wrap: anywhere; }
|
|
73
|
+
.journey-start p { margin: 0; color: var(--muted); font-size: .82rem; }
|
|
74
|
+
.journey-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
|
|
75
|
+
.journey-grid article { min-height: 330px; padding: 1.4rem; border-right: 1px solid var(--line); background: linear-gradient(160deg, #141916, #0d100f); }
|
|
76
|
+
.journey-grid article:last-child { border-right: 0; }
|
|
77
|
+
.journey-number { display: grid; width: 2rem; height: 2rem; place-items: center; margin-bottom: 3.5rem; border: 1px solid var(--line-strong); border-radius: 50%; color: #89938c; font: .65rem ui-monospace, monospace; }
|
|
78
|
+
.journey-label { margin-bottom: .7rem; }
|
|
79
|
+
.journey-grid h3 { min-height: 2.5em; margin-bottom: .65rem; font-size: 1.15rem; }
|
|
80
|
+
.journey-grid article > p:not(.journey-label) { min-height: 7.8em; color: var(--muted); font-size: .84rem; }
|
|
81
|
+
.journey-grid code { display: block; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--blue); }
|
|
82
|
+
.journey-continue { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; margin-top: 1rem; padding: clamp(2rem, 5vw, 3.5rem); border: 1px solid var(--line); border-radius: 14px; background: #111512; }
|
|
83
|
+
.journey-continue h3 { margin-bottom: .7rem; font-size: 1.55rem; }
|
|
84
|
+
.journey-continue p:not(.eyebrow), .journey-continue li { color: var(--muted); font-size: .87rem; }
|
|
85
|
+
.journey-continue code { display: block; margin-bottom: 1rem; padding: .9rem; border: 1px solid #355672; border-radius: 8px; background: #090c0a; color: var(--blue); }
|
|
86
|
+
.journey-continue ul { margin: 0; padding-left: 1.2rem; }
|
|
87
|
+
.agent-handoff { display: grid; grid-template-columns: .8fr 1.2fr; gap: 3rem; margin-top: 1rem; padding: 1.5rem; border: 1px solid #725d35; border-radius: 12px; background: rgba(241,197,107,.055); }
|
|
88
|
+
.agent-handoff span { color: var(--amber); font: 700 .65rem ui-monospace, monospace; text-transform: uppercase; letter-spacing: .08em; }
|
|
89
|
+
.agent-handoff h3 { margin: .6rem 0 0; }
|
|
90
|
+
.agent-handoff p { margin: 0; color: var(--muted); font-size: .88rem; }
|
|
91
|
+
.agentic-guide { margin-top: 1rem; padding: clamp(2rem, 5vw, 4rem); border: 1px solid #355672; border-radius: 14px; background: radial-gradient(circle at 85% 5%, rgba(59,118,166,.14), transparent 34%), #101412; }
|
|
92
|
+
.agentic-guide > header { max-width: 810px; margin-bottom: 2.5rem; }
|
|
93
|
+
.agentic-guide > header h3 { font-size: clamp(1.6rem, 3.2vw, 2.65rem); line-height: 1.08; }
|
|
94
|
+
.agentic-guide > header > p:not(.eyebrow) { color: var(--muted); }
|
|
95
|
+
.agentic-guide ol { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; margin: 0; padding: 0; list-style: none; }
|
|
96
|
+
.agentic-guide li { display: grid; grid-template-columns: 34px 1fr; gap: .75rem; padding: 1.2rem 0; border-top: 1px solid var(--line); }
|
|
97
|
+
.agentic-guide li > span { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid #355672; border-radius: 50%; color: var(--blue); font: .65rem ui-monospace, monospace; }
|
|
98
|
+
.agentic-guide li strong { display: block; margin-bottom: .25rem; }
|
|
99
|
+
.agentic-guide li p { margin: 0; color: var(--muted); font-size: .82rem; }
|
|
100
|
+
.agentic-guide code { color: var(--blue); font: .78rem/1.55 ui-monospace, monospace; overflow-wrap: anywhere; }
|
|
101
|
+
.agentic-prompt { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; margin-top: 1.5rem; padding: 1.2rem; border: 1px solid #53653c; border-radius: 9px; background: #090c0a; }
|
|
102
|
+
.agentic-prompt span { color: var(--lime); font: 700 .65rem ui-monospace, monospace; text-transform: uppercase; letter-spacing: .08em; }
|
|
103
|
+
.agentic-prompt code { color: #dfe9e2; }
|
|
104
|
+
.agentic-note { margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
|
|
105
|
+
|
|
69
106
|
.section { padding-block: clamp(5rem, 10vw, 9rem); }
|
|
70
107
|
.section-heading { max-width: 760px; margin-bottom: 3.5rem; }.section-heading > p:not(.eyebrow) { max-width: 630px; color: var(--muted); font-size: 1.05rem; }
|
|
71
108
|
.split-heading { display: grid; grid-template-columns: 1.3fr .7fr; gap: 4rem; max-width: none; align-items: end; }.split-heading > p { margin-bottom: 1.3rem; }
|
|
@@ -80,6 +117,7 @@ h3 { letter-spacing: -.025em; }
|
|
|
80
117
|
.process-section { border-block: 1px solid var(--line); background: #101412; }.process-list { margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }.process-list li { display: grid; grid-template-columns: 90px 1fr; gap: 1rem; padding: 2rem 0; border-bottom: 1px solid var(--line); }.process-list > li > span { color: var(--lime); font: 700 .74rem ui-monospace, monospace; }.process-list h3 { margin: 0 0 .35rem; font-size: 1.4rem; }.process-list p { max-width: 690px; margin: 0; color: var(--muted); }
|
|
81
118
|
|
|
82
119
|
.routing-diagram { display: grid; grid-template-columns: 1fr auto 1fr auto 1.15fr auto 1fr; gap: .8rem; align-items: center; }.route-node { min-height: 125px; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }.route-node small { display: block; margin-bottom: .8rem; color: #778179; font: .65rem ui-monospace, monospace; text-transform: uppercase; }.route-node strong { display: block; font-size: .9rem; }.route-node code { display: block; margin-top: .65rem; color: var(--lime); font-size: .65rem; }.route-node.router { border-color: #52633b; }.route-node.selected { min-height: auto; border-color: #405036; background: #151c13; }.route-node.muted { min-height: auto; opacity: .55; }.route-node.report { border-color: #355672; }.route-stack { display: grid; gap: .5rem; }.route-arrow { color: #5c675f; }
|
|
120
|
+
.token-note { display: grid; grid-template-columns: .7fr 1.3fr; gap: 3rem; margin-top: 1rem; padding: 1.35rem; border: 1px solid #52633b; border-radius: 10px; background: rgba(200,244,107,.045); }.token-note span { display: block; margin-bottom: .45rem; color: var(--lime); font: 700 .64rem ui-monospace, monospace; text-transform: uppercase; letter-spacing: .08em; }.token-note strong { font-size: 1.05rem; }.token-note p { margin: 0; color: var(--muted); font-size: .86rem; }
|
|
83
121
|
|
|
84
122
|
.command-section { background: #e9eddf; color: #10130f; }.command-layout { display: grid; grid-template-columns: .82fr 1.18fr; gap: clamp(3rem, 8vw, 7rem); align-items: center; }.command-section .eyebrow { color: #4c681a; }.command-section p { color: #566057; }.command-notes { margin-top: 2rem; border-top: 1px solid #bdc4b8; }.command-notes p { display: grid; grid-template-columns: 22px 1fr; margin: 0; padding: .8rem 0; border-bottom: 1px solid #c8cec3; }.command-notes span { color: #557817; }.command-notes strong { color: #20251f; }.command-notes small { grid-column: 2; }
|
|
85
123
|
.command-mode-card { margin-top: 1.5rem; padding: 1rem; border: 1px solid #bdc6b9; border-radius: 12px; background: rgba(255,255,255,.5); }.command-mode-card > strong { display: block; margin-bottom: .7rem; font-size: .84rem; }.command-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; padding: .3rem; border-radius: 9px; background: #d8ddd2; }.command-mode-switch button { display: flex; flex-direction: column; gap: .05rem; padding: .65rem .8rem; border: 1px solid transparent; border-radius: 7px; color: #5a635b; background: transparent; cursor: pointer; text-align: left; }.command-mode-switch button span { color: inherit; font-size: .82rem; font-weight: 760; }.command-mode-switch button small { font-size: .68rem; }.command-mode-switch button[aria-pressed="true"] { border-color: #a7b09f; color: #151a15; background: #fff; box-shadow: 0 3px 12px rgba(28,38,29,.09); }.command-mode-help { min-height: 2.7em; margin: .75rem 0 0 !important; font-size: .76rem; line-height: 1.35; }
|
|
@@ -140,14 +178,16 @@ button:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-
|
|
|
140
178
|
.hero-layout { padding-block: 6rem; }.console { max-width: 620px; transform: none; }
|
|
141
179
|
.split-heading { grid-template-columns: 1fr; gap: 1rem; }.workflow-panel { gap: 2.5rem; }
|
|
142
180
|
.routing-diagram { grid-template-columns: 1fr; }.route-arrow { transform: rotate(90deg); text-align: center; }
|
|
143
|
-
.options-block, .skill-detail { grid-template-columns: 1fr; gap: 2rem; }.package-parts { grid-template-columns: 1fr 1fr; }.package-parts article:nth-child(2) { border-right: 0; }.package-parts article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }.catalog-layout { grid-template-columns: 1fr 1fr; }.documentation-catalog { grid-column: 1 / -1; }
|
|
181
|
+
.options-block, .skill-detail, .token-note { grid-template-columns: 1fr; gap: 2rem; }.package-parts { grid-template-columns: 1fr 1fr; }.package-parts article:nth-child(2) { border-right: 0; }.package-parts article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }.catalog-layout { grid-template-columns: 1fr 1fr; }.documentation-catalog { grid-column: 1 / -1; }
|
|
144
182
|
.trust-grid { grid-template-columns: 1fr 1fr; }.trust-grid article:nth-child(2) { border-right: 0; }.trust-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
|
|
183
|
+
.journey-grid { grid-template-columns: 1fr 1fr; }.journey-grid article:nth-child(2) { border-right: 0; }.journey-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }.journey-continue { gap: 2rem; }
|
|
145
184
|
}
|
|
146
185
|
|
|
147
186
|
@media (max-width: 700px) {
|
|
148
187
|
.shell { width: min(100% - 2rem, 1160px); }.hero { min-height: auto; }.nav { align-items: flex-start; padding-block: 1rem; }.nav-links a:not(.nav-install) { display: none; }.brand > span:last-child { max-width: 130px; line-height: 1.1; }
|
|
149
188
|
.hero-layout { padding-block: 4.5rem 5rem; }.hero-facts { gap: 1rem; }.hero-facts div { display: block; }.hero-facts dd { max-width: 72px; }
|
|
150
189
|
.principle-strip .shell { grid-template-columns: 1fr 1fr; }.principle-strip p:nth-child(2) { border-right: 1px solid var(--line); }.principle-strip p:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
|
|
190
|
+
.journey-start, .journey-continue, .agent-handoff, .journey-grid, .agentic-guide ol, .agentic-prompt { grid-template-columns: 1fr; }.journey-start { align-items: start; }.journey-grid article { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }.journey-grid article:last-child { border-bottom: 0; }.journey-number { margin-bottom: 1.5rem; }.journey-grid h3, .journey-grid article > p:not(.journey-label) { min-height: 0; }
|
|
151
191
|
.workflow-tabs button { padding: .8rem .4rem; font-size: .72rem; }.workflow-tabs button span { display: block; margin: 0; }.workflow-details { grid-template-columns: 1fr; }.workflow-details .result-card { grid-column: auto; }
|
|
152
192
|
.command-mode-switch { grid-template-columns: 1fr; }
|
|
153
193
|
.command-reference article { grid-template-columns: 1fr; gap: 1rem; }.options-block dl, .package-parts, .catalog-layout, .install-paths, .other-installation { grid-template-columns: 1fr; }.package-parts article { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }.package-parts article:last-child { border-bottom: 0; }.package-parts h3 { margin-top: 1.4rem; }.documentation-catalog { grid-column: auto; }
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: manage-project-quality
|
|
3
|
-
description: Set up and audit project documentation, perform evidence-based security reviews,
|
|
3
|
+
description: Set up and audit project documentation, perform evidence-based security reviews, assess engineering practices, or continue an Agent Docs & Quality Kit workflow. Use when asked to initialize a new or existing repository, decide what to do after setup, create or repair a docs structure, check documentation drift, conduct a security gate or phase audit, review engineering quality, generate audit evidence, or explain kit results in standard or learning mode.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Manage Project Quality
|
|
7
7
|
|
|
8
8
|
Choose exactly one primary workflow for the request: documentation governance, security assurance, or engineering review. Combine workflows only when the user explicitly requests a broader quality pass.
|
|
9
9
|
|
|
10
|
+
## Start from repository state
|
|
11
|
+
|
|
12
|
+
When the user hands you this skill, names the npm package, or asks what to do after setup:
|
|
13
|
+
|
|
14
|
+
1. Inspect the repository before choosing a workflow. Look for `.agent-docs/config.json`, required documents, starter prompts, saved audits, and open `Unverified` worksheets.
|
|
15
|
+
2. If the CLI is available, run or recommend `agent-docs next --cwd <project>` to obtain the current stage. Otherwise apply the same order: initialize, complete the baseline, audit documentation, complete one focused review, then maintain.
|
|
16
|
+
3. Distinguish a new project from an existing implementation. In a new project, record intended behavior as planned. In an existing project, derive statements from code, configuration, tests, workflows, and authorized operational evidence.
|
|
17
|
+
4. Explain proposed writes before making them unless the user has already authorized that exact setup or report action.
|
|
18
|
+
5. If the skill is not installed in the repository, recommend `npx @ghostbyte/agent-docs-kit@latest skill install --target project`. Installation alone does not initialize files, run an audit, or authorize active testing.
|
|
19
|
+
6. End each response with the completed stage, unresolved evidence, and one concrete next action.
|
|
20
|
+
|
|
10
21
|
## Establish the operating context
|
|
11
22
|
|
|
12
23
|
1. Inspect the repository, its local instructions, and the files relevant to the request.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Agent Docs & Quality"
|
|
3
|
-
short_description: "
|
|
4
|
-
default_prompt: "Use $manage-project-quality to
|
|
3
|
+
short_description: "Guide and review project quality workflows"
|
|
4
|
+
default_prompt: "Use $manage-project-quality to inspect this repository, determine its current Agent Docs stage, and guide the next safe documentation, security, or engineering step using repository evidence."
|
package/src/api/index.mjs
CHANGED
|
@@ -4,5 +4,6 @@ export { installSkill } from "../commands/skill.mjs";
|
|
|
4
4
|
export { createTemplate, listTemplates, templateTypes } from "../commands/template.mjs";
|
|
5
5
|
export { showDocumentationGuide } from "../commands/guide.mjs";
|
|
6
6
|
export { openWebsite, websiteUrl } from "../commands/website.mjs";
|
|
7
|
+
export { startWorkflow, nextWorkflow, npxCommand } from "../commands/workflow.mjs";
|
|
7
8
|
export { loadCatalog } from "../core/catalog.mjs";
|
|
8
9
|
export { loadProjectConfig, defaultConfig } from "../core/config.mjs";
|
package/src/cli/help.mjs
CHANGED
|
@@ -11,6 +11,8 @@ After installing globally:
|
|
|
11
11
|
|
|
12
12
|
Commands:
|
|
13
13
|
(no command) Open the guided menu (TTY only)
|
|
14
|
+
start [new|existing|agent|manual] Show a complete onboarding path
|
|
15
|
+
next Detect project state and show the next step
|
|
14
16
|
setup [--dry-run] Create the documentation workspace
|
|
15
17
|
audit documentation [--strict] Check documentation health
|
|
16
18
|
documentation guide <area> Print one documentation guidance area
|
|
@@ -31,6 +33,8 @@ Commands:
|
|
|
31
33
|
--version Show the package version
|
|
32
34
|
|
|
33
35
|
Examples:
|
|
36
|
+
npx @ghostbyte/agent-docs-kit@latest start existing
|
|
37
|
+
npx @ghostbyte/agent-docs-kit@latest next
|
|
34
38
|
npx @ghostbyte/agent-docs-kit@latest setup --dry-run
|
|
35
39
|
npx @ghostbyte/agent-docs-kit@latest audit documentation --strict --format text
|
|
36
40
|
npx @ghostbyte/agent-docs-kit@latest documentation guide system-documentation
|
|
@@ -56,4 +60,8 @@ Options:
|
|
|
56
60
|
--strict Fail when documentation checks fail
|
|
57
61
|
--help Show this help
|
|
58
62
|
|
|
59
|
-
|
|
63
|
+
Recommended first run:
|
|
64
|
+
npx @ghostbyte/agent-docs-kit@latest start
|
|
65
|
+
|
|
66
|
+
Installing the npm package performs no project setup. Run 'start' for a guided path
|
|
67
|
+
or 'next' to continue an initialized project.`;
|
package/src/cli/main.mjs
CHANGED
|
@@ -11,6 +11,7 @@ import { validatePackage } from "../commands/validate.mjs";
|
|
|
11
11
|
import { openWebsite } from "../commands/website.mjs";
|
|
12
12
|
import { createTemplate, listTemplates } from "../commands/template.mjs";
|
|
13
13
|
import { showDocumentationGuide } from "../commands/guide.mjs";
|
|
14
|
+
import { nextWorkflow, startWorkflow } from "../commands/workflow.mjs";
|
|
14
15
|
import { readFile } from "node:fs/promises";
|
|
15
16
|
import { resolveFromPackage } from "../core/paths.mjs";
|
|
16
17
|
|
|
@@ -27,22 +28,28 @@ function assertInvocation(positionals, flags, { counts, allowedFlags = [], usage
|
|
|
27
28
|
async function menu() {
|
|
28
29
|
const ui = createInterface({ input: stdin, output: stdout });
|
|
29
30
|
try {
|
|
30
|
-
console.log(`\nAgent Docs & Quality Kit\n\n1. Set up documentation\
|
|
31
|
+
console.log(`\nAgent Docs & Quality Kit\n\nStart and continue\n1. Choose a starting path\n2. Continue from the current project state\n\nFocused workflows\n3. Set up documentation\n4. Audit documentation\n5. Create security worksheet\n6. Create engineering worksheet\n7. Install project skill\n\nReference and maintenance\n8. List documentation templates\n9. Validate package\n10. Open documentation website\n0. Exit`);
|
|
31
32
|
const choice = await ui.question("\nChoose an action: ");
|
|
32
|
-
if (choice === "1")
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
if (choice === "1") {
|
|
34
|
+
console.log("\n1. New or empty project\n2. Existing project\n3. AI-assisted workflow\n4. Manual workflow");
|
|
35
|
+
const path = await ui.question("Choose a starting path: ");
|
|
36
|
+
return startWorkflow({ "1": "new", "2": "existing", "3": "agent", "4": "manual" }[path]);
|
|
37
|
+
}
|
|
38
|
+
if (choice === "2") return nextWorkflow();
|
|
39
|
+
if (choice === "3") return setupProject();
|
|
40
|
+
if (choice === "4") return auditDocumentation();
|
|
41
|
+
if (choice === "5") {
|
|
35
42
|
await listCatalog("security");
|
|
36
43
|
return auditSecurity(await ui.question("Phase id or slug: "));
|
|
37
44
|
}
|
|
38
|
-
if (choice === "
|
|
45
|
+
if (choice === "6") {
|
|
39
46
|
await listCatalog("engineering");
|
|
40
47
|
return reviewEngineering(await ui.question("Topic id or slug: "));
|
|
41
48
|
}
|
|
42
|
-
if (choice === "
|
|
43
|
-
if (choice === "6") return validatePackage();
|
|
44
|
-
if (choice === "7") return openWebsite();
|
|
49
|
+
if (choice === "7") return installSkill("project");
|
|
45
50
|
if (choice === "8") return listTemplates();
|
|
51
|
+
if (choice === "9") return validatePackage();
|
|
52
|
+
if (choice === "10") return openWebsite();
|
|
46
53
|
if (choice !== "0") throw new Error("Unknown menu choice.");
|
|
47
54
|
} finally {
|
|
48
55
|
ui.close();
|
|
@@ -67,6 +74,14 @@ export async function main(argv) {
|
|
|
67
74
|
}
|
|
68
75
|
return menu();
|
|
69
76
|
}
|
|
77
|
+
if (command === "start") {
|
|
78
|
+
assertInvocation(positionals, flags, { counts: [1, 2], usage: "agent-docs start [new|existing|agent|manual]" });
|
|
79
|
+
return startWorkflow(subject);
|
|
80
|
+
}
|
|
81
|
+
if (command === "next") {
|
|
82
|
+
assertInvocation(positionals, flags, { counts: [1], allowedFlags: ["cwd"], usage: "agent-docs next [--cwd <path>]" });
|
|
83
|
+
return nextWorkflow(options);
|
|
84
|
+
}
|
|
70
85
|
if (command === "setup") {
|
|
71
86
|
assertInvocation(positionals, flags, { counts: [1], allowedFlags: ["cwd", "dry-run", "force"], usage: "agent-docs setup [--cwd <path>] [--dry-run] [--force]" });
|
|
72
87
|
return setupProject(options);
|
package/src/commands/audit.mjs
CHANGED
|
@@ -32,6 +32,15 @@ async function reportFor(kind, selector, options = {}) {
|
|
|
32
32
|
const body = `# ${heading}: ${entry.title}\n\n- Date: ${localDate()}\n- Style: ${options.style ?? config.interactionStyle}\n- Overall status: Unverified\n- Reviewer: _Unassigned_\n\n${context}\n\n## Findings\n\n${columns}\n\n## Reference checklist\n\n${reference.trim()}\n`;
|
|
33
33
|
const result = await writeUnique(output, body, options);
|
|
34
34
|
console.log(`${result.status} ${result.path}`);
|
|
35
|
+
if (options.dryRun) {
|
|
36
|
+
console.log("Preview only: no worksheet was created.");
|
|
37
|
+
} else {
|
|
38
|
+
console.log("\nNext steps:");
|
|
39
|
+
console.log(`1. Open ${relative(root, result.path)}. Every finding starts as Unverified.`);
|
|
40
|
+
console.log("2. Collect evidence, then record status, remediation, owner, and verification. Do not treat worksheet creation as a completed review.");
|
|
41
|
+
console.log("3. For AI assistance, install the project skill and ask $manage-project-quality to review only this scope.");
|
|
42
|
+
console.log(`4. Continue: npx @ghostbyte/agent-docs-kit@latest next --cwd "${root}"`);
|
|
43
|
+
}
|
|
35
44
|
return result;
|
|
36
45
|
}
|
|
37
46
|
|
|
@@ -160,5 +169,9 @@ export async function auditDocumentation(options = {}) {
|
|
|
160
169
|
console.log(`${written.status} ${written.path}`);
|
|
161
170
|
result.reportPath = written.path;
|
|
162
171
|
}
|
|
172
|
+
if (options.format === "text") {
|
|
173
|
+
console.log("\nThis is a structural documentation check; it does not prove that every statement is factually complete or current.");
|
|
174
|
+
console.log(`Continue: npx @ghostbyte/agent-docs-kit@latest next --cwd "${root}"`);
|
|
175
|
+
}
|
|
163
176
|
return result;
|
|
164
177
|
}
|
package/src/commands/setup.mjs
CHANGED
|
@@ -18,6 +18,17 @@ const files = {
|
|
|
18
18
|
|
|
19
19
|
This directory is the maintained project record. Keep decisions and system facts separate from generated audit evidence.
|
|
20
20
|
|
|
21
|
+
## Start here
|
|
22
|
+
|
|
23
|
+
1. Replace the starter prompts in \`01-system/overview.md\`, \`02-project/README.md\`, and \`05-operations/README.md\` with verified project facts.
|
|
24
|
+
2. Choose how to complete the baseline:
|
|
25
|
+
- AI-assisted: install the project skill with \`npx @ghostbyte/agent-docs-kit@latest skill install --target project\`, restart the AI session if needed, then ask it to use \`$manage-project-quality\` and inspect repository evidence.
|
|
26
|
+
- Manual: run \`npx @ghostbyte/agent-docs-kit@latest list documentation\`, then open one focused area with \`documentation guide <area>\`.
|
|
27
|
+
3. Run \`npx @ghostbyte/agent-docs-kit@latest audit documentation --strict --report --format markdown\`.
|
|
28
|
+
4. Run \`npx @ghostbyte/agent-docs-kit@latest next\` whenever you need the next project-specific action.
|
|
29
|
+
|
|
30
|
+
Generated structure is not proof of completeness. Keep unknowns explicit, label planned behavior as planned, and never assign a security result without evidence.
|
|
31
|
+
|
|
21
32
|
- \`01-system/\`: system scope, architecture, data, and security design
|
|
22
33
|
- \`02-project/\`: requirements, roadmap, decisions, and status
|
|
23
34
|
- \`03-development/\`: implementation notes and engineering reviews
|
|
@@ -43,5 +54,20 @@ export async function setupProject(options = {}) {
|
|
|
43
54
|
results.push(await writeSafe(resolve(root, path), contents, options));
|
|
44
55
|
}
|
|
45
56
|
displayResults(root, results);
|
|
57
|
+
const changed = results.filter((result) => result.status !== "skipped").length;
|
|
58
|
+
if (options.dryRun) {
|
|
59
|
+
console.log(`\nPreview complete: ${changed} owned path(s) would be created or replaced.`);
|
|
60
|
+
console.log(`Apply it: npx @ghostbyte/agent-docs-kit@latest setup --cwd "${root}"`);
|
|
61
|
+
} else {
|
|
62
|
+
console.log(`\nWorkspace ready: ${changed} path(s) created or replaced; existing files were skipped unless --force was supplied.`);
|
|
63
|
+
console.log("Nothing is running in the background, and no AI review has been performed.");
|
|
64
|
+
console.log("\nTo use this workspace with an AI coding agent:");
|
|
65
|
+
console.log(`1. npx @ghostbyte/agent-docs-kit@latest skill install --target project --cwd "${root}"`);
|
|
66
|
+
console.log("2. Open or restart the agent in this repository so it can discover .agents/skills/.");
|
|
67
|
+
console.log("3. Prompt: Use $manage-project-quality. Inspect this repository, determine the current Agent Docs stage, and guide me through the next safe step. Do not infer facts without evidence.");
|
|
68
|
+
console.log("\nTo work without an AI:");
|
|
69
|
+
console.log("npx @ghostbyte/agent-docs-kit@latest start manual");
|
|
70
|
+
console.log(`\nTo continue later: npx @ghostbyte/agent-docs-kit@latest next --cwd "${root}"`);
|
|
71
|
+
}
|
|
46
72
|
return results;
|
|
47
73
|
}
|
package/src/commands/skill.mjs
CHANGED
|
@@ -11,5 +11,16 @@ export async function installSkill(target = "project", options = {}) {
|
|
|
11
11
|
: resolve(root, ".agents", "skills", "manage-project-quality");
|
|
12
12
|
const result = await copySafe(resolveFromPackage("skills", "manage-project-quality"), destination, options);
|
|
13
13
|
console.log(`${result.status} ${destination}`);
|
|
14
|
+
if (options.dryRun) {
|
|
15
|
+
console.log("\nPreview only: no skill files were copied.");
|
|
16
|
+
} else if (target === "project") {
|
|
17
|
+
console.log("\nNext steps:");
|
|
18
|
+
console.log("1. Open or restart your AI coding session so it can discover .agents/skills/.");
|
|
19
|
+
console.log("2. Prompt: Use $manage-project-quality. Inspect this repository, determine the current Agent Docs stage, and guide me through the next safe step. Do not infer facts without evidence.");
|
|
20
|
+
console.log(`3. Check progress: npx @ghostbyte/agent-docs-kit@latest next --cwd "${root}"`);
|
|
21
|
+
} else {
|
|
22
|
+
console.log("\nThe skill is now available to supported AI sessions for the current user.");
|
|
23
|
+
console.log("Open or restart the AI session if it was already running, then invoke $manage-project-quality with a scoped request.");
|
|
24
|
+
}
|
|
14
25
|
return result;
|
|
15
26
|
}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { readdir, readFile } from "node:fs/promises";
|
|
2
|
+
import { relative, resolve } from "node:path";
|
|
3
|
+
import { loadProjectConfig } from "../core/config.mjs";
|
|
4
|
+
import { exists } from "../core/files.mjs";
|
|
5
|
+
|
|
6
|
+
export const npxCommand = "npx @ghostbyte/agent-docs-kit@latest";
|
|
7
|
+
|
|
8
|
+
const startModes = Object.freeze({
|
|
9
|
+
new: {
|
|
10
|
+
title: "New or empty project",
|
|
11
|
+
summary: "Create the documentation structure first, then record plans without presenting them as implemented facts.",
|
|
12
|
+
steps: [
|
|
13
|
+
`${npxCommand} doctor`,
|
|
14
|
+
`${npxCommand} setup --dry-run`,
|
|
15
|
+
`${npxCommand} setup`,
|
|
16
|
+
"Describe the intended users, scope, architecture, and operating assumptions in docs/.",
|
|
17
|
+
`${npxCommand} audit documentation --strict --report --format markdown`,
|
|
18
|
+
`${npxCommand} next`
|
|
19
|
+
],
|
|
20
|
+
note: "For a new project, label unimplemented behavior as planned or proposed. Do not create security Pass results without evidence."
|
|
21
|
+
},
|
|
22
|
+
existing: {
|
|
23
|
+
title: "Existing project",
|
|
24
|
+
summary: "Add the scaffold without overwriting existing files, then reconcile it with code, configuration, tests, and deployment evidence.",
|
|
25
|
+
steps: [
|
|
26
|
+
`${npxCommand} doctor`,
|
|
27
|
+
`${npxCommand} setup --dry-run`,
|
|
28
|
+
`${npxCommand} setup`,
|
|
29
|
+
"Choose AI-assisted or manual completion below.",
|
|
30
|
+
`${npxCommand} audit documentation --strict --report --format markdown`,
|
|
31
|
+
`${npxCommand} next`
|
|
32
|
+
],
|
|
33
|
+
note: "Setup skips existing files by default. Review every generated placeholder before treating the documentation as current."
|
|
34
|
+
},
|
|
35
|
+
agent: {
|
|
36
|
+
title: "AI-assisted workflow",
|
|
37
|
+
summary: "Install the repository-scoped skill, start a fresh AI session if necessary, and give the agent an evidence-bounded request.",
|
|
38
|
+
steps: [
|
|
39
|
+
`${npxCommand} setup --dry-run`,
|
|
40
|
+
`${npxCommand} setup`,
|
|
41
|
+
`${npxCommand} skill install --target project`,
|
|
42
|
+
"Open or restart your AI coding session so it can discover .agents/skills/.",
|
|
43
|
+
"Prompt: Use $manage-project-quality. Inspect this repository, determine the current Agent Docs stage, and guide me through the next safe step. Do not infer facts without evidence.",
|
|
44
|
+
`${npxCommand} next`
|
|
45
|
+
],
|
|
46
|
+
note: "Giving an AI only the npm package name does not grant authority or perform an audit. The agent should inspect the repository, explain proposed writes, and request authorization before active security testing."
|
|
47
|
+
},
|
|
48
|
+
manual: {
|
|
49
|
+
title: "Manual workflow",
|
|
50
|
+
summary: "Use the CLI as a reference and record generator; complete and verify every document or worksheet yourself.",
|
|
51
|
+
steps: [
|
|
52
|
+
`${npxCommand} setup --dry-run`,
|
|
53
|
+
`${npxCommand} setup`,
|
|
54
|
+
`${npxCommand} list documentation`,
|
|
55
|
+
`${npxCommand} documentation guide system-documentation`,
|
|
56
|
+
"Replace scaffold prompts with verified project facts and cite the source of each important claim.",
|
|
57
|
+
`${npxCommand} audit documentation --strict --report`,
|
|
58
|
+
`${npxCommand} next`
|
|
59
|
+
],
|
|
60
|
+
note: "For security and engineering work, list the available scopes first, create one worksheet, then replace Unverified only when evidence supports the result."
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
function renderStart(path) {
|
|
65
|
+
return `\n${path.title}\n${"=".repeat(path.title.length)}\n${path.summary}\n\nWorking path\n${path.steps.map((step, index) => `${index + 1}. ${step}`).join("\n")}\n\nImportant\n${path.note}\n\nCommands above use npx. After a global install, replace '${npxCommand}' with 'agent-docs'.`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function startWorkflow(mode) {
|
|
69
|
+
const normalized = mode === "ai" ? "agent" : mode;
|
|
70
|
+
if (normalized) {
|
|
71
|
+
const path = startModes[normalized];
|
|
72
|
+
if (!path) throw new Error(`Unknown start path '${mode}'. Use new, existing, agent, or manual.`);
|
|
73
|
+
const text = renderStart(path);
|
|
74
|
+
console.log(text);
|
|
75
|
+
return { mode: normalized, ...path, text };
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const text = `\nChoose your starting path\n=========================\n1. New project ${npxCommand} start new\n2. Existing project ${npxCommand} start existing\n3. Use an AI agent ${npxCommand} start agent\n4. Work manually ${npxCommand} start manual\n\nNot sure? Run '${npxCommand} next' to inspect the current project and receive one recommended next step.\n\nInstallation alone changes nothing. Setup creates only the owned scaffold, and existing files are skipped unless --force is explicit.`;
|
|
79
|
+
console.log(text);
|
|
80
|
+
return { mode: undefined, paths: Object.keys(startModes), text };
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async function markdownFiles(directory) {
|
|
84
|
+
if (!(await exists(directory))) return [];
|
|
85
|
+
const found = [];
|
|
86
|
+
for (const item of await readdir(directory, { withFileTypes: true })) {
|
|
87
|
+
const path = resolve(directory, item.name);
|
|
88
|
+
if (item.isDirectory()) found.push(...await markdownFiles(path));
|
|
89
|
+
else if (item.isFile() && item.name.toLowerCase().endsWith(".md")) found.push(path);
|
|
90
|
+
}
|
|
91
|
+
return found;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
async function regularFiles(directory) {
|
|
95
|
+
if (!(await exists(directory))) return [];
|
|
96
|
+
const found = [];
|
|
97
|
+
for (const item of await readdir(directory, { withFileTypes: true })) {
|
|
98
|
+
const path = resolve(directory, item.name);
|
|
99
|
+
if (item.isDirectory()) found.push(...await regularFiles(path));
|
|
100
|
+
else if (item.isFile() && item.name !== ".gitkeep") found.push(path);
|
|
101
|
+
}
|
|
102
|
+
return found;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
async function filesContaining(paths, pattern) {
|
|
106
|
+
const matching = [];
|
|
107
|
+
for (const path of paths) {
|
|
108
|
+
const value = await readFile(path, "utf8");
|
|
109
|
+
if (pattern.test(value)) matching.push(path);
|
|
110
|
+
}
|
|
111
|
+
return matching;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function renderNext(result) {
|
|
115
|
+
const lines = [
|
|
116
|
+
`\nStage ${result.stage}: ${result.title}`,
|
|
117
|
+
"=".repeat(`Stage ${result.stage}: ${result.title}`.length),
|
|
118
|
+
result.summary,
|
|
119
|
+
"",
|
|
120
|
+
"Detected"
|
|
121
|
+
];
|
|
122
|
+
lines.push(...result.detected.map((item) => `- ${item}`), "", "Next actions");
|
|
123
|
+
lines.push(...result.actions.map((item, index) => `${index + 1}. ${item}`));
|
|
124
|
+
if (result.note) lines.push("", "Why this stage", result.note);
|
|
125
|
+
lines.push("", `Re-run '${npxCommand} next' after completing these actions.`);
|
|
126
|
+
return lines.join("\n");
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function nextResult(stage, title, summary, detected, actions, note) {
|
|
130
|
+
const result = { stage, title, summary, detected, actions, note };
|
|
131
|
+
result.text = renderNext(result);
|
|
132
|
+
console.log(result.text);
|
|
133
|
+
return result;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export async function nextWorkflow(options = {}) {
|
|
137
|
+
const root = resolve(options.cwd ?? process.cwd());
|
|
138
|
+
const configPath = resolve(root, ".agent-docs", "config.json");
|
|
139
|
+
if (!(await exists(configPath))) {
|
|
140
|
+
return nextResult(1, "Initialize safely", "No Agent Docs workspace was found in this project.", [
|
|
141
|
+
`Target: ${root}`,
|
|
142
|
+
"Configuration: not found"
|
|
143
|
+
], [
|
|
144
|
+
`${npxCommand} setup --cwd "${root}" --dry-run`,
|
|
145
|
+
`${npxCommand} setup --cwd "${root}"`,
|
|
146
|
+
`Choose a completion path with '${npxCommand} start agent' or '${npxCommand} start manual'.`
|
|
147
|
+
], "The preview shows every planned file. The real setup skips existing files by default.");
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const { config } = await loadProjectConfig(root);
|
|
151
|
+
const missing = [];
|
|
152
|
+
for (const path of config.requiredDocuments) if (!(await exists(resolve(root, path)))) missing.push(path);
|
|
153
|
+
if (missing.length) {
|
|
154
|
+
return nextResult(2, "Complete the scaffold", "The workspace is configured, but one or more required documents are missing.", [
|
|
155
|
+
"Configuration: found",
|
|
156
|
+
`Missing required documents: ${missing.join(", ")}`
|
|
157
|
+
], [
|
|
158
|
+
`${npxCommand} setup --cwd "${root}" --dry-run`,
|
|
159
|
+
`${npxCommand} setup --cwd "${root}"`
|
|
160
|
+
], "Setup restores only missing owned files unless --force is explicitly supplied.");
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const documentationFiles = await markdownFiles(resolve(root, config.documentationRoot));
|
|
164
|
+
const placeholders = await filesContaining(documentationFiles, /Status:\s*Needs update|Describe the system boundary|Track requirements|Document setup, deployment/i);
|
|
165
|
+
const skillInstalled = await exists(resolve(root, ".agents", "skills", "manage-project-quality", "SKILL.md"));
|
|
166
|
+
if (placeholders.length) {
|
|
167
|
+
const relativePlaceholders = placeholders.slice(0, 4).map((path) => relative(root, path));
|
|
168
|
+
return nextResult(3, "Build the documentation baseline", "The scaffold exists, but starter prompts still need verified project information.", [
|
|
169
|
+
`Starter documents needing work: ${relativePlaceholders.join(", ")}${placeholders.length > 4 ? ` (+${placeholders.length - 4} more)` : ""}`,
|
|
170
|
+
`Project AI skill: ${skillInstalled ? "installed" : "not installed"}`
|
|
171
|
+
], [
|
|
172
|
+
skillInstalled
|
|
173
|
+
? "Ask your AI: Use $manage-project-quality to inspect this repository and update the documentation baseline from repository evidence. Keep unknowns explicit."
|
|
174
|
+
: `AI-assisted path: ${npxCommand} skill install --target project --cwd "${root}"`,
|
|
175
|
+
`Manual path: ${npxCommand} list documentation`,
|
|
176
|
+
`${npxCommand} documentation guide system-documentation`,
|
|
177
|
+
"Replace generated prompts with evidence-backed facts; label planned behavior as planned."
|
|
178
|
+
], "Setup creates a structure, not complete documentation. A structural audit can pass while the content is still incomplete.");
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const documentationReports = await regularFiles(resolve(root, config.documentationReports));
|
|
182
|
+
if (!documentationReports.length) {
|
|
183
|
+
return nextResult(4, "Verify documentation", "The baseline no longer contains starter prompts. Run the structural checks and save the result.", [
|
|
184
|
+
`Documentation files: ${documentationFiles.length}`,
|
|
185
|
+
"Saved documentation audit: not found"
|
|
186
|
+
], [
|
|
187
|
+
`${npxCommand} audit documentation --cwd "${root}" --strict --report --format markdown`,
|
|
188
|
+
"Review every failure and rerun the audit until the result matches the intended release standard."
|
|
189
|
+
], "This audit checks structure, metadata, placeholders, and local links. It does not prove that every statement is factually correct.");
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const securityReports = await markdownFiles(resolve(root, config.securityReports));
|
|
193
|
+
const engineeringReports = await markdownFiles(resolve(root, config.engineeringReports));
|
|
194
|
+
const openReports = await filesContaining([...securityReports, ...engineeringReports], /Overall status:\s*Unverified|\|\s*Unverified\s*\|/i);
|
|
195
|
+
if (openReports.length) {
|
|
196
|
+
return nextResult(5, "Complete the open review", "A generated worksheet still contains Unverified results and needs evidence or an explicit N/A rationale.", [
|
|
197
|
+
...openReports.slice(0, 5).map((path) => `Open: ${relative(root, path)}`)
|
|
198
|
+
], [
|
|
199
|
+
"Inspect the named report and collect code, configuration, test, metric, or authorized environment evidence.",
|
|
200
|
+
"Assign only the allowed status values; record remediation, owner, and verification for actionable findings.",
|
|
201
|
+
skillInstalled ? "Ask your AI to use $manage-project-quality for the report's single selected scope." : `${npxCommand} skill install --target project --cwd "${root}" (optional AI assistance)`
|
|
202
|
+
], "Creating a worksheet does not perform a review. All findings intentionally begin as Unverified.");
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (!securityReports.length && !engineeringReports.length) {
|
|
206
|
+
return nextResult(5, "Choose a focused quality review", "Documentation is initialized and audited. Security and engineering reviews are optional and should be selected by current risk or project need.", [
|
|
207
|
+
`Saved documentation audits: ${documentationReports.length}`,
|
|
208
|
+
"Security worksheets: none",
|
|
209
|
+
"Engineering worksheets: none"
|
|
210
|
+
], [
|
|
211
|
+
`${npxCommand} list security`,
|
|
212
|
+
`${npxCommand} security worksheet <phase>`,
|
|
213
|
+
`${npxCommand} list engineering`,
|
|
214
|
+
`${npxCommand} engineering worksheet <topic>`
|
|
215
|
+
], "Select one narrow scope. Active security testing requires explicit authorization for the exact target.");
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return nextResult(6, "Maintain the project record", "The workspace has documentation evidence and no open generated worksheet was detected.", [
|
|
219
|
+
`Documentation audits: ${documentationReports.length}`,
|
|
220
|
+
`Security worksheets: ${securityReports.length}`,
|
|
221
|
+
`Engineering worksheets: ${engineeringReports.length}`,
|
|
222
|
+
`Project AI skill: ${skillInstalled ? "installed" : "not installed"}`
|
|
223
|
+
], [
|
|
224
|
+
`${npxCommand} audit documentation --cwd "${root}" --strict`,
|
|
225
|
+
"Create ADRs, change records, test evidence, runbooks, or incident reviews when the project changes.",
|
|
226
|
+
"Revisit focused security and engineering scopes before material releases."
|
|
227
|
+
], "Keep the records aligned with code and operations; a previous audit is evidence from a point in time, not a permanent guarantee.");
|
|
228
|
+
}
|
package/tests/cli.test.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import test from "node:test";
|
|
2
2
|
import assert from "node:assert/strict";
|
|
3
|
+
import { execFileSync } from "node:child_process";
|
|
3
4
|
import { access, mkdir, mkdtemp, readFile, readdir, rm, writeFile } from "node:fs/promises";
|
|
4
5
|
import { tmpdir } from "node:os";
|
|
5
6
|
import { join } from "node:path";
|
|
@@ -14,6 +15,7 @@ import { validateReport } from "../skills/manage-project-quality/scripts/check-r
|
|
|
14
15
|
import { showDocumentationGuide } from "../src/commands/guide.mjs";
|
|
15
16
|
import { installSkill } from "../src/commands/skill.mjs";
|
|
16
17
|
import { main } from "../src/cli/main.mjs";
|
|
18
|
+
import { nextWorkflow, startWorkflow } from "../src/commands/workflow.mjs";
|
|
17
19
|
|
|
18
20
|
test("setup is explicit, non-destructive, and repeatable", async () => {
|
|
19
21
|
const root = await mkdtemp(join(tmpdir(), "agent-docs-kit-"));
|
|
@@ -29,6 +31,67 @@ test("setup is explicit, non-destructive, and repeatable", async () => {
|
|
|
29
31
|
}
|
|
30
32
|
});
|
|
31
33
|
|
|
34
|
+
test("guided starts explain all human and agent onboarding paths", () => {
|
|
35
|
+
const overview = startWorkflow();
|
|
36
|
+
assert.deepEqual(overview.paths, ["new", "existing", "agent", "manual"]);
|
|
37
|
+
const agent = startWorkflow("agent");
|
|
38
|
+
assert.match(agent.text, /skill install --target project/);
|
|
39
|
+
assert.match(agent.text, /Do not infer facts without evidence/);
|
|
40
|
+
assert.throws(() => startWorkflow("unknown"), /Use new, existing, agent, or manual/);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test("next derives progress from project state without writing a progress file", async () => {
|
|
44
|
+
const root = await mkdtemp(join(tmpdir(), "agent-docs-kit-"));
|
|
45
|
+
try {
|
|
46
|
+
const empty = await nextWorkflow({ cwd: root });
|
|
47
|
+
assert.equal(empty.stage, 1);
|
|
48
|
+
assert.match(empty.text, /setup --cwd/);
|
|
49
|
+
await setupProject({ cwd: root });
|
|
50
|
+
const baseline = await nextWorkflow({ cwd: root });
|
|
51
|
+
assert.equal(baseline.stage, 3);
|
|
52
|
+
assert.match(baseline.text, /AI-assisted path/);
|
|
53
|
+
await assert.rejects(access(join(root, ".agent-docs", "state.json")));
|
|
54
|
+
} finally { await rm(root, { recursive: true, force: true }); }
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test("next recognizes documentation reports in every supported output format", async () => {
|
|
58
|
+
const root = await mkdtemp(join(tmpdir(), "agent-docs-kit-"));
|
|
59
|
+
try {
|
|
60
|
+
await setupProject({ cwd: root });
|
|
61
|
+
await writeFile(join(root, "docs", "01-system", "overview.md"), "# System overview\n\nVerified system facts.\n");
|
|
62
|
+
await writeFile(join(root, "docs", "02-project", "README.md"), "# Project\n\nVerified project status.\n");
|
|
63
|
+
await writeFile(join(root, "docs", "05-operations", "README.md"), "# Operations\n\nVerified operating procedure.\n");
|
|
64
|
+
await auditDocumentation({ cwd: root, report: true, format: "json" });
|
|
65
|
+
const result = await nextWorkflow({ cwd: root });
|
|
66
|
+
assert.equal(result.stage, 5);
|
|
67
|
+
assert.match(result.text, /Saved documentation audits: 1/);
|
|
68
|
+
} finally { await rm(root, { recursive: true, force: true }); }
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test("next covers the complete repository-backed workflow lifecycle", async () => {
|
|
72
|
+
const root = await mkdtemp(join(tmpdir(), "agent-docs-kit-"));
|
|
73
|
+
try {
|
|
74
|
+
const stages = [];
|
|
75
|
+
stages.push((await nextWorkflow({ cwd: root })).stage);
|
|
76
|
+
await setupProject({ cwd: root });
|
|
77
|
+
await rm(join(root, "docs", "01-system", "overview.md"));
|
|
78
|
+
stages.push((await nextWorkflow({ cwd: root })).stage);
|
|
79
|
+
await setupProject({ cwd: root });
|
|
80
|
+
stages.push((await nextWorkflow({ cwd: root })).stage);
|
|
81
|
+
await writeFile(join(root, "docs", "01-system", "overview.md"), "# System overview\n\nVerified system facts.\n");
|
|
82
|
+
await writeFile(join(root, "docs", "02-project", "README.md"), "# Project\n\nVerified project status.\n");
|
|
83
|
+
await writeFile(join(root, "docs", "05-operations", "README.md"), "# Operations\n\nVerified operating procedures.\n");
|
|
84
|
+
stages.push((await nextWorkflow({ cwd: root })).stage);
|
|
85
|
+
await auditDocumentation({ cwd: root, report: true, format: "markdown" });
|
|
86
|
+
stages.push((await nextWorkflow({ cwd: root })).stage);
|
|
87
|
+
const report = await auditSecurity("api-layer", { cwd: root });
|
|
88
|
+
stages.push((await nextWorkflow({ cwd: root })).stage);
|
|
89
|
+
await writeFile(report.path, (await readFile(report.path, "utf8")).replaceAll("Unverified", "Pass"));
|
|
90
|
+
stages.push((await nextWorkflow({ cwd: root })).stage);
|
|
91
|
+
assert.deepEqual(stages, [1, 2, 3, 4, 5, 5, 6]);
|
|
92
|
+
} finally { await rm(root, { recursive: true, force: true }); }
|
|
93
|
+
});
|
|
94
|
+
|
|
32
95
|
test("forced setup atomically replaces owned files without leaving staging artifacts", async () => {
|
|
33
96
|
const root = await mkdtemp(join(tmpdir(), "agent-docs-kit-"));
|
|
34
97
|
try {
|
|
@@ -216,6 +279,8 @@ test("help distinguishes no-install, local, and global command forms", () => {
|
|
|
216
279
|
assert.match(helpText, /agent-docs --version/);
|
|
217
280
|
assert.match(helpText, /npm view @ghostbyte\/agent-docs-kit version/);
|
|
218
281
|
assert.match(helpText, /npm install --global @ghostbyte\/agent-docs-kit@latest/);
|
|
282
|
+
assert.match(helpText, /start \[new\|existing\|agent\|manual\]/);
|
|
283
|
+
assert.match(helpText, /next\s+Detect project state/);
|
|
219
284
|
});
|
|
220
285
|
|
|
221
286
|
test("website provides a complete installation guide without a GitHub header button", async () => {
|
|
@@ -228,6 +293,13 @@ test("website provides a complete installation guide without a GitHub header but
|
|
|
228
293
|
assert.match(site, /documentation guide/);
|
|
229
294
|
assert.match(site, /role="tab" aria-selected="true" aria-controls="code-panel-setup"/);
|
|
230
295
|
assert.match(site, /If <code>agent-docs<\/code> is not recognized/);
|
|
296
|
+
assert.match(site, /Choose a path, then let the kit show what comes next/);
|
|
297
|
+
assert.match(site, /start \[new\|existing\|agent\|manual\]/);
|
|
298
|
+
assert.match(site, /The package is context, not automatic authority/);
|
|
299
|
+
assert.match(site, /The kit supplies project memory and review rules/);
|
|
300
|
+
assert.match(site, /does not bundle an AI model or start a background service/);
|
|
301
|
+
assert.match(site, /This can reduce unnecessary context and token usage/);
|
|
302
|
+
assert.match(site, /Actual token use still depends on the agent, repository, and requested scope/);
|
|
231
303
|
assert.doesNotMatch(site, /View on GitHub/);
|
|
232
304
|
assert.doesNotMatch(site, /git clone https:\/\/github\.com\/ghostbyte1014\/Agent_Docs_Kit\.git/);
|
|
233
305
|
assert.doesNotMatch(site, /Run the repository source/);
|
|
@@ -240,3 +312,20 @@ test("website provides a complete installation guide without a GitHub header but
|
|
|
240
312
|
assert.ok(installationGuide < packageContents, "package details should follow installation");
|
|
241
313
|
assert.ok(packageContents < cliReference, "the complete CLI reference should be the final main section");
|
|
242
314
|
});
|
|
315
|
+
|
|
316
|
+
test("site preview builds first and the artifact exposes only public documentation", async () => {
|
|
317
|
+
const projectRoot = join(import.meta.dirname, "..");
|
|
318
|
+
const metadata = JSON.parse(await readFile(join(projectRoot, "package.json"), "utf8"));
|
|
319
|
+
assert.match(metadata.scripts["site:preview"], /^npm run build && /);
|
|
320
|
+
execFileSync(process.execPath, ["scripts/build-site.mjs"], { cwd: projectRoot, stdio: "pipe" });
|
|
321
|
+
const builtDocs = (await readdir(join(projectRoot, "build", "site", "docs"))).sort();
|
|
322
|
+
assert.deepEqual(builtDocs, [
|
|
323
|
+
"ARCHITECTURE.md",
|
|
324
|
+
"CONTENT_MAINTENANCE.md",
|
|
325
|
+
"GITHUB_AND_NPM_SETUP.md",
|
|
326
|
+
"PURPOSE.md",
|
|
327
|
+
"RELEASE_PROCESS.md",
|
|
328
|
+
"SECURITY_MODEL.md"
|
|
329
|
+
]);
|
|
330
|
+
await assert.rejects(access(join(projectRoot, "build", "site", "docs", "README.md")));
|
|
331
|
+
});
|