argsbarg 7.0.6 → 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 +13 -1
- package/README.md +3 -3
- package/docs/README.md +1 -1
- package/docs/ai-skills.md +14 -62
- package/docs/bundled-docs.md +9 -13
- package/docs/cli-program.md +10 -11
- package/docs/configure.md +9 -11
- package/docs/output-schema.md +0 -1
- package/examples/full-example/AGENTS.md +3 -3
- package/examples/full-example/docs/README.md +1 -1
- package/examples/full-example/justfile +0 -1
- package/examples/full-example/skills/full-example/SKILL.md +0 -2
- package/examples/full-example/src/program.ts +0 -1
- package/examples/full-example-json/AGENTS.md +3 -3
- package/examples/full-example-json/docs/README.md +1 -1
- package/examples/full-example-json/justfile +0 -1
- package/examples/full-example-json/skills/full-example-json/SKILL.md +0 -2
- 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/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 -112
- 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 -47
- package/src/docs/resolve.ts +5 -5
- package/src/docs/save.ts +9 -20
- package/src/help.test.ts +6 -7
- package/src/skill/generate.ts +30 -156
- package/src/skill/hint.ts +2 -15
- package/src/skill/install.ts +3 -35
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [7.0.7] - 2026-09-15
|
|
11
|
+
|
|
12
|
+
### Removed
|
|
13
|
+
|
|
14
|
+
- **Removed all skill generation features** — completely removed the `docs skill` (and `docs skill --save`) built-in subcommands from the CLI runtime. Skill files are no longer generated from code or schemas. Skills are purely authored starter templates located at `skills/<app>/SKILL.md` (conforming to the open https://dotagentsprotocol.com standard), included with examples and scaffolded via `argsbarg create`. Removed skill bundle generation from `configure install` (uninstall continues to clean up legacy `~/.agents/skills/<key>/` directories). Deprecated `program.skill`.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- **Consumer AGENTS.md scoped to app authors** — adjusted instructions in `AGENTS.md` copy templates and consumer checkouts. Removed consumer-facing discovery instructions (`--help` discovery belongs in `SKILL.md` for end-user agents) and added guidance for authoring agents to maintain `skills/<key>/SKILL.md` when adding or modifying commands.
|
|
19
|
+
- **Omit skill from consumer docgen** — in consumer copy templates, `just docgen` omits skill generation so author customizations in `skills/<app>/SKILL.md` are not overwritten. Skills are included with examples and scaffolded via `argsbarg create`.
|
|
20
|
+
|
|
10
21
|
## [7.0.6] - 2026-09-15
|
|
11
22
|
|
|
12
23
|
### Changed
|
|
@@ -973,7 +984,8 @@ const cli = { ... } satisfies CliProgram; // or : CliProgram
|
|
|
973
984
|
- Migrate schemas: rename every `children` property to **`commands`**; move positional definitions to **`CliPositional`** objects on `positionals` and strip `positional` / `argMin` / `argMax` from flag definitions under `options` (flags only carry `name`, `description`, `kind`, and optional `shortName`).
|
|
974
985
|
- Imports: use `CliPositional` where needed; replace `CliOptionDef` with `CliOption` or `CliPositional` as appropriate.
|
|
975
986
|
|
|
976
|
-
[Unreleased]: https://github.com/bdombro/bun-argsbarg/compare/v7.0.
|
|
987
|
+
[Unreleased]: https://github.com/bdombro/bun-argsbarg/compare/v7.0.7...HEAD
|
|
988
|
+
[7.0.7]: https://github.com/bdombro/bun-argsbarg/releases/tag/v7.0.7
|
|
977
989
|
[7.0.6]: https://github.com/bdombro/bun-argsbarg/releases/tag/v7.0.6
|
|
978
990
|
[7.0.5]: https://github.com/bdombro/bun-argsbarg/releases/tag/v7.0.5
|
|
979
991
|
[7.0.4]: https://github.com/bdombro/bun-argsbarg/releases/tag/v7.0.4
|
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Why ArgsBarg?
|
|
|
11
11
|
|
|
12
12
|
*Schema-first & Auto-validated* — Define your entire command structure, options, description, and inputs once. ArgsBarg compiles this into type-safe option accessors, command-line routing, and validation schemas, keeping your code and interfaces perfectly aligned.
|
|
13
13
|
|
|
14
|
-
*Automated Schemagen & Docgen* — Maintain single-source truth by decorating standard TypeScript types (`/** @sg */ interface...`) to automatically compile them into runtime validation schemas (`argsbarg schemagen`). Easily export standard-compliant API documentation, full CLI reference markdown, OpenAPI 3.1 definitions
|
|
14
|
+
*Automated Schemagen & Docgen* — Maintain single-source truth by decorating standard TypeScript types (`/** @sg */ interface...`) to automatically compile them into runtime validation schemas (`argsbarg schemagen`). Easily export standard-compliant API documentation, full CLI reference markdown, and OpenAPI 3.1 definitions directly from your code (`docs --save` command) using introspection.
|
|
15
15
|
|
|
16
16
|
*Production REST Server* — Instantly expose your commands as HTTP REST endpoints (`POST /v1/some-command`) with built-in Kubernetes-compliant `/health/liveness` and `/health/readiness` probes, ECS structured JSON logging to `stderr`, and auto-generated OpenAPI 3.1 specs with an interactive Swagger UI.
|
|
17
17
|
|
|
@@ -383,9 +383,9 @@ bun scripts/merge-agents-md.ts .
|
|
|
383
383
|
|
|
384
384
|
This refreshes the argsbarg-managed section in `AGENTS.md` while preserving your app-specific prefix and `**<app> conventions:**` footer. See **Agent instructions** in [docs/cli-program.md](docs/cli-program.md).
|
|
385
385
|
|
|
386
|
-
### 3.
|
|
386
|
+
### 3. Agent Skills & Workspace Configuration
|
|
387
387
|
|
|
388
|
-
|
|
388
|
+
ArgsBarg CLIs adopt the open repository skill convention (`skills/<app>/SKILL.md`) per the standard at https://dotagentsprotocol.com/. Scaffolding via `argsbarg create` copies an initial `SKILL.md` template directing agents to run `<subcommand> --help` for just-in-time option discovery. Running `myapp configure install` registers your MCP server in `~/.agents/mcp.json` and bootstraps app configuration.
|
|
389
389
|
|
|
390
390
|
See **[docs/configure.md](docs/configure.md)** and **[docs/ai-skills.md](docs/ai-skills.md)** for developer setup and automated Homebrew pipeline integration.
|
|
391
391
|
|
package/docs/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Start here to pick the right guide.
|
|
|
15
15
|
| **Shipping configure / agent artifacts** | [configure.md](configure.md) — Homebrew + `myapp configure install` |
|
|
16
16
|
| **Homebrew tap-from-repo distribution** | [distribution-homebrew.md](distribution-homebrew.md) — formula pattern, `argsbarg create` |
|
|
17
17
|
| **Bundling `myapp docs` topics** | [bundled-docs.md](bundled-docs.md) — consumer docgen vs framework docs |
|
|
18
|
-
| **Agent skills** | [ai-skills.md](ai-skills.md) —
|
|
18
|
+
| **Agent skills** | [ai-skills.md](ai-skills.md) — repository skills (`skills/<app>/SKILL.md`) |
|
|
19
19
|
| **Maintaining the argsbarg repo** | [developing.md](developing.md) — release, consumers, npm `files` |
|
|
20
20
|
| **IDE agents in a consumer app** | `bunx argsbarg create` (includes `AGENTS.md`) or `bun scripts/merge-agents-md.ts .` from argsbarg checkout |
|
|
21
21
|
| **Runnable examples** (shipped in npm) | [examples/](examples/) — see table below |
|
package/docs/ai-skills.md
CHANGED
|
@@ -1,78 +1,30 @@
|
|
|
1
1
|
# Agent skills
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
ArgsBarg CLIs adopt the open repository skill convention (`skills/<app>/SKILL.md`) per the standard at https://dotagentsprotocol.com/.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Enable on the program root
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
export const program = {
|
|
11
|
-
key: "myapp",
|
|
12
|
-
skill: { enabled: true },
|
|
13
|
-
...
|
|
14
|
-
} satisfies CliProgram;
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
When `skill.enabled` is `true`, run `configure install` after `brew install` or `brew upgrade` to install and refresh the skill. When omitted or `enabled` is not `true`, no skill is installed.
|
|
18
|
-
|
|
19
|
-
The skill directory name is the program `key` with `/`, `\`, and spaces replaced by `_` (e.g. `sqsp-qa`, `full-example`).
|
|
20
|
-
|
|
21
|
-
## Install via `configure install`
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
myapp configure install
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Skills are installed via `configure install` and removed via `configure uninstall` (run `just install-local` / `just uninstall` in dev).
|
|
28
|
-
|
|
29
|
-
## Programmatic install
|
|
30
|
-
|
|
31
|
-
```typescript
|
|
32
|
-
import { cliSkillInstall } from "argsbarg/skill/install"; // internal module
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
`cliSkillInstall(root, { global: true, rimraf: true })` returns changed file paths.
|
|
36
|
-
|
|
37
|
-
## Generated content
|
|
38
|
-
|
|
39
|
-
- **`skill.md`** — https://dotagentsprotocol.com frontmatter (`id`, `name`, `description`, `enabled`), execution guidance, options & help discovery protocol (`--help`), compact command router, workflow & pitfalls, and client setup
|
|
40
|
-
- **`SKILL.md`** — compatibility copy of `skill.md` for tools that expect uppercase filenames
|
|
41
|
-
|
|
42
|
-
Installed files include an HTML comment hint (`Generated by myapp configure; do not edit.`) after skill frontmatter.
|
|
43
|
-
|
|
44
|
-
## Client setup
|
|
45
|
-
|
|
46
|
-
| Client | Skill path |
|
|
47
|
-
| --- | --- |
|
|
48
|
-
| Cursor, Codex, Copilot, most agents | `~/.agents/skills/<key>/` (auto via `configure install`) |
|
|
49
|
-
| Claude Code | Manual symlink to `~/.claude/skills/<key>/` |
|
|
5
|
+
## Repository skill (`skills/<app>/SKILL.md`)
|
|
50
6
|
|
|
51
|
-
|
|
52
|
-
mkdir -p ~/.claude/skills
|
|
53
|
-
ln -sf ~/.agents/skills/<key> ~/.claude/skills/<key>
|
|
54
|
-
```
|
|
7
|
+
ArgsBarg CLI templates and `argsbarg create` scaffold an initial `skills/<app>/SKILL.md` directly in the consumer repository. Committing this file allows agents, tools, and skill managers (such as `npx skills add`) to discover and install your CLI's skill directly from the source repository.
|
|
55
8
|
|
|
56
|
-
|
|
9
|
+
Because developers customize `skills/<app>/SKILL.md` with domain workflows, execution tips, and specific examples, skills are **authored artifacts**, not dynamically generated from code. Consumer `just docgen` refreshes only API and schema docs under `./docs/` and never overwrites repository skills.
|
|
57
10
|
|
|
58
|
-
|
|
11
|
+
### Structure of `skills/<app>/SKILL.md`
|
|
59
12
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
| **`myapp docs`** (requires `docs`) | Bundled markdown on stdout (`docs mcp` when MCP enabled) |
|
|
13
|
+
- **YAML frontmatter** — `id`, `name`, `description`, `enabled` per https://dotagentsprotocol.com
|
|
14
|
+
- **Options & Help Discovery** — guides agents to discover arguments and flags just-in-time via `<command> --help`
|
|
15
|
+
- **Commands catalog** — compact intent-based router directing agents to the right subcommands
|
|
16
|
+
- **Workflow & Pitfalls** — guidelines for automated execution (e.g. using non-interactive flags like `--yes`)
|
|
65
17
|
|
|
66
|
-
|
|
18
|
+
## Claude Code plugin
|
|
67
19
|
|
|
68
|
-
|
|
20
|
+
When `mcpServer.claudePlugin: true` is configured, running `myapp mcp bundle` packages `dist/claude-plugin/<name>.zip` containing an MCP pointer skill (`SKILL.md` only) that routes Claude Code to the bundled MCP server. This is a dist packaging artifact, not installed via `configure`.
|
|
69
21
|
|
|
70
|
-
|
|
22
|
+
## Uninstalling legacy skills
|
|
71
23
|
|
|
72
|
-
|
|
24
|
+
If an earlier version of an app installed a skill to `~/.agents/skills/<key>/`, running `myapp configure uninstall` cleans up that directory.
|
|
73
25
|
|
|
74
26
|
See also:
|
|
75
27
|
|
|
76
28
|
- [Bundled docs](bundled-docs.md) — `docs` config and compile-time imports
|
|
77
29
|
- [MCP server](mcp.md) — `mcpServer` config and `mcp` protocol
|
|
78
|
-
- [Configure](configure.md) — app
|
|
30
|
+
- [Configure](configure.md) — app config and MCP registration
|
package/docs/bundled-docs.md
CHANGED
|
@@ -56,18 +56,15 @@ myapp docs readme
|
|
|
56
56
|
myapp docs architecture
|
|
57
57
|
myapp docs cli-schema # full command tree as JSON
|
|
58
58
|
myapp docs cli # command tree as markdown
|
|
59
|
-
myapp docs skill # generated Cursor SKILL.md
|
|
60
59
|
myapp docs mcp # auto-generated when mcpServer.enabled
|
|
61
60
|
myapp docs http # auto-generated when httpServer.enabled
|
|
62
61
|
myapp docs openapi # OpenAPI 3.1 JSON when httpServer.enabled
|
|
63
62
|
myapp docs readme --save # write ./docs/readme.md
|
|
64
63
|
myapp docs cli-schema --save # write ./docs/cli-schema.json
|
|
65
64
|
myapp docs openapi --save # write ./docs/openapi.json
|
|
66
|
-
myapp docs
|
|
65
|
+
myapp docs cli --save # write ./docs/cli.md
|
|
67
66
|
```
|
|
68
67
|
|
|
69
|
-
Top-level `myapp --help` points agents at `myapp docs skill`. The `docs skill` subcommand description recommends `configure` for a persisted bundle.
|
|
70
|
-
|
|
71
68
|
## Configuration
|
|
72
69
|
|
|
73
70
|
| Field | Default | Purpose |
|
|
@@ -76,7 +73,7 @@ Top-level `myapp --help` points agents at `myapp docs skill`. The `docs skill` s
|
|
|
76
73
|
| `description` | `"Print bundled CLI documentation."` | Router help for `myapp docs` |
|
|
77
74
|
| `topics` | *(none)* | Optional topic key → `{ text, description? }` |
|
|
78
75
|
|
|
79
|
-
Reserved topic keys in `topics`: **`http`**, **`mcp`**, **`all`**, **`schema`**, **`cli`**, **`
|
|
76
|
+
Reserved topic keys in `topics`: **`http`**, **`mcp`**, **`all`**, **`schema`**, **`cli`**, **`openapi`** (reserved — use the matching `docs <name>` subcommand instead).
|
|
80
77
|
|
|
81
78
|
When `description` is omitted on a topic, ArgsBarg generates leaf help (`readme` → "Print README (user guide).").
|
|
82
79
|
|
|
@@ -92,13 +89,12 @@ Bun embeds the file when you `bun build --compile`. ArgsBarg does not read the f
|
|
|
92
89
|
|
|
93
90
|
Inline topics in your program root when the set is small; use a separate module only if the import map grows enough to clutter `index.tsx`.
|
|
94
91
|
|
|
95
|
-
## CLI schema
|
|
92
|
+
## CLI schema and API (`docs cli-schema`, `docs cli`)
|
|
96
93
|
|
|
97
94
|
By default (unless `docs.enabled: false`):
|
|
98
95
|
|
|
99
96
|
- **`docs cli-schema`** — same JSON as the former root `--schema` flag (handlers omitted; built-in subtrees included for leaf roots).
|
|
100
97
|
- **`docs cli`** — markdown rendering of the same command tree (options, positionals, subcommands, fallback routing).
|
|
101
|
-
- **`docs skill`** — prints the compact `SKILL.md` router. Prefer `configure install` for agents (persists `skill.md` + `SKILL.md` to `~/.agents/skills/<key>/`).
|
|
102
98
|
|
|
103
99
|
## MCP guide (`docs mcp`)
|
|
104
100
|
|
|
@@ -124,8 +120,7 @@ All `docs` subcommands are hidden from MCP `tools/list` (`mcpTool: { enabled: fa
|
|
|
124
120
|
|
|
125
121
|
| Channel | Role |
|
|
126
122
|
| --- | --- |
|
|
127
|
-
| `
|
|
128
|
-
| `docs skill` | Print generated `SKILL.md` to stdout |
|
|
123
|
+
| `skills/<app>/SKILL.md` | Authored repository skill router |
|
|
129
124
|
| `docs cli` | Print command tree markdown to stdout |
|
|
130
125
|
| `docs cli-schema` | Print command tree JSON to stdout |
|
|
131
126
|
| `docs` | Bundled markdown topics on stdout |
|
|
@@ -140,7 +135,7 @@ Load one primary artifact per task — avoid pulling full CLI markdown trees or
|
|
|
140
135
|
|
|
141
136
|
| Goal | Load |
|
|
142
137
|
| --- | --- |
|
|
143
|
-
| Route to the right command | `SKILL.md` (
|
|
138
|
+
| Route to the right command | `skills/<app>/SKILL.md` (repository skill) |
|
|
144
139
|
| Inspect options and positional slots | `<subcommand> --help` |
|
|
145
140
|
| Full command tree + option prose | `docs cli` |
|
|
146
141
|
| Machine-readable CLI tree + schemas | `docs cli-schema` |
|
|
@@ -149,7 +144,7 @@ Load one primary artifact per task — avoid pulling full CLI markdown trees or
|
|
|
149
144
|
|
|
150
145
|
## Save to disk (`--save`)
|
|
151
146
|
|
|
152
|
-
Pass **`--save`** on `docs` or any docs subcommand to write files under **`./docs/`** (
|
|
147
|
+
Pass **`--save`** on `docs` or any docs subcommand to write files under **`./docs/`** (relative to the current working directory). Each saved path is printed on stdout.
|
|
153
148
|
|
|
154
149
|
| Command | Output |
|
|
155
150
|
| --- | --- |
|
|
@@ -157,6 +152,7 @@ Pass **`--save`** on `docs` or any docs subcommand to write files under **`./doc
|
|
|
157
152
|
| `docs cli-schema --save` | `./docs/cli-schema.json` |
|
|
158
153
|
| `docs openapi --save` | `./docs/openapi.json` |
|
|
159
154
|
| `docs cli --save` | `./docs/cli.md` |
|
|
160
|
-
| `docs skill --save` | `./skills/<app>/SKILL.md` |
|
|
161
155
|
|
|
162
|
-
|
|
156
|
+
> **Repository skill convention:** Scaffolding (`argsbarg create`) includes `./skills/<app>/SKILL.md` from the project template as an editable intent-based router. In consumer projects, `just docgen` intentionally refreshes only API/CLI reference docs under `./docs/` (`cli.md`, `cli-schema.json`, `mcp.md`, etc.), leaving `skills/<app>/SKILL.md` for hand-crafted agent instructions and domain workflows.
|
|
157
|
+
|
|
158
|
+
Argsbarg-generated markdown (`mcp`, `http`) includes a `Generated by … docs … --save` HTML comment. `cli-schema.json`, `openapi.json`, and argsbarg-generated markdown resolve `{argsbarg:program}` in `notes` to the program key. Consumer-authored topic files are written as-is.
|
package/docs/cli-program.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Writing `CliProgram` and leaf commands
|
|
2
2
|
|
|
3
|
-
ArgsBarg turns your schema into help, shell completions, MCP tools
|
|
3
|
+
ArgsBarg turns your schema into help, shell completions, and MCP tools. **The same `description` fields you write for humans are the agent contract** for basic apps.
|
|
4
4
|
|
|
5
5
|
**Documentation map:** [docs/README.md](README.md) — which guide to read for MCP, configure, consumer docgen, and Cursor setup.
|
|
6
6
|
|
|
@@ -90,7 +90,7 @@ export const reserveCommand = {
|
|
|
90
90
|
|
|
91
91
|
Use a **parameterized factory** only when the schema truly depends on inputs (e.g. `createUpsertCommand(deps)` for tests or injected config). A `reserveCommand()` that returns a static literal adds indirection without benefit.
|
|
92
92
|
|
|
93
|
-
**`satisfies CliProgram`** on the root (or **`satisfies CliLeaf`** / router type on extracted modules) preserves type-checking whether inline or not. Keep **program-root fields in alphabetical order** (`appConfig`, `commands`, `description`, `docs`, `hooks`, `httpServer`, `key`, `mcpServer`, `readiness`, `
|
|
93
|
+
**`satisfies CliProgram`** on the root (or **`satisfies CliLeaf`** / router type on extracted modules) preserves type-checking whether inline or not. Keep **program-root fields in alphabetical order** (`appConfig`, `commands`, `description`, `docs`, `hooks`, `httpServer`, `key`, `mcpServer`, `readiness`, `version`, …).
|
|
94
94
|
|
|
95
95
|
## Descriptions
|
|
96
96
|
|
|
@@ -99,26 +99,26 @@ Write for **what the command does**, not how the UI works:
|
|
|
99
99
|
- **Good:** `Reserve a QA environment.`
|
|
100
100
|
- **Weak:** `Opens the reservation wizard.`
|
|
101
101
|
|
|
102
|
-
Option and positional `description` strings appear in `-h
|
|
102
|
+
Option and positional `description` strings appear in `-h` and MCP `inputSchema` — keep them concrete (`Environment name (e.g. qa2).`).
|
|
103
103
|
|
|
104
104
|
Use root **`notes`** for cross-cutting hints shown in help (install commands, docs topics, VPN requirements).
|
|
105
105
|
|
|
106
106
|
## Agent-friendly schema
|
|
107
107
|
|
|
108
|
-
Descriptions and schemas are copied into MCP tools
|
|
108
|
+
Descriptions and schemas are copied into MCP tools and HTTP OpenAPI — optimize for smaller, clearer agent payloads:
|
|
109
109
|
|
|
110
|
-
- **Declare options on the leaf command** that uses them — routing groups cannot declare options (program root may). Wire schemas (MCP, OpenAPI
|
|
110
|
+
- **Declare options on the leaf command** that uses them — routing groups cannot declare options (program root may). Wire schemas (MCP, OpenAPI) expose leaf-local options only.
|
|
111
111
|
- Prefer **`kind: "json"`** leaves with schemagen `inputSchema` for complex tool bodies (one nested object beats many flat flags).
|
|
112
112
|
- Keep **`description`** strings short and action-oriented; put examples in **`notes`**, not duplicated in every option.
|
|
113
113
|
- Use **`hidden: true`** or **`mcpTool.enabled: false`** for debug/internal commands.
|
|
114
114
|
- For shape discovery: HTTP agents load **`docs openapi`** or `GET /openapi.json`; MCP agents use **`docs cli-schema`**; load full **`docs cli`** only when prose is needed.
|
|
115
|
-
-
|
|
115
|
+
- Repository **`skills/<app>/SKILL.md`** acts as an intent-based router that directs agents to `<subcommand> --help` — see [bundled-docs.md](bundled-docs.md#agent-artifact-contract).
|
|
116
116
|
|
|
117
117
|
Validation: [json-schema-subset.md](json-schema-subset.md) (Draft-07 default; 2019-09 / 2020-12 when `$schema` is set — including Zod-generated schemas).
|
|
118
118
|
|
|
119
119
|
## Well-known option names
|
|
120
120
|
|
|
121
|
-
Prefer **`yes`**, **`dry-run`**, and **`json`** when semantics match. They appear in `-h
|
|
121
|
+
Prefer **`yes`**, **`dry-run`**, and **`json`** when semantics match. They appear in `-h` and MCP `inputSchema` — write clear option `description` strings (e.g. "Skip confirmation; use for non-interactive runs.").
|
|
122
122
|
|
|
123
123
|
## When to use `mcpTool` (escape hatches only)
|
|
124
124
|
|
|
@@ -542,8 +542,7 @@ await cli.run();
|
|
|
542
542
|
- **Strict:** unknown keys rejected on load.
|
|
543
543
|
- **CLI:** missing required config exits 1 before the leaf handler (TTY prompt when interactive). Built-in `docs` and `configure get`/`set` skip this exit.
|
|
544
544
|
- **MCP:** server stays up; missing config returns `isError: true` at `tools/call`.
|
|
545
|
-
- **Configure:** interactive `configure` runs the app config wizard; **`configure install`**
|
|
546
|
-
- **Agent skill:** `program.skill: { enabled: true }` installs to `~/.agents/skills/<key>/` on `configure install`; see [configure.md](configure.md) and [ai-skills.md](ai-skills.md).
|
|
545
|
+
- **Configure:** interactive `configure` runs the app config wizard; **`configure install`** registers MCP in `~/.agents/mcp.json` (see https://dotagentsprotocol.com). Optional `configure.afterInstall` / `configure.beforeUninstall` for app-specific agent setup; see [configure.md](configure.md).
|
|
547
546
|
- **MCP install:** `mcpServer: { enabled: true }` merges into `~/.agents/mcp.json` on `configure install`; manual Cursor/Claude setup in [mcp.md](mcp.md).
|
|
548
547
|
|
|
549
548
|
See [config-schema.md](config-schema.md) for codegen, [configure.md](configure.md) (`configure.targets`), and [mcp.md](mcp.md).
|
|
@@ -583,7 +582,7 @@ If you maintain argsbarg from a sibling checkout, `just consumers-dev` / `just c
|
|
|
583
582
|
|
|
584
583
|
3. **Optional:** add consumer-specific sections above the `<!-- argsbarg:managed -->` marker in `AGENTS.md` (project context, Ink patterns, domain notes).
|
|
585
584
|
|
|
586
|
-
- **Not this file:** `
|
|
585
|
+
- **Not this file:** `skills/<app>/SKILL.md` in your repository is the **app** skill — how to *invoke* the CLI. `AGENTS.md` is for *authoring* argsbarg schema.
|
|
587
586
|
|
|
588
587
|
## See also
|
|
589
588
|
|
|
@@ -591,5 +590,5 @@ If you maintain argsbarg from a sibling checkout, `just consumers-dev` / `just c
|
|
|
591
590
|
- [Output schemas](output-schema.md) — codegen pipeline for leaf `outputSchema`
|
|
592
591
|
- [Developing argsbarg](developing.md) — release, consumer sync, npm `files`
|
|
593
592
|
- [MCP server](mcp.md) — tools, schema resource, env bootstrapping
|
|
594
|
-
- [Agent skills](ai-skills.md) —
|
|
593
|
+
- [Agent skills](ai-skills.md) — repository skills
|
|
595
594
|
- [Bundled docs](bundled-docs.md) — `docs` topics, consumer docgen vs framework docs
|
package/docs/configure.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> This feature is experimental.
|
|
4
4
|
|
|
5
|
-
The `configure` built-in manages **agent artifacts** (
|
|
5
|
+
The `configure` built-in manages **agent artifacts** (MCP config, app config). The **binary and shell completions** ship via Homebrew — see [distribution-homebrew.md](distribution-homebrew.md).
|
|
6
6
|
|
|
7
7
|
Opt out with `configure: { enabled: false }` on the program root.
|
|
8
8
|
|
|
@@ -13,7 +13,7 @@ Private GitHub release downloads require [GitHub CLI](https://cli.github.com/) a
|
|
|
13
13
|
```bash
|
|
14
14
|
brew tap <org>/<repo> git@github.com:<org>/<repo>.git
|
|
15
15
|
brew install <tap>/<key>
|
|
16
|
-
<key> configure install #
|
|
16
|
+
<key> configure install # MCP, config bootstrap; required-config wizard on TTY
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
Upgrade with `brew upgrade <key>`, then run `<key> configure install` again. Shell completions are installed by Homebrew during `brew install`. Users must configure their shell per [Homebrew Shell Completion](https://docs.brew.sh/Shell-Completion).
|
|
@@ -34,18 +34,18 @@ just build
|
|
|
34
34
|
just install-local # uninstall, build, brew install, configure install (`just install` is an alias)
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
`just install-local` runs `configure uninstall` (via `just uninstall`), installs via Homebrew, then `configure install`. Use `just reinstall-local` to swap the binary into Cellar during tight edit cycles; run `just refresh` afterward for
|
|
37
|
+
`just install-local` runs `configure uninstall` (via `just uninstall`), installs via Homebrew, then `configure install`. Use `just reinstall-local` to swap the binary into Cellar during tight edit cycles; run `just refresh` afterward for MCP.
|
|
38
38
|
|
|
39
39
|
## Quick reference
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
# Install
|
|
42
|
+
# Install MCP config after install or upgrade (required — not run by Homebrew)
|
|
43
43
|
<key> configure install
|
|
44
44
|
|
|
45
45
|
# See what is installed
|
|
46
46
|
<key> configure status [--json]
|
|
47
47
|
|
|
48
|
-
# Remove
|
|
48
|
+
# Remove agent artifacts and app config (run before brew uninstall)
|
|
49
49
|
<key> configure uninstall [--yes]
|
|
50
50
|
|
|
51
51
|
# Read or write app config (when program.appConfig is set)
|
|
@@ -61,7 +61,6 @@ Bare `<key> configure` (no subcommand) shows help. Use subcommands above.
|
|
|
61
61
|
| --- | --- | --- |
|
|
62
62
|
| Binary | skipped (read-only) | Homebrew formula `bin.install` |
|
|
63
63
|
| Shell completions | skipped | Homebrew `generate_completions_from_executable` |
|
|
64
|
-
| Agent skill | automatic | `~/.agents/skills/<key>/` when `program.skill.enabled` |
|
|
65
64
|
| MCP config | automatic | `~/.agents/mcp.json` when `mcpServer.enabled` (see https://dotagentsprotocol.com) |
|
|
66
65
|
| App config | bootstrap + wizard | Creates `~/.local/lib/<key>/config.json` as `{}` when missing; TTY wizard when required keys are missing |
|
|
67
66
|
|
|
@@ -70,7 +69,7 @@ Bare `<key> configure` (no subcommand) shows help. Use subcommands above.
|
|
|
70
69
|
When **`PATH`** resolves the program key to the **running executable** (e.g. after `brew install`):
|
|
71
70
|
|
|
72
71
|
- **`configure status`** shows `app: system (PATH)`
|
|
73
|
-
- **`configure install`**
|
|
72
|
+
- **`configure install`** registers MCP in `~/.agents/mcp.json` (when `mcpServer.enabled`); bootstraps `config.json` when missing
|
|
74
73
|
|
|
75
74
|
MCP config uses the command name on **`PATH`**, not a Cellar path. For Cursor, Claude Code, and Claude Desktop, copy the `mcpServers` entry manually — see [mcp.md](mcp.md) and `docs mcp`.
|
|
76
75
|
|
|
@@ -88,7 +87,6 @@ Optional keys are set via `configure set` or environment variables.
|
|
|
88
87
|
Optional gates for app binary status:
|
|
89
88
|
|
|
90
89
|
```typescript
|
|
91
|
-
skill: { enabled: true },
|
|
92
90
|
mcpServer: { enabled: true },
|
|
93
91
|
configure: {
|
|
94
92
|
targets: {
|
|
@@ -142,8 +140,8 @@ Export helpers from `argsbarg`: `resolveAppConfigPath`, `displayAppConfigPath`.
|
|
|
142
140
|
|
|
143
141
|
| Subcommand | Description |
|
|
144
142
|
| --- | --- |
|
|
145
|
-
| `install` | Install agent artifacts; bootstrap config; required-config wizard on TTY |
|
|
146
|
-
| `uninstall` | Remove skill, MCP entry, and app config (`--yes` skips TTY confirm) |
|
|
143
|
+
| `install` | Install agent artifacts (MCP); bootstrap config; required-config wizard on TTY |
|
|
144
|
+
| `uninstall` | Remove legacy skill, MCP entry, and app config (`--yes` skips TTY confirm) |
|
|
147
145
|
| `status` | Read-only inventory (`--json` for machine output) |
|
|
148
146
|
| `get` / `set` | Read or write `program.appConfig` keys (when configured) |
|
|
149
147
|
|
|
@@ -159,7 +157,7 @@ If an existing entry matches, install is a no-op. If an existing entry differs,
|
|
|
159
157
|
|
|
160
158
|
## Formula `caveats`
|
|
161
159
|
|
|
162
|
-
Generated formulae document the two-step install when the app has
|
|
160
|
+
Generated formulae document the two-step install when the app has MCP or `appConfig` entries. Homebrew prints `caveats` after `brew install` and in `brew info`:
|
|
163
161
|
|
|
164
162
|
```ruby
|
|
165
163
|
def caveats
|
package/docs/output-schema.md
CHANGED
|
@@ -21,7 +21,6 @@ export const status = {
|
|
|
21
21
|
| --- | --- |
|
|
22
22
|
| `myapp docs cli-schema` | Full command tree JSON export |
|
|
23
23
|
| `myapp docs cli` | Markdown per-command **Output** section |
|
|
24
|
-
| `myapp docs skill` | Intent-based SKILL.md router for agent skills |
|
|
25
24
|
| MCP `tools/list` | Optional `outputSchema` on each tool |
|
|
26
25
|
| HTTP `GET /openapi.json` | Response schema per tool |
|
|
27
26
|
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
- `README.md` — user-facing install/commands
|
|
10
10
|
- `docs/architecture.md` — maintainer internals (create if missing)
|
|
11
|
-
- Generated: `just docgen` → `docs/cli.md`, `docs/cli-schema.json
|
|
11
|
+
- Generated: `just docgen` → `docs/cli.md`, `docs/cli-schema.json`
|
|
12
|
+
- `skills/full-example/SKILL.md` — agent skill router (scaffolded from template; customize as needed)
|
|
12
13
|
|
|
13
14
|
<!-- argsbarg:managed -->
|
|
14
15
|
|
|
@@ -67,8 +68,7 @@ When adding commands: `src/commands/<name>/command.ts`; register in `program.ts`
|
|
|
67
68
|
|
|
68
69
|
- **CLI:** `bun ./src/index.ts …` or `just run …`
|
|
69
70
|
- **Tests:** `just test` (after `just check`)
|
|
70
|
-
- **
|
|
71
|
-
- **Agent skill:** `skills/<key>/SKILL.md` is an intent-based router. Run `configure install` to persist it to `~/.agents/skills/<key>/`.
|
|
71
|
+
- **Repository skill:** When adding, renaming, or removing commands, update `skills/<key>/SKILL.md` so the intent-based router remains accurate for end-user agents. (`just docgen` updates `./docs/` only and never overwrites `skills/`).
|
|
72
72
|
|
|
73
73
|
<!-- /argsbarg:managed -->
|
|
74
74
|
|
|
@@ -11,7 +11,7 @@ Reference template for argsbarg consumer docgen. Every builtin is enabled in `sr
|
|
|
11
11
|
| **Full command tree (markdown)** | [cli.md](cli.md) — generated |
|
|
12
12
|
| **Full command tree (JSON)** | [cli-schema.json](cli-schema.json) — generated |
|
|
13
13
|
| **OpenAPI 3.1** | [openapi.json](openapi.json) — generated |
|
|
14
|
-
| **Agent skill router** | [../skills/full-example/SKILL.md](../skills/full-example/SKILL.md) —
|
|
14
|
+
| **Agent skill router** | [../skills/full-example/SKILL.md](../skills/full-example/SKILL.md) — scaffolded from template |
|
|
15
15
|
|
|
16
16
|
## Framework docs vs this directory
|
|
17
17
|
|
|
@@ -4,8 +4,6 @@ name: full-example
|
|
|
4
4
|
description: Operates the full-example CLI (echo, status). Use when the user mentions full-example, echo, status, or related tasks.
|
|
5
5
|
enabled: true
|
|
6
6
|
---
|
|
7
|
-
<!-- Generated by full-example docs skill --save; do not edit. -->
|
|
8
|
-
|
|
9
7
|
|
|
10
8
|
# full-example
|
|
11
9
|
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
- `README.md` — user-facing install/commands
|
|
10
10
|
- `docs/architecture.md` — maintainer internals (create if missing)
|
|
11
|
-
- Generated: `just docgen` → `docs/cli.md`, `docs/cli-schema.json
|
|
11
|
+
- Generated: `just docgen` → `docs/cli.md`, `docs/cli-schema.json`
|
|
12
|
+
- `skills/full-example-json/SKILL.md` — agent skill router (scaffolded from template; customize as needed)
|
|
12
13
|
|
|
13
14
|
<!-- argsbarg:managed -->
|
|
14
15
|
|
|
@@ -72,8 +73,7 @@ When adding commands: `src/commands/<name>/command.ts` + `types.ts` when schemas
|
|
|
72
73
|
- **Runtime:** Bun (`just test`, `just dev`).
|
|
73
74
|
- **Tests:** colocate `*.test.ts` next to the module.
|
|
74
75
|
- **Schemagen:** after changing `/** @sg */` types in `src/`, run `just schemagen` (`__generated__/` is gitignored).
|
|
75
|
-
- **
|
|
76
|
-
- **Agent skill:** `skills/<key>/SKILL.md` is an intent-based router. Run `configure install` to persist it to `~/.agents/skills/<key>/`.
|
|
76
|
+
- **Repository skill:** When adding, renaming, or removing commands, update `skills/<key>/SKILL.md` so the intent-based router remains accurate for end-user agents. (`just docgen` updates `./docs/` only and never overwrites `skills/`).
|
|
77
77
|
|
|
78
78
|
### Abstractions
|
|
79
79
|
|
|
@@ -11,7 +11,7 @@ Reference template for argsbarg consumer docgen. Every builtin is enabled in `sr
|
|
|
11
11
|
| **Full command tree (markdown)** | [cli.md](cli.md) — generated |
|
|
12
12
|
| **Full command tree (JSON)** | [cli-schema.json](cli-schema.json) — generated |
|
|
13
13
|
| **OpenAPI 3.1** | [openapi.json](openapi.json) — generated |
|
|
14
|
-
| **Agent skill router** | [../skills/full-example-json/SKILL.md](../skills/full-example-json/SKILL.md) —
|
|
14
|
+
| **Agent skill router** | [../skills/full-example-json/SKILL.md](../skills/full-example-json/SKILL.md) — scaffolded from template |
|
|
15
15
|
|
|
16
16
|
## Framework docs vs this directory
|
|
17
17
|
|
|
@@ -4,8 +4,6 @@ name: full-example-json
|
|
|
4
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
|
|
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
|
-
});
|