argsbarg 7.0.11 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/CHANGELOG.md +19 -1
  2. package/README.md +3 -2
  3. package/docs/ai-skills.md +2 -2
  4. package/docs/cli-program.md +3 -5
  5. package/docs/developing.md +3 -3
  6. package/docs/mcp.md +20 -7
  7. package/docs/output-schema.md +1 -1
  8. package/examples/full-example/AGENTS.md +20 -12
  9. package/examples/full-example/README.md +57 -12
  10. package/examples/full-example/biome.json +5 -4
  11. package/examples/full-example/bunfig.toml +3 -0
  12. package/examples/full-example/justfile +22 -27
  13. package/examples/full-example-json/AGENTS.md +14 -12
  14. package/examples/full-example-json/README.md +63 -15
  15. package/examples/full-example-json/biome.json +1 -3
  16. package/examples/full-example-json/bunfig.toml +3 -0
  17. package/examples/full-example-json/justfile +22 -27
  18. package/examples/mcp-plugin/.claude-plugin/plugin.json +11 -0
  19. package/examples/mcp-plugin/.cursor/hooks/run-tests-on-stop.ts +56 -0
  20. package/examples/mcp-plugin/.cursor/hooks.json +12 -0
  21. package/examples/mcp-plugin/.cursor-plugin/plugin.json +12 -0
  22. package/examples/mcp-plugin/.mcp.json +6 -0
  23. package/examples/mcp-plugin/AGENTS.md +90 -0
  24. package/examples/mcp-plugin/CLAUDE.md +1 -0
  25. package/examples/mcp-plugin/README.md +70 -0
  26. package/examples/mcp-plugin/biome.json +20 -0
  27. package/examples/mcp-plugin/bun.lock +48 -0
  28. package/examples/mcp-plugin/bunfig.toml +3 -0
  29. package/examples/mcp-plugin/docs/README.md +27 -0
  30. package/examples/mcp-plugin/docs/cli-schema.json +2085 -0
  31. package/examples/mcp-plugin/docs/cli.md +2026 -0
  32. package/examples/mcp-plugin/docs/http.md +92 -0
  33. package/examples/mcp-plugin/docs/mcp.md +116 -0
  34. package/examples/mcp-plugin/docs/openapi.json +1243 -0
  35. package/examples/mcp-plugin/justfile +89 -0
  36. package/examples/mcp-plugin/mcp.json +8 -0
  37. package/examples/mcp-plugin/package.json +23 -0
  38. package/examples/mcp-plugin/scripts/create-identity.ts +12 -0
  39. package/examples/mcp-plugin/scripts/mcp.mjs +11106 -0
  40. package/examples/mcp-plugin/scripts/release.ts +225 -0
  41. package/examples/mcp-plugin/skills/mcp-plugin/SKILL.md +59 -0
  42. package/examples/mcp-plugin/src/commands/echo/command.ts +26 -0
  43. package/examples/mcp-plugin/src/commands/render-json/__generated__/RenderJsonInputSchema.json +15 -0
  44. package/examples/mcp-plugin/src/commands/render-json/__generated__/index.ts +5 -0
  45. package/examples/mcp-plugin/src/commands/render-json/command.test.ts +46 -0
  46. package/examples/mcp-plugin/src/commands/render-json/command.ts +30 -0
  47. package/examples/mcp-plugin/src/commands/render-json/types.ts +9 -0
  48. package/examples/mcp-plugin/src/commands/status/__generated__/StatusJsonOutputSchema.json +15 -0
  49. package/examples/mcp-plugin/src/commands/status/__generated__/index.ts +5 -0
  50. package/examples/mcp-plugin/src/commands/status/command.test.ts +10 -0
  51. package/examples/mcp-plugin/src/commands/status/command.ts +28 -0
  52. package/examples/mcp-plugin/src/commands/status/types.ts +6 -0
  53. package/examples/mcp-plugin/src/commands/workspaces/__generated__/WorkspaceNameInputSchema.json +15 -0
  54. package/examples/mcp-plugin/src/commands/workspaces/__generated__/index.ts +5 -0
  55. package/examples/mcp-plugin/src/commands/workspaces/command.test.ts +58 -0
  56. package/examples/mcp-plugin/src/commands/workspaces/command.ts +94 -0
  57. package/examples/mcp-plugin/src/commands/workspaces/types.ts +6 -0
  58. package/examples/mcp-plugin/src/db/index.test.ts +86 -0
  59. package/examples/mcp-plugin/src/db/index.ts +77 -0
  60. package/examples/mcp-plugin/src/db/tables/workspaces.ts +58 -0
  61. package/examples/mcp-plugin/src/index.ts +10 -0
  62. package/examples/mcp-plugin/src/program.ts +32 -0
  63. package/examples/mcp-plugin/src/types/argsbarg.d.ts +11 -0
  64. package/examples/mcp-plugin/src/types/md.d.ts +4 -0
  65. package/examples/mcp-plugin/tsconfig.json +17 -0
  66. package/index.d.ts +12 -0
  67. package/package.json +1 -1
  68. package/src/builtins/mcp.ts +1 -1
  69. package/src/cli-tool/create.test.ts +5 -0
  70. package/src/cli-tool/create.ts +9 -1
  71. package/src/config/manifest.ts +56 -0
  72. package/src/config/resolve.test.ts +12 -12
  73. package/src/configure/configure.test.ts +5 -3
  74. package/src/core/parse.test.ts +6 -5
  75. package/src/core/types.ts +12 -0
  76. package/src/exports/mcp.ts +12 -0
  77. package/src/mcp/bundle.ts +12 -3
  78. package/src/mcp/claude.test.ts +2 -7
  79. package/src/mcp/claude.ts +49 -67
  80. package/src/mcp/cursor.test.ts +151 -0
  81. package/src/mcp/cursor.ts +155 -0
  82. package/src/mcp/hidden-mcpb.test.ts +34 -1
  83. package/src/mcp/plugin-shared.ts +107 -0
  84. package/src/mcp/result.ts +5 -1
  85. package/src/mcp/server.ts +3 -2
  86. package/src/test/fixtures.ts +13 -0
  87. package/src/test/integration/mcp.test.ts +8 -7
  88. package/examples/full-example/scripts/print-identity.ts +0 -28
  89. package/examples/full-example-json/scripts/print-identity.ts +0 -28
package/CHANGELOG.md CHANGED
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [7.1.0] - 2026-09-18
11
+
12
+ ### Changed
13
+
14
+ - Updated copy-template READMEs (`full-example`, `full-example-json`) to be user-facing (Homebrew install via tap and simplified formula install, CLI commands, usage examples, agent/MCP integration, and documentation links) rather than template contributor guides.
15
+ - Copy-template justfiles use hardcoded CLI/tap literals (substituted by `argsbarg create`); removed `scripts/print-identity.ts` and runtime `bun` indirection. `{tapOrg}` / `{tapRepo}` remain only for Homebrew tap paths. Comment documents `set shell`.
16
+ - Inverted `AGENTS.md` hierarchy in copy templates and consumer sync: argsbarg managed framework baseline sits at the top (under the app title) with an explicit precedence note, and all app-specific sections (`## Tooling`, `## Documentation`, `## App conventions`, custom sections) live below `<!-- /argsbarg:managed -->` so project-specific rules override framework defaults. `merge-agents-md` automatically migrates legacy sandwich layouts to the new structure.
17
+
18
+ ### Added
19
+
20
+ - **`mcp-plugin` copy template** (`examples/mcp-plugin/`) — Agent MCP plugin template for Cursor and Claude Code marketplaces, featuring in-repo manifests (`.cursor-plugin/plugin.json`, `mcp.json`, `.claude-plugin/plugin.json`, `.mcp.json`), a standalone bundled Node script (`scripts/mcp.mjs`), and an in-memory datastore with `@sg` schemagen.
21
+ - Cross-runtime MCP stdio loop using `process.stdin` in `mcpServeStdioLoop` to support standalone bundled execution under Node.js as well as Bun.
22
+ - bunfig.toml to examples so bun will auto-install deps on run
23
+ - **`mcpServer.cursorPlugin`** — opt-in Cursor plugin zip packaging (`dist/cursor-plugin/<name>.zip`) via `mcp bundle`, generating `.cursor-plugin/plugin.json`, `mcp.json` with `${CURSOR_PLUGIN_ROOT}`, and preservation of repository skills.
24
+ - **Plugin skill preservation** — `mcp bundle` (`claudePlugin` and `cursorPlugin`) copies repository skills (`skills/<key>/`) when present in the project, falling back to generated MCP routing stubs when absent.
25
+ - **Extended bundle metadata** — `CliMcpBundleConfig` supports `displayName`, `homepage`, `repository`, `license`, and `skillsDir` overrides for plugin manifests.
26
+
10
27
  ## [7.0.11] - 2026-09-16
11
28
 
12
29
  ### Fixed
@@ -1016,7 +1033,8 @@ const cli = { ... } satisfies CliProgram; // or : CliProgram
1016
1033
  - 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`).
1017
1034
  - Imports: use `CliPositional` where needed; replace `CliOptionDef` with `CliOption` or `CliPositional` as appropriate.
1018
1035
 
1019
- [Unreleased]: https://github.com/bdombro/bun-argsbarg/compare/v7.0.11...HEAD
1036
+ [Unreleased]: https://github.com/bdombro/bun-argsbarg/compare/v7.1.0...HEAD
1037
+ [7.1.0]: https://github.com/bdombro/bun-argsbarg/releases/tag/v7.1.0
1020
1038
  [7.0.11]: https://github.com/bdombro/bun-argsbarg/releases/tag/v7.0.11
1021
1039
  [7.0.10]: https://github.com/bdombro/bun-argsbarg/releases/tag/v7.0.10
1022
1040
  [7.0.9]: https://github.com/bdombro/bun-argsbarg/releases/tag/v7.0.9
package/README.md CHANGED
@@ -1,4 +1,5 @@
1
- Logo
1
+ ![Logo](logo.png)
2
+ <!-- Big money NE - https://patorjk.com/software/taag/#p=testall&f=Bulbhead&t=shebangsy&x=none&v=4&h=4&w=80&we=false> -->
2
3
 
3
4
  [GitHub](https://github.com/bdombro/bun-argsbarg)
4
5
  [License: MIT](LICENSE)
@@ -381,7 +382,7 @@ ArgsBarg ships authoring docs under `node_modules/argsbarg/docs/`. Because AI ag
381
382
  bun scripts/merge-agents-md.ts .
382
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
+ This refreshes the argsbarg-managed section at the top of `AGENTS.md` while preserving all app-specific sections below it. See **Agent instructions** in [docs/cli-program.md](docs/cli-program.md).
385
386
 
386
387
  ### 3. Agent Skills & Workspace Configuration
387
388
 
package/docs/ai-skills.md CHANGED
@@ -15,9 +15,9 @@ Because developers customize `skills/<app>/SKILL.md` with domain workflows, exec
15
15
  - **Commands catalog** — compact intent-based router directing agents to the right subcommands
16
16
  - **Workflow & Pitfalls** — guidelines for automated execution (e.g. using non-interactive flags like `--yes`)
17
17
 
18
- ## Claude Code plugin
18
+ ## Claude Code and Cursor plugins
19
19
 
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`.
20
+ When `mcpServer.claudePlugin: true` and/or `mcpServer.cursorPlugin: true` is configured, running `myapp mcp bundle` packages plugin archives (`dist/claude-plugin/<name>.zip` and `dist/cursor-plugin/<name>.zip`). If a repository skill directory exists (`skills/<key>/`), the package bundles that custom skill; otherwise it falls back to a generated MCP pointer skill that routes agents to the bundled MCP server. These are dist packaging artifacts, not installed via `configure`.
21
21
 
22
22
  ## Uninstalling legacy skills
23
23
 
@@ -584,18 +584,16 @@ bun scripts/merge-agents-md.ts .
584
584
 
585
585
  `bunx argsbarg create` copies `AGENTS.md` and `CLAUDE.md` (`@AGENTS.md`) into new projects automatically.
586
586
 
587
- 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:
587
+ 2. **Add app-specific sections below the managed block** (recommended). The framework baseline lives between `<!-- argsbarg:managed -->` and `<!-- /argsbarg:managed -->` at the top of the file. All application-specific sections (`## Tooling`, `## Documentation`, `## App conventions`, custom rules) live below the closing marker where they take precedence over framework defaults. Example:
588
588
 
589
589
  ```markdown
590
- **sqsp-qa conventions:**
590
+ ## App conventions
591
591
 
592
592
  - Shared mutator flags: `readQaMutatingFlags(ctx)` in `src/cli/shared.ts`.
593
593
  - Per command: `read*Flags` + `resolve*Input` in `commands/<name>/resolve.ts`.
594
594
  ```
595
595
 
596
- 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.
597
-
598
- 3. **Optional:** add consumer-specific sections above the `<!-- argsbarg:managed -->` marker in `AGENTS.md` (project context, Ink patterns, domain notes).
596
+ If you maintain argsbarg from a sibling checkout, `just consumers-dev` / `just consumers-sync` refresh the shared managed section and **keep** all app-specific sections below it. Commit `AGENTS.md` in your repo.
599
597
 
600
598
  - **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.
601
599
 
@@ -36,15 +36,15 @@ Sibling consumer repos (machine-specific paths in the root `justfile` `consumer_
36
36
 
37
37
  | Recipe | When | Effect |
38
38
  | --- | --- | --- |
39
- | `just consumers-dev` | Before publish; hacking on argsbarg locally | `bun add argsbarg@file:<relative>`; fix `.bin/argsbarg` symlink; refresh `AGENTS.md` from template (keeps app-specific prefix and conventions footer) |
39
+ | `just consumers-dev` | Before publish; hacking on argsbarg locally | `bun add argsbarg@file:<relative>`; fix `.bin/argsbarg` symlink; refresh `AGENTS.md` from template (preserves app-specific sections below managed block) |
40
40
  | `just consumers-sync` | After release | Sets `"argsbarg": "^<this package.json version>"`, `bun install`, merge `AGENTS.md`, `just build`, `just docgen`, `just install-local` (Homebrew dev formula + agent artifacts; `just install` is an alias) |
41
41
  | `just consumers-schemagen` | After `@sg` type changes in consumers | Runs `argsbarg schemagen` in each `consumer_apps` path (fails if missing) |
42
42
 
43
43
  `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.
44
44
 
45
- **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.
45
+ **Argsbarg authoring rules** — `scripts/merge-agents-md.ts` copies the template from `examples/full-example-json/AGENTS.md` into each consumer. The framework baseline is placed at the top, and all app-specific sections live below `<!-- /argsbarg:managed -->` where they take precedence over framework defaults.
46
46
 
47
- **Recommended in each consumer:** replace template placeholders with `**<app> conventions:**` bullets. Commit `AGENTS.md`; merges refresh the managed section, not your prefix or footer.
47
+ **Recommended in each consumer:** replace template placeholders under `## App conventions` with project-specific bullets. Commit `AGENTS.md`; merges refresh the managed section, not your app-specific sections.
48
48
 
49
49
  ## Upgrading consumer apps to 7.0
50
50
 
package/docs/mcp.md CHANGED
@@ -343,17 +343,19 @@ When `mcpServer.enabled` is true, **`mcp bundle`** writes dist artifacts you opt
343
343
  ```bash
344
344
  just build
345
345
  ./dist/myapp mcp bundle
346
- # → dist/myapp.mcpb (when mcpServer.mcpd: true)
346
+ # → dist/myapp.mcpb (when mcpServer.mcpd: true)
347
347
  # → dist/claude-plugin/myapp.zip (when mcpServer.claudePlugin: true)
348
+ # → dist/cursor-plugin/myapp.zip (when mcpServer.cursorPlugin: true)
348
349
  ```
349
350
 
350
- Enable one or both flags:
351
+ Enable any combination of packaging flags:
351
352
 
352
353
  ```typescript
353
354
  mcpServer: {
354
355
  enabled: true,
355
356
  mcpd: true, // Claude Desktop `.mcpb`
356
357
  claudePlugin: true, // Claude Code plugin zip
358
+ cursorPlugin: true, // Cursor plugin zip
357
359
  },
358
360
  ```
359
361
 
@@ -363,8 +365,9 @@ Expects the compiled binary at **`dist/<program.key>`**. Stdout prints one path
363
365
  | --- | --- |
364
366
  | **`dist/<key>.mcpb`** | Claude Desktop MCP Bundle — when `mcpd: true` (default **false**) |
365
367
  | **`dist/claude-plugin/<name>.zip`** | Claude Code plugin zip — when `claudePlugin: true` (default **false**) |
368
+ | **`dist/cursor-plugin/<name>.zip`** | Cursor plugin zip — when `cursorPlugin: true` (default **false**) |
366
369
 
367
- Manifest metadata is generated from your schema (`mcpServerId`, tools, `program.appConfig` user config for env-mapped entries). Optional pack-time fields live under **`mcpServer.bundle`** (`author`, `icon`, `longDescription`).
370
+ Manifest metadata is generated from your schema (`mcpServerId`, tools, `program.appConfig` user config for env-mapped entries). Optional pack-time fields live under **`mcpServer.bundle`** (`author`, `displayName`, `homepage`, `icon`, `license`, `longDescription`, `repository`, `skillsDir`).
368
371
 
369
372
  **Claude Code plugin zip layout** (paths at archive root):
370
373
 
@@ -372,14 +375,24 @@ Manifest metadata is generated from your schema (`mcpServerId`, tools, `program.
372
375
  .claude-plugin/plugin.json # includes "mcpServers": ".mcp.json"
373
376
  .mcp.json
374
377
  bin/myapp # executable (0755 preserved in the zip)
375
- skills/<dirName>/SKILL.md
378
+ skills/<dirName>/...
376
379
  ```
377
380
 
378
- `plugin.json` references `.mcp.json` so Claude Desktop and Claude Code load the bundled MCP server when the plugin is enabled. The plugin zip preserves the executable bit on `bin/<key>`.
381
+ **Cursor plugin zip layout** (paths at archive root):
379
382
 
380
- The bundled `SKILL.md` is an **MCP routing stub** — it tells Claude to use the plugin’s MCP toolset (server id, `tools/list`, schema resource). It is not a shell CLI catalog and does not include `reference.md`. Use **`configure`** for a persisted shell-oriented skill bundle.
383
+ ```
384
+ .cursor-plugin/plugin.json # Cursor plugin manifest
385
+ mcp.json # includes mcpServers with ${CURSOR_PLUGIN_ROOT}
386
+ bin/myapp # executable (0755 preserved in the zip)
387
+ skills/<dirName>/...
388
+ ```
389
+
390
+ `plugin.json` and `mcp.json` configure Cursor and Claude to load the bundled MCP server when the plugin is enabled. The plugin zip preserves the executable bit on `bin/<key>`.
391
+
392
+ If the repository has a skill directory under `skills/<dirName>/` (or `mcpServer.bundle.skillsDir`), the plugin bundles that repository skill. Otherwise, it falls back to a generated **MCP routing stub** telling the agent to use the plugin's MCP toolset.
381
393
 
382
- Load locally with `claude --plugin-dir ./dist/claude-plugin/myapp.zip`.
394
+ Load Claude plugin locally with `claude --plugin-dir ./dist/claude-plugin/myapp.zip`.
395
+ Unpack Cursor plugin locally into `~/.cursor/plugins/local/<name>`.
383
396
 
384
397
  Bare **`myapp mcp`** still runs the stdio MCP server (unchanged for `configure` MCP targets and MCP hosts). Use **`configure install`** for Cursor, Claude Code, Claude Desktop, and OpenCode JSON config.
385
398
 
@@ -212,7 +212,7 @@ Per consumer repo (optional):
212
212
  4. `just docgen` / `myapp docs cli --save` — refresh consumer docs.
213
213
  5. Document which commands use which roots in **your** `docs/architecture.md` (argsbarg does not maintain per-app tables).
214
214
 
215
- Add a bullet under your app’s `**… conventions:**` block in `AGENTS.md` pointing at `node_modules/argsbarg/docs/output-schema.md`.
215
+ Add a bullet under your app’s `## App conventions` section in `AGENTS.md` pointing at `node_modules/argsbarg/docs/output-schema.md`.
216
216
 
217
217
  **Reference implementation:** [`examples/full-example-json/`](../examples/full-example-json/) in this repo — `@sg` on command types, `__generated__/`, and `status` leaf with `StatusJsonOutputSchema`.
218
218
 
@@ -1,17 +1,8 @@
1
1
  # full-example
2
2
 
3
- ## Tooling
4
-
5
- - Bun only (`bun`, `bunx`, `bun test`). No Node/npm/pnpm.
6
-
7
- ## Documentation
8
-
9
- - `README.md` — user-facing install/commands
10
- - `docs/architecture.md` — maintainer internals (create if missing)
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)
3
+ <!-- argsbarg:managed — overwritten on merge; framework baseline; app-specific sections below take precedence -->
13
4
 
14
- <!-- argsbarg:managed -->
5
+ > **Baseline framework rules:** The conventions below are defaults for argsbarg projects. Project-specific sections below this managed block override these defaults.
15
6
 
16
7
  ## Argsbarg schema
17
8
 
@@ -70,8 +61,25 @@ When adding commands: `src/commands/<name>/command.ts`; register in `program.ts`
70
61
  - **Tests:** `just test` (after `just check`)
71
62
  - **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
63
 
64
+ ### Abstractions
65
+
66
+ Avoid needless extraction: keep single-use helpers in the calling file by default. Split only when reused elsewhere, the caller is large or hard to follow, or extraction clarifies a substantial unit. Do not create tiny one-off helpers.
67
+ - ❌ `utils/formatX.ts` — 60-line helper used by one command
68
+ - ✅ inline helper in that command file
69
+
73
70
  <!-- /argsbarg:managed -->
74
71
 
75
- **full-example conventions:**
72
+ ## Tooling
73
+
74
+ - Bun only (`bun`, `bunx`, `bun test`). No Node/npm/pnpm.
75
+
76
+ ## Documentation
77
+
78
+ - `README.md` — user-facing install/commands
79
+ - `docs/architecture.md` — maintainer internals (create if missing)
80
+ - Generated: `just docgen` → `docs/cli.md`, `docs/cli-schema.json`
81
+ - `skills/full-example/SKILL.md` — agent skill router (scaffolded from template; customize as needed)
82
+
83
+ ## App conventions
76
84
 
77
85
  Replace with app-specific bullets.
@@ -1,24 +1,69 @@
1
1
  # full-example
2
2
 
3
- Argsbarg **CLI copy template** — production shell without schemagen (not a kitchen-sink product).
3
+ Argsbarg CLI copy template (MCP, HTTP, configure, skills; no schemagen).
4
4
 
5
- For `@sg` schemagen, JSON Schema validation, and REST CRUD patterns, use `examples/full-example-json/` or `argsbarg create --template json`.
5
+ ## Installation
6
6
 
7
- ## What's in this app
7
+ Install via Homebrew:
8
8
 
9
- - **Builtins enabled:** CLI, shell completion, `docs`, MCP, HTTP API, `configure`, agent skills
10
- - **Commands:**
11
- - `echo` — simple flags/positionals (MCP-friendly)
12
- - `status` — app version with optional `--json` (no `outputSchema`)
13
- - **Tooling:** `just docgen`, Homebrew/just dev workflow (no schemagen)
9
+ ```bash
10
+ brew tap bdombro/bun-argsbarg git@github.com:bdombro/bun-argsbarg.git
11
+ brew install full-example
12
+ full-example configure install
13
+ ```
14
+
15
+ `full-example configure install` sets up shell completions, agent skills, and MCP configuration.
16
+
17
+ ## Commands
18
+
19
+ - `full-example echo` — Echo text back to stdout or inspect flags.
20
+ - `full-example status` — Show application version with optional `--json`.
21
+
22
+ ### Built-in commands
23
+
24
+ - `full-example completion` — Install or inspect shell tab completions (bash, zsh, fish).
25
+ - `full-example configure` — Manage agent artifacts (skills, MCP, application configuration).
26
+ - `full-example docs` — Browse bundled documentation topics (`cli`, `mcp`, `http`, `readme`).
27
+ - `full-example mcp` — Start the Model Context Protocol (stdio) server for AI coding agents.
28
+ - `full-example version` — Display version information.
29
+
30
+ ## Usage
31
+
32
+ ```bash
33
+ # Print a message
34
+ full-example echo "Hello, world!"
35
+
36
+ # Inspect JSON status
37
+ full-example status --json
38
+
39
+ # Start the MCP server for AI agents
40
+ full-example mcp
41
+ ```
42
+
43
+ ## AI Agent & MCP Integration
44
+
45
+ `full-example` includes an integrated MCP server and agent skills out of the box:
46
+
47
+ - **MCP server**: Run `full-example mcp` or register via `full-example configure install`.
48
+ - **Agent skill**: See `skills/full-example/SKILL.md` for agent router instructions.
49
+
50
+ ## Documentation
51
+
52
+ | Need | Resource |
53
+ | --- | --- |
54
+ | CLI reference | [docs/cli.md](docs/cli.md) or `full-example docs cli` |
55
+ | MCP tools | [docs/mcp.md](docs/mcp.md) or `full-example docs mcp` |
56
+ | HTTP API | [docs/http.md](docs/http.md) or `full-example docs http` |
57
+ | Agent skill router | [skills/full-example/SKILL.md](skills/full-example/SKILL.md) |
58
+ | CLI schema (JSON) | [docs/cli-schema.json](docs/cli-schema.json) |
14
59
 
15
- ## Quick start
60
+ ## Development
16
61
 
17
- From a git checkout at this directory (requires [Homebrew](https://brew.sh), [just](https://just.systems), and [Bun](https://bun.sh)):
62
+ Requires [Homebrew](https://brew.sh), [just](https://just.systems), and [Bun](https://bun.sh):
18
63
 
19
64
  ```bash
20
65
  brew install just bun
21
66
  just setup
22
- just run status --json
23
- just run docs readme
67
+ just check
68
+ just test
24
69
  ```
@@ -4,7 +4,10 @@
4
4
  "linter": {
5
5
  "enabled": true,
6
6
  "rules": {
7
- "preset": "recommended"
7
+ "preset": "recommended",
8
+ "complexity": {
9
+ "noStaticOnlyClass": "off"
10
+ }
8
11
  }
9
12
  },
10
13
  "formatter": {
@@ -14,9 +17,7 @@
14
17
  },
15
18
  "overrides": [
16
19
  {
17
- "includes": ["**/*.json"],
18
- "formatter": { "enabled": false },
19
- "linter": { "enabled": false }
20
+ "includes": ["**/*.json"]
20
21
  }
21
22
  ]
22
23
  }
@@ -0,0 +1,3 @@
1
+ [install]
2
+ # fetch package.json deps on first `bun src/index.ts` without manual `bun install`.
3
+ auto = "fallback"
@@ -1,16 +1,11 @@
1
+ # bash (not sh); -e bail on errors, -u error on unset vars, pipefail fails pipelines when any stage fails
1
2
  set shell := ["bash", "-eu", "-o", "pipefail", "-c"]
2
3
 
3
4
  export PATH := justfile_directory() + "/node_modules/.bin:" + env_var("PATH")
4
5
 
5
- cli_key := `bun scripts/print-identity.ts key`
6
- tap_org := `bun scripts/print-identity.ts tapOrg`
7
- tap_repo := `bun scripts/print-identity.ts tapRepo`
8
- tap := `bun scripts/print-identity.ts tap`
9
- release_repo := `bun scripts/print-identity.ts releaseRepo`
10
- tap_git_url := "git@github.com:" + release_repo + ".git"
11
6
  brew_prefix := `brew --prefix`
12
- tap_parent := brew_prefix + "/Library/Taps/" + tap_org
13
- tap_path := tap_parent + "/homebrew-" + tap_repo
7
+ tap_parent := brew_prefix + "/Library/Taps/{tapOrg}"
8
+ tap_path := tap_parent + "/homebrew-{tapRepo}"
14
9
 
15
10
  # List available recipes (default)
16
11
  _:
@@ -18,7 +13,7 @@ _:
18
13
 
19
14
  # Compile the CLI binary to dist/full-example
20
15
  build:
21
- bun build ./src/index.ts --compile --outfile=dist/{{cli_key}}
16
+ bun build ./src/index.ts --compile --outfile=dist/full-example
22
17
  @rm -f .*.bun-build
23
18
 
24
19
  # Run typecheck and format
@@ -34,11 +29,11 @@ demo-http:
34
29
 
35
30
  # demo a CLI command
36
31
  demo-cli:
37
- @just run {{cli_key}} status
32
+ @just run full-example status
38
33
 
39
34
  # demo a CLI command
40
35
  demo-help:
41
- @just run {{cli_key}} --help
36
+ @just run full-example --help
42
37
 
43
38
  # Run the CLI from source with optional args; restarts on file changes
44
39
  dev *ARGS:
@@ -70,26 +65,26 @@ install-local: uninstall build
70
65
  mkdir -p {{tap_parent}}
71
66
  ln -sfn '{{justfile_directory()}}' {{tap_path}}
72
67
  bun scripts/dev-formula.ts install
73
- HOMEBREW_NO_ASK=1 brew reinstall --formula {{tap}}/{{cli_key}} || HOMEBREW_NO_ASK=1 brew install --force --formula {{tap}}/{{cli_key}}
68
+ HOMEBREW_NO_ASK=1 brew reinstall --formula bdombro/bun-argsbarg/full-example || HOMEBREW_NO_ASK=1 brew install --force --formula bdombro/bun-argsbarg/full-example
74
69
  bun scripts/dev-formula.ts reset
75
- {{cli_key}} configure install
70
+ full-example configure install
76
71
 
77
72
  # Remove local dev install, then install from GitHub tap (requires gh auth login)
78
73
  install-production: uninstall
79
- brew tap {{release_repo}} {{tap_git_url}}
80
- brew install --formula {{release_repo}}/{{cli_key}}
81
- {{cli_key}} configure install
74
+ brew tap bdombro/bun-argsbarg git@github.com:bdombro/bun-argsbarg.git
75
+ brew install full-example
76
+ full-example configure install
82
77
 
83
78
  # Alias for backward compatibility
84
79
  reinstall: reinstall-local
85
80
 
86
81
  # Rebuild binary and swap into Cellar (run install-local first; run `just refresh` for skills/MCP)
87
82
  reinstall-local: build
88
- install -m 755 dist/{{cli_key}} "$(brew --prefix {{cli_key}})/bin/{{cli_key}}"
83
+ install -m 755 dist/full-example "$(brew --prefix full-example)/bin/full-example"
89
84
 
90
85
  # Refresh agent skills/MCP without reinstalling the binary
91
86
  refresh:
92
- {{cli_key}} configure install
87
+ full-example configure install
93
88
 
94
89
  # Lint sources without writing
95
90
  lint:
@@ -101,7 +96,7 @@ run *ARGS:
101
96
 
102
97
  # Generate JSON Schema artifacts from TypeScript types (not used in this template)
103
98
  schemagen:
104
- @echo "This CLI template has no @sg types. Use full-example-json or add /** @sg */ types first."
99
+ @echo "No @sg types in the cli template. Use argsbarg create --template json or add /** @sg */ types first."
105
100
 
106
101
  # Install bun/npm dependencies
107
102
  setup:
@@ -118,12 +113,12 @@ release *ARGS:
118
113
 
119
114
  # Install release formula from tap and run formula test
120
115
  test-release:
121
- HOMEBREW_NO_ASK=1 brew untap {{tap}} 2>/dev/null || true
116
+ HOMEBREW_NO_ASK=1 brew untap bdombro/bun-argsbarg 2>/dev/null || true
122
117
  mkdir -p {{tap_parent}}
123
118
  ln -sfn '{{justfile_directory()}}' {{tap_path}}
124
- HOMEBREW_NO_ASK=1 brew uninstall --formula {{tap}}/{{cli_key}} 2>/dev/null || true
125
- brew install --formula {{tap}}/{{cli_key}}
126
- brew test {{cli_key}}
119
+ HOMEBREW_NO_ASK=1 brew uninstall --formula bdombro/bun-argsbarg/full-example 2>/dev/null || true
120
+ brew install --formula bdombro/bun-argsbarg/full-example
121
+ brew test full-example
127
122
 
128
123
  # Typecheck without emitting build artifacts
129
124
  typecheck:
@@ -131,7 +126,7 @@ typecheck:
131
126
 
132
127
  # Undo dev/Homebrew install (remove agent artifacts, then keg + untap)
133
128
  uninstall:
134
- @{{cli_key}} configure uninstall --yes 2>/dev/null || just run configure uninstall --yes
135
- @HOMEBREW_NO_ASK=1 brew uninstall --formula {{tap}}/{{cli_key}} 2>/dev/null || true
136
- @HOMEBREW_NO_ASK=1 brew uninstall --formula {{tap}}/{{cli_key}}-local 2>/dev/null || true
137
- @HOMEBREW_NO_ASK=1 brew untap {{tap}} 2>/dev/null || true
129
+ @full-example configure uninstall --yes 2>/dev/null || just run configure uninstall --yes
130
+ @HOMEBREW_NO_ASK=1 brew uninstall --formula bdombro/bun-argsbarg/full-example 2>/dev/null || true
131
+ @HOMEBREW_NO_ASK=1 brew uninstall --formula bdombro/bun-argsbarg/full-example-local 2>/dev/null || true
132
+ @HOMEBREW_NO_ASK=1 brew untap bdombro/bun-argsbarg 2>/dev/null || true
@@ -1,17 +1,8 @@
1
1
  # full-example-json
2
2
 
3
- ## Tooling
4
-
5
- - Bun only (`bun`, `bunx`, `bun test`). No Node/npm/pnpm.
3
+ <!-- argsbarg:managed — overwritten on merge; framework baseline; app-specific sections below take precedence -->
6
4
 
7
- ## Documentation
8
-
9
- - `README.md` — user-facing install/commands
10
- - `docs/architecture.md` — maintainer internals (create if missing)
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)
13
-
14
- <!-- argsbarg:managed -->
5
+ > **Baseline framework rules:** The conventions below are defaults for argsbarg projects. Project-specific sections below this managed block override these defaults.
15
6
 
16
7
  ## Argsbarg schema
17
8
 
@@ -83,6 +74,17 @@ Avoid needless extraction: keep single-use helpers in the calling file by defaul
83
74
 
84
75
  <!-- /argsbarg:managed -->
85
76
 
86
- **full-example-json conventions:**
77
+ ## Tooling
78
+
79
+ - Bun only (`bun`, `bunx`, `bun test`). No Node/npm/pnpm.
80
+
81
+ ## Documentation
82
+
83
+ - `README.md` — user-facing install/commands
84
+ - `docs/architecture.md` — maintainer internals (create if missing)
85
+ - Generated: `just docgen` → `docs/cli.md`, `docs/cli-schema.json`
86
+ - `skills/full-example-json/SKILL.md` — agent skill router (scaffolded from template; customize as needed)
87
+
88
+ ## App conventions
87
89
 
88
90
  Replace with app-specific bullets.
@@ -1,27 +1,75 @@
1
1
  # full-example-json
2
2
 
3
- Argsbarg **schema-first copy template** — `@sg` schemagen, JSON Schema validation, REST CRUD demo (not a kitchen-sink product).
3
+ Argsbarg schema-first copy template (@sg schemagen, JSON schemas, REST CRUD).
4
4
 
5
- For a CLI-only template without schemagen, use `examples/full-example/` or `argsbarg create --template cli`.
5
+ ## Installation
6
6
 
7
- ## What's in this app
7
+ Install via Homebrew:
8
8
 
9
- - **Builtins enabled:** CLI, shell completion, `docs`, MCP, HTTP API, `configure`, agent skills
10
- - **Commands:**
11
- - `echo` — simple flags/positionals
12
- - `render-json` — `kind: "json"` leaf, schemagen `inputSchema`, `ctx.inputsAs`
13
- - `status` — schemagen `outputSchema`, `--json`
14
- - `workspaces` — REST CRUD, `:id` param routers, verb leaves, schemagen input schemas
15
- - **Tooling:** `@sg` schemagen, `just docgen`, Homebrew/just dev workflow, in-memory SQLite (`bun:sqlite`)
9
+ ```bash
10
+ brew tap bdombro/bun-argsbarg git@github.com:bdombro/bun-argsbarg.git
11
+ brew install full-example-json
12
+ full-example-json configure install
13
+ ```
14
+
15
+ `full-example-json configure install` sets up shell completions, agent skills, and MCP configuration.
16
+
17
+ ## Commands
18
+
19
+ - `full-example-json echo` — Echo text back to stdout or inspect flags.
20
+ - `full-example-json render-json` — Process structured JSON payloads with schema validation.
21
+ - `full-example-json status` — Show application version with schemagen output schema (`--json`).
22
+ - `full-example-json workspaces` — Manage workspace resources (REST CRUD with in-memory SQLite).
23
+
24
+ ### Built-in commands
25
+
26
+ - `full-example-json completion` — Install or inspect shell tab completions (bash, zsh, fish).
27
+ - `full-example-json configure` — Manage agent artifacts (skills, MCP, application configuration).
28
+ - `full-example-json docs` — Browse bundled documentation topics (`cli`, `mcp`, `http`, `readme`).
29
+ - `full-example-json mcp` — Start the Model Context Protocol (stdio) server for AI coding agents.
30
+ - `full-example-json version` — Display version information.
31
+
32
+ ## Usage
33
+
34
+ ```bash
35
+ # Print a message
36
+ full-example-json echo "Hello, world!"
37
+
38
+ # Inspect JSON status
39
+ full-example-json status --json
40
+
41
+ # List workspaces
42
+ full-example-json workspaces list
43
+
44
+ # Start the MCP server for AI agents
45
+ full-example-json mcp
46
+ ```
47
+
48
+ ## AI Agent & MCP Integration
49
+
50
+ `full-example-json` includes an integrated MCP server and agent skills out of the box:
51
+
52
+ - **MCP server**: Run `full-example-json mcp` or register via `full-example-json configure install`.
53
+ - **Agent skill**: See `skills/full-example-json/SKILL.md` for agent router instructions.
54
+
55
+ ## Documentation
56
+
57
+ | Need | Resource |
58
+ | --- | --- |
59
+ | CLI reference | [docs/cli.md](docs/cli.md) or `full-example-json docs cli` |
60
+ | MCP tools | [docs/mcp.md](docs/mcp.md) or `full-example-json docs mcp` |
61
+ | HTTP API | [docs/http.md](docs/http.md) or `full-example-json docs http` |
62
+ | Agent skill router | [skills/full-example-json/SKILL.md](skills/full-example-json/SKILL.md) |
63
+ | CLI schema (JSON) | [docs/cli-schema.json](docs/cli-schema.json) |
16
64
 
17
- ## Quick start
65
+ ## Development
18
66
 
19
- From a git checkout at this directory (requires [Homebrew](https://brew.sh), [just](https://just.systems), and [Bun](https://bun.sh)):
67
+ Requires [Homebrew](https://brew.sh), [just](https://just.systems), and [Bun](https://bun.sh):
20
68
 
21
69
  ```bash
22
70
  brew install just bun
23
71
  just setup
24
- just schemagen # after changing @sg types in src/
25
- just run status --json
26
- just run docs readme
72
+ just schemagen # after modifying @sg types in src/
73
+ just check
74
+ just test
27
75
  ```
@@ -14,9 +14,7 @@
14
14
  },
15
15
  "overrides": [
16
16
  {
17
- "includes": ["**/*.json"],
18
- "formatter": { "enabled": false },
19
- "linter": { "enabled": false }
17
+ "includes": ["**/*.json"]
20
18
  }
21
19
  ]
22
20
  }
@@ -0,0 +1,3 @@
1
+ [install]
2
+ # fetch package.json deps on first `bun src/index.ts` without manual `bun install`.
3
+ auto = "fallback"