argsbarg 6.1.10 → 6.2.2

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.
Files changed (136) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/README.md +49 -49
  3. package/docs/README.md +5 -4
  4. package/docs/ai-skills.md +36 -23
  5. package/docs/bundled-docs.md +1 -1
  6. package/docs/cli-program.md +19 -20
  7. package/docs/config-schema.md +3 -3
  8. package/docs/configure.md +12 -16
  9. package/docs/developing.md +9 -9
  10. package/docs/mcp.md +21 -57
  11. package/docs/output-schema.md +3 -3
  12. package/examples/formats.ts +5 -6
  13. package/examples/full-example/AGENTS.md +75 -0
  14. package/examples/full-example/CLAUDE.md +1 -0
  15. package/examples/full-example/README.md +7 -69
  16. package/examples/full-example/docs/README.md +1 -1
  17. package/examples/full-example/docs/cli-schema.json +1 -1659
  18. package/examples/full-example/docs/cli.md +2 -1538
  19. package/examples/full-example/docs/http.md +0 -7
  20. package/examples/full-example/docs/mcp.md +23 -59
  21. package/examples/full-example/docs/openapi.json +2 -782
  22. package/examples/full-example/docs/skill.md +18 -14
  23. package/examples/full-example/justfile +5 -17
  24. package/examples/full-example/scripts/create-identity.ts +2 -1
  25. package/examples/full-example/src/commands/status/command.test.ts +2 -2
  26. package/examples/full-example/src/commands/status/command.ts +7 -6
  27. package/examples/full-example/src/program.ts +4 -10
  28. package/examples/full-example-json/AGENTS.md +86 -0
  29. package/examples/full-example-json/CLAUDE.md +1 -0
  30. package/examples/full-example-json/Formula/.gitkeep +0 -0
  31. package/examples/full-example-json/Formula/full-example-json.rb +35 -0
  32. package/examples/full-example-json/README.md +27 -0
  33. package/examples/full-example-json/biome.json +22 -0
  34. package/examples/full-example-json/bun.lock +48 -0
  35. package/examples/full-example-json/docs/README.md +27 -0
  36. package/examples/full-example-json/docs/cli-schema.json +2145 -0
  37. package/examples/full-example-json/docs/cli.md +1990 -0
  38. package/examples/full-example-json/docs/http.md +92 -0
  39. package/examples/full-example-json/docs/mcp.md +116 -0
  40. package/examples/full-example-json/docs/openapi.json +1246 -0
  41. package/examples/full-example-json/docs/skill.md +57 -0
  42. package/examples/full-example-json/justfile +171 -0
  43. package/examples/full-example-json/package.json +22 -0
  44. package/examples/full-example-json/scripts/create-identity.ts +12 -0
  45. package/examples/full-example-json/scripts/dev-formula.ts +97 -0
  46. package/examples/full-example-json/scripts/formula-shared.test.ts +68 -0
  47. package/examples/full-example-json/scripts/formula-shared.ts +170 -0
  48. package/examples/full-example-json/scripts/print-identity.ts +28 -0
  49. package/examples/full-example-json/scripts/release.ts +212 -0
  50. package/examples/full-example-json/src/commands/echo/command.ts +26 -0
  51. package/examples/full-example-json/src/commands/status/command.test.ts +10 -0
  52. package/examples/full-example-json/src/commands/status/command.ts +28 -0
  53. package/examples/full-example-json/src/index.ts +10 -0
  54. package/examples/full-example-json/src/program.ts +33 -0
  55. package/examples/full-example-json/src/types/md.d.ts +4 -0
  56. package/examples/full-example-json/tsconfig.json +17 -0
  57. package/examples/minimal.ts +17 -17
  58. package/examples/nested.ts +10 -10
  59. package/examples/option-required.ts +13 -13
  60. package/examples/servers.ts +10 -10
  61. package/index.d.ts +17 -43
  62. package/package.json +1 -1
  63. package/src/cli-tool/create.test.ts +44 -68
  64. package/src/cli-tool/create.ts +81 -17
  65. package/src/cli-tool/full-example-capabilities.test.ts +33 -18
  66. package/src/cli-tool/post-create.ts +31 -17
  67. package/src/cli-tool/program.ts +16 -7
  68. package/src/cli-tool/prompt.ts +27 -0
  69. package/src/cli-tool/run-create.ts +19 -7
  70. package/src/cli-tool/schemagen/schemagen.test.ts +3 -3
  71. package/src/configure/artifacts/install-validate.test.ts +20 -33
  72. package/src/configure/artifacts/paths.ts +9 -53
  73. package/src/configure/artifacts/status.test.ts +13 -16
  74. package/src/configure/artifacts/status.ts +5 -22
  75. package/src/configure/artifacts/target-base.ts +6 -15
  76. package/src/configure/artifacts/target-effective.ts +16 -54
  77. package/src/configure/artifacts/target-mcp-json.ts +2 -5
  78. package/src/configure/artifacts/target-registry.ts +0 -7
  79. package/src/configure/artifacts/target-scope.ts +7 -17
  80. package/src/configure/artifacts/target-skill.ts +6 -15
  81. package/src/configure/artifacts/target-types.ts +6 -54
  82. package/src/configure/artifacts/targets/agents-mcp.ts +11 -0
  83. package/src/configure/artifacts/targets/configure.ts +1 -5
  84. package/src/configure/artifacts/targets/index.ts +4 -44
  85. package/src/configure/artifacts/targets/skill.ts +12 -0
  86. package/src/configure/artifacts/targets.test.ts +21 -59
  87. package/src/configure/configure.test.ts +35 -46
  88. package/src/configure/index.ts +19 -19
  89. package/src/configure/prompt.ts +2 -12
  90. package/src/core/parse.test.ts +21 -32
  91. package/src/core/types.ts +18 -44
  92. package/src/core/validate.ts +28 -45
  93. package/src/docs/docs.test.ts +4 -4
  94. package/src/docs/mcp-guide.ts +41 -71
  95. package/src/docs/resolve.ts +1 -1
  96. package/src/exports/cli.ts +1 -1
  97. package/src/index.ts +1 -1
  98. package/src/skill/generate.ts +26 -45
  99. package/src/skill/install.ts +18 -38
  100. package/src/skill/naming.ts +3 -27
  101. package/src/test/integration/config.test.ts +3 -3
  102. package/src/test/integration/mcp.test.ts +4 -4
  103. package/{examples/mcp-test.ts → src/test/mcp-integration-fixture.ts} +20 -22
  104. package/src/configure/artifacts/target-mcp-cli.ts +0 -127
  105. package/src/configure/artifacts/targets/chatgpt-mcp.ts +0 -12
  106. package/src/configure/artifacts/targets/claude-code-mcp.ts +0 -15
  107. package/src/configure/artifacts/targets/claude-desktop-mcp.ts +0 -12
  108. package/src/configure/artifacts/targets/claude-skill.ts +0 -16
  109. package/src/configure/artifacts/targets/codex-mcp.ts +0 -25
  110. package/src/configure/artifacts/targets/codex-skill.ts +0 -14
  111. package/src/configure/artifacts/targets/cursor-mcp.ts +0 -15
  112. package/src/configure/artifacts/targets/cursor-skill.ts +0 -16
  113. package/src/configure/artifacts/targets/openclaw-mcp.ts +0 -25
  114. package/src/configure/artifacts/targets/openclaw-skill.ts +0 -17
  115. package/src/configure/artifacts/targets/opencode-mcp.ts +0 -96
  116. package/src/configure/artifacts/targets/opencode-skill.ts +0 -15
  117. /package/examples/{full-example → full-example-json}/src/commands/render-json/__generated__/RenderJsonInputSchema.json +0 -0
  118. /package/examples/{full-example → full-example-json}/src/commands/render-json/__generated__/index.ts +0 -0
  119. /package/examples/{full-example → full-example-json}/src/commands/render-json/command.test.ts +0 -0
  120. /package/examples/{full-example → full-example-json}/src/commands/render-json/command.ts +0 -0
  121. /package/examples/{full-example → full-example-json}/src/commands/render-json/types.ts +0 -0
  122. /package/examples/{full-example → full-example-json}/src/commands/status/__generated__/StatusJsonOutputSchema.json +0 -0
  123. /package/examples/{full-example → full-example-json}/src/commands/status/__generated__/index.ts +0 -0
  124. /package/examples/{full-example → full-example-json}/src/commands/status/types.ts +0 -0
  125. /package/examples/{full-example → full-example-json}/src/commands/workspaces/__generated__/WorkspaceNameInputSchema.json +0 -0
  126. /package/examples/{full-example → full-example-json}/src/commands/workspaces/__generated__/index.ts +0 -0
  127. /package/examples/{full-example → full-example-json}/src/commands/workspaces/command.test.ts +0 -0
  128. /package/examples/{full-example → full-example-json}/src/commands/workspaces/command.ts +0 -0
  129. /package/examples/{full-example → full-example-json}/src/commands/workspaces/types.ts +0 -0
  130. /package/examples/{full-example → full-example-json}/src/db/index.test.ts +0 -0
  131. /package/examples/{full-example → full-example-json}/src/db/index.ts +0 -0
  132. /package/examples/{full-example → full-example-json}/src/db/migrate.test.ts +0 -0
  133. /package/examples/{full-example → full-example-json}/src/db/migrate.ts +0 -0
  134. /package/examples/{full-example → full-example-json}/src/db/migrations/001_workspaces.sql +0 -0
  135. /package/examples/{full-example → full-example-json}/src/db/tables/workspaces.ts +0 -0
  136. /package/examples/{full-example → full-example-json}/src/types/argsbarg.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [6.2.2] - 2026-08-07
11
+
12
+ ### Changed
13
+
14
+ - **Agent instructions (`AGENTS.md`)** — replace `.cursor/rules/*.mdc` with inlined `AGENTS.md` + `CLAUDE.md` (`@AGENTS.md`) in copy templates and consumer sync. `scripts/merge-agents-md.ts` replaces `merge-cli-program-rule.ts` and `merge-code-rule.ts`. Argsbarg maintainer repo uses root `AGENTS.md`.
15
+
16
+ ## [6.2.1] - 2026-08-07
17
+
18
+ Chore
19
+
20
+ ## [6.2.0] - 2026-07-30
21
+
22
+ ### Changed
23
+
24
+ - **Breaking: two `argsbarg create` templates** — default `cli` template (`examples/full-example`) is CLI-centric (MCP, HTTP, configure, skills; no schemagen). Schema-first template (`examples/full-example-json`) keeps `@sg` schemagen, `inputSchema`/`outputSchema`, REST CRUD, and in-memory SQLite. Interactive create shows an A/B template picker; `--template cli|json` for non-interactive use. `create-identity.ts` records `template` for `--check` drift detection.
25
+ - **Experimental: agent skill install** — single opt-in target via `program.skill: { enabled: true }` installs to `~/.agents/skills/<key>/` (no per-host skill targets). Brew `post_install` sync installs the skill when enabled. Removed `configure.agentIntegration` and per-host skill keys (`cursorSkill`, etc.).
26
+ - **Experimental: .agents protocol–only agent install** — MCP configure install writes only `~/.agents/mcp.json` when `mcpServer.enabled` (included in `configure --sync` automatically, parallel to `skill.enabled`). Removed vendor MCP auto-install (Cursor, Claude, Codex, OpenCode, OpenClaw, ChatGPT). Removed `configure.targets.*Mcp`; use `mcpServer.enabled`. Skill bundle adds protocol `skill.md` (+ `SKILL.md` compatibility copy). Docs and generated `docs mcp` document manual Cursor/Claude/Desktop MCP setup and Claude Code skill symlink.
27
+
10
28
  ## [6.1.10] - 2026-07-29
11
29
 
12
30
  ### Changed
@@ -885,7 +903,10 @@ const cli = { ... } satisfies CliProgram; // or : CliProgram
885
903
  - 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`).
886
904
  - Imports: use `CliPositional` where needed; replace `CliOptionDef` with `CliOption` or `CliPositional` as appropriate.
887
905
 
888
- [Unreleased]: https://github.com/bdombro/bun-argsbarg/compare/v6.1.10...HEAD
906
+ [Unreleased]: https://github.com/bdombro/bun-argsbarg/compare/v6.2.2...HEAD
907
+ [6.2.2]: https://github.com/bdombro/bun-argsbarg/releases/tag/v6.2.2
908
+ [6.2.1]: https://github.com/bdombro/bun-argsbarg/releases/tag/v6.2.1
909
+ [6.2.0]: https://github.com/bdombro/bun-argsbarg/releases/tag/v6.2.0
889
910
  [6.1.10]: https://github.com/bdombro/bun-argsbarg/releases/tag/v6.1.10
890
911
  [6.1.9]: https://github.com/bdombro/bun-argsbarg/releases/tag/v6.1.9
891
912
  [6.1.8]: https://github.com/bdombro/bun-argsbarg/releases/tag/v6.1.8
package/README.md CHANGED
@@ -52,9 +52,23 @@ $ myapp http
52
52
  import { Cli, type CliProgram, CliOptionKind } from "argsbarg";
53
53
 
54
54
  const program = {
55
- key: "helloapp",
56
- version: "1.0.0",
57
55
  description: "Tiny demo.",
56
+ handler: async (ctx) => {
57
+ const name = ctx.args[0] ?? "world";
58
+ if (ctx.hasFlag("verbose")) {
59
+ console.log("verbose mode");
60
+ }
61
+ console.log(`hello ${name}`);
62
+ },
63
+ key: "helloapp",
64
+ options: [
65
+ {
66
+ name: "verbose",
67
+ description: "Enable extra logging.",
68
+ kind: CliOptionKind.Presence,
69
+ shortName: "v",
70
+ },
71
+ ],
58
72
  positionals: [
59
73
  {
60
74
  name: "name",
@@ -64,21 +78,7 @@ const program = {
64
78
  argMax: 1,
65
79
  },
66
80
  ],
67
- options: [
68
- {
69
- name: "verbose",
70
- description: "Enable extra logging.",
71
- kind: CliOptionKind.Presence,
72
- shortName: "v",
73
- },
74
- ],
75
- handler: async (ctx) => {
76
- const name = ctx.args[0] ?? "world";
77
- if (ctx.hasFlag("verbose")) {
78
- console.log("verbose mode");
79
- }
80
- console.log(`hello ${name}`);
81
- },
81
+ version: "1.0.0",
82
82
  } satisfies CliProgram;
83
83
 
84
84
  const cli = new Cli(program);
@@ -133,7 +133,7 @@ Edit `scripts/create-identity.ts` in the new repository to set your description.
133
133
  | Package import | `from "argsbarg"` (not relative to argsbarg `src/`) |
134
134
  | Homebrew distribution | `scripts/formula-shared.ts`, `scripts/dev-formula.ts`, `Formula/`, `justfile` |
135
135
  | Dev tooling | Biome (`just format` / `just lint`), TypeScript, colocated tests |
136
- | Cursor rules | `.cursor/rules/cli-program.mdc`, `.cursor/rules/code.mdc` |
136
+ | Agent instructions | `AGENTS.md`, `CLAUDE.md` (`@AGENTS.md`) |
137
137
 
138
138
  *Tip: Verify an existing tree or template setup with `bunx argsbarg create --check .`*
139
139
 
@@ -170,11 +170,11 @@ Nested command paths map directly to standard REST paths (e.g., `v1 invoices ren
170
170
 
171
171
  ```typescript
172
172
  const cli = {
173
- key: "myapp",
174
- version: "1.0.0",
173
+ commands: [/* ... */],
175
174
  description: "My service.",
176
175
  httpServer: { enabled: true, port: 3000 },
177
- commands: [/* ... */],
176
+ key: "myapp",
177
+ version: "1.0.0",
178
178
  } satisfies CliProgram;
179
179
  ```
180
180
 
@@ -284,19 +284,20 @@ Check the `examples/` directory for full working scripts:
284
284
 
285
285
  | Example | File | Shows |
286
286
  | --------------------- | ------------------------ | ------------------------------------------------------------------------------------------------- |
287
- | `ArgsBargMinimal` | `examples/minimal.ts` | String + presence flags, `MissingOrUnknown` fallback. |
287
+ | `ArgsBargMinimal` | `examples/minimal.ts` | Smallest embeddable CLI (not a copy template). |
288
288
  | `ArgsBargNested` | `examples/nested.ts` | Nested command tree, positional tails, async handlers. |
289
289
  | `ArgsBargFormats` | `examples/formats.ts` | `CliValueFormat`, `default`, `ctx.inputs`. |
290
- | `ArgsBargFullExample` | `examples/full-example/` | **Copy template:** all builtins, schemagen, Homebrew justfile, `outputSchema`, `from "argsbarg"`. |
290
+ | `ArgsBargFullExample` | `examples/full-example/` | **Default copy template:** all builtins, Homebrew justfile; options/flags only (no schemagen). |
291
+ | `ArgsBargFullExampleJson` | `examples/full-example-json/` | **Schema-first copy template:** `@sg`, `inputSchema`/`outputSchema`, REST CRUD, SQLite. |
291
292
 
292
293
 
293
294
  Examples ship in the npm package under `node_modules/argsbarg/examples/`.
294
295
 
295
296
  ## Bootstrap a new CLI
296
297
 
297
- Copy the shipped `examples/full-example` template into a new directory:
298
+ Copy a shipped template into a new directory (`cli` default, or `json` for schema-first):
298
299
 
299
- Interactive (TTY):
300
+ Interactive (TTY) — pick template A/B, then key and release repo:
300
301
 
301
302
  ```bash
302
303
  bunx argsbarg create my-cli
@@ -306,37 +307,38 @@ Non-interactive:
306
307
 
307
308
  ```bash
308
309
  bunx argsbarg create my-cli \
310
+ --template cli \
309
311
  --key my-cli --release-repo org/my-cli --yes
310
312
  ```
311
313
 
314
+ Schema-first (`@sg`, JSON schemas, REST CRUD demo):
315
+
316
+ ```bash
317
+ bunx argsbarg create my-api \
318
+ --template json \
319
+ --key my-api --release-repo org/my-api --yes
320
+ ```
321
+
312
322
  Edit `scripts/create-identity.ts` in the new repo to set `desc` (used by `program.description` and the Homebrew formula).
313
323
 
314
- `create` copies the template (including `.cursor/rules/cli-program.mdc`), substitutes `{key}` / `{tap}` / `{releaseRepo}` placeholders in `README.md` and other files, runs `bun install`, schemagen, `bun test`, and `git init` + Initial commit when appropriate.
324
+ `create` copies the template (including `AGENTS.md` and `CLAUDE.md`), substitutes `{key}` / `{tap}` / `{releaseRepo}` placeholders, runs `bun install`, `argsbarg schemagen` (json template only), `bun test`, and `git init` + Initial commit when appropriate.
315
325
 
316
326
  **Git bootstrap:** skipped when the target already has a `.git` directory, or when the target sits inside an existing git work tree (monorepo subfolder). Standalone new directories get an `Initial commit`.
317
327
 
318
328
  Verify an existing tree: `bunx argsbarg create --check .`
319
329
 
320
- To refresh Cursor rules in an existing consumer: `bun scripts/merge-cli-program-rule.ts .` and `bun scripts/merge-code-rule.ts .` from an argsbarg checkout (or pass the npm package path to the template).
330
+ To refresh agent instructions in an existing consumer: `bun scripts/merge-agents-md.ts .` from an argsbarg checkout (or pass the npm package path to the template).
321
331
 
322
- ### What the full-example template includes
332
+ ### What the copy templates include
323
333
 
334
+ Both templates ship all builtins (`completion`, `version`, `configure`, `docs`, `mcp`, `http`), Homebrew `justfile` + formula scripts, and `AGENTS.md` + `CLAUDE.md`.
324
335
 
325
- | Area | Files / wiring |
326
- | --------------------- | ---------------------------------------------------------------------------------------- |
327
- | All builtins | `completion`, `version`, `configure`, `docs`, `mcp`, `http`, `configure get`/`set` |
328
- | `@sg` schemagen | `/** @sg */` on types in `src/**/*.ts` → `{TypeName}Schema` in `__generated__/` |
329
- | `outputSchema` | `src/commands/status/types.ts` → `StatusJsonOutputSchema` from `__generated__/` |
330
- | Schemagen | `just schemagen` → `argsbarg schemagen` (justfile exports `node_modules/.bin` on `PATH`) |
331
- | Command layout | `src/commands/<name>/command.ts`; registration in `src/program.ts` |
332
- | MCP doc topics | `docs.topics` auto-exposed as `<key>://docs/<topic>` resources when docs + MCP enabled |
333
- | Package import | `from "argsbarg"` (not relative to argsbarg `src/`) |
334
- | Homebrew distribution | `scripts/formula-shared.ts`, `scripts/dev-formula.ts`, `Formula/`, `justfile` |
335
- | Dev tooling | Biome (`just format` / `just lint`), TypeScript, colocated tests |
336
- | Cursor rules | `.cursor/rules/cli-program.mdc`, `.cursor/rules/code.mdc` |
337
-
336
+ | Template | Path | Adds beyond builtins |
337
+ | --- | --- | --- |
338
+ | **cli** (default) | `examples/full-example/` | `echo`, `status` — options/flags only; no schemagen |
339
+ | **json** | `examples/full-example-json/` | `@sg` schemagen, `inputSchema`/`outputSchema`, `render-json`, `workspaces` REST CRUD, in-memory SQLite |
338
340
 
339
- When changing builtins or the template, run `just example-full-check` from the argsbarg repo root.
341
+ Package import: `from "argsbarg"` (not relative to argsbarg `src/`).
340
342
 
341
343
  ```bash
342
344
  export PATH="$PATH:$(pwd)/examples"
@@ -371,21 +373,19 @@ Opt in by setting `mcpServer: { enabled: true }` on your program root. Running `
371
373
 
372
374
  See **[docs/mcp.md](docs/mcp.md)** for configuration, env bootstrapping, custom resources, Cursor/Claude setup, and protocol details.
373
375
 
374
- ### 2. IDE Copilot Rules (Cursor / Claude Code)
376
+ ### 2. Agent instructions (`AGENTS.md`)
375
377
 
376
- ArgsBarg ships authoring docs under `node_modules/argsbarg/docs/`. Because AI agents do not automatically read inside `node_modules/`, you can copy a thin custom rule into your project:
378
+ ArgsBarg ships authoring docs under `node_modules/argsbarg/docs/`. Because AI agents do not automatically read inside `node_modules/`, each copy template includes an `AGENTS.md` with inlined argsbarg authoring rules and a `CLAUDE.md` bridge (`@AGENTS.md`).
377
379
 
378
380
  ```bash
379
- mkdir -p .cursor/rules
380
- bun scripts/merge-cli-program-rule.ts . \
381
- node_modules/argsbarg/examples/full-example/.cursor/rules/cli-program.mdc
381
+ bun scripts/merge-agents-md.ts .
382
382
  ```
383
383
 
384
- This acts as a "tripwire" that instructs AI agents in your workspace to read ArgsBarg's framework documentation before modifying your command definitions or schemas. See the **Cursor rule** section in [docs/cli-program.md](docs/cli-program.md).
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
386
  ### 3. Generated Skills & Workspace Configuration
387
387
 
388
- Running `myapp configure` launches an interactive setup wizard that can automatically write compact `SKILL.md` index files and full-reference markdown files (`reference.md`) directly into your global IDE directories (e.g., `~/.cursor/skills/` or `~/.claude/skills/`).
388
+ Running `myapp configure --sync` installs a compact `SKILL.md` index and full-reference `reference.md` to `~/.agents/skills/<key>/` when `program.skill: { enabled: true }`.
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
@@ -17,7 +17,7 @@ Start here to pick the right guide.
17
17
  | **Bundling `myapp docs` topics** | [bundled-docs.md](bundled-docs.md) — consumer docgen vs framework docs |
18
18
  | **Agent skills** | [ai-skills.md](ai-skills.md) — `configure`, `docs skill` |
19
19
  | **Maintaining the argsbarg repo** | [developing.md](developing.md) — release, consumers, npm `files` |
20
- | **Cursor / IDE agents in a consumer app** | `bunx argsbarg create` (includes rule) or `bun scripts/merge-cli-program-rule.ts .` from argsbarg checkout |
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 |
22
22
 
23
23
  ## Examples (agents: read these)
@@ -27,7 +27,8 @@ Examples are included in the npm tarball (`package.json` `files`). After `bun ad
27
27
  | Tier | Path | Use when |
28
28
  | --- | --- | --- |
29
29
  | Learn | [examples/minimal.ts](../examples/minimal.ts), [examples/nested.ts](../examples/nested.ts), [formats.ts](../examples/formats.ts) | One feature at a time |
30
- | **Copy** | [examples/full-example/](../examples/full-example/) | Bootstrapping a production CLI (all builtins + schemagen + Homebrew justfile) |
30
+ | **Copy (CLI)** | [examples/full-example/](../examples/full-example/) | Default `create` template — all builtins, Homebrew justfile; no schemagen |
31
+ | **Copy (JSON)** | [examples/full-example-json/](../examples/full-example-json/) | `create --template json` — `@sg`, schemas, REST CRUD, SQLite |
31
32
 
32
33
  ## Framework docs vs consumer docgen
33
34
 
@@ -35,6 +36,6 @@ Examples are included in the npm tarball (`package.json` `files`). After `bun ad
35
36
  | --- | --- | --- |
36
37
  | **Framework docs** | How argsbarg works; authoring conventions | This directory — shipped in `node_modules/argsbarg/docs/` after `bun add argsbarg` |
37
38
  | **Consumer docgen** | *Your* command tree, API, MCP guide for *your* app | `myapp docs cli`, `docs cli-schema`, `docs mcp` — written to `./docs/` with `--save` |
38
- | **Cursor rule** | Thin tripwire telling agents to read framework docs | `node_modules/argsbarg/examples/full-example/.cursor/rules/cli-program.mdc` — included by `create`; refresh with `merge-cli-program-rule.ts` |
39
+ | **Agent instructions** | Inlined argsbarg authoring rules in `AGENTS.md` | `node_modules/argsbarg/examples/full-example-json/AGENTS.md` — merge default for consumers; `create` includes a template copy |
39
40
 
40
- Agents do **not** load `node_modules/argsbarg/docs/` unless your repo references them (Cursor rule, `AGENTS.md`, or an `alwaysApply` project rule). Generated `./docs/cli.md` in a consumer repo describes **your** CLI, not argsbarg itself.
41
+ Agents do **not** load `node_modules/argsbarg/docs/` unless your repo references them (`AGENTS.md`, or an always-on project rule). Generated `./docs/cli.md` in a consumer repo describes **your** CLI, not argsbarg itself.
package/docs/ai-skills.md CHANGED
@@ -2,29 +2,29 @@
2
2
 
3
3
  > This feature is experimental.
4
4
 
5
- ArgsBarg can generate Cursor and Claude Code skill directories (`SKILL.md` + `reference.md`) from your CLI schema.
5
+ ArgsBarg can generate agent skill directories (`skill.md` + `reference.md`) from your CLI schema and install them to `~/.agents/skills/<key>/` per the open standard at https://dotagentsprotocol.com/.
6
6
 
7
- ## Install via `configure` (recommended)
7
+ ## Enable on the program root
8
8
 
9
- Install skills to the user environment:
10
-
11
- ```bash
12
- myapp configure --sync --yes
13
- # or interactive (accept skill targets when prompted):
14
- myapp configure
9
+ ```typescript
10
+ export const program = {
11
+ key: "myapp",
12
+ skill: { enabled: true },
13
+ ...
14
+ } satisfies CliProgram;
15
15
  ```
16
16
 
17
- Skills are written when the agent home or CLI exists:
17
+ When `skill.enabled` is `true`, Homebrew `post_install` (`configure --sync --yes`) installs and refreshes the skill. When omitted or `enabled` is not `true`, no skill is installed.
18
18
 
19
- - Cursor: `~/.cursor/skills/<dir>/` when `~/.cursor` exists
20
- - Claude Code: `~/.claude/skills/<dir>/` when `~/.claude` exists
21
- - Codex: `~/.codex/skills/<dir>/` when `codex` is on PATH
22
- - OpenCode: `~/.config/opencode/skills/<dir>/`
23
- - OpenClaw: `~/.openclaw/skills/<dir>/` when `openclaw` is on PATH
19
+ The skill directory name is the program `key` with `/`, `\`, and spaces replaced by `_` (e.g. `sqsp-qa`, `full-example`).
24
20
 
25
- The skill directory name defaults to the sanitized program `key` (e.g. `minimal.ts` → `minimal_ts`).
21
+ ## Install via `configure --sync`
22
+
23
+ ```bash
24
+ myapp configure --sync --yes
25
+ ```
26
26
 
27
- Existing skill directories are removed and rewritten on each install.
27
+ Skills are not prompted during interactive `configure` — install and uninstall are automatic when `skill.enabled` is set (brew install/uninstall and `--sync` / `--remove-all`).
28
28
 
29
29
  ## Programmatic install
30
30
 
@@ -32,28 +32,41 @@ Existing skill directories are removed and rewritten on each install.
32
32
  import { cliSkillInstall } from "argsbarg/skill/install"; // internal module
33
33
  ```
34
34
 
35
- For library use, call `cliSkillInstall(root, "cursor" | "claude", { global: true, rimraf: true })` — it returns changed file paths.
35
+ `cliSkillInstall(root, { global: true, rimraf: true })` returns changed file paths.
36
36
 
37
37
  ## Generated content
38
38
 
39
- - **`SKILL.md`** — YAML frontmatter, compact command index, pitfalls, and a pointer to `reference.md`
39
+ - **`skill.md`** — https://dotagentsprotocol.com frontmatter (`id`, `name`, `description`, `enabled`), compact command index, pitfalls, client setup, and a pointer to `reference.md`
40
+ - **`SKILL.md`** — compatibility copy of `skill.md` for tools that expect uppercase filenames
40
41
  - **`reference.md`** — full `docs cli` markdown reference
41
42
 
42
- Installed files include an HTML comment hint (`Generated by myapp configure; do not edit.`) after SKILL.md frontmatter and at the top of `reference.md`.
43
+ Installed files include an HTML comment hint (`Generated by myapp configure; do not edit.`) after skill frontmatter and at the top of `reference.md`.
44
+
45
+ ## Client setup
46
+
47
+ | Client | Skill path |
48
+ | --- | --- |
49
+ | Cursor, Codex, Copilot, most agents | `~/.agents/skills/<key>/` (auto via `configure --sync`) |
50
+ | Claude Code | Manual symlink to `~/.claude/skills/<key>/` |
51
+
52
+ ```bash
53
+ mkdir -p ~/.claude/skills
54
+ ln -sf ~/.agents/skills/<key> ~/.claude/skills/<key>
55
+ ```
43
56
 
44
- Skills describe **shell invocation only** — no MCP setup, `mcp.json`, or `tools/call` guidance. Use **`myapp docs mcp`** (when `docs` and `mcpServer` are enabled) or connect the MCP server for agent execution.
57
+ Skills describe **shell invocation only** — no MCP setup or `tools/call` guidance. Use **`myapp docs mcp`** (when `docs` and `mcpServer` are enabled) or connect the MCP server for agent execution.
45
58
 
46
59
  ## MCP vs skills vs docs
47
60
 
48
61
  | Mechanism | Role |
49
62
  | --- | --- |
50
63
  | **`myapp mcp`** (requires `mcpServer`) | Runtime tool execution over MCP |
51
- | **`myapp configure`** (skill targets) | Persists optimized skill bundle (`SKILL.md` index + `reference.md` full API) |
64
+ | **`program.skill.enabled`** + **`configure --sync`** | Persists optimized skill bundle at `~/.agents/skills/<key>/` |
52
65
  | **`myapp docs`** (requires `docs`) | Bundled markdown on stdout (`docs mcp` when MCP enabled) |
53
66
 
54
- `SKILL.md` is the routing index; `reference.md` matches `docs cli`. Prefer `configure` over `docs skill` for agents. See [cli-program.md](cli-program.md).
67
+ `skill.md` is the routing index; `reference.md` matches `docs cli`. Prefer `configure --sync` over `docs skill` for installed agents. See [cli-program.md](cli-program.md).
55
68
 
56
- **Claude Code plugin** (`mcpServer.claudePlugin: true` → `mcp bundle` writes `dist/claude-plugin/<name>.zip`) ships a separate MCP pointer skill (`SKILL.md` only) that routes agents to the bundled MCP server. This is a **dist artifact**, not installed via `configure`. Use **`configure`** for persisted shell-oriented skills.
69
+ **Claude Code plugin** (`mcpServer.claudePlugin: true` → `mcp bundle` writes `dist/claude-plugin/<name>.zip`) ships a separate MCP pointer skill (`SKILL.md` only) that routes agents to the bundled MCP server. This is a **dist artifact**, not installed via `configure`.
57
70
 
58
71
  See also:
59
72
 
@@ -8,7 +8,7 @@ Two documentation layers often coexist in a consumer repo:
8
8
 
9
9
  | Layer | Contents | How agents/humans get it |
10
10
  | --- | --- | --- |
11
- | **Argsbarg framework** | How to author `CliProgram`, MCP varargs policy, headless patterns | `node_modules/argsbarg/docs/` — wire via [full-example Cursor rule](../examples/full-example/.cursor/rules/cli-program.mdc) or `AGENTS.md` |
11
+ | **Argsbarg framework** | How to author `CliProgram`, MCP varargs policy, headless patterns | `node_modules/argsbarg/docs/` — wired via consumer [`AGENTS.md`](../examples/full-example-json/AGENTS.md) |
12
12
  | **Your CLI (docgen)** | Your command tree, options, MCP tool list, install notes | `myapp docs cli`, `docs cli-schema`, `docs mcp` — save with `--save` to `./docs/` |
13
13
 
14
14
  `docs cli` and `docs cli-schema` embed each leaf’s `outputSchema` when set — see [output-schema.md](output-schema.md) for how to generate and wire schemas.
@@ -8,10 +8,6 @@ ArgsBarg turns your schema into help, shell completions, MCP tools, and agent sk
8
8
 
9
9
  ```typescript
10
10
  const cli = {
11
- key: "myapp",
12
- version: "1.0.0",
13
- description: "One-line summary of what the CLI does.",
14
- mcpServer: { enabled: true },
15
11
  commands: [
16
12
  {
17
13
  key: "greet",
@@ -22,6 +18,10 @@ const cli = {
22
18
  handler: async (ctx) => { /* ... */ },
23
19
  },
24
20
  ],
21
+ description: "One-line summary of what the CLI does.",
22
+ key: "myapp",
23
+ mcpServer: { enabled: true },
24
+ version: "1.0.0",
25
25
  } satisfies CliProgram;
26
26
  ```
27
27
 
@@ -31,11 +31,11 @@ No `mcpTool` blocks required. Every leaf becomes an MCP tool; `inputSchema` come
31
31
 
32
32
  ```typescript
33
33
  const cli = {
34
- key: "myapp",
35
- version: "1.0.0",
34
+ commands: [/* ... */],
36
35
  description: "One-line summary of what the CLI does.",
37
36
  httpServer: { enabled: true }, // myapp api → http://127.0.0.1:3000
38
- commands: [/* ... */],
37
+ key: "myapp",
38
+ version: "1.0.0",
39
39
  } satisfies CliProgram;
40
40
  ```
41
41
 
@@ -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.
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`, `skill`, `version`, …).
94
94
 
95
95
  ## Descriptions
96
96
 
@@ -541,8 +541,9 @@ await cli.run();
541
541
  - **Strict:** unknown keys rejected on load.
542
542
  - **CLI:** missing required config exits 1 before the leaf handler (TTY prompt when interactive). Built-in `docs` and `configure get`/`set` skip this exit.
543
543
  - **MCP:** server stays up; missing config returns `isError: true` at `tools/call`.
544
- - **Configure:** interactive `configure` runs the app config wizard; **`configure --sync`** refreshes agent artifacts.
545
- - **Agent integration:** `configure.agentIntegration` (`mcp` | `skill` | `both`) sets default sync targets; see [configure.md](configure.md#configuretargets).
544
+ - **Configure:** interactive `configure` runs the app config wizard; **`configure --sync`** refreshes agent artifacts to `~/.agents/` (see https://dotagentsprotocol.com).
545
+ - **Agent skill:** `program.skill: { enabled: true }` installs to `~/.agents/skills/<key>/` on `configure --sync`; see [configure.md](configure.md) and [ai-skills.md](ai-skills.md).
546
+ - **MCP install:** `mcpServer: { enabled: true }` merges into `~/.agents/mcp.json` on `configure --sync`; manual Cursor/Claude setup in [mcp.md](mcp.md).
546
547
 
547
548
  See [config-schema.md](config-schema.md) for codegen, [configure.md](configure.md) (`configure.targets`), and [mcp.md](mcp.md).
548
549
 
@@ -554,21 +555,19 @@ See [config-schema.md](config-schema.md) for codegen, [configure.md](configure.m
554
555
 
555
556
  Do not declare user commands named `completion`, `configure`, `mcp`, `version`, or `docs` at the root — ArgsBarg injects these when configured. App config uses `configure get` / `configure set` subcommands (not a top-level `config` command).
556
557
 
557
- ## Cursor rule for consumer repos
558
+ ## Agent instructions for consumer repos
558
559
 
559
- Argsbarg ships framework docs under `node_modules/argsbarg/docs/` (same files as this repo’s `docs/`). **This file is the authoritative guide** — the Cursor rule is a thin tripwire that tells agents to read it.
560
+ Argsbarg ships framework docs under `node_modules/argsbarg/docs/` (same files as this repo’s `docs/`). **This file is the authoritative guide** — `AGENTS.md` inlines the tripwire rules that tell agents when to read it.
560
561
 
561
562
  Agents do **not** discover package docs automatically. Wire them in after `bun add argsbarg`:
562
563
 
563
- 1. **Copy the Cursor rule** (recommended):
564
+ 1. **Use the copy template `AGENTS.md`** (recommended):
564
565
 
565
566
  ```bash
566
- mkdir -p .cursor/rules
567
- bun scripts/merge-cli-program-rule.ts . \
568
- node_modules/argsbarg/examples/full-example/.cursor/rules/cli-program.mdc
567
+ bun scripts/merge-agents-md.ts .
569
568
  ```
570
569
 
571
- The template is ~30 lines: when to read which doc, plus hard rules agents often get wrong. It does **not** duplicate this guide. `bunx argsbarg create` copies this file into new projects automatically.
570
+ `bunx argsbarg create` copies `AGENTS.md` and `CLAUDE.md` (`@AGENTS.md`) into new projects automatically.
572
571
 
573
572
  2. **Add an app-specific block at the bottom** (recommended). Replace the template placeholder with a heading like `**myapp conventions:**` and short bullets — shared flag modules, `read*Flags` / `resolve*` paths, Ink vs JSON-only, etc. Example:
574
573
 
@@ -579,11 +578,11 @@ The template is ~30 lines: when to read which doc, plus hard rules agents often
579
578
  - Per command: `read*Flags` + `resolve*Input` in `commands/<name>/resolve.ts`.
580
579
  ```
581
580
 
582
- If you maintain argsbarg from a sibling checkout, `just consumer-dev` / `just consumers-sync` refresh the shared template and **keep** this footer (matched by the `**… conventions:**` heading). Commit `.cursor/rules/cli-program.mdc` in your repo.
581
+ If you maintain argsbarg from a sibling checkout, `just consumers-dev` / `just consumers-sync` refresh the shared managed section and **keep** your prefix and conventions footer. Commit `AGENTS.md` in your repo.
583
582
 
584
- 3. **Optional:** a separate rule (e.g. `.cursor/argsbarg.mdc` or `AGENTS.md`) for broader package API notes.
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:** `myapp configure` writes the **app** skill (`SKILL.md` under `~/.cursor/skills/`) from your command schema — how to *invoke* the CLI. The rule above is for *authoring* argsbarg schema.
585
+ - **Not this file:** `myapp configure --sync` writes the **app** skill (`SKILL.md` under `~/.agents/skills/<key>/`) from your command schema — how to *invoke* the CLI. `AGENTS.md` is for *authoring* argsbarg schema.
587
586
 
588
587
  ## See also
589
588
 
@@ -224,9 +224,9 @@ Object/array/`$ref` properties require `--json` on `configure set` when comma-se
224
224
 
225
225
  | Example | Role |
226
226
  | --- | --- |
227
- | [`examples/full-example/`](../examples/full-example/) | **Copy template** — `@sg` schemagen, builtins; optional `program.appConfig` |
227
+ | [`examples/full-example-json/`](../examples/full-example-json/) | **Schema-first copy template** — `@sg` schemagen, builtins; optional `program.appConfig` |
228
228
 
229
229
  ```bash
230
- cd examples/full-example && just setup && just schemagen
231
- FULL_EXAMPLE_API_TOKEN=dev just run configure get apiToken --json
230
+ cd examples/full-example-json && just setup && just schemagen
231
+ FULL_EXAMPLE_JSON_API_TOKEN=dev just run configure get apiToken --json
232
232
  ```
package/docs/configure.md CHANGED
@@ -68,10 +68,8 @@ Non-interactive / CI: pass **`--yes`** (or **`--json`**, **`--sync`**, **`--remo
68
68
  | --- | --- | --- |
69
69
  | Binary | skipped (read-only) | Homebrew formula `bin.install` |
70
70
  | Shell completions | skipped | Homebrew `generate_completions_from_executable` |
71
- | Cursor skill | Y/n prompt | `~/.cursor/skills/<dir>/` when `~/.cursor` exists |
72
- | Claude skill | Y/n prompt | `~/.claude/skills/<dir>/` when `~/.claude` exists |
73
- | Codex / OpenCode / OpenClaw skills | Y/n prompt | Agent-specific dirs when available |
74
- | MCP config | Y/n prompt when `mcpServer.enabled` | Cursor, Claude Code/Desktop, OpenCode, Codex, OpenClaw, ChatGPT desktop |
71
+ | Agent skill | skipped (automatic) | `~/.agents/skills/<key>/` when `program.skill.enabled` |
72
+ | MCP config | skipped (automatic) | `~/.agents/mcp.json` when `mcpServer.enabled` (see https://dotagentsprotocol.com) |
75
73
  | App config | auto-runs wizard | Interactive wizard may update `~/.local/lib/<key>/config.json` when values change; `--sync` bootstraps an empty file on install |
76
74
 
77
75
  ### Externally managed binary (Homebrew)
@@ -79,37 +77,35 @@ Non-interactive / CI: pass **`--yes`** (or **`--json`**, **`--sync`**, **`--remo
79
77
  When **`PATH`** resolves the program key to the **running executable** (e.g. after `brew install`):
80
78
 
81
79
  - **`configure --status`** shows `app: system (PATH)`
82
- - **`--sync`** refreshes skills and MCP; also creates `~/.local/lib/<key>/config.json` as `{}` when missing (all apps)
80
+ - **`configure --sync`** refreshes the agent skill (when `program.skill.enabled`) and merges MCP into `~/.agents/mcp.json` (when `mcpServer.enabled`); also creates `~/.local/lib/<key>/config.json` as `{}` when missing (all apps)
83
81
 
84
- MCP config uses the command name on **`PATH`**, not a Cellar path.
82
+ 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`.
85
83
 
86
84
  ### Interactive default
87
85
 
88
- Bare **`configure`** (TTY required) walks enabled install targets in order. For each target:
86
+ Bare **`configure`** (TTY required) runs the app config wizard when `program.appConfig` has entries. Agent skills and MCP are **not** prompted — they install automatically via brew `post_install` / `--sync` when `program.skill.enabled` or `mcpServer.enabled` respectively.
89
87
 
90
- - **Not installed:** `[Y/n]` — default install; `n` skips.
91
- - **Installed:** `[y/N]` — default keep; `n` uninstalls.
92
- - **App config** (`program.appConfig` with entries): runs the config wizard automatically (no Y/n gate). Remove the config file with **`configure --remove-config --yes`**.
88
+ Remove the config file with **`configure --remove-config --yes`**.
93
89
 
94
- The **`app`** target (binary on PATH) is shown in `--status` only — never mutated by `configure`.
90
+ The **`app`** and **`skill`** / **`agentsMcp`** targets are shown in `--status` only — never mutated by interactive `configure` (use `--sync` / brew hooks).
95
91
 
96
92
  ### `configure.targets`
97
93
 
98
- Configure which artifacts participate in `--sync`:
94
+ Optional gates for app binary status and app-config wizard participation in `--sync`:
99
95
 
100
96
  ```typescript
97
+ skill: { enabled: true },
98
+ mcpServer: { enabled: true },
101
99
  configure: {
102
- agentIntegration: "mcp", // | "skill" | "both" — default from mcpServer.enabled
103
100
  targets: {
104
- chatgptMcp: false,
105
- cursorSkill: { includedInAll: true },
101
+ configure: { includedInAll: true }, // optional: app config wizard on --sync
106
102
  },
107
103
  },
108
104
  ```
109
105
 
110
106
  `ConfigureTargetSpec` is `boolean` or `{ enabled?: boolean; includedInAll?: boolean }`.
111
107
 
112
- Artifact keys: `chatgptMcp`, `claudeCodeMcp`, `claudeDesktopMcp`, `claudeSkill`, `codexMcp`, `codexSkill`, `configure`, `cursorMcp`, `cursorSkill`, `openclawMcp`, `openclawSkill`, `opencodeMcp`, `opencodeSkill`.
108
+ Artifact keys: `app`, `configure`. Legacy `configure.targets.*Mcp` keys are rejected — MCP installs to `~/.agents/mcp.json` when `mcpServer.enabled`.
113
109
 
114
110
  ## App config (`program.appConfig`)
115
111
 
@@ -32,15 +32,15 @@ Sibling consumer repos (machine-specific paths in the root `justfile` `consumer_
32
32
 
33
33
  | Recipe | When | Effect |
34
34
  | --- | --- | --- |
35
- | `just consumers-dev` | Before publish; hacking on argsbarg locally | `bun add argsbarg@file:<relative>`; refresh `.cursor/rules/cli-program.mdc` and `code.mdc` from template (keeps app-specific suffix) |
35
+ | `just consumers-dev` | Before publish; hacking on argsbarg locally | `bun add argsbarg@file:<relative>`; refresh `AGENTS.md` from template (keeps app-specific prefix and conventions footer) |
36
36
  | `just consumers-sync` | After release | Sets `"argsbarg": "^<this package.json version>"`, `bun install`, merge **cli-program** + **code** Cursor rules, `just build`, `just docgen`, `just install-local` (Homebrew dev formula + agent artifacts; `just install` is an alias) |
37
37
  | `just consumers-schemagen` | After `@sg` type changes in consumers | Runs `argsbarg schemagen` in each `consumer_apps` path (fails if missing) |
38
38
 
39
39
  `consumers-sync` reads the version from **this repo’s** `package.json` — not npm. Run it **after** `just release` so consumers pin a version that exists on the registry.
40
40
 
41
- **Argsbarg authoring rules** — `scripts/merge-cli-program-rule.ts` and `scripts/merge-code-rule.ts` copy templates from `examples/full-example/.cursor/rules/` into each consumer, preserving any existing `**… conventions:**` footer block.
41
+ **Argsbarg authoring rules** — `scripts/merge-agents-md.ts` copies the template from `examples/full-example-json/AGENTS.md` into each consumer, preserving any existing prefix and `**… conventions:**` footer block.
42
42
 
43
- **Recommended in each consumer:** replace template placeholders with `**<app> conventions:**` bullets. Commit those files; merges refresh the shared top, not your footer.
43
+ **Recommended in each consumer:** replace template placeholders with `**<app> conventions:**` bullets. Commit `AGENTS.md`; merges refresh the managed section, not your prefix or footer.
44
44
 
45
45
  ## Upgrading consumer apps to 7.0
46
46
 
@@ -52,10 +52,10 @@ Breaking changes (no backward compat). See [CHANGELOG.md](../CHANGELOG.md) `[Unr
52
52
  4. **HTTP:** use `/api/...` REST routes only (`POST /tools/*` removed).
53
53
  5. **Hooks:** remove manual `ctx.locals.requestId` in `beforeInvoke` — framework seeds it.
54
54
  6. **Exports:** stop importing `loadLeafInputs` / `CliHttpResponseConfig` from `argsbarg` (use `ctx.inputs`, leaf `http.successContentType`).
55
- 7. **Cursor rules:** `just consumers-dev` merges `cli-program.mdc` + `code.mdc` (includes **Abstractions** needless-extraction rule).
55
+ 7. **Agent instructions:** `just consumers-dev` merges `AGENTS.md` + `CLAUDE.md` (includes **Abstractions** needless-extraction rule).
56
56
  8. **Verify:** `just test` and `just docgen` in each consumer repo.
57
57
 
58
- **Consumer app skill** — `just install-local` in each consumer (part of `consumers-sync`) runs Homebrew dev install then `myapp configure --sync --yes`, which updates `~/.cursor/skills/<app>/` from that app’s schema — not the argsbarg framework rule.
58
+ **Consumer app skill** — `just install-local` in each consumer (part of `consumers-sync`) runs Homebrew dev install then `myapp configure --sync --yes`, which updates `~/.agents/skills/<app>/` when `program.skill.enabled` — not the argsbarg framework rule.
59
59
 
60
60
  ## npm package contents
61
61
 
@@ -63,14 +63,14 @@ Breaking changes (no backward compat). See [CHANGELOG.md](../CHANGELOG.md) `[Unr
63
63
 
64
64
  When adding docs or examples intended for consumers, ensure they live under whitelisted paths (`docs/`, `examples/`, `src/`, etc.).
65
65
 
66
- Exclude `examples/full-example/node_modules/` from the npm tarball via [`.npmignore`](../.npmignore).
66
+ Exclude `examples/full-example/node_modules/` and `examples/full-example-json/node_modules/` from the npm tarball via [`.npmignore`](../.npmignore).
67
67
 
68
- ## Full example
68
+ ## Copy templates
69
69
 
70
- [`examples/full-example/`](../examples/full-example/) must enable every builtin (`capabilities.test.ts`). After builtin or schemagen doc changes:
70
+ Both [`examples/full-example/`](../examples/full-example/) (CLI) and [`examples/full-example-json/`](../examples/full-example-json/) (schema-first) must enable every builtin (`capabilities.test.ts`). After builtin or schemagen doc changes:
71
71
 
72
72
  ```bash
73
- just example-full-schemagen
73
+ just example-full-check
74
74
  just test
75
75
  ```
76
76