argsbarg 7.0.5 → 7.0.7
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 +22 -1
- package/README.md +3 -3
- package/docs/README.md +1 -1
- package/docs/ai-skills.md +14 -59
- package/docs/bundled-docs.md +11 -15
- package/docs/cli-program.md +11 -12
- package/docs/configure.md +9 -11
- package/docs/output-schema.md +0 -1
- package/examples/full-example/AGENTS.md +3 -1
- package/examples/full-example/docs/README.md +1 -1
- package/examples/full-example/docs/http.md +1 -1
- package/examples/full-example/docs/mcp.md +1 -1
- package/examples/full-example/docs/openapi.json +1 -6
- package/examples/full-example/justfile +0 -1
- package/examples/full-example/{docs/skill.md → skills/full-example/SKILL.md} +10 -8
- package/examples/full-example/src/program.ts +0 -1
- package/examples/full-example-json/AGENTS.md +3 -1
- package/examples/full-example-json/docs/README.md +1 -1
- package/examples/full-example-json/docs/http.md +1 -1
- package/examples/full-example-json/docs/mcp.md +5 -5
- package/examples/full-example-json/docs/openapi.json +1 -6
- package/examples/full-example-json/justfile +0 -1
- package/examples/full-example-json/{docs/skill.md → skills/full-example-json/SKILL.md} +15 -13
- package/examples/full-example-json/src/program.ts +0 -1
- package/index.d.ts +5 -3
- package/package.json +1 -1
- package/src/builtins/builtins.test.ts +1 -22
- package/src/builtins/configure-copy.ts +4 -11
- package/src/builtins/presentation.ts +2 -5
- package/src/cli-tool/create.test.ts +1 -0
- package/src/cli-tool/create.ts +5 -1
- package/src/configure/artifacts/status.test.ts +5 -5
- package/src/configure/artifacts/target-effective.ts +1 -2
- package/src/configure/artifacts/target-skill.ts +9 -15
- package/src/configure/artifacts/targets/skill.ts +8 -1
- package/src/configure/artifacts/targets.test.ts +5 -5
- package/src/configure/configure.test.ts +4 -4
- package/src/core/parse.test.ts +1 -93
- package/src/core/types.ts +5 -3
- package/src/core/validate.ts +4 -2
- package/src/docs/builtin.ts +5 -3
- package/src/docs/cli-guide.ts +3 -3
- package/src/docs/docs.test.ts +3 -45
- package/src/docs/resolve.ts +5 -5
- package/src/docs/save.ts +52 -15
- package/src/help.test.ts +6 -7
- package/src/skill/generate.ts +32 -154
- package/src/skill/hint.ts +6 -32
- package/src/skill/install.ts +10 -31
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: full-example-json
|
|
3
3
|
name: full-example-json
|
|
4
|
-
description: Operates the full-example-json CLI (echo, render-json, status, workspaces
|
|
4
|
+
description: Operates the full-example-json CLI (echo, render-json, status, workspaces :id delete, workspaces :id get, and 4 more). Use when the user mentions full-example-json, echo, render-json, status, or related tasks.
|
|
5
5
|
enabled: true
|
|
6
6
|
---
|
|
7
|
-
<!-- Generated by full-example-json docs skill --save; do not edit. -->
|
|
8
|
-
|
|
9
7
|
|
|
10
8
|
# full-example-json
|
|
11
9
|
|
|
@@ -19,25 +17,29 @@ Invoke via shell:
|
|
|
19
17
|
full-example-json <subcommand> [options] [args]
|
|
20
18
|
```
|
|
21
19
|
|
|
20
|
+
## Options & Help Discovery
|
|
21
|
+
|
|
22
|
+
- Run `full-example-json <subcommand> --help` to inspect flags, choices, and positional arguments before running unfamiliar subcommands.
|
|
23
|
+
- Run `full-example-json --help` at the root for top-level options and command routing.
|
|
24
|
+
|
|
22
25
|
## Commands
|
|
23
26
|
|
|
24
27
|
- **`full-example-json echo`** — Echo a message (MCP-friendly leaf).
|
|
25
28
|
- **`full-example-json render-json`** — Echo a JSON message (schema-first JSON leaf demo).
|
|
26
|
-
- **`full-example-json status`** — Show app version.
|
|
27
|
-
- **`full-example-json workspaces
|
|
28
|
-
- **`full-example-json workspaces post`** — Create a workspace.
|
|
29
|
+
- **`full-example-json status`** — Show app version.
|
|
30
|
+
- **`full-example-json workspaces :id delete`** — Delete a workspace.
|
|
29
31
|
- **`full-example-json workspaces :id get`** — Get one workspace.
|
|
30
|
-
- **`full-example-json workspaces :id put`** — Replace a workspace.
|
|
31
32
|
- **`full-example-json workspaces :id patch`** — Patch a workspace name.
|
|
32
|
-
- **`full-example-json workspaces :id
|
|
33
|
+
- **`full-example-json workspaces :id put`** — Replace a workspace.
|
|
34
|
+
- **`full-example-json workspaces get`** — List workspaces.
|
|
35
|
+
- **`full-example-json workspaces post`** — Create a workspace.
|
|
33
36
|
|
|
34
|
-
## Pitfalls
|
|
37
|
+
## Workflow & Pitfalls
|
|
35
38
|
|
|
39
|
+
- Always run `full-example-json <subcommand> --help` instead of guessing options or reading large doc files.
|
|
36
40
|
- Pass `--` before arguments that look like flags.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
For full detail, open `reference.md` in this skill directory (same as `full-example-json docs cli`).
|
|
41
|
+
- Pass `--yes` for non-interactive execution when confirmation is required.
|
|
42
|
+
- Pass `--json` when machine-readable structured output is supported.
|
|
41
43
|
|
|
42
44
|
## Install location
|
|
43
45
|
|
package/index.d.ts
CHANGED
|
@@ -533,9 +533,11 @@ export interface CliCompletionConfig {
|
|
|
533
533
|
/** When `false`, hide/disable `completion` (default: enabled). */
|
|
534
534
|
enabled?: boolean;
|
|
535
535
|
}
|
|
536
|
-
/**
|
|
536
|
+
/**
|
|
537
|
+
* @deprecated Skill generation was removed; skills are authored directly in repositories under `skills/<app>/SKILL.md`.
|
|
538
|
+
*/
|
|
537
539
|
export interface CliSkillConfig {
|
|
538
|
-
/**
|
|
540
|
+
/** @deprecated Skill generation was removed; this property has no effect. */
|
|
539
541
|
enabled?: boolean;
|
|
540
542
|
}
|
|
541
543
|
/** Context for {@link CliConfigureConfig} lifecycle hooks. */
|
|
@@ -807,7 +809,7 @@ export type CliProgram = CliNode & {
|
|
|
807
809
|
mcpServer?: CliMcpServerConfig;
|
|
808
810
|
/** Optional readiness probe for HTTP/MCP `GET /health/readiness` only. */
|
|
809
811
|
readiness?: (ctx: ReadinessContext) => boolean | Promise<boolean>;
|
|
810
|
-
/**
|
|
812
|
+
/** @deprecated Skill generation was removed; skills are authored directly in repositories under `skills/<app>/SKILL.md`. */
|
|
811
813
|
skill?: CliSkillConfig;
|
|
812
814
|
/** Program version (printed by the `version` built-in and MCP serverInfo). */
|
|
813
815
|
version: string;
|
package/package.json
CHANGED
|
@@ -5,7 +5,6 @@ Tests for builtins/builtins module behavior.
|
|
|
5
5
|
import { describe, expect, test } from "bun:test";
|
|
6
6
|
import { ParseKind, parse, postParseValidate } from "../core/parse.ts";
|
|
7
7
|
import type { CliProgram } from "../core/types.ts";
|
|
8
|
-
import { cliBuiltinDocsGroup } from "../docs/builtin.ts";
|
|
9
8
|
import { resolveCapabilities } from "../runtime/capabilities.ts";
|
|
10
9
|
import { completionBashScript, completionFishScript, completionZshScript } from ".";
|
|
11
10
|
import { cliBuiltinConfigureCommand } from "./configure.ts";
|
|
@@ -41,7 +40,6 @@ const noMcp: CliProgram = {
|
|
|
41
40
|
describe("builtins help copy", () => {
|
|
42
41
|
test("configure command includes capability-aware description", () => {
|
|
43
42
|
const configure = cliBuiltinConfigureCommand(fixture);
|
|
44
|
-
expect(configure.description).toContain("agent skills");
|
|
45
43
|
expect(configure.description).toContain("MCP config");
|
|
46
44
|
expect(configure.notes).toContain("brew upgrade");
|
|
47
45
|
const commandKeys = configure.commands.map((c) => c.key);
|
|
@@ -55,7 +53,7 @@ describe("builtins help copy", () => {
|
|
|
55
53
|
|
|
56
54
|
test("configure copy omits MCP when mcpServer unset", () => {
|
|
57
55
|
const caps = resolveCapabilities(noMcp);
|
|
58
|
-
expect(configureCommandDescription(noMcp, caps)).toBe("Set up agent
|
|
56
|
+
expect(configureCommandDescription(noMcp, caps)).toBe("Set up agent artifacts for this app (binary via Homebrew).");
|
|
59
57
|
expect(configureCommandDescription(noMcp, caps)).not.toContain("MCP");
|
|
60
58
|
const configure = cliBuiltinConfigureCommand(noMcp);
|
|
61
59
|
expect(configure.description).not.toContain("MCP");
|
|
@@ -172,22 +170,3 @@ describe("schema export builtins", () => {
|
|
|
172
170
|
expect(builtins.map((b) => b.key)).not.toContain("completion");
|
|
173
171
|
});
|
|
174
172
|
});
|
|
175
|
-
|
|
176
|
-
/** Tests for docs skill topic copy. */
|
|
177
|
-
describe("docs skill topic copy", () => {
|
|
178
|
-
test("mentions configure when configure is enabled", () => {
|
|
179
|
-
const withDocs: CliProgram = {
|
|
180
|
-
...noMcp,
|
|
181
|
-
docs: { topics: { readme: { text: "# r\n" } } },
|
|
182
|
-
};
|
|
183
|
-
const skill = cliBuiltinDocsGroup(withDocs).commands.find((c) => c.key === "skill");
|
|
184
|
-
expect(skill?.description).toContain("configure");
|
|
185
|
-
|
|
186
|
-
const configureOff: CliProgram = {
|
|
187
|
-
...withDocs,
|
|
188
|
-
configure: { enabled: false },
|
|
189
|
-
};
|
|
190
|
-
const skillOff = cliBuiltinDocsGroup(configureOff).commands.find((c) => c.key === "skill");
|
|
191
|
-
expect(skillOff?.description).not.toContain("configure");
|
|
192
|
-
});
|
|
193
|
-
});
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
This module provides capability-aware labels for the configure built-in and docs copy.
|
|
3
|
+
*/
|
|
2
4
|
|
|
3
5
|
import type { CliProgram } from "../core/types.ts";
|
|
4
6
|
import type { CliCapabilities } from "../runtime/capabilities.ts";
|
|
5
7
|
|
|
6
|
-
type Kind = "
|
|
8
|
+
type Kind = "mcp" | "config";
|
|
7
9
|
|
|
8
10
|
const LABEL: Record<Kind, { prose: string; short: string }> = {
|
|
9
|
-
skills: { prose: "agent skills", short: "skills" },
|
|
10
11
|
mcp: { prose: "MCP config", short: "MCP" },
|
|
11
12
|
config: { prose: "app config", short: "config" },
|
|
12
13
|
};
|
|
13
14
|
|
|
14
15
|
function enabledKinds(program: CliProgram, caps: CliCapabilities): Kind[] {
|
|
15
16
|
const kinds: Kind[] = [];
|
|
16
|
-
if (program.skill?.enabled) kinds.push("skills");
|
|
17
17
|
if (caps.mcp && program.mcpServer?.enabled) kinds.push("mcp");
|
|
18
18
|
if (program.appConfig && Object.keys(program.appConfig.entries).length > 0) kinds.push("config");
|
|
19
19
|
return kinds;
|
|
@@ -39,13 +39,6 @@ export function configureCommandDescription(program: CliProgram, caps: CliCapabi
|
|
|
39
39
|
return `Set up ${prose(program, caps)} for this app (binary via Homebrew).`;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export function docsSkillTopicDescription(_program: CliProgram, caps: CliCapabilities): string {
|
|
43
|
-
if (caps.configure) {
|
|
44
|
-
return "Print a reference agent SKILL; run `configure install` to install an optimized copy.";
|
|
45
|
-
}
|
|
46
|
-
return "Print a reference agent SKILL for AI agents.";
|
|
47
|
-
}
|
|
48
|
-
|
|
49
42
|
export function configureCommandNotes(program: CliProgram, _caps: CliCapabilities): string {
|
|
50
43
|
const app = program.key;
|
|
51
44
|
const lines = [
|
|
@@ -77,15 +77,12 @@ export function cliPresentationRoot(program: CliProgram): CliRouter {
|
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
/** Root help notes
|
|
81
|
-
export function presentationRootNotes(program: CliProgram,
|
|
80
|
+
/** Root help notes from consumer `program.notes`. */
|
|
81
|
+
export function presentationRootNotes(program: CliProgram, _caps: CliCapabilities): string | undefined {
|
|
82
82
|
const parts: string[] = [];
|
|
83
83
|
if ((program.notes ?? "").trim().length > 0) {
|
|
84
84
|
parts.push((program.notes ?? "").trim());
|
|
85
85
|
}
|
|
86
|
-
if (caps.docs) {
|
|
87
|
-
parts.push(`For AI agents: \`${program.key} docs skill\`.`);
|
|
88
|
-
}
|
|
89
86
|
if (parts.length === 0) {
|
|
90
87
|
return undefined;
|
|
91
88
|
}
|
|
@@ -83,6 +83,7 @@ describe("argsbarg create", () => {
|
|
|
83
83
|
const tree = renderCreateTree(baseOpts({ key: "testapp" }));
|
|
84
84
|
expect(tree.has("justfile")).toBe(true);
|
|
85
85
|
expect(tree.has("scripts/create-identity.ts")).toBe(true);
|
|
86
|
+
expect(tree.has("skills/testapp/SKILL.md")).toBe(true);
|
|
86
87
|
const identity = tree.get("scripts/create-identity.ts");
|
|
87
88
|
expect(identity).toContain('key: "testapp"');
|
|
88
89
|
expect(identity).toContain('template: "cli"');
|
package/src/cli-tool/create.ts
CHANGED
|
@@ -330,6 +330,7 @@ function listTemplateFiles(templateId: CreateTemplateId): string[] {
|
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
export function renderCreateTree(opts: CreateOptions): Map<string, string> {
|
|
333
|
+
const tmpl = templateIdentity(opts.templateId);
|
|
333
334
|
const files = new Map<string, string>();
|
|
334
335
|
for (const rel of listTemplateFiles(opts.templateId)) {
|
|
335
336
|
if (rel === CREATE_IDENTITY_REL) {
|
|
@@ -338,7 +339,10 @@ export function renderCreateTree(opts: CreateOptions): Map<string, string> {
|
|
|
338
339
|
}
|
|
339
340
|
const src = join(templateDirFor(opts.templateId), rel);
|
|
340
341
|
const raw = readFileSync(src, "utf8");
|
|
341
|
-
|
|
342
|
+
const targetRel = rel.startsWith(`skills/${tmpl.key}/`)
|
|
343
|
+
? rel.replace(`skills/${tmpl.key}/`, `skills/${opts.key}/`)
|
|
344
|
+
: rel;
|
|
345
|
+
files.set(targetRel, substituteTemplateContent(raw, opts));
|
|
342
346
|
}
|
|
343
347
|
return files;
|
|
344
348
|
}
|
|
@@ -43,7 +43,7 @@ describe("resolveInstallTargetPreview", () => {
|
|
|
43
43
|
expect(preview.skill).toEqual([]);
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
test("skill app
|
|
46
|
+
test("skill app does not include skill in all scope (skill gen removed)", () => {
|
|
47
47
|
const program: CliProgram = {
|
|
48
48
|
key: "cliapp",
|
|
49
49
|
version: "1",
|
|
@@ -53,8 +53,8 @@ describe("resolveInstallTargetPreview", () => {
|
|
|
53
53
|
};
|
|
54
54
|
const paths = resolveInstallPaths(program);
|
|
55
55
|
const preview = resolveInstallTargetPreview(program, paths);
|
|
56
|
-
expect(preview.all).toEqual([
|
|
57
|
-
expect(preview.skill).toEqual([
|
|
56
|
+
expect(preview.all).toEqual([]);
|
|
57
|
+
expect(preview.skill).toEqual([]);
|
|
58
58
|
expect(preview.mcp).toEqual([]);
|
|
59
59
|
});
|
|
60
60
|
});
|
|
@@ -81,8 +81,8 @@ describe("printInstallStatus json", () => {
|
|
|
81
81
|
const parsed = JSON.parse(chunks.join("")) as {
|
|
82
82
|
effective: { all: string[]; mcp: string[]; skill: string[] };
|
|
83
83
|
};
|
|
84
|
-
expect(parsed.effective.all).toEqual(["
|
|
85
|
-
expect(parsed.effective.skill).toEqual([
|
|
84
|
+
expect(parsed.effective.all).toEqual(["agentsMcp"]);
|
|
85
|
+
expect(parsed.effective.skill).toEqual([]);
|
|
86
86
|
expect(parsed.effective.mcp).toEqual(["agentsMcp"]);
|
|
87
87
|
} finally {
|
|
88
88
|
process.stdout.write = orig;
|
|
@@ -32,8 +32,7 @@ function artifactDefaults(
|
|
|
32
32
|
program?: Pick<CliProgram, "mcpServer" | "skill">,
|
|
33
33
|
): { enabled: boolean; includedInAll: boolean } {
|
|
34
34
|
if (key === "skill") {
|
|
35
|
-
|
|
36
|
-
return { enabled: on, includedInAll: on };
|
|
35
|
+
return { enabled: false, includedInAll: false };
|
|
37
36
|
}
|
|
38
37
|
if (key === "agentsMcp") {
|
|
39
38
|
const on = program?.mcpServer?.enabled === true;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Agent shell skill directory install (~/.agents/skills/<key>/).
|
|
3
|
+
Skill generation is removed; skills are authored directly in repositories under skills/<app>/SKILL.md.
|
|
4
|
+
Uninstall cleans up legacy/stale skill directories if present.
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
import { existsSync } from "node:fs";
|
|
2
8
|
import type { CliProgram } from "../../core/types.ts";
|
|
3
|
-
import { cliSkillInstall } from "../../skill/install.ts";
|
|
4
9
|
import { displayInstallPath, type InstallPaths } from "./paths.ts";
|
|
5
10
|
import { InstallTarget } from "./target-base.ts";
|
|
6
11
|
import type {
|
|
@@ -15,6 +20,7 @@ import type {
|
|
|
15
20
|
} from "./target-types.ts";
|
|
16
21
|
import { uninstallSkillDir } from "./uninstall.ts";
|
|
17
22
|
|
|
23
|
+
/** Specification for an agent skill install target. */
|
|
18
24
|
export interface SkillHostSpec {
|
|
19
25
|
key: CliInstallArtifactKey;
|
|
20
26
|
actionKind: InstallActionKind;
|
|
@@ -71,20 +77,8 @@ export class SkillInstallTarget extends InstallTarget {
|
|
|
71
77
|
return this.spec.skillDir(paths);
|
|
72
78
|
}
|
|
73
79
|
|
|
74
|
-
protected buildInstallActions(
|
|
75
|
-
|
|
76
|
-
const displayDir = `${displayInstallPath(dir)}/`;
|
|
77
|
-
return [
|
|
78
|
-
{
|
|
79
|
-
kind: this.actionKind,
|
|
80
|
-
summary: `${this.spec.label.toLowerCase()}: ${displayDir}`,
|
|
81
|
-
message: `Installing ${this.spec.label.toLowerCase()} to ${displayDir}`,
|
|
82
|
-
run: () => {
|
|
83
|
-
cliSkillInstall(ctx.root, { global: true, rimraf: true, dry: ctx.dry });
|
|
84
|
-
return [];
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
];
|
|
80
|
+
protected buildInstallActions(_ctx: TargetPlanContext): InstallAction[] {
|
|
81
|
+
return [];
|
|
88
82
|
}
|
|
89
83
|
|
|
90
84
|
protected buildUninstallActions(ctx: TargetPlanContext): UninstallAction[] {
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Install target definition for agent skill cleanup and status.
|
|
3
|
+
Skill generation is removed; skills are authored directly in repositories under skills/<app>/SKILL.md.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { existsSync } from "node:fs";
|
|
1
7
|
import { SkillInstallTarget } from "../target-skill.ts";
|
|
2
8
|
|
|
9
|
+
/** Registered install target for agent skill directory cleanup and detection. */
|
|
3
10
|
export const skillTarget = new SkillInstallTarget({
|
|
4
11
|
key: "skill",
|
|
5
12
|
actionKind: "agent-skill",
|
|
@@ -8,5 +15,5 @@ export const skillTarget = new SkillInstallTarget({
|
|
|
8
15
|
skillDir: (p) => p.agentsSkillDir,
|
|
9
16
|
detectedKey: "skill",
|
|
10
17
|
statusField: "skill",
|
|
11
|
-
isAvailable: (
|
|
18
|
+
isAvailable: (_root, p) => existsSync(p.agentsSkillDir),
|
|
12
19
|
});
|
|
@@ -42,10 +42,10 @@ describe("resolveEffectiveInstallTargets", () => {
|
|
|
42
42
|
expect(t.agentsMcp.includedInAll).toBe(false);
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
test("skill
|
|
45
|
+
test("skill disabled even when program.skill is set (skill gen removed)", () => {
|
|
46
46
|
const t = resolveEffectiveInstallTargets(undefined, { skill: { enabled: true } });
|
|
47
|
-
expect(t.skill.enabled).toBe(
|
|
48
|
-
expect(t.skill.includedInAll).toBe(
|
|
47
|
+
expect(t.skill.enabled).toBe(false);
|
|
48
|
+
expect(t.skill.includedInAll).toBe(false);
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
test("agentsMcp in --all when mcpServer enabled", () => {
|
|
@@ -69,7 +69,7 @@ describe("resolveEffectiveInstallTargets", () => {
|
|
|
69
69
|
expect(isArtifactInScope("agentsMcp", scope, effective, "install-scoped", program)).toBe(true);
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
test("scoped --skill
|
|
72
|
+
test("scoped --skill omits skill because skill generation is removed", () => {
|
|
73
73
|
const program: CliProgram = {
|
|
74
74
|
key: "app",
|
|
75
75
|
version: "1",
|
|
@@ -79,6 +79,6 @@ describe("resolveEffectiveInstallTargets", () => {
|
|
|
79
79
|
};
|
|
80
80
|
const effective = resolveEffectiveInstallTargets(program.configure, program);
|
|
81
81
|
const scope = { skill: true };
|
|
82
|
-
expect(isArtifactInScope("skill", scope, effective, "install-scoped", program)).toBe(
|
|
82
|
+
expect(isArtifactInScope("skill", scope, effective, "install-scoped", program)).toBe(false);
|
|
83
83
|
});
|
|
84
84
|
});
|
|
@@ -88,19 +88,19 @@ describe("detect installed", () => {
|
|
|
88
88
|
|
|
89
89
|
/** Tests for install plan. */
|
|
90
90
|
describe("install plan", () => {
|
|
91
|
-
test("buildUpdatePlan greenfield
|
|
91
|
+
test("buildUpdatePlan greenfield omits skill because skill generation is removed", () => {
|
|
92
92
|
const paths = resolveInstallPaths(fixture);
|
|
93
93
|
const plan = buildUpdatePlan(fixture, paths, parseInstallOpts({ reinstall: "1", yes: "1" }));
|
|
94
94
|
expect(plan.length).toBeGreaterThan(0);
|
|
95
|
-
expect(plan.some((a) => a.kind === "agent-skill")).toBe(
|
|
95
|
+
expect(plan.some((a) => a.kind === "agent-skill")).toBe(false);
|
|
96
96
|
expect(plan.some((a) => a.kind === "app")).toBe(false);
|
|
97
97
|
});
|
|
98
98
|
|
|
99
|
-
test("buildInstallPlan --all omits app self-install", () => {
|
|
99
|
+
test("buildInstallPlan --all omits app self-install and skill", () => {
|
|
100
100
|
const paths = resolveInstallPaths(fixture);
|
|
101
101
|
const plan = buildInstallPlan(fixture, paths, parseInstallOpts({ all: "1" }));
|
|
102
102
|
expect(plan.some((a) => a.kind === "app")).toBe(false);
|
|
103
|
-
expect(plan.some((a) => a.kind === "agent-skill")).toBe(
|
|
103
|
+
expect(plan.some((a) => a.kind === "agent-skill")).toBe(false);
|
|
104
104
|
expect(plan.some((a) => a.kind === "agents-mcp")).toBe(true);
|
|
105
105
|
});
|
|
106
106
|
|
package/src/core/parse.test.ts
CHANGED
|
@@ -3,9 +3,6 @@ Domain-specific regression tests (split from index.test.ts).
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { expect, test } from "bun:test";
|
|
6
|
-
import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
7
|
-
import { tmpdir } from "node:os";
|
|
8
|
-
import { join } from "node:path";
|
|
9
6
|
import { $ } from "bun";
|
|
10
7
|
import { completionBashScript, completionZshScript } from "../builtins/index.ts";
|
|
11
8
|
import { cliPresentationRoot } from "../builtins/presentation.ts";
|
|
@@ -13,8 +10,7 @@ import { cliHelpRender } from "../help.ts";
|
|
|
13
10
|
import { Cli, CliFallbackMode, CliOptionKind, type CliProgram } from "../index.ts";
|
|
14
11
|
import { applyShellEnv } from "../mcp/env.ts";
|
|
15
12
|
import { allMcpResources, collectMcpTools, mcpToolCallToArgv, resolveMcpSchemaUri } from "../mcp/tools.ts";
|
|
16
|
-
import { generatePluginSkillBundle
|
|
17
|
-
import { cliSkillInstall } from "../skill/install.ts";
|
|
13
|
+
import { generatePluginSkillBundle } from "../skill/generate.ts";
|
|
18
14
|
import {
|
|
19
15
|
enumMcpFixture,
|
|
20
16
|
nestedDocsFallbackFixture,
|
|
@@ -1352,31 +1348,6 @@ test("configure.prefix is rejected", () => {
|
|
|
1352
1348
|
expect(() => cliValidateProgram(root)).toThrow(/configure\.prefix removed/);
|
|
1353
1349
|
});
|
|
1354
1350
|
|
|
1355
|
-
/** Tests that generateSkillBundle includes frontmatter and compact command index. */
|
|
1356
|
-
test("generateSkillBundle includes frontmatter and compact command index", () => {
|
|
1357
|
-
const bundle = generateSkillBundle(nestedMcpFixture);
|
|
1358
|
-
expect(bundle.dirName).toBe("nested.ts");
|
|
1359
|
-
expect(bundle.skillMd).toMatch(/^---\nid: nested\.ts\nname: nested\.ts\n/);
|
|
1360
|
-
expect(bundle.skillMd).toContain("enabled: true");
|
|
1361
|
-
expect(bundle.skillMd).toContain("dotagentsprotocol.com");
|
|
1362
|
-
expect(bundle.skillMd).toContain("~/.claude/skills/nested.ts");
|
|
1363
|
-
expect(bundle.skillMd).toContain("## Commands");
|
|
1364
|
-
expect(bundle.skillMd).toContain("`nested.ts stat owner lookup <path>`");
|
|
1365
|
-
expect(bundle.skillMd).toContain("Invoke via shell:");
|
|
1366
|
-
expect(bundle.skillMd).toContain("For full detail, open `reference.md`");
|
|
1367
|
-
expect(bundle.skillMd).toContain("~/.agents/skills/nested.ts/");
|
|
1368
|
-
expect(bundle.skillMd).not.toContain("#### Options");
|
|
1369
|
-
expect(bundle.skillMd).not.toContain("CLI API reference");
|
|
1370
|
-
expect(bundle.skillMd).not.toContain("mcp.json");
|
|
1371
|
-
expect(bundle.skillMd).not.toContain("Prefer MCP");
|
|
1372
|
-
expect(bundle.skillMd).not.toContain("tools/call");
|
|
1373
|
-
expect(bundle.skillMd).not.toContain("Generated by");
|
|
1374
|
-
expect(bundle.referenceMd).toContain("CLI API reference");
|
|
1375
|
-
expect(bundle.referenceMd).toContain("#### Options");
|
|
1376
|
-
expect(bundle.referenceMd).not.toContain("Generated by");
|
|
1377
|
-
expect(bundle.referenceMd).not.toContain("```json");
|
|
1378
|
-
});
|
|
1379
|
-
|
|
1380
1351
|
/** Tests that generatePluginSkillBundle is MCP routing stub without shell catalog. */
|
|
1381
1352
|
test("generatePluginSkillBundle is MCP routing stub without shell catalog", () => {
|
|
1382
1353
|
const bundle = generatePluginSkillBundle(nestedMcpFixture);
|
|
@@ -1391,66 +1362,3 @@ test("generatePluginSkillBundle is MCP routing stub without shell catalog", () =
|
|
|
1391
1362
|
expect(bundle.skillMd).not.toContain("`nested.ts stat owner lookup <path>`");
|
|
1392
1363
|
expect(bundle.skillMd).not.toContain("## Commands");
|
|
1393
1364
|
});
|
|
1394
|
-
|
|
1395
|
-
/** CliSkillInstall writes project agent skill files. */
|
|
1396
|
-
test("cliSkillInstall writes project agent skill files", () => {
|
|
1397
|
-
const cwd = mkdtempSync(join(tmpdir(), "argsbarg-skill-"));
|
|
1398
|
-
const prev = process.cwd();
|
|
1399
|
-
process.chdir(cwd);
|
|
1400
|
-
try {
|
|
1401
|
-
const files = cliSkillInstall(nestedMcpFixture, { global: false, rimraf: true });
|
|
1402
|
-
expect(files.some((f) => f.includes(".agents/skills/nested.ts/"))).toBe(true);
|
|
1403
|
-
const skillDir = join(cwd, ".agents", "skills", "nested.ts");
|
|
1404
|
-
expect(existsSync(join(skillDir, "SKILL.md"))).toBe(true);
|
|
1405
|
-
expect(existsSync(join(skillDir, "reference.md"))).toBe(true);
|
|
1406
|
-
expect(readFileSync(join(skillDir, "SKILL.md"), "utf8")).toContain("## Commands");
|
|
1407
|
-
expect(readFileSync(join(skillDir, "reference.md"), "utf8")).toContain("CLI API reference");
|
|
1408
|
-
const skillText = readFileSync(join(skillDir, "SKILL.md"), "utf8");
|
|
1409
|
-
expect(skillText.startsWith("---\n")).toBe(true);
|
|
1410
|
-
const hint = "<!-- Generated by nested.ts configure; do not edit. -->";
|
|
1411
|
-
expect(skillText.indexOf(hint)).toBeGreaterThan(skillText.indexOf("---\n", 4));
|
|
1412
|
-
const refText = readFileSync(join(skillDir, "reference.md"), "utf8");
|
|
1413
|
-
expect(refText.startsWith(hint)).toBe(true);
|
|
1414
|
-
} finally {
|
|
1415
|
-
process.chdir(prev);
|
|
1416
|
-
rmSync(cwd, { recursive: true, force: true });
|
|
1417
|
-
}
|
|
1418
|
-
});
|
|
1419
|
-
|
|
1420
|
-
/** CliSkillInstall global uses TEST_USER_HOME agents skills directory. */
|
|
1421
|
-
test("cliSkillInstall global uses TEST_USER_HOME agents skills directory", () => {
|
|
1422
|
-
const home = mkdtempSync(join(tmpdir(), "argsbarg-home-"));
|
|
1423
|
-
const prevTestHome = process.env.TEST_USER_HOME;
|
|
1424
|
-
process.env.TEST_USER_HOME = home;
|
|
1425
|
-
try {
|
|
1426
|
-
const files = cliSkillInstall(nestedMcpFixture, { global: true, rimraf: true });
|
|
1427
|
-
expect(files.some((f) => f.includes(join(home, ".agents", "skills", "nested.ts")))).toBe(true);
|
|
1428
|
-
expect(existsSync(join(home, ".agents", "skills", "nested.ts", "SKILL.md"))).toBe(true);
|
|
1429
|
-
} finally {
|
|
1430
|
-
if (prevTestHome === undefined) {
|
|
1431
|
-
delete process.env.TEST_USER_HOME;
|
|
1432
|
-
} else {
|
|
1433
|
-
process.env.TEST_USER_HOME = prevTestHome;
|
|
1434
|
-
}
|
|
1435
|
-
rmSync(home, { recursive: true, force: true });
|
|
1436
|
-
}
|
|
1437
|
-
});
|
|
1438
|
-
|
|
1439
|
-
/** CliSkillInstall rimraf overwrites existing directory. */
|
|
1440
|
-
test("cliSkillInstall rimraf overwrites existing directory", () => {
|
|
1441
|
-
const cwd = mkdtempSync(join(tmpdir(), "argsbarg-skill-dup-"));
|
|
1442
|
-
const prev = process.cwd();
|
|
1443
|
-
process.chdir(cwd);
|
|
1444
|
-
try {
|
|
1445
|
-
cliSkillInstall(nestedMcpFixture, { global: false, rimraf: true });
|
|
1446
|
-
writeFileSync(join(cwd, ".agents", "skills", "nested.ts", "SKILL.md"), "stale", "utf8");
|
|
1447
|
-
const files = cliSkillInstall(nestedMcpFixture, { global: false, rimraf: true });
|
|
1448
|
-
expect(files.length).toBeGreaterThan(0);
|
|
1449
|
-
expect(readFileSync(join(cwd, ".agents", "skills", "nested.ts", "SKILL.md"), "utf8")).toContain(
|
|
1450
|
-
"stat owner lookup",
|
|
1451
|
-
);
|
|
1452
|
-
} finally {
|
|
1453
|
-
process.chdir(prev);
|
|
1454
|
-
rmSync(cwd, { recursive: true, force: true });
|
|
1455
|
-
}
|
|
1456
|
-
});
|
package/src/core/types.ts
CHANGED
|
@@ -404,9 +404,11 @@ export interface CliCompletionConfig {
|
|
|
404
404
|
enabled?: boolean;
|
|
405
405
|
}
|
|
406
406
|
|
|
407
|
-
/**
|
|
407
|
+
/**
|
|
408
|
+
* @deprecated Skill generation was removed; skills are authored directly in repositories under `skills/<app>/SKILL.md`.
|
|
409
|
+
*/
|
|
408
410
|
export interface CliSkillConfig {
|
|
409
|
-
/**
|
|
411
|
+
/** @deprecated Skill generation was removed; this property has no effect. */
|
|
410
412
|
enabled?: boolean;
|
|
411
413
|
}
|
|
412
414
|
|
|
@@ -678,7 +680,7 @@ export type CliProgram = CliNode & {
|
|
|
678
680
|
mcpServer?: CliMcpServerConfig;
|
|
679
681
|
/** Optional readiness probe for HTTP/MCP `GET /health/readiness` only. */
|
|
680
682
|
readiness?: (ctx: ReadinessContext) => boolean | Promise<boolean>;
|
|
681
|
-
/**
|
|
683
|
+
/** @deprecated Skill generation was removed; skills are authored directly in repositories under `skills/<app>/SKILL.md`. */
|
|
682
684
|
skill?: CliSkillConfig;
|
|
683
685
|
/** Program version (printed by the `version` built-in and MCP serverInfo). */
|
|
684
686
|
version: string;
|
package/src/core/validate.ts
CHANGED
|
@@ -105,7 +105,9 @@ function validateConfigureConfig(program: CliProgram): void {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
if ("agentIntegration" in configure) {
|
|
108
|
-
throw new CliSchemaValidationError(
|
|
108
|
+
throw new CliSchemaValidationError(
|
|
109
|
+
"configure.agentIntegration removed; skills are authored under skills/<app>/SKILL.md",
|
|
110
|
+
);
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
if (!configure.targets) return;
|
|
@@ -119,7 +121,7 @@ function validateConfigureConfig(program: CliProgram): void {
|
|
|
119
121
|
for (const key of legacySkillKeys) {
|
|
120
122
|
if (key in targets) {
|
|
121
123
|
throw new CliSchemaValidationError(
|
|
122
|
-
`configure.targets.${key} removed;
|
|
124
|
+
`configure.targets.${key} removed; skills are authored under skills/<app>/SKILL.md`,
|
|
123
125
|
);
|
|
124
126
|
}
|
|
125
127
|
}
|
package/src/docs/builtin.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
This module builds the built-in `docs` command group router.
|
|
3
|
+
It registers bundled documentation topics (CLI guide, schema, MCP, HTTP) as subcommands.
|
|
4
|
+
*/
|
|
5
|
+
|
|
2
6
|
import { type CliLeaf, type CliOption, CliOptionKind, type CliProgram, type CliRouter } from "../core/types.ts";
|
|
3
|
-
import { resolveCapabilities } from "../runtime/capabilities.ts";
|
|
4
7
|
import {
|
|
5
8
|
DOCS_ROUTER_DESCRIPTION,
|
|
6
9
|
docsEnabled,
|
|
@@ -74,7 +77,6 @@ export function cliBuiltinDocsGroup(program: CliProgram): CliRouter {
|
|
|
74
77
|
leaves.push(
|
|
75
78
|
docsLeaf(program, "cli-schema", "Print the full CLI command tree as JSON."),
|
|
76
79
|
docsLeaf(program, "cli", "Print the full command reference as markdown."),
|
|
77
|
-
docsLeaf(program, "skill", docsSkillTopicDescription(program, resolveCapabilities(program))),
|
|
78
80
|
);
|
|
79
81
|
|
|
80
82
|
return {
|
package/src/docs/cli-guide.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { cliPositionalLabel, cliResolveNotes } from "../help.ts";
|
|
|
6
6
|
|
|
7
7
|
/** Options for {@link generateCliGuideBody} and {@link generateCliGuide}. */
|
|
8
8
|
export interface CliGuideBodyOptions {
|
|
9
|
-
/** Omit embedded outputSchema JSON; point to `docs cli-schema` instead
|
|
9
|
+
/** Omit embedded outputSchema JSON; point to `docs cli-schema` instead. */
|
|
10
10
|
compact?: boolean;
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -72,7 +72,7 @@ function formatNotesBlockquote(notes: string, appKey: string): string {
|
|
|
72
72
|
.join("\n");
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
/** Markdown section for leaf outputSchema (docs cli
|
|
75
|
+
/** Markdown section for leaf outputSchema (docs cli). */
|
|
76
76
|
function formatOutputSchemaSection(schema: Record<string, unknown>): string[] {
|
|
77
77
|
return [
|
|
78
78
|
"#### Output",
|
|
@@ -173,7 +173,7 @@ function renderCommandNode(
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
/** Command-tree markdown
|
|
176
|
+
/** Command-tree markdown for `docs cli` (no API doc header). */
|
|
177
177
|
export function generateCliGuideBody(program: CliProgram, opts: CliGuideBodyOptions = {}): string {
|
|
178
178
|
const schema = cliSchemaExport(program);
|
|
179
179
|
const lines: string[] = [];
|