@ghostbyte/agent-docs-kit 4.0.2 → 4.0.3
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/README.md +1 -0
- package/package.json +1 -1
- package/src/api/index.mjs +1 -0
- package/src/cli/help.mjs +27 -12
- package/src/cli/main.mjs +4 -1
- package/src/commands/website.mjs +26 -0
package/README.md
CHANGED
|
@@ -32,6 +32,7 @@ npx @ghostbyte/agent-docs-kit@latest list security
|
|
|
32
32
|
npx @ghostbyte/agent-docs-kit@latest audit security api-layer --style learning
|
|
33
33
|
npx @ghostbyte/agent-docs-kit@latest review engineering testing-types
|
|
34
34
|
npx @ghostbyte/agent-docs-kit@latest skill install --target project
|
|
35
|
+
npx @ghostbyte/agent-docs-kit@latest website
|
|
35
36
|
```
|
|
36
37
|
|
|
37
38
|
Installing the package performs no setup and changes no project files. Mutation happens only after an explicit command:
|
package/package.json
CHANGED
package/src/api/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { setupProject } from "../commands/setup.mjs";
|
|
2
2
|
export { auditDocumentation, auditSecurity, reviewEngineering } from "../commands/audit.mjs";
|
|
3
3
|
export { installSkill } from "../commands/skill.mjs";
|
|
4
|
+
export { openWebsite, websiteUrl } from "../commands/website.mjs";
|
|
4
5
|
export { loadCatalog } from "../core/catalog.mjs";
|
package/src/cli/help.mjs
CHANGED
|
@@ -1,17 +1,32 @@
|
|
|
1
1
|
export const helpText = `Agent Docs & Quality Kit
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
agent-docs
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
agent-docs
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
Run without installing:
|
|
4
|
+
npx @ghostbyte/agent-docs-kit@latest [command] [options]
|
|
5
|
+
|
|
6
|
+
After installing in a project:
|
|
7
|
+
npx agent-docs [command] [options]
|
|
8
|
+
|
|
9
|
+
Commands:
|
|
10
|
+
(no command) Open the guided menu (TTY only)
|
|
11
|
+
setup [--dry-run] Install the documentation workspace
|
|
12
|
+
audit documentation Check documentation health
|
|
13
|
+
audit security [phase] Create an evidence-based security worksheet
|
|
14
|
+
review engineering [topic] Create an engineering review worksheet
|
|
15
|
+
list [security|engineering] List available phases or topics
|
|
16
|
+
skill install [--target project|codex] [--dry-run]
|
|
17
|
+
Install the unified quality skill
|
|
18
|
+
validate Validate the package catalog and skill
|
|
19
|
+
doctor Check local prerequisites
|
|
20
|
+
website Open the documentation website
|
|
21
|
+
--version Show the package version
|
|
22
|
+
|
|
23
|
+
Examples:
|
|
24
|
+
npx @ghostbyte/agent-docs-kit@latest setup --dry-run
|
|
25
|
+
npx @ghostbyte/agent-docs-kit@latest audit documentation
|
|
26
|
+
npx @ghostbyte/agent-docs-kit@latest audit security api-layer
|
|
27
|
+
npx @ghostbyte/agent-docs-kit@latest review engineering testing-types
|
|
28
|
+
npx @ghostbyte/agent-docs-kit@latest skill install --target project
|
|
29
|
+
npx @ghostbyte/agent-docs-kit@latest website
|
|
15
30
|
|
|
16
31
|
Options:
|
|
17
32
|
--cwd <path> Target project (default: current directory)
|
package/src/cli/main.mjs
CHANGED
|
@@ -8,13 +8,14 @@ import { listCatalog } from "../commands/list.mjs";
|
|
|
8
8
|
import { installSkill } from "../commands/skill.mjs";
|
|
9
9
|
import { doctor } from "../commands/doctor.mjs";
|
|
10
10
|
import { validatePackage } from "../commands/validate.mjs";
|
|
11
|
+
import { openWebsite } from "../commands/website.mjs";
|
|
11
12
|
import { readFile } from "node:fs/promises";
|
|
12
13
|
import { resolveFromPackage } from "../core/paths.mjs";
|
|
13
14
|
|
|
14
15
|
async function menu() {
|
|
15
16
|
const ui = createInterface({ input: stdin, output: stdout });
|
|
16
17
|
try {
|
|
17
|
-
console.log(`\nAgent Docs & Quality Kit\n\n1. Set up documentation\n2. Audit documentation\n3. Start security audit\n4. Start engineering review\n5. Install project skill\n6. Validate package\n0. Exit`);
|
|
18
|
+
console.log(`\nAgent Docs & Quality Kit\n\n1. Set up documentation\n2. Audit documentation\n3. Start security audit\n4. Start engineering review\n5. Install project skill\n6. Validate package\n7. Open documentation website\n0. Exit`);
|
|
18
19
|
const choice = await ui.question("\nChoose an action: ");
|
|
19
20
|
if (choice === "1") return setupProject();
|
|
20
21
|
if (choice === "2") return auditDocumentation();
|
|
@@ -28,6 +29,7 @@ async function menu() {
|
|
|
28
29
|
}
|
|
29
30
|
if (choice === "5") return installSkill("project");
|
|
30
31
|
if (choice === "6") return validatePackage();
|
|
32
|
+
if (choice === "7") return openWebsite();
|
|
31
33
|
if (choice !== "0") throw new Error("Unknown menu choice.");
|
|
32
34
|
} finally {
|
|
33
35
|
ui.close();
|
|
@@ -57,6 +59,7 @@ export async function main(argv) {
|
|
|
57
59
|
if (command === "list") return listCatalog(subject);
|
|
58
60
|
if (command === "skill" && subject === "install") return installSkill(flags.target ?? "project", options);
|
|
59
61
|
if (command === "validate") return validatePackage();
|
|
62
|
+
if (command === "website") return openWebsite();
|
|
60
63
|
if (command === "doctor") {
|
|
61
64
|
if (!doctor()) process.exitCode = 1;
|
|
62
65
|
return;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
|
|
3
|
+
export const websiteUrl = "https://ghostbyte1014.github.io/Agent_Docs_Kit/";
|
|
4
|
+
|
|
5
|
+
export function browserCommand(platform = process.platform) {
|
|
6
|
+
if (platform === "win32") {
|
|
7
|
+
return { executable: "cmd.exe", arguments: ["/d", "/s", "/c", `start "" "${websiteUrl}"`] };
|
|
8
|
+
}
|
|
9
|
+
if (platform === "darwin") return { executable: "open", arguments: [websiteUrl] };
|
|
10
|
+
return { executable: "xdg-open", arguments: [websiteUrl] };
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function openWebsite({ platform = process.platform, spawnProcess = spawn } = {}) {
|
|
14
|
+
const command = browserCommand(platform);
|
|
15
|
+
const child = spawnProcess(command.executable, command.arguments, {
|
|
16
|
+
detached: true,
|
|
17
|
+
stdio: "ignore",
|
|
18
|
+
windowsHide: true
|
|
19
|
+
});
|
|
20
|
+
child.once("error", () => {
|
|
21
|
+
console.error(`Could not open a browser. Visit: ${websiteUrl}`);
|
|
22
|
+
});
|
|
23
|
+
child.unref();
|
|
24
|
+
console.log(`Opening documentation: ${websiteUrl}`);
|
|
25
|
+
return websiteUrl;
|
|
26
|
+
}
|