get-tbd 0.2.1 → 0.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 (31) hide show
  1. package/dist/bin.mjs +14 -7
  2. package/dist/bin.mjs.map +1 -1
  3. package/dist/cli.mjs +14 -7
  4. package/dist/cli.mjs.map +1 -1
  5. package/dist/docs/guidelines/bun-monorepo-patterns.md +65 -66
  6. package/dist/docs/guidelines/cli-agent-skill-patterns.md +314 -158
  7. package/dist/docs/guidelines/common-doc-guidelines.md +2 -2
  8. package/dist/docs/guidelines/convex-limits-best-practices.md +39 -39
  9. package/dist/docs/guidelines/convex-rules.md +13 -13
  10. package/dist/docs/guidelines/electron-app-development-patterns.md +18 -18
  11. package/dist/docs/guidelines/general-comment-rules.md +1 -1
  12. package/dist/docs/guidelines/general-tdd-guidelines.md +4 -4
  13. package/dist/docs/guidelines/golden-testing-guidelines.md +9 -9
  14. package/dist/docs/guidelines/pnpm-monorepo-patterns.md +49 -49
  15. package/dist/docs/guidelines/python-cli-patterns.md +1 -1
  16. package/dist/docs/guidelines/python-modern-guidelines.md +4 -4
  17. package/dist/docs/guidelines/release-notes-guidelines.md +18 -2
  18. package/dist/docs/guidelines/supply-chain-hardening.md +84 -29
  19. package/dist/docs/guidelines/tbd-sync-troubleshooting.md +3 -3
  20. package/dist/docs/guidelines/typescript-cli-tool-rules.md +17 -17
  21. package/dist/docs/guidelines/typescript-code-coverage.md +5 -5
  22. package/dist/docs/guidelines/typescript-rules.md +3 -3
  23. package/dist/docs/guidelines/typescript-yaml-handling-rules.md +3 -3
  24. package/dist/docs/tbd-design.md +40 -40
  25. package/dist/docs/tbd-docs.md +1 -1
  26. package/dist/docs/tbd-prime.md +3 -3
  27. package/dist/index.mjs +1 -1
  28. package/dist/{src-CtZIHxYM.mjs → src-BpvcrLnq.mjs} +2 -2
  29. package/dist/{src-CtZIHxYM.mjs.map → src-BpvcrLnq.mjs.map} +1 -1
  30. package/dist/tbd +14 -7
  31. package/package.json +1 -1
@@ -1,23 +1,25 @@
1
1
  ---
2
- title: Agent Skills & CLI Integration Patterns
3
- description: How to write skills and agent-integrated CLIs that work across Claude Code, Codex, and the broader coding-agent ecosystem a simple baseline plus references for advanced, multi-subcommand tools
2
+ title: Agent Skills and CLI Integration Patterns
3
+ description: How to write skills and agent-integrated CLIs that work across Claude Code, Codex, and the broader coding-agent ecosystem—a simple baseline plus references for advanced, multi-subcommand tools
4
4
  author: Joshua Levy (github.com/jlevy) with LLM assistance
5
5
  ---
6
- # Agent Skills & CLI Integration Patterns
6
+ # Agent Skills and CLI Integration Patterns
7
7
 
8
- **Last Updated**: 2026-05-23 (research verified against primary sources May 2026)
8
+ **Last Updated**: 2026-05-31 (research verified against primary sources May 2026; added
9
+ the L0–L3 integration ladder and §6.6.2 project-vs-global scope mechanics, informed by
10
+ `qmd`)
9
11
 
10
12
  This guideline covers how to package a capability so AI coding agents can discover and
11
- use it well from a single-file skill up to a full CLI with many subcommands exposed as
12
- a skill. It is deliberately **not dogmatic**: most needs are met by a tiny `SKILL.md`,
13
- and the heavier patterns are opt-in for tools that genuinely need them.
13
+ use it well—from a single-file skill up to a full CLI with many subcommands exposed as a
14
+ skill. It is deliberately **not dogmatic**: most needs are met by a tiny `SKILL.md`, and
15
+ the heavier patterns are opt-in for tools that genuinely need them.
14
16
 
15
17
  The patterns draw on the current (May 2026) state of the ecosystem and on `tbd`’s own
16
18
  implementation, which serves as a reference for the advanced “CLI-as-skill” approach.
17
19
 
18
20
  **When to use this guideline**: when building or packaging anything an AI coding agent
19
- should use a prompt-only skill, a CLI tool, an MCP server, or a multi-agent
20
- integration and you want it to work across Claude Code, Codex, Cursor, Gemini CLI, and
21
+ should use—a prompt-only skill, a CLI tool, an MCP server, or a multi-agent
22
+ integration—and you want it to work across Claude Code, Codex, Cursor, Gemini CLI, and
21
23
  others without rewriting it per agent.
22
24
 
23
25
  > **The single most important shift since 2025**: skills and project instructions are
@@ -29,7 +31,7 @@ others without rewriting it per agent.
29
31
 
30
32
  * * *
31
33
 
32
- ## 0. Start Here The Simple Baseline
34
+ ## 0. Start Here—The Simple Baseline
33
35
 
34
36
  Read this section first.
35
37
  For the large majority of cases, you are done after it.
@@ -55,17 +57,17 @@ description: >-
55
57
  Step-by-step instructions the agent should follow...
56
58
  ```
57
59
 
58
- That is the entire artifact no build step, no runtime, no dependencies.
60
+ That is the entire artifact—no build step, no runtime, no dependencies.
59
61
  This is the **Agent Skills open standard** ([agentskills.io](https://agentskills.io)),
60
62
  and the same folder works in Claude Code, Codex CLI, Gemini CLI, GitHub Copilot, Cursor,
61
63
  Windsurf, Cline, pi, and 20+ other tools.
62
64
  Garry Tan’s **gstack** (~97K stars) is 23 skills, each a plain `SKILL.md` and nothing
63
- more proof the baseline scales without custom tooling.
65
+ more—proof the baseline scales without custom tooling.
64
66
 
65
67
  **The only two things that matter for a basic skill:**
66
68
 
67
69
  1. A **`description`** that says *what it does* AND *when to use it* (this drives
68
- activation see §4.2).
70
+ activation—see §4.2).
69
71
  2. A **body under ~500 lines** of clear, imperative instructions.
70
72
 
71
73
  **Install it** by copying into a known directory, or with the cross-agent package
@@ -81,7 +83,7 @@ npx skills add owner/repo # Vercel's skills.sh ecosystem (symlinks, 27+ ag
81
83
 
82
84
  The `SKILL.md` folder is the portable **authoring** format; some agents add their own
83
85
  discovery paths (Codex/pi also read `.agents/skills/`) and their own **distribution**
84
- layers on top (Claude Code plugins, Codex plugins) see §5.
86
+ layers on top (Claude Code plugins, Codex plugins)—see §5.
85
87
 
86
88
  ### 0.2 If your capability is a CLI
87
89
 
@@ -94,11 +96,11 @@ So:
94
96
  2. Ship a **`SKILL.md`** (or an `AGENTS.md` snippet) that tells the agent the tool
95
97
  exists, what it’s for, and the handful of commands to run.
96
98
  Reference the CLI via a **pinned zero-install runner** (`npx`/`uvx <pkg>@<version>`)
97
- so it works even in ephemeral/cloud environments global install vs.
99
+ so it works even in ephemeral/cloud environments—global install vs.
98
100
  zero-install is its own design dimension (§6.7).
99
101
  3. That’s the baseline.
100
102
  Stop here unless you have many subcommands or need cross-session state, structured
101
- auth, or background services then see §6 (CLI-as-skill) and §7 (MCP).
103
+ auth, or background services—then see §6 (CLI-as-skill) and §7 (MCP).
102
104
 
103
105
  > **The skill points; the CLI documents.** A CLI’s `--help` (and per-command
104
106
  > `mycli <cmd> --help`) is the source of truth for flags, arguments, and exact command
@@ -120,16 +122,17 @@ So:
120
122
  (§7)
121
123
  - **Maximum reach across many agents** → layer them: AGENTS.md, SKILL.md, CLI, and MCP.
122
124
  (§1)
123
- - **Self-installs into agents & ships evolving skills?** that is the advanced Tier 2
124
- pattern (self-upgrade and format versioning); most tools are Tier 1: a pure skill run
125
- via a **pinned** `npx`/`uvx`. (§6.0)
125
+ - **Self-installs into agents?** climb the integration ladder (§6.0): L0 pure skill
126
+ L1 skill + pinned `npx`/`uvx` L2 self-install into skill dirs only (`qmd`) → L3 full
127
+ platform with managed `AGENTS.md`, hooks, and format versioning (`tbd`). Most tools
128
+ are L1; stop as low as you can.
126
129
 
127
130
  Everything below is reference material.
128
131
  You do not need most of it for most tools.
129
132
 
130
133
  * * *
131
134
 
132
- ## 1. The Layered Model — “Write Once, Integrate Many”
135
+ ## 1. The Layered Model—“Write Once, Integrate Many”
133
136
 
134
137
  There is no single integration surface that every agent uses, but the surfaces compose
135
138
  cleanly.
@@ -151,19 +154,19 @@ Add agent-specific files last, and only where they buy something.
151
154
 
152
155
  * * *
153
156
 
154
- ## 2. AGENTS.md The Universal Project Baseline
157
+ ## 2. AGENTS.md—The Universal Project Baseline
155
158
 
156
159
  `AGENTS.md` is a plain-Markdown file at the repo root that tells any agent how your
157
160
  project works: build commands, test commands, conventions, gotchas.
158
- It is **not** capability-specific think of it as the README written for agents.
161
+ It is **not** capability-specific—think of it as the README written for agents.
159
162
 
160
- **Governance & reach**: Originated by OpenAI (Aug 2025); since Dec 2025 stewarded by the
161
- **Agentic AI Foundation under the Linux Foundation** (co-founded by OpenAI, Anthropic,
162
- and Block; ~180 member orgs).
163
+ **Governance and reach**: Originated by OpenAI (Aug 2025); since Dec 2025 stewarded by
164
+ the **Agentic AI Foundation under the Linux Foundation** (co-founded by OpenAI,
165
+ Anthropic, and Block; ~180 member orgs).
163
166
  Used by **60,000+** open-source projects.
164
167
  Canonical spec: [agents.md](https://agents.md).
165
168
 
166
- **Discovery & precedence** vary by agent know your targets:
169
+ **Discovery and precedence** vary by agent—know your targets:
167
170
 
168
171
  - **Codex**: reads global `~/.codex/AGENTS.md` (or `AGENTS.override.md`), then walks
169
172
  from repo root down to the working directory, concatenating one file per directory
@@ -205,8 +208,8 @@ generated content without touching user-authored text:
205
208
  <!-- END MYCLI INTEGRATION -->
206
209
  ```
207
210
 
208
- Keep the begin/end marker *names* stable (`<!-- BEGIN MYCLI INTEGRATION`) match on
209
- that prefix so detection finds both legacy blocks (no `format=`, treated as `f01`) and
211
+ Keep the begin/end marker *names* stable (`<!-- BEGIN MYCLI INTEGRATION`)—match on that
212
+ prefix so detection finds both legacy blocks (no `format=`, treated as `f01`) and
210
213
  current ones. Only the `format=fNN` value changes when the block’s shape changes.
211
214
 
212
215
  * * *
@@ -237,7 +240,7 @@ Skills are loaded in three levels so they cost almost nothing until used:
237
240
  **Constraints that matter**: keep the body **under 500 lines**; keep reference files
238
241
  **one level deep** from `SKILL.md` (avoid `SKILL.md → a.md → b.md` chains); put bulky
239
242
  material (schemas, examples, scripts) in supporting files.
240
- Scripts execute *outside* the context window only their output costs tokens, which is
243
+ Scripts execute *outside* the context window—only their output costs tokens, which is
241
244
  why bundling a script can be far cheaper than inlining instructions.
242
245
 
243
246
  **For a CLI-backed skill, the CLI itself is the Level-3 layer.** Treat `mycli --help`,
@@ -299,12 +302,12 @@ specifically.
299
302
 
300
303
  ### 4.2 Description optimization (this is what makes skills activate)
301
304
 
302
- Activation is **pure LLM reasoning** — the model reads every installed skill’s `name` +
305
+ Activation is **pure LLM reasoning**—the model reads every installed skill’s `name` +
303
306
  `description` and decides what to invoke.
304
307
  There is no keyword matcher or embedding step.
305
308
  So the description is the single highest-leverage thing you write.
306
309
 
307
- **The two-part rule** — every description answers:
310
+ **The two-part rule**—every description answers:
308
311
 
309
312
  1. **What does it do?** (capabilities)
310
313
  2. **When should it be used?** (explicit triggers, in the user’s words)
@@ -324,13 +327,13 @@ description: >-
324
327
  the most important trigger keywords in the first ~50 characters (descriptions can be
325
328
  truncated in large collections); state both capability and trigger.
326
329
 
327
- **Activation reliability** (community 650-trial sandboxed eval directional, not
330
+ **Activation reliability** (community 650-trial sandboxed eval—directional, not
328
331
  official): vague descriptions ~20% → optimized “Use when…” descriptions ~50% → adding
329
332
  concrete examples ~72–90%. Two distinct failure modes to design against: *activation
330
- failure* (never invoked) and *execution failure* (invoked but steps skipped fix with
333
+ failure* (never invoked) and *execution failure* (invoked but steps skipped—fix with
331
334
  clearer, checklist-style instructions).
332
335
 
333
- ### 4.3 The description budget (changed in 2026 verify against your target)
336
+ ### 4.3 The description budget (changed in 2026—verify against your target)
334
337
 
335
338
  Earlier guidance cited a flat ~15K-character budget.
336
339
  **Claude Code’s current model is different**:
@@ -345,7 +348,7 @@ Earlier guidance cited a flat ~15K-character budget.
345
348
  `off` without editing the file; `/doctor` reports overflow.
346
349
 
347
350
  **Implication for tools that install many skills**: don’t. Use the **meta-skill
348
- pattern** (§6.2) one skill that exposes N resources via CLI subcommands consumes a
351
+ pattern** (§6.2)—one skill that exposes N resources via CLI subcommands consumes a
349
352
  single listing slot instead of N. This is the strongest architectural reason to prefer
350
353
  CLI-as-skill once you have more than a handful of capabilities.
351
354
 
@@ -354,9 +357,9 @@ CLI-as-skill once you have more than a handful of capabilities.
354
357
  Because activation is probabilistic (§4.2) and the body is executable influence, test
355
358
  it:
356
359
 
357
- - **Positive activation**: a few realistic prompts that *should* trigger the skill
358
- does the agent invoke it?
359
- - **Negative activation**: nearby prompts that should *not* trigger it no false fires?
360
+ - **Positive activation**: a few realistic prompts that *should* trigger the skill—does
361
+ the agent invoke it?
362
+ - **Negative activation**: nearby prompts that should *not* trigger it—no false fires?
360
363
  - **Explicit invocation**: `/skill-name` (or the agent equivalent) loads and runs
361
364
  cleanly.
362
365
  - **Sandbox / write-denial**: the skill (and any bundled script) degrades gracefully
@@ -402,12 +405,12 @@ you care about.
402
405
  | **Goose** (Block) | `AGENTS.md` | Recipes; 70+ MCP extensions | Yes (deepest) | extension lifecycle | MCP (primary) |
403
406
  | **Zed** | `.rules` (reads `.cursorrules`, `CLAUDE.md`) | Rules Library | Yes (extensions) | — | MCP extension + `.rules` |
404
407
  | **Factory** | `AGENTS.md` + `.factory/droids/*.md` | Custom Droids (sub-agents) | Yes | Delegator loop | AGENTS.md + droid file |
405
- | **pi** | `AGENTS.md` / `CLAUDE.md`, `.pi/SYSTEM.md` | Agent Skills (`.pi/skills/`, `.agents/skills/`); TS extensions | **No (by design)** — use CLI+README or an extension | extension hooks | SKILL.md + CLI; extension for deep tool registration |
408
+ | **pi** | `AGENTS.md` / `CLAUDE.md`, `.pi/SYSTEM.md` | Agent Skills (`.pi/skills/`, `.agents/skills/`); TS extensions | **No (by design)**—use CLI+README or an extension | extension hooks | SKILL.md + CLI; extension for deep tool registration |
406
409
 
407
410
  **Notes on the minimal end (pi)**: pi (Mario Zechner’s `@mariozechner/pi-coding-agent`,
408
411
  ~44K stars) ships four tools (read/write/edit/bash) and treats context as a scarce
409
412
  budget. It reads `AGENTS.md`/`CLAUDE.md`, supports the Agent Skills standard, and
410
- **deliberately omits MCP** — its docs tell authors to “build CLI tools with READMEs” or
413
+ **deliberately omits MCP**—its docs tell authors to “build CLI tools with READMEs” or
411
414
  write a TypeScript extension (`pi.registerTool()` / `pi.registerCommand()`). This is a
412
415
  clean endorsement of the CLI-as-skill approach: a self-documenting CLI plus a `SKILL.md`
413
416
  is exactly what a minimal agent wants.
@@ -415,23 +418,23 @@ is exactly what a minimal agent wants.
415
418
  **Codex specifics** (it gained a real skill system in 2026): skills are `SKILL.md`
416
419
  folders with the same progressive disclosure.
417
420
  Verified against the Codex source (`codex-rs/core-skills/src/loader.rs`, tags
418
- `rust-v0.130.0`…`v0.133.0`): the loader scans several **scopes** — `Repo` (every
421
+ `rust-v0.130.0`…`v0.133.0`): the loader scans several **scopes**—`Repo` (every
419
422
  `<dir>/.agents/skills/` from the project root down to cwd), `User`
420
423
  (`$HOME/.agents/skills/`), `Admin`, plus plugin roots and `$CODEX_HOME/skills`. So a
421
424
  **plain repo-root `.agents/skills/<name>/SKILL.md` is read directly**, no manifest
422
425
  required. (The repo path is built by joining `.agents` and `skills` at runtime, so it
423
- does *not* appear as a contiguous `.agents/skills` literal in the binary a
426
+ does *not* appear as a contiguous `.agents/skills` literal in the binary—a
424
427
  `strings`-based inspection will miss it and see only `.agents/plugins/marketplace.json`;
425
428
  confirm against the source, not binary strings.)
426
429
  **Plugins** are an *additional* distribution layer (installable units bundling skills
427
- and MCP servers 90+ ship with Codex), declared in `.agents/plugins/marketplace.json`
428
- (also reads `.claude-plugin/marketplace.json`) useful for *publishing a bundle*, but
429
- not needed to make a repo-local skill load.
430
+ and MCP servers—90+ ship with Codex), declared in `.agents/plugins/marketplace.json`
431
+ (also reads `.claude-plugin/marketplace.json`)—useful for *publishing a bundle*, but not
432
+ needed to make a repo-local skill load.
430
433
  Codex skills may carry a richer **`agents/openai.yaml`** companion (e.g.
431
434
  `interface.display_name`, icons, `dependencies.tools[]`,
432
435
  `policy.allow_implicit_invocation`); map the portable
433
436
  `name`/`description`/`allowed-tools` onto it only when you specifically want that Codex
434
- polish it’s optional.
437
+ polish—it’s optional.
435
438
  An experimental, off-by-default **`external_migration`** feature can import `.claude/`
436
439
  config (hooks/MCP/skills) into `.codex/`; don’t depend on it yet, but expect the
437
440
  portable duplication to shrink if it stabilizes.
@@ -439,14 +442,14 @@ Operational config lives in `~/.codex/config.toml` (or trusted per-project
439
442
  `.codex/config.toml`): `model`, `approval_policy`
440
443
  (`untrusted`/`on-request`/`granular`/`never`), `sandbox_mode`
441
444
  (`read-only`/`workspace-write`/`danger-full-access`), and `[mcp_servers.*]`. A CLI your
442
- tool ships will run **inside Codex’s sandbox** — under `workspace-write`, writes are
445
+ tool ships will run **inside Codex’s sandbox**—under `workspace-write`, writes are
443
446
  limited to workspace roots and network is off unless explicitly enabled.
444
447
  Design your CLI to work read-only where possible and to fail with a clear message when
445
448
  sandboxed.
446
449
 
447
450
  * * *
448
451
 
449
- ## 6. CLI-as-Skill (Advanced) One Tool, Many Self-Injecting Commands
452
+ ## 6. CLI-as-Skill (Advanced)—One Tool, Many Self-Injecting Commands
450
453
 
451
454
  This is the pattern for a richer tool: a CLI that is itself a skill, exposing many
452
455
  capabilities as subcommands while costing a single description slot.
@@ -455,37 +458,58 @@ follows the same shape (subcommands, `AGENTS.md`, `--json`, and an optional MCP
455
458
 
456
459
  Use this when you have many capabilities, need cross-session state, or want a curated
457
460
  knowledge library the agent pulls from.
458
- For a single capability, the §0 baseline is better don’t reach for this prematurely.
461
+ For a single capability, the §0 baseline is better—don’t reach for this prematurely.
459
462
 
460
- ### 6.0 Two integration tiers pick the lighter one
463
+ ### 6.0 The integration ladder—pick the lowest rung that works
461
464
 
462
465
  Most tools should **not** self-install.
463
- Decide which tier you are before adding any setup machinery:
464
-
465
- - **Tier 1 — pure skill (the default for most tools).** Ship a `SKILL.md` (optionally an
466
- `AGENTS.md` snippet); users install it once (commit to `.agents/skills/`,
467
- `npx skills add`, or the Claude mirror).
468
- Invoke the tool through a **version-pinned** zero-install runner —
469
- `npx --yes pkg@<ver>`, `uvx --from pkg@<ver>`, or `pipx run pkg==<ver>` (§6.7). No
470
- hooks, no managed `AGENTS.md` block, no `setup` command, no format versioning.
466
+ Distribution complexity is a ladder, not a switch: each rung adds machinery (and
467
+ maintenance) over the one below, so climb only as far as the tool genuinely needs.
468
+ Four rungs, lightest first:
469
+
470
+ - **L0—pure prompt skill.** A `SKILL.md` and nothing else: no binary, no runtime, no
471
+ install command. The agent follows the body directly.
472
+ Garry Tan’s **gstack** (23 plain skills) is L0. Install by committing to a discovery
473
+ dir or `npx skills add`.
474
+ - **L1—skill + delegated CLI (zero-install).** Ship a `SKILL.md` that points at a CLI
475
+ invoked through a **version-pinned** zero-install runner—`npx --yes pkg@<ver>`,
476
+ `uvx --from pkg@<ver>`, or `pipx run pkg==<ver>` (§6.7). No install command, no
477
+ managed `AGENTS.md` block, no hooks, no format versioning.
478
+ The skill *delegates* execution to a package it never installs itself.
479
+ This is the default for most CLI-backed capabilities.
471
480
  Pinning the version here does **double duty**:
472
- - **Supply-chain control** — an unpinned runner (`npx pkg`, `uvx --from pkg`) silently
481
+ - **Supply-chain control**—an unpinned runner (`npx pkg`, `uvx --from pkg`) silently
473
482
  re-resolves to the latest published version on every run and bypasses any cool-off
474
483
  window. A pinned version is the artifact you actually vetted.
475
- - **Consistency control** — every teammate and every agent runs the *same* tool
476
- version, so skill behavior is reproducible across a team and across agents rather
477
- than drifting as upstream publishes new releases.
478
- - **Tier 2 self-installing CLI (advanced; the rest of §6).** A tool that writes its
479
- own integration files into multiple agents (`.agents/skills/`, `.claude/skills/`, a
480
- managed `AGENTS.md` block, hooks, `.codex/` config) **and** whose skill content
481
- evolves across releases.
482
- Take on this complexity only for a tool with many capabilities, cross-session state,
483
- or a curated knowledge library.
484
- The self-upgrade and format-versioning rules in §6.6 apply **only to this tier** — a
485
- pure skill never needs them.
486
-
487
- If in doubt, you are Tier 1. `tbd` is a Tier-2 reference implementation; most CLIs are
488
- not.
484
+ - **Consistency control**—every teammate and every agent runs the *same* tool version,
485
+ so skill behavior is reproducible across a team and across agents rather than
486
+ drifting as upstream publishes new releases.
487
+ - **L2—self-installing skill, discovery-dirs only.** The tool ships an `install` command
488
+ (with `--project`/`--global` scope—§6.6.2) that writes its `SKILL.md` into the
489
+ skill-discovery directories (`.agents/skills/<tool>/`, the `.claude/skills/` mirror)
490
+ and **stops there**: no managed `AGENTS.md` block, no hooks, no `prime`/`setup`
491
+ context machinery. Because it never touches a human-authored project-instruction file
492
+ and always full-overwrites its own generated skill, it does **not** need the §6.6
493
+ format-version / migration apparatus—a re-install is just a clean overwrite.
494
+ **`qmd`** (Tobi Lütke’s Markdown search tool) is the reference: `qmd skill install` /
495
+ `--global`, an embedded skill with a build-time drift test, a
496
+ `.claude-plugin/marketplace.json`, and an MCP server—all without writing to
497
+ `AGENTS.md` at all.
498
+ - **L3—full self-installing CLI platform.** Everything in L2 **plus** a managed
499
+ `AGENTS.md` block, lifecycle hooks (`SessionStart`/`PreCompact`), `prime` and `setup`
500
+ commands, format-versioned migration with a forward-compatibility guard (§6.6), and
501
+ usually a knowledge-injection meta-skill (§6.2) backed by a path-ordered DocCache
502
+ (§6.3). Take this on only for a tool with many capabilities, cross-session state, or a
503
+ curated knowledge library.
504
+ **`tbd`** is the reference implementation; **Beads/`bd`** follows the same shape.
505
+ Such platforms are typically **project-only and version-pinned per repo** (§6.6.2):
506
+ the tool is part of the project’s reproducible toolchain, so global scope is usually
507
+ not worth offering. `qmd` (L2) offers global/dual scope precisely because it is a
508
+ general-purpose utility that carries no per-project config.
509
+
510
+ The self-upgrade and format-versioning rules in §6.6 apply **only to L3**—L0–L2 never
511
+ need them. If in doubt, you are L1: `tbd` is an L3 reference implementation, `qmd` an L2
512
+ one, and most CLIs are neither.
489
513
 
490
514
  ### 6.1 Two kinds of commands
491
515
 
@@ -494,7 +518,7 @@ not.
494
518
  | **Action commands** | Perform operations | `create`, `close`, `sync` |
495
519
  | **Informational commands** | Output guidance for the agent to *follow* | `guidelines <name>`, `shortcut <name>`, `template <name>` |
496
520
 
497
- Informational commands don’t *do* anything they print instructions, best practices, or
521
+ Informational commands don’t *do* anything—they print instructions, best practices, or
498
522
  templates the agent reads and acts on.
499
523
  This is the mechanism behind tbd’s **knowledge-injection-via-subcommands**: rather than
500
524
  installing dozens of skills, tbd installs *one* meta-skill and exposes its entire
@@ -533,8 +557,8 @@ post-compaction contexts).
533
557
 
534
558
  ### 6.3 Resource directories: show the full command
535
559
 
536
- When listing resources, print the command to run, not just a name it removes a step
537
- for the agent.
560
+ When listing resources, print the command to run, not just a name—it removes a step for
561
+ the agent.
538
562
 
539
563
  ```markdown
540
564
  ## Available Shortcuts
@@ -563,7 +587,7 @@ Rules: reference commands **explicitly** (`mycli command arg`, never “see the
563
587
 
564
588
  ### 6.5 Making the CLI agent-friendly
565
589
 
566
- - **`--json` on every command** — one output path that renders human or machine output.
590
+ - **`--json` on every command**—one output path that renders human or machine output.
567
591
  - **`--brief`/`--quiet`** for constrained contexts and scripts.
568
592
  - **Idempotent `setup --auto`** (non-interactive) vs.
569
593
  `setup --interactive` for humans; never let an agent get stuck on a prompt.
@@ -604,13 +628,13 @@ their options) down into the tool.
604
628
  Adequate beats exhaustive: a short skill that reliably routes the agent to the right
605
629
  command beats a long one that mirrors the manual.
606
630
 
607
- ### 6.6 Distribution & multi-agent install
631
+ ### 6.6 Distribution and multi-agent install
608
632
 
609
633
  A CLI can install itself into multiple agents from one `setup` run.
610
634
  Use the portable Agent Skills location as the primary project skill surface and mirror
611
635
  only where a target agent requires it:
612
636
 
613
- - `.agents/skills/<tool>/SKILL.md` — the portable project skill.
637
+ - `.agents/skills/<tool>/SKILL.md`—the portable project skill.
614
638
  **Be precise about who reads this path natively vs.
615
639
  who reaches it via an installer**, rather than claiming a flat “all agents read it”:
616
640
  - **Scans repo-root `.agents/skills/` natively** (verified): **Codex** (source above)
@@ -619,17 +643,17 @@ only where a target agent requires it:
619
643
  - **Reached via the cross-agent installer**: `npx skills add` copies the same
620
644
  `SKILL.md` into `.agents/skills/` and **symlinks it into each agent’s own dir**
621
645
  (Cursor, Copilot, Cline, Amp, Windsurf, …). For those agents the *installer*, not
622
- the agent, is what binds `.agents/skills/` to their native location so “works with
646
+ the agent, is what binds `.agents/skills/` to their native location—so “works with
623
647
  Cursor/Copilot/…” means “via skills.sh”, not “Cursor scans `.agents/skills/`
624
648
  itself.”
625
- - **Claude Code does NOT scan `.agents/`** at all it reads only `.claude/skills/`
649
+ - **Claude Code does NOT scan `.agents/`** at all—it reads only `.claude/skills/`
626
650
  (next bullet), which is why the mirror is required, not optional.
627
651
  - When in doubt, verify against the agent’s source/docs before asserting native
628
652
  scanning.
629
- - `.claude/skills/<tool>/SKILL.md` — Claude Code compatibility mirror (required: Claude
653
+ - `.claude/skills/<tool>/SKILL.md`—Claude Code compatibility mirror (required: Claude
630
654
  Code reads only this path).
631
- - `AGENTS.md` — compact always-on project bootstrap, not a full copy of the skill.
632
- - `.codex/hooks.json` or `.codex/config.toml` — Codex lifecycle automation, not policy
655
+ - `AGENTS.md`—compact always-on project bootstrap, not a full copy of the skill.
656
+ - `.codex/hooks.json` or `.codex/config.toml`—Codex lifecycle automation, not policy
633
657
  text or skill content.
634
658
 
635
659
  tbd should write a CLI-managed `SKILL.md` to `.agents/skills/tbd/`, mirror it to
@@ -659,12 +683,19 @@ scripts/agent/<tool>-session.sh # shared hook script, referenced by both agents
659
683
  .claude/settings.json # Claude hook entry → same shared script
660
684
  ```
661
685
 
662
- Copy (don’t symlink) the `SKILL.md` payload to both skill paths — symlinks behave
663
- unevenly across Windows, sandboxes, and remote worktrees.
686
+ **Copy vs symlink the mirror.** Default to **copying** the `SKILL.md` payload to both
687
+ skill paths: a committed copy is browsable on GitHub/skills.sh and behaves predictably
688
+ across Windows, sandboxes, and remote worktrees, where symlinks do not.
689
+ A **symlink** of the Claude mirror onto the canonical `.agents/skills/<tool>/` is a
690
+ legitimate *single-machine* optimization—one source of truth, zero drift—and is what
691
+ `qmd` and the `npx skills add` installer do.
692
+ Reserve it for installs that stay on one developer’s machine; for anything committed or
693
+ shared across platforms, copy.
694
+ Whichever you pick, the two paths must carry identical content.
664
695
  Claude Code does **not** auto-load `AGENTS.md` (it reads `CLAUDE.md`), so a multi-agent
665
696
  project needs both.
666
697
 
667
- **File-ownership rules** — distinguish three categories:
698
+ **File-ownership rules**—distinguish three categories:
668
699
 
669
700
  - **Project instruction files** (`AGENTS.md`, `CLAUDE.md`): *commit these*. They hold
670
701
  human-authored project norms (§2). A CLI may own a **marker-bounded section** inside
@@ -685,30 +716,32 @@ project needs both.
685
716
  Con: not browsable in the repo, and no committed artifact to diff in review.
686
717
  With this mode a format-version stamp matters less (there is no committed artifact
687
718
  for an older tool to clobber).
688
- - **Source files** in the CLI package (header, baseline, brief): the canonical inputs —
689
- always version-controlled.
719
+ - **Source files** in the CLI package (header, baseline, brief): the canonical
720
+ inputs—always version-controlled.
690
721
 
691
722
  Make setup idempotent: dedupe hooks before merging, overwrite generated skills rather
692
723
  than patching them, update only the marked section of `AGENTS.md`, and clean up legacy
693
724
  files each run.
694
725
 
695
726
  **Generated output must be deterministic.** A given input state must always produce
696
- byte-identical output no timestamps, no random IDs, no machine-specific paths, no
727
+ byte-identical output—no timestamps, no random IDs, no machine-specific paths, no
697
728
  unstable ordering. This is what makes the artifact diff-stable, drift-testable, and safe
698
729
  to regenerate. It must also be stable under whatever formatter the repo runs (e.g. emit
699
- the managed block in the formatter’s canonical form sentence-aware line wrapping,
700
- correct quote style so a format pass is a no-op; and don’t emit a second YAML
730
+ the managed block in the formatter’s canonical form—sentence-aware line wrapping,
731
+ correct quote style—so a format pass is a no-op; and don’t emit a second YAML
701
732
  frontmatter block mid-document).
702
733
  Because Codex and Claude Code now share a hook event schema (§8), prefer **one shared
703
734
  script referenced by two thin per-agent configs**: keep the logic in a neutral location
704
735
  (e.g. `scripts/agent/<tool>-session.sh`) and reference it from both
705
736
  `.claude/settings.json` and the Codex `[hooks]`/`.codex/hooks.json` entry.
706
- Do not make Codex hooks call scripts stored under `.claude/` — that couples Codex setup
707
- to Claude setup. If a script must move out of `.claude/scripts/`, update the tbd-owned
708
- hook commands (or leave a wrapper) so existing Claude hooks keep working.
709
-
710
- **Upgrade existing installs deliberately (Tier 2 only).** A self-installing tool whose
711
- skill content evolves *will* leave older generated files in users’ repos.
737
+ Do not make Codex hooks call scripts stored under `.claude/`—that couples Codex setup to
738
+ Claude setup. If a script must move out of `.claude/scripts/`, update the tbd-owned hook
739
+ commands (or leave a wrapper) so existing Claude hooks keep working.
740
+
741
+ **Upgrade existing installs deliberately (L3 only).** A self-installing tool whose skill
742
+ content evolves *will* leave older generated files in users’ repos.
743
+ (An L2 tool that only writes discovery-dir skills can skip all of this: a re-install is
744
+ a clean full overwrite, with no managed `AGENTS.md` block or hooks to migrate.)
712
745
  Treat generated integration files like config migrations:
713
746
 
714
747
  Reserve an `fNN` **format bump** for changes big enough to need an explicit migration: a
@@ -726,11 +759,11 @@ it; it does not license the tool to mutate the repo on its own.
726
759
  (This is why a `SessionStart` hook should run a read-only `prime`, not `setup`.)
727
760
 
728
761
  - Version the generated surfaces with an `fNN` format code.
729
- Prefer **one format code for all the tool’s managed surfaces** — reuse the tool’s
762
+ Prefer **one format code for all the tool’s managed surfaces**—reuse the tool’s
730
763
  existing config/data-format version as the single source of truth (tbd stamps the
731
764
  AGENTS.md block with the same `tbd_format`, currently `f03`) rather than maintaining a
732
- parallel counter. Bump it when any managed surface config schema or a generated agent
733
- surface changes shape.
765
+ parallel counter. Bump it when any managed surface—config schema or a generated agent
766
+ surface—changes shape.
734
767
  - Stamp the format on the generated artifact itself: on the `AGENTS.md` begin-marker
735
768
  line (`<!-- BEGIN … format=fNN … -->`), the skill “DO NOT EDIT” marker, script
736
769
  headers, or an equivalent hook signature.
@@ -776,8 +809,9 @@ Recommended setup flags:
776
809
 
777
810
  Use a true tri-state: with no targeting flag a surface is detection-based; a positive
778
811
  flag forces it on (and suppresses auto-detection of untargeted surfaces); `--skip-*`
779
- forces it off. Avoid Commander’s `--no-<x>` for surfaces — it defaults the value to
780
- `true`, which would force-install on every run.
812
+ forces it off.
813
+ Avoid Commander’s `--no-<x>` for surfaces—it defaults the value to `true`,
814
+ which would force-install on every run.
781
815
  (`tbd` itself ships `--all`, `--claude`, `--codex`, `--skip-claude`, `--skip-codex`;
782
816
  `AGENTS.md` installs as part of the Codex surface.)
783
817
 
@@ -785,13 +819,16 @@ Keep project-local setup separate from global/user setup.
785
819
  Writing `~/.codex/AGENTS.md`, `~/.agents/skills/`, or `~/.claude/skills/` should be an
786
820
  explicit global install command or documented manual step, not something `setup --auto`
787
821
  does silently.
822
+ For a tool that genuinely needs **both** scopes (a general-purpose writing
823
+ tool, linter, or formatter—most CLIs are project-only and can ignore this), §6.6.2
824
+ codifies the concrete flag mechanics and guard rails.
788
825
 
789
826
  #### 6.6.1 Extensible skill registries (let other packages contribute skills)
790
827
 
791
828
  A single bundled skill is enough for most tools.
792
829
  But when a tool is a **platform** that other packages extend, don’t hard-code its skill
793
- list expose a **registry** so any installed package can contribute a skill that the
794
- CLI discovers at runtime.
830
+ list—expose a **registry** so any installed package can contribute a skill that the CLI
831
+ discovers at runtime.
795
832
 
796
833
  The clean implementation is the host language’s plugin mechanism:
797
834
 
@@ -807,11 +844,129 @@ The clean implementation is the host language’s plugin mechanism:
807
844
 
808
845
  Keep each registered skill a **spec** (name, two-part description, `allowed-tools`, a
809
846
  baseline source, and an optional dynamic catalog function) and run them all through the
810
- **same** `compose` and `--install` path, so every skill first-party or third-party
811
- gets identical frontmatter, the `DO NOT EDIT`/format marker, and deterministic output.
847
+ **same** `compose` and `--install` path, so every skill—first-party or third-party—gets
848
+ identical frontmatter, the `DO NOT EDIT`/format marker, and deterministic output.
812
849
  This keeps the “one tool, many self-injecting commands” model open for extension without
813
850
  the core tool taking a dependency on every plugin.
814
851
 
852
+ #### 6.6.2 Install scope: project-pinned, global, or both
853
+
854
+ **First decide which scopes the tool should even offer—most tools should not offer all
855
+ three.** The deciding factor is whether the tool is *customized per install*; a
856
+ secondary one is whether the user wants it as an explicit dependency of each repo.
857
+
858
+ - **Customized per install → project install, version-pinned, single scope (preferred;
859
+ consider discouraging global).** If the tool carries per-project configuration or
860
+ defines how *this* repo is built, tracked, or reviewed, install it into the project
861
+ and pin its version there, so the whole team and every agent get identical behavior
862
+ and different projects can pin different versions independently.
863
+ For such a tool a global install is usually not worth supporting—and can be worth
864
+ actively discouraging—because a per-project install is almost always preferable.
865
+ **`tbd` is deliberately here**: pinned per project and configured per repo
866
+ (`.tbd/config.yml`, the issue prefix), so a global cross-repo install would be an
867
+ anti-pattern, not a missing feature.
868
+ This is the §6.0 “consistency control” argument taken to its conclusion.
869
+ - **Not customized (a general utility) → dual-scope, for flexibility.** When there is no
870
+ per-project configuration to anchor the tool, offering *both* `--project` and
871
+ `--global` simply lets the user decide where it lives—global so it is available
872
+ everywhere with no explicit repo dependency, or project-local when they do want it
873
+ pinned. **`qmd` is here**: a Markdown search tool pointed at arbitrary collections,
874
+ useful across repos and configured per invocation.
875
+ - **Global-only → rare, but conceivable.** Reserve it for a genuine *user-level
876
+ preference* that applies across all of a user’s projects and that the user would
877
+ rarely want committed into any single repo.
878
+ Most tools are not this; do not default to global-only.
879
+
880
+ The `--project`/`--global` mechanics below apply to any tool that offers global or
881
+ dual-scope installs.
882
+ §6.6 states the principle (project-local and global must be kept separate; global must
883
+ be explicit); this codifies it.
884
+ The model to copy is **`git config`**: implicit scope when it is unambiguous, a hard
885
+ error when it is not.
886
+
887
+ **Explicit scope flags.**
888
+
889
+ ```
890
+ mycli install [--project | --global] [--surfaces=LIST | per-agent flags]
891
+ [--dir DIR] [--no-repo-check] [--pin VERSION]
892
+ ```
893
+
894
+ - `--project` → project-local install (the canonical `.agents/skills/<tool>/` plus the
895
+ Claude mirror, under the repo).
896
+ - `--global` → user-global install under `$HOME` (`~/.agents/skills/`,
897
+ `~/.claude/skills/`).
898
+ - Mutually exclusive: `--project ↔ --global`, and `--global ↔ --dir`.
899
+
900
+ **Implicit-when-unambiguous, error-when-not** (the `git config` rule).
901
+ Resolve scope *before* writing anything:
902
+
903
+ | Situation | Behavior |
904
+ | --- | --- |
905
+ | cwd is inside a git repo and not `$HOME` | implicit `--project` |
906
+ | cwd is `$HOME` or the filesystem root | **error**: ambiguous; pass `--project` or `--global` |
907
+ | cwd is not in a git repo | **error**: ambiguous; pass `--project --no-repo-check` or `--global` |
908
+ | explicit `--project` / `--global` given | honor it (subject to the `$HOME` refusal below) |
909
+
910
+ This removes the footgun where `cd ~ && mycli install` silently writes into the user’s
911
+ global agent surfaces and changes every project’s behavior.
912
+ Warning *after* the write (what some tools do—and `qmd`, which simply defaults to cwd
913
+ with no guard at all, does not warn) is too late; refuse *before* it.
914
+
915
+ **`$HOME` is always refused in `--project` mode**—even with `--no-repo-check`,
916
+ `--project --dir ~` is an error, because that is exactly what `--global` is for.
917
+ Name the right flag in the message:
918
+
919
+ ```
920
+ mycli install --project: refusing to install into /Users/me (home directory).
921
+ That would write to your global agent surfaces. Use --global for a user-wide install.
922
+ ```
923
+
924
+ **Print the resolved target before writing**, so the user can ctrl-c if it is wrong:
925
+
926
+ ```
927
+ Installing mycli skills (project mode) into: /Users/me/myrepo
928
+ surfaces: portable, claude
929
+ ```
930
+
931
+ (Printing the scope *after* the write—as `qmd` does—is weaker: the damage is already
932
+ done.)
933
+
934
+ **Surface selection—match the vocabulary to the surface count.** There is no single
935
+ right answer; pick by how many surfaces you have and expect to add:
936
+
937
+ - **Two or three surfaces** → terse per-agent / boolean flags read best.
938
+ `qmd` (canonical skill dir + Claude mirror) uses a single
939
+ `--skip-claude`/`--no-claude` toggle; `tbd` uses `--all` / `--claude` / `--codex` /
940
+ `--skip-<surface>`.
941
+ - **Three or more surfaces, or you expect to add agents** → a `--surfaces=<comma-list>`
942
+ selector with an `all` alias (`--surfaces=portable,claude,agents-md,all`) scales
943
+ better: adding `gemini-md` or `cursor-rules` later is a no-op for the CLI shape, with
944
+ no flag soup. The selector vocabulary lives only in the CLI—the artifact’s identity is
945
+ clear from its location (a `SKILL.md` under a skill dir, or the BEGIN/END-bounded
946
+ block in `AGENTS.md`), so no in-file `surface=` tag is needed beyond the load-bearing
947
+ `format=fNN`.
948
+
949
+ Either way, use a true tri-state (detection-based when unflagged; positive flag forces
950
+ on and suppresses auto-detection; skip forces off) and avoid Commander’s `--no-<x>` for
951
+ surfaces, which defaults the value to `true` (§6.6).
952
+
953
+ **Global mode skips global `AGENTS.md` by default.** `AGENTS.md` loads on every turn;
954
+ skills are progressive-disclosure (~100 tokens until invoked).
955
+ Writing a global block to `~/.codex/AGENTS.md` would tax every session in every project,
956
+ so global install should populate only the skill-discovery dirs.
957
+ `--global --surfaces=agents-md` should **error** with a clear “we don’t support this”
958
+ message rather than silently do it.
959
+ (`qmd` validates this from the lighter end—it writes no `AGENTS.md` block in *any*
960
+ scope.)
961
+
962
+ **Cross-scope coexistence is the supported pattern, not a conflict.** Having a skill
963
+ installed both globally and per-project is a feature: **project scope shadows user
964
+ scope**, exactly like `git config`, shell `$PATH`, npm, and Python site-packages, and
965
+ matching the path-ordered DocCache in §6.3. Codex documents the same precedence in its
966
+ loader (`Repo` > `User` > `Admin`), and Claude Code ships `.claude/skills/` and
967
+ `~/.claude/skills/` as deliberately separate discovery paths.
968
+ Don’t treat a dual install as something to detect and de-duplicate.
969
+
815
970
  ### 6.7 Making the CLI available: global install vs. zero-install
816
971
 
817
972
  A separate design dimension from §6.6 (how the CLI installs *itself into agents*) is how
@@ -828,13 +983,13 @@ Decide this explicitly and state the chosen invocation in `SKILL.md`/`AGENTS.md`
828
983
 
829
984
  **Trade-offs**
830
985
 
831
- - **Global install** — *Pros*: fastest invocation (no per-call resolution), works
832
- offline, and version is managed by the project (lockfile / `package.json` / `uv` tool
986
+ - **Global install**—*Pros*: fastest invocation (no per-call resolution), works offline,
987
+ and version is managed by the project (lockfile / `package.json` / `uv` tool
833
988
  manifest), so it’s auditable and reproducible.
834
- *Cons*: it’s a stateful prerequisite in ephemeral or cloud environments the global
835
- bin doesn’t persist, so the CLI can be **missing at session start** unless you
836
- bootstrap it.
837
- - **Zero-install** — *Pros*: works in any environment with no setup; nothing to persist;
989
+ *Cons*: it’s a stateful prerequisite—in ephemeral or cloud environments the global bin
990
+ doesn’t persist, so the CLI can be **missing at session start** unless you bootstrap
991
+ it.
992
+ - **Zero-install**—*Pros*: works in any environment with no setup; nothing to persist;
838
993
  ideal default for portability.
839
994
  *Cons*: cold-start download/cache cost on first call (uvx cold ≈ 1s, cached ≈ tens of
840
995
  ms; npx similar), needs network, and an **unpinned** invocation (`npx pkg`, `uvx pkg`)
@@ -849,7 +1004,7 @@ will fail on a fresh cloud session.
849
1004
 
850
1005
  **Pin the version (security).** Whichever you choose, the skill’s referenced invocation
851
1006
  should pin a version so the agent can’t silently run a newer (possibly compromised)
852
- release the §9 / 14-day-package-age rule applied to the runner itself:
1007
+ release—the §9 / 14-day-package-age rule applied to the runner itself:
853
1008
 
854
1009
  ```bash
855
1010
  uvx mytool@1.4.2 ... # not `uvx mytool`
@@ -884,7 +1039,7 @@ See `tbd guidelines supply-chain-hardening` for the cross-ecosystem policy.
884
1039
  Astral’s `uv`, Rust-fast, no Python prereq) or `pipx run <pkg>==<ver>`; persistent via
885
1040
  `uv tool install` / `pipx install`. `uvx` reuses a persistent install if one exists.
886
1041
  - **Go**: `go run <module>@<ver>` (compiles on the fly) or `go install`.
887
- - **Rust**: no first-class zero-install runner ship **prebuilt binaries** (GitHub
1042
+ - **Rust**: no first-class zero-install runner—ship **prebuilt binaries** (GitHub
888
1043
  releases and a `curl … | sh` installer) or `cargo binstall`; `cargo install` compiles.
889
1044
  - **Cross-language**: a prebuilt binary and install script, or a container image (Docker
890
1045
  is emerging as the production-grade distribution for MCP servers).
@@ -899,24 +1054,24 @@ configs; **CLIs** like Beads offer `brew` / `npm -g` / `curl` installers, while
899
1054
  **global install and a `SessionStart` bootstrap** as the optimization for persistent
900
1055
  environments where the project wants lockfile-managed versions and warm-start speed.
901
1056
 
902
- ### 6.8 Publishing & discovery make the skill installable
1057
+ ### 6.8 Publishing and discovery—make the skill installable
903
1058
 
904
1059
  Most “skill registries” (May 2026) are **GitHub-repo discoverers, not gated app
905
1060
  stores**. You don’t submit a form; you put a spec-compliant `SKILL.md` in a public repo
906
1061
  and the ecosystem finds it.
907
1062
  The landscape worth targeting:
908
1063
 
909
- - **`skills.sh` / `npx skills add <owner/repo>`** (Vercel) the cross-agent “npm for
1064
+ - **`skills.sh` / `npx skills add <owner/repo>`** (Vercel)—the cross-agent “npm for
910
1065
  skills”: one command installs into `.agents/skills/` and symlinks per agent (Claude
911
1066
  Code, Codex, Cursor, Copilot, Gemini, …). No review; ranked by install telemetry.
912
1067
  **This is the highest-leverage target** and needs zero extra infra.
913
1068
  - **GitHub-scraping indexers** (SkillsMP ~800k skills, ClaudeSkills.info, LobeHub,
914
- claudemarketplaces.com) auto-list public repos that contain a `SKILL.md` (often
915
- gated on ≥2 stars). You get listed for free just by being public and discoverable.
916
- - **Plugin marketplaces** — `.claude-plugin/marketplace.json` (Claude Code, the official
1069
+ claudemarketplaces.com)—auto-list public repos that contain a `SKILL.md` (often gated
1070
+ on ≥2 stars). You get listed for free just by being public and discoverable.
1071
+ - **Plugin marketplaces**—`.claude-plugin/marketplace.json` (Claude Code, the official
917
1072
  Anthropic channel) and `.agents/plugins/marketplace.json` (Codex; Codex reads both).
918
1073
  These are *plugin* channels: bundles of skills, MCP servers, hooks, and commands.
919
- They are **only for publishing a bundle** — a repo-local skill already loads from
1074
+ They are **only for publishing a bundle**—a repo-local skill already loads from
920
1075
  `.claude/skills/` (Claude Code) and `.agents/skills/` (Codex) **without any
921
1076
  manifest**, so don’t add one just to be discovered.
922
1077
  If you *do* emit a `marketplace.json` / `.codex-plugin/plugin.json`, treat it like any
@@ -935,11 +1090,11 @@ your-repo/
935
1090
 
936
1091
  `skills/<name>/SKILL.md` at the repo root is the universal discovery location
937
1092
  (`npx skills add`, the indexers, and agent installers all scan it).
938
- That’s the whole publishing step push it public.
1093
+ That’s the whole publishing step—push it public.
939
1094
 
940
1095
  **For a CLI-backed skill** (the §6 pattern), one extra rule matters: a registry installs
941
1096
  **only the Markdown**, never your binary.
942
- So the published `SKILL.md` must **bootstrap its own CLI** — lead with a pinned install
1097
+ So the published `SKILL.md` must **bootstrap its own CLI**—lead with a pinned install
943
1098
  line (`npm i -g <pkg>@<ver>` / `uvx --from <pkg>@<ver>`) and a one-time `setup`, and
944
1099
  have commands degrade with a clear “install the CLI first” message.
945
1100
  Treat the registry copy as a **landing page that installs the engine**, not the engine
@@ -949,13 +1104,13 @@ pushing.
949
1104
 
950
1105
  `tbd` does exactly this: `skills/tbd/SKILL.md` is generated at build time from the same
951
1106
  baseline, carries `name: tbd` and a trigger-rich description, and opens with the
952
- `npm install -g get-tbd` and `tbd setup --auto` bootstrap so
953
- `npx skills add jlevy/tbd` gives an agent a working landing page, and `tbd setup` then
954
- upgrades it to the full multi-agent install (§6.6).
1107
+ `npm install -g get-tbd` and `tbd setup --auto` bootstrap—so `npx skills add jlevy/tbd`
1108
+ gives an agent a working landing page, and `tbd setup` then upgrades it to the full
1109
+ multi-agent install (§6.6).
955
1110
 
956
1111
  * * *
957
1112
 
958
- ## 7. CLI vs MCP vs Skill Choosing the Surface
1113
+ ## 7. CLI vs MCP vs Skill—Choosing the Surface
959
1114
 
960
1115
  These are complementary, not competing.
961
1116
  Pick by need:
@@ -969,25 +1124,25 @@ Pick by need:
969
1124
 
970
1125
  **Why CLI usually wins when one exists**: benchmarks (2026) put a CLI at ~100% task
971
1126
  reliability and ~1.3K–8.7K tokens, vs.
972
- MCP at ~72% reliability and ~32K–82K tokens roughly **17× cheaper** at scale because
1127
+ MCP at ~72% reliability and ~32K–82K tokens—roughly **17× cheaper** at scale—because
973
1128
  LLMs already know common CLI usage and no tool schema is injected.
974
1129
  Use MCP when there’s no CLI to lean on or you need its auth/permission machinery.
975
1130
 
976
- **MCP current state (May 2026)**: governed by AAIF/Linux Foundation; two transports —
977
- **stdio** (local) and **Streamable HTTP** (remote; replaced legacy SSE in the Nov 2025
978
- spec, supports OAuth 2.1 + PKCE). Primitives: **tools**, **resources**, **prompts**.
979
- Security is a real concern (a scan found 492 public servers with no auth) — authenticate
980
- every request, scope every tool call, validate inputs, never pass tokens between
981
- servers.
1131
+ **MCP current state (May 2026)**: governed by AAIF/Linux Foundation; two
1132
+ transports—**stdio** (local) and **Streamable HTTP** (remote; replaced legacy SSE in the
1133
+ Nov 2025 spec, supports OAuth 2.1 + PKCE). Primitives: **tools**, **resources**,
1134
+ **prompts**. Security is a real concern (a scan found 492 public servers with no
1135
+ auth)—authenticate every request, scope every tool call, validate inputs, never pass
1136
+ tokens between servers.
982
1137
 
983
1138
  **Code execution with MCP** ("Code Mode"): instead of exposing many MCP tools as direct
984
1139
  calls (each ~550–1,400 tokens of schema), let the agent write code against a compact
985
- tool API in a sandbox reported 78–99% token reduction.
1140
+ tool API in a sandbox—reported 78–99% token reduction.
986
1141
  Worth it when an MCP server exposes *many* tools; overkill for one.
987
1142
 
988
1143
  * * *
989
1144
 
990
- ## 8. Hooks & Lifecycle (Cross-Agent)
1145
+ ## 8. Hooks and Lifecycle (Cross-Agent)
991
1146
 
992
1147
  Hooks let a tool inject context or enforce invariants automatically.
993
1148
  Support varies:
@@ -1002,7 +1157,7 @@ Support varies:
1002
1157
  via exit code 2), **Gemini CLI** (~12), and **opencode** (25+, with tool interception)
1003
1158
  all have lifecycle hooks.
1004
1159
  - **Codex** (as of May 2026) ships a **Claude-style hooks engine that uses the same
1005
- event schema as Claude Code** — `SessionStart`, `PreCompact`/`PostCompact`,
1160
+ event schema as Claude Code**—`SessionStart`, `PreCompact`/`PostCompact`,
1006
1161
  `PreToolUse`/`PostToolUse`, `UserPromptSubmit`, `Stop`,
1007
1162
  `SubagentStart`/`SubagentStop`, and `PermissionRequest`. Hooks load from `hooks.json`
1008
1163
  **or an inline `[hooks]` table in `config.toml`** next to an active config layer
@@ -1018,7 +1173,7 @@ Support varies:
1018
1173
  **Common, portable use**: a `SessionStart` hook that runs your CLI’s `prime`/`skill`
1019
1174
  command to restore workflow context; a `PreCompact` hook that re-injects a brief
1020
1175
  (`skill --brief`) before the window is trimmed.
1021
- Keep injected context small it competes with everything else.
1176
+ Keep injected context small—it competes with everything else.
1022
1177
 
1023
1178
  ```jsonc
1024
1179
  // Claude Code ~/.claude/settings.json
@@ -1032,7 +1187,7 @@ Keep injected context small — it competes with everything else.
1032
1187
 
1033
1188
  * * *
1034
1189
 
1035
- ## 9. Security & Supply Chain (Don’t Skip This)
1190
+ ## 9. Security and Supply Chain (Don’t Skip This)
1036
1191
 
1037
1192
  Skills and instruction files are **executable influence** on an agent, which makes them
1038
1193
  an attack surface. Treat them with the same care as dependencies.
@@ -1044,11 +1199,11 @@ an attack surface. Treat them with the same care as dependencies.
1044
1199
  input**.
1045
1200
  - **Never put secrets in skill/instruction files or tool output.** `AGENTS.md`,
1046
1201
  `SKILL.md`, bundled scripts, and anything a command prints get loaded into agent
1047
- context (and often committed) keep credentials, tokens, and keys out of them; read
1202
+ context (and often committed)—keep credentials, tokens, and keys out of them; read
1048
1203
  secrets from the environment at runtime instead.
1049
1204
  - **Vet third-party skills before install.** Prefer sources that scan (skills.sh runs
1050
1205
  Snyk on every install).
1051
- Read the body and any bundled scripts review them like dependency code.
1206
+ Read the body and any bundled scripts—review them like dependency code.
1052
1207
  Pin to a commit, not a moving tag.
1053
1208
  - **Scope tools tightly.** Use `allowed-tools` to grant the minimum (e.g.,
1054
1209
  `Bash(mycli:*)` not blanket `Bash`). Prefer `disable-model-invocation` for
@@ -1059,35 +1214,34 @@ an attack surface. Treat them with the same care as dependencies.
1059
1214
  denied.
1060
1215
  - **Apply the same currency discipline** you use for packages: if your skill ships a
1061
1216
  script with dependencies, the project’s supply-chain rules (e.g., the 14-day
1062
- package-age rule) apply and a skill that references a zero-install runner must pin
1063
- the version (§6.7), since unpinned `npx`/`uvx` bypasses the cool-off.
1217
+ package-age rule) apply—and a skill that references a zero-install runner must pin the
1218
+ version (§6.7), since unpinned `npx`/`uvx` bypasses the cool-off.
1064
1219
  See `tbd guidelines supply-chain-hardening` for the cross-ecosystem policy, or
1065
1220
  `tbd guidelines bun-monorepo-patterns` / `pnpm-monorepo-patterns` for monorepo
1066
1221
  specifics.
1067
1222
 
1068
1223
  * * *
1069
1224
 
1070
- ## 10. Emerging & Forward-Looking (Know It Exists)
1225
+ ## 10. Emerging and Forward-Looking (Know It Exists)
1071
1226
 
1072
1227
  You usually don’t need these to ship a skill, but they shape where the ecosystem is
1073
1228
  going:
1074
1229
 
1075
- - **ACP (Agent Client Protocol)** — Zed’s “LSP for agents” (JSON-RPC over stdio); 25+
1230
+ - **ACP (Agent Client Protocol)**—Zed’s “LSP for agents” (JSON-RPC over stdio); 25+
1076
1231
  agents (Claude Code, Codex, Gemini CLI, opencode) and editors (Zed, JetBrains, Kiro).
1077
1232
  Complements MCP (editor↔agent, while MCP is agent↔tools).
1078
1233
  Your agent runtime speaks it; a skill author doesn’t implement it.
1079
- - **A2A (Agent2Agent)** — Google/Linux Foundation, v1.0, 150+ orgs; for enterprise
1234
+ - **A2A (Agent2Agent)**—Google/Linux Foundation, v1.0, 150+ orgs; for enterprise
1080
1235
  agent-to-agent delegation, not skill authoring.
1081
1236
  Ignore unless you build autonomous multi-agent systems.
1082
- - **Codex App-Server** — JSON-RPC (Thread/Turn/Item) decoupling Codex logic from client
1237
+ - **Codex App-Server**—JSON-RPC (Thread/Turn/Item) decoupling Codex logic from client
1083
1238
  surfaces; relevant only for Codex-specific integration surfaces.
1084
- - **Plugin marketplaces & `npx skills`** — distribution is consolidating: Claude Code
1239
+ - **Plugin marketplaces & `npx skills`**—distribution is consolidating: Claude Code
1085
1240
  plugin marketplaces (official and community), Codex plugins, and Vercel’s
1086
1241
  `npx skills add` over the skills.sh directory (cross-agent symlinks).
1087
- - **Routines / scheduled agents, background monitors, `/run` & `/verify` skills** —
1088
- newer Claude Code capabilities for autonomous, event-triggered, and app-verifying
1089
- workflows (confirm GA vs.
1090
- preview for your version before relying on them).
1242
+ - **Routines / scheduled agents, background monitors, `/run` & `/verify` skills**—newer
1243
+ Claude Code capabilities for autonomous, event-triggered, and app-verifying workflows
1244
+ (confirm GA vs. preview for your version before relying on them).
1091
1245
 
1092
1246
  * * *
1093
1247
 
@@ -1101,7 +1255,7 @@ going:
1101
1255
  - Have a CLI → make it agent-friendly (`--json`, idempotent, actionable errors) and
1102
1256
  point a `SKILL.md` at it.
1103
1257
 
1104
- **Descriptions & disclosure**
1258
+ **Descriptions and disclosure**
1105
1259
 
1106
1260
  - Two-part rule: *what it does* + *when to use it*; third person; front-load keywords.
1107
1261
  - Progressive disclosure: metadata → body → supporting files; bundle scripts
@@ -1115,13 +1269,13 @@ going:
1115
1269
 
1116
1270
  **Scale up only when needed**
1117
1271
 
1118
- - Many capabilities → meta-skill + informational, self-injecting subcommands (one
1272
+ - Many capabilities → meta-skill and informational, self-injecting subcommands (one
1119
1273
  listing slot, unbounded resources).
1120
1274
  This is tbd’s validated approach.
1121
1275
  - Path-ordered resource cache for project/user shadowing; generate `--list` dynamically.
1122
1276
  - Context-injection loop with explicit `cli command arg` references; depth ≤ 3.
1123
1277
 
1124
- **Reach & surface**
1278
+ **Reach and surface**
1125
1279
 
1126
1280
  - Layer for reach: `AGENTS.md` + `SKILL.md` + CLI + (MCP if no CLI fits).
1127
1281
  - Prefer CLI over MCP when a CLI exists (cheaper, more reliable); use MCP for
@@ -1187,7 +1341,7 @@ going:
1187
1341
 
1188
1342
  ## References
1189
1343
 
1190
- ### Open standards & governance
1344
+ ### Open standards and governance
1191
1345
 
1192
1346
  - Agent Skills standard: https://agentskills.io (spec:
1193
1347
  https://agentskills.io/specification)
@@ -1225,7 +1379,7 @@ going:
1225
1379
  - Amp: https://ampcode.com/manual
1226
1380
  - pi: https://github.com/badlogic/pi-mono
1227
1381
 
1228
- ### MCP & protocols
1382
+ ### MCP and protocols
1229
1383
 
1230
1384
  - 2026 MCP roadmap: https://blog.modelcontextprotocol.io/posts/2026-mcp-roadmap/
1231
1385
  - Code execution with MCP: https://www.anthropic.com/engineering/code-execution-with-mcp
@@ -1234,7 +1388,7 @@ going:
1234
1388
  - A2A:
1235
1389
  https://www.linuxfoundation.org/press/a2a-protocol-surpasses-150-organizations-lands-in-major-cloud-platforms-and-sees-enterprise-production-use-in-first-year
1236
1390
 
1237
- ### Distribution & ecosystem
1391
+ ### Distribution and ecosystem
1238
1392
 
1239
1393
  - Vercel skills / skills.sh:
1240
1394
  https://vercel.com/changelog/introducing-skills-the-open-agent-skills-ecosystem
@@ -1242,6 +1396,8 @@ going:
1242
1396
  - Anthropic skills (examples): https://github.com/anthropics/skills
1243
1397
  - gstack: https://github.com/garrytan/gstack
1244
1398
  - Beads (bd): https://github.com/gastownhall/beads
1399
+ - qmd (L2 reference: self-installing skill, discovery-dirs only, CLI + MCP + plugin):
1400
+ https://github.com/tobi/qmd
1245
1401
 
1246
1402
  ### Security
1247
1403