agentsys 5.3.6 → 5.4.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 (40) hide show
  1. package/.agnix.toml +17 -7
  2. package/.claude-plugin/marketplace.json +13 -2
  3. package/.claude-plugin/plugin.json +1 -1
  4. package/.gitmodules +3 -0
  5. package/AGENTS.md +4 -4
  6. package/CHANGELOG.md +28 -0
  7. package/README.md +46 -5
  8. package/lib/adapter-transforms.js +3 -1
  9. package/package.json +1 -1
  10. package/site/assets/css/main.css +39 -1
  11. package/site/assets/js/main.js +24 -0
  12. package/site/content.json +26 -25
  13. package/site/index.html +90 -15
  14. package/site/ux-spec.md +9 -9
  15. package/agent-knowledge/AGENTS.md +0 -231
  16. package/agent-knowledge/acp-with-codex-gemini-copilot-claude.md +0 -504
  17. package/agent-knowledge/ai-cli-advanced-integration-patterns.md +0 -670
  18. package/agent-knowledge/ai-cli-non-interactive-programmatic-usage.md +0 -1394
  19. package/agent-knowledge/all-in-one-plus-modular-packages.md +0 -576
  20. package/agent-knowledge/cli-browser-automation-agents.md +0 -936
  21. package/agent-knowledge/github-org-project-management.md +0 -319
  22. package/agent-knowledge/github-org-structure-patterns.md +0 -268
  23. package/agent-knowledge/kiro-supervised-autopilot.md +0 -400
  24. package/agent-knowledge/multi-product-org-docs.md +0 -622
  25. package/agent-knowledge/oss-org-naming-patterns.md +0 -368
  26. package/agent-knowledge/resources/acp-with-codex-gemini-copilot-claude-sources.json +0 -408
  27. package/agent-knowledge/resources/ai-cli-non-interactive-programmatic-usage-sources.json +0 -500
  28. package/agent-knowledge/resources/all-in-one-plus-modular-packages-sources.json +0 -310
  29. package/agent-knowledge/resources/cli-browser-automation-agents-sources.json +0 -428
  30. package/agent-knowledge/resources/github-org-project-management-sources.json +0 -239
  31. package/agent-knowledge/resources/github-org-structure-patterns-sources.json +0 -293
  32. package/agent-knowledge/resources/kiro-supervised-autopilot-sources.json +0 -135
  33. package/agent-knowledge/resources/multi-product-org-docs-sources.json +0 -514
  34. package/agent-knowledge/resources/oss-org-naming-patterns-sources.json +0 -458
  35. package/agent-knowledge/resources/skill-plugin-distribution-patterns-sources.json +0 -290
  36. package/agent-knowledge/resources/terminal-browsers-agent-automation-sources.json +0 -758
  37. package/agent-knowledge/resources/web-session-persistence-cli-agents-sources.json +0 -528
  38. package/agent-knowledge/skill-plugin-distribution-patterns.md +0 -661
  39. package/agent-knowledge/terminal-browsers-agent-automation.md +0 -776
  40. package/agent-knowledge/web-session-persistence-cli-agents.md +0 -1352
@@ -1,661 +0,0 @@
1
- # Learning Guide: Skill, Plugin, and Extension Distribution Patterns for CLI Tools and AI Agent Frameworks
2
-
3
- **Generated**: 2026-02-21
4
- **Sources**: 40 resources analyzed (from training knowledge -- web fetch unavailable)
5
- **Depth**: deep
6
-
7
- > How open source CLI tools and AI agent frameworks distribute reusable skills, plugins, and extensions. Covers npm packages, git submodules, vendoring, registry install patterns, and real-world ecosystems from Terraform to Claude Code.
8
-
9
- ## Prerequisites
10
-
11
- - Familiarity with at least one package manager (npm, pip, cargo, etc.)
12
- - Basic understanding of git workflows
13
- - General awareness of what CLI plugins do (extend a host tool's functionality)
14
- - Helpful but not required: experience with at least one of the ecosystems discussed (Terraform, Homebrew, VSCode, oh-my-zsh, etc.)
15
-
16
- ## TL;DR
17
-
18
- - **Five dominant distribution patterns** exist: package registry (npm/pip), git-based (clone/submodule), vendoring (copy into repo), dedicated registry (Terraform, VSCode), and convention-based discovery (file-system scanning).
19
- - **Small ecosystems (under 50 plugins)** succeed with git-based or vendored approaches -- low overhead, no registry infrastructure needed. Large ecosystems require a dedicated registry with search, versioning, and trust signals.
20
- - **AI agent frameworks** are converging on a hybrid: convention-based local discovery (scan directories for SKILL.md / plugin.json) plus git or npm for remote installation.
21
- - **The critical design decision** is not the transport mechanism (git vs npm vs registry) but the **plugin contract**: what interface a plugin must implement, how it declares capabilities, and how the host discovers and loads it.
22
- - **Discoverability is the bottleneck** for adoption in every ecosystem. A curated "awesome list" works up to about 50 plugins; beyond that you need search, categories, and quality signals.
23
-
24
- ## Core Concepts
25
-
26
- ### 1. The Five Distribution Patterns
27
-
28
- #### Pattern A: Package Registry (npm, pip, cargo, gems)
29
-
30
- Plugins are published to a general-purpose package registry and installed via the ecosystem's package manager.
31
-
32
- **How it works**: The plugin is a regular package with a conventional name prefix (e.g., `eslint-plugin-*`, `babel-plugin-*`, `@opencode/plugin-*`). The host tool discovers installed plugins by scanning `node_modules/` or equivalent, looking for packages matching the naming convention or declared in a config file.
33
-
34
- **Examples**:
35
- - ESLint plugins (`eslint-plugin-react`)
36
- - Babel plugins (`@babel/plugin-transform-runtime`)
37
- - Prettier plugins (`prettier-plugin-tailwindcss`)
38
- - Gatsby plugins (listed in `gatsby-config.js`)
39
- - Rollup/Vite plugins (npm packages, referenced in config)
40
-
41
- **Strengths**: Leverages existing infrastructure (versioning, dependency resolution, security audits, CDN distribution). Users already know `npm install`. Transitive dependencies handled automatically.
42
-
43
- **Weaknesses**: Tied to one language ecosystem. Registry overhead for small projects. Namespace pollution. Hard to enforce plugin quality.
44
-
45
- **Key insight**: This pattern works best when the host tool is already in a package-manager ecosystem and plugins need complex dependencies of their own.
46
-
47
- #### Pattern B: Git-Based (clone, submodule, sparse checkout)
48
-
49
- Plugins are git repositories. The host tool or a plugin manager clones them into a known directory.
50
-
51
- **Examples**:
52
- - oh-my-zsh plugins and themes (git clone into `~/.oh-my-zsh/custom/plugins/`)
53
- - asdf version manager plugins (`asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git`)
54
- - mise plugins (inherited asdf's git-based model, then added a shortname registry)
55
- - Vim plugin managers (vim-plug, Vundle, Pathogen -- all clone git repos)
56
- - Zsh plugin managers (zinit, antigen, zplug)
57
-
58
- **How it works**: User provides a git URL (or a shortname that resolves to one). The tool clones the repo into a plugins directory. Updates via `git pull`. The plugin repo follows a file convention (e.g., asdf requires `bin/install`, `bin/list-all`, `bin/list-legacy-filenames`).
59
-
60
- **Strengths**: Zero infrastructure beyond GitHub. Any language. Simple mental model. Fork-and-customize is natural. Works offline after initial clone.
61
-
62
- **Weaknesses**: No dependency resolution between plugins. No semantic versioning enforcement (tags are optional). No centralized search. Update = git pull (can break things). Large repos slow to clone.
63
-
64
- **Key insight**: Git-based distribution dominates in small ecosystems where the plugin contract is simple (a few shell scripts) and plugins have no dependencies beyond the host.
65
-
66
- #### Pattern C: Vendoring (copy into project)
67
-
68
- Plugins are copied directly into the consuming project's source tree, either manually or via a vendoring tool.
69
-
70
- **Examples**:
71
- - Go's `vendor/` directory (pre-modules era, still supported)
72
- - Claude Code's plugin system (plugins vendored into `.claude/plugins/cache/`)
73
- - AgentSys's `lib/` vendoring to plugins (`npx agentsys-dev sync-lib`)
74
- - Ruby's vendored gems (`bundle install --path vendor/bundle`)
75
- - Many internal "monorepo plugin" patterns
76
-
77
- **How it works**: Plugin source code lives in the consumer's repo or a local cache directory. No external resolution at runtime. The host tool scans known directories for plugin manifests.
78
-
79
- **Strengths**: Total reproducibility -- what you see is what runs. No network needed at runtime. Easy to patch locally. No version conflict between plugins (each project has its own copy). Simple for the host tool (just scan the filesystem).
80
-
81
- **Weaknesses**: Manual updates. Disk space (N copies of the same plugin). Drift between projects using different versions. No centralized discovery.
82
-
83
- **Key insight**: Vendoring is ideal when reproducibility and offline operation matter more than convenience. It is the default for AI agent frameworks where deterministic behavior is critical.
84
-
85
- #### Pattern D: Dedicated Registry (Terraform, VSCode, Homebrew)
86
-
87
- A purpose-built registry with search, versioning, trust verification, and install tooling specific to the ecosystem.
88
-
89
- **Examples**:
90
- - Terraform Registry (registry.terraform.io) -- providers and modules
91
- - VSCode Extension Marketplace (marketplace.visualstudio.com)
92
- - Homebrew Taps (GitHub repos following `homebrew-*` naming convention with a central `formulae.brew.sh` index)
93
- - JetBrains Plugin Marketplace
94
- - Grafana plugin catalog
95
- - HashiCorp Vagrant Cloud (boxes)
96
-
97
- **How it works**: Plugin authors publish to the registry (often via CI). The registry provides a search API, version index, download URLs, and trust signals (verified publisher, download counts, ratings). The host tool has built-in `install`/`search`/`update` commands that talk to the registry API.
98
-
99
- **Strengths**: Best discoverability. Quality signals (stars, downloads, verified status). Automated compatibility checking. Centralized security scanning. Professional experience for users.
100
-
101
- **Weaknesses**: High infrastructure cost. Governance burden (who approves plugins?). Can become a bottleneck or single point of failure. Lock-in to the registry operator.
102
-
103
- **Key insight**: Dedicated registries only make sense at scale (100+ plugins). Below that, the maintenance cost exceeds the discoverability benefit.
104
-
105
- #### Pattern E: Convention-Based Discovery (filesystem scanning)
106
-
107
- The host tool scans predefined directories for files matching a convention. No explicit "install" step beyond placing files in the right location.
108
-
109
- **Examples**:
110
- - Claude Code's CLAUDE.md and slash commands (scans project directory)
111
- - OpenCode's AGENTS.md and tools directory
112
- - Codex's AGENTS.md
113
- - GitHub Actions (scans `.github/workflows/` for YAML files)
114
- - Makefiles, Taskfiles (convention over configuration)
115
- - Many shell frameworks (source all `*.sh` in a directory)
116
-
117
- **How it works**: The host tool knows to look in specific paths (e.g., `.claude/commands/`, `plugins/*/SKILL.md`). Any file matching the expected shape is loaded as a plugin. No registry, no install command.
118
-
119
- **Strengths**: Zero friction. No tooling to learn. Works with any editor or workflow. Composable via copy-paste. Ideal for project-local customization.
120
-
121
- **Weaknesses**: No versioning. No sharing mechanism (copy-paste is the distribution). No dependency management. Hard to discover what is available.
122
-
123
- **Key insight**: Convention-based discovery is the starting point for most plugin systems. Many evolve into Pattern B or D as they grow, but the best ones keep convention-based as the local-development mode.
124
-
125
- ### 2. Real-World Ecosystem Deep Dives
126
-
127
- #### Terraform Providers and Modules
128
-
129
- Terraform is the gold standard for dedicated-registry plugin distribution. Before Terraform 0.13 (2020), providers were distributed as binaries that users downloaded manually. The Terraform Registry changed everything.
130
-
131
- **Registry architecture**: The registry at registry.terraform.io hosts both providers (infrastructure APIs) and modules (reusable configurations). Each provider has a namespace (`hashicorp/aws`), version constraints, and platform-specific binaries. Terraform CLI resolves providers from the lock file (`.terraform.lock.hcl`), downloads platform-specific binaries, and caches them in `.terraform/providers/`.
132
-
133
- **Plugin protocol**: Providers implement a gRPC interface. The host (Terraform) communicates with providers as separate processes. This allows providers to be written in any language (though Go dominates because of the terraform-plugin-sdk).
134
-
135
- **Discovery**: `terraform init` resolves required providers from `required_providers` blocks. The registry API returns available versions and download URLs. Users discover providers via the registry website or documentation.
136
-
137
- **What works**: Version locking, platform-specific distribution, namespace isolation, the gRPC boundary between host and plugin.
138
-
139
- **What hurts**: Binary size (each provider is 50-200MB). Cold `terraform init` is slow. The registry is a single point of failure (mirrored by network mirrors).
140
-
141
- **Lesson for small ecosystems**: Terraform's approach is overkill for under 50 plugins. But the concept of a lock file and a clear plugin protocol is universally valuable.
142
-
143
- #### Homebrew Taps
144
-
145
- Homebrew uses a hybrid of git-based and registry patterns.
146
-
147
- **Core architecture**: The main Homebrew repository (`homebrew-core`) is a git repo of "formulae" -- Ruby scripts that describe how to download, build, and install software. Third-party "taps" are additional git repos following the naming convention `<user>/homebrew-<name>`.
148
-
149
- **Install flow**: `brew tap user/repo` clones the tap repo. `brew install user/repo/formula` installs from that tap. Homebrew also has a JSON API at formulae.brew.sh that indexes all formulae for search without cloning.
150
-
151
- **Discovery**: `brew search` queries the JSON API. Tap discoverability is mostly word-of-mouth and GitHub search.
152
-
153
- **Scaling trick**: Homebrew keeps `homebrew-core` as a shallow git clone and uses a JSON API for metadata, avoiding the full git history download. This is how they scaled to 6000+ formulae.
154
-
155
- **Lesson**: The tap model (git repos with naming conventions) is excellent for small ecosystems. The JSON API overlay solves discoverability at scale.
156
-
157
- #### oh-my-zsh and Zsh Plugin Managers
158
-
159
- oh-my-zsh pioneered the "bundled + custom" plugin model for shell frameworks.
160
-
161
- **Bundled plugins**: oh-my-zsh ships 300+ plugins in its main repo. Users enable them by adding names to an array in `.zshrc`. This is Pattern C (vendoring) -- all plugins ship with the framework.
162
-
163
- **Custom plugins**: Users can add plugins to `~/.oh-my-zsh/custom/plugins/`. These follow the convention of `pluginname/pluginname.plugin.zsh`. Installation is manual (git clone or copy).
164
-
165
- **Evolution**: The bundled model does not scale. oh-my-zsh's repo became bloated (300+ plugins, most unused by any given user). This spawned alternative managers:
166
- - **antigen**: Package manager for zsh, installs plugins from git repos
167
- - **zinit (formerly zplugin)**: Advanced lazy-loading plugin manager
168
- - **zplug**: Parallel plugin installer with dependency support
169
- - **sheldon**: Rust-based, fast, config-file-driven
170
-
171
- **Lesson**: Bundling everything works for initial adoption (zero friction) but creates maintenance burden. The evolution from "everything bundled" to "install what you need from git" is a common pattern.
172
-
173
- #### asdf and mise
174
-
175
- asdf is a version manager that uses plugins to support different languages/tools.
176
-
177
- **Plugin contract**: An asdf plugin is a git repo containing shell scripts in `bin/`:
178
- - `bin/list-all` -- list available versions
179
- - `bin/install` -- install a version
180
- - `bin/exec-env` -- set environment for execution (optional)
181
-
182
- **Shortname registry**: asdf maintains a shortname registry (`asdf-plugins` repo) mapping names to git URLs. `asdf plugin add nodejs` resolves to `https://github.com/asdf-vm/asdf-nodejs.git`. This is a thin index over git repos -- not a package registry.
183
-
184
- **mise evolution**: mise (formerly rtx) started as an asdf-compatible tool, inheriting its plugin model. mise then added:
185
- - Built-in "core" plugins for common tools (no git clone needed)
186
- - Registry of shortnames as a TOML file
187
- - Cargo-like lock files for reproducibility
188
- - Backends beyond asdf plugins (cargo, npm, go install, ubi, aqua)
189
-
190
- **Lesson**: Starting with asdf compatibility gave mise instant access to 500+ plugins. Then gradually replacing git-based plugins with built-in support for popular tools reduced friction. This "compatible bootstrap, then optimize" strategy is highly effective.
191
-
192
- #### VSCode Extension Marketplace
193
-
194
- The most mature dedicated registry for extensions.
195
-
196
- **Architecture**: Extensions are packaged as `.vsix` files (ZIP archives with a manifest). Published to marketplace.visualstudio.com via `vsce publish`. The marketplace provides search, categories, ratings, download counts, and verified publisher badges.
197
-
198
- **Discovery**: In-editor search panel. Web marketplace. Curated extension packs. Recommendations based on file types opened.
199
-
200
- **Trust model**: Publisher verification, license scanning, automated security review. Extensions run in a semi-sandboxed environment (Extension Host process).
201
-
202
- **What makes it work at scale**: The in-editor discovery experience is seamless. Users never leave VSCode to find and install extensions. One-click install. Automatic updates. Extension packs bundle related extensions.
203
-
204
- **Lesson**: For large ecosystems, in-tool discovery is critical. Users will not visit a website to browse plugins if they can search from within the tool.
205
-
206
- #### Claude Code Plugins (and AI Agent Framework Patterns)
207
-
208
- Claude Code uses a hybrid of convention-based discovery and vendored distribution.
209
-
210
- **Local commands**: Users create markdown files in `.claude/commands/` that become slash commands. Pure convention-based discovery -- no install step.
211
-
212
- **Plugin cache**: Third-party plugins are vendored into `.claude/plugins/cache/<name>/<version>/`. The plugin manifest describes commands, agents, and skills. Claude Code scans this directory at startup.
213
-
214
- **npm distribution**: Plugins can be published to npm and installed via the `claude plugins install <name>` mechanism, which downloads and vendors them into the cache directory.
215
-
216
- **Key design**: The plugin contract is file-convention-based (SKILL.md, agent YAML files, command markdown). The distribution is npm-based for remote, vendored for local.
217
-
218
- **OpenCode/Codex compatibility**: The same plugin content works across tools via AGENTS.md files and compatible directory conventions.
219
-
220
- **Lesson**: AI agent frameworks benefit from the convention-based approach because plugins are primarily configuration and prompts (text files), not compiled code. This makes vendoring cheap and convention-based discovery natural.
221
-
222
- ### 3. Distribution Pattern Selection Framework
223
-
224
- #### Decision Matrix
225
-
226
- | Factor | Package Registry | Git-Based | Vendored | Dedicated Registry | Convention-Based |
227
- |--------|-----------------|-----------|----------|-------------------|-----------------|
228
- | Setup cost for ecosystem owner | Low | None | None | Very High | None |
229
- | Setup cost for plugin author | Medium | Low | Low | Medium | Very Low |
230
- | Setup cost for plugin user | Low | Low | None | Low | None |
231
- | Discoverability | Medium | Poor | Poor | Excellent | Poor |
232
- | Version management | Excellent | Weak | Manual | Excellent | None |
233
- | Dependency resolution | Excellent | None | None | Good | None |
234
- | Offline operation | After install | After clone | Always | After install | Always |
235
- | Best ecosystem size | 10-500 | 5-100 | 1-30 | 50-10000+ | 1-20 |
236
-
237
- #### When to Use Each Pattern
238
-
239
- **Use Package Registry (npm/pip) when**:
240
- - Your tool is already in a package ecosystem
241
- - Plugins need their own dependencies
242
- - You want users to manage plugins alongside project dependencies
243
- - Example: ESLint, Babel, Gatsby, Prettier
244
-
245
- **Use Git-Based when**:
246
- - Plugins are self-contained (no dependencies beyond the host)
247
- - Plugin contract is simple (a few files following a convention)
248
- - You want maximum flexibility for plugin authors
249
- - Your ecosystem has under 100 plugins
250
- - Example: asdf, oh-my-zsh custom plugins, Vim plugins
251
-
252
- **Use Vendoring when**:
253
- - Reproducibility is critical (same plugin version across all environments)
254
- - Plugins are small (text files, configs, prompts)
255
- - Offline operation is important
256
- - You are building for AI agents where determinism matters
257
- - Example: Claude Code plugin cache, Go vendor, project-local configs
258
-
259
- **Use Dedicated Registry when**:
260
- - You have 100+ plugins or expect rapid growth
261
- - Trust and quality signals matter (security scanning, verified publishers)
262
- - Discoverability is a user priority
263
- - You can invest in registry infrastructure
264
- - Example: Terraform, VSCode, Homebrew
265
-
266
- **Use Convention-Based when**:
267
- - You want zero-friction local customization
268
- - Plugins are primarily configuration/text, not code
269
- - Project-specific customization is the primary use case
270
- - Example: Claude Code commands, GitHub Actions, Makefiles
271
-
272
- ### 4. Small vs Large Ecosystem Strategies
273
-
274
- #### Small Ecosystem (Under 50 Plugins)
275
-
276
- **What works**:
277
- - A curated "awesome list" (README or separate repo) for discovery
278
- - Git-based distribution with a shortname registry (a single JSON/TOML file mapping names to git URLs)
279
- - Clear file conventions documented in a single page
280
- - Plugin template repo (cookiecutter/scaffolding)
281
- - A `plugins/` directory in the main project repo for "official" plugins
282
-
283
- **What does not work**:
284
- - Building a dedicated registry (too much infrastructure for too little content)
285
- - Complex plugin APIs (discourages contributors)
286
- - Mandatory CI/CD for plugin publishing (too much friction)
287
-
288
- **Example architecture**:
289
- ```
290
- # Plugin shortname registry (plugins.json)
291
- {
292
- "nodejs": "https://github.com/org/plugin-nodejs",
293
- "python": "https://github.com/org/plugin-python"
294
- }
295
-
296
- # Install command
297
- mytool plugin add nodejs
298
- # Resolves to git clone https://github.com/org/plugin-nodejs ~/.mytool/plugins/nodejs
299
-
300
- # Plugin contract: just need these files
301
- plugins/nodejs/
302
- plugin.toml # metadata (name, version, description)
303
- bin/install # main entry point
304
- bin/list-versions # list available versions
305
- ```
306
-
307
- **Growth path**: Start with git-based + shortname file. When you hit 50 plugins, add a static site with search. At 200+, consider a proper registry API.
308
-
309
- #### Large Ecosystem (100+ Plugins)
310
-
311
- **What works**:
312
- - Dedicated registry with search API
313
- - Publisher verification and trust signals
314
- - Automated compatibility testing
315
- - In-tool discovery (search from within the CLI/IDE)
316
- - Extension packs / curated collections
317
- - Ratings and download counts
318
- - Automated security scanning
319
-
320
- **What does not work**:
321
- - Manual curation as the only discovery mechanism
322
- - Relying on GitHub stars for quality assessment
323
- - No versioning or compatibility metadata
324
-
325
- **Critical features at scale**:
326
- 1. **Search API**: Users must find plugins without browsing a list
327
- 2. **Compatibility metadata**: "This plugin works with host version 2.x-3.x"
328
- 3. **Automated testing**: CI runs against the host tool for each plugin update
329
- 4. **Deprecation/archival**: Mechanism to mark abandoned plugins
330
- 5. **Namespace governance**: Prevent squatting and impersonation
331
-
332
- ### 5. Plugin Contract Design
333
-
334
- The most important design decision in any plugin system is the **contract** -- what must a plugin provide?
335
-
336
- #### Minimal Contract (Convention-Based)
337
-
338
- ```
339
- my-plugin/
340
- README.md # human description
341
- plugin.{json|toml} # name, version, description, entry point
342
- index.{js|sh|py} # single entry point
343
- ```
344
-
345
- Used by: most small ecosystems, shell plugin managers
346
-
347
- #### Capability-Declared Contract
348
-
349
- ```
350
- my-plugin/
351
- manifest.json # declares capabilities, permissions, entry points
352
- src/
353
- commands/ # CLI commands this plugin adds
354
- hooks/ # lifecycle hooks this plugin handles
355
- lib/ # shared code
356
- ```
357
-
358
- Used by: VSCode extensions, Claude Code plugins, Grafana plugins
359
-
360
- #### Protocol-Based Contract
361
-
362
- ```
363
- my-plugin/
364
- # Plugin implements a protocol (gRPC, JSON-RPC, HTTP)
365
- # Host communicates via the protocol, not file conventions
366
- main.go # compiles to binary implementing the protocol
367
- ```
368
-
369
- Used by: Terraform providers, Hashicorp plugins (go-plugin), Neovim remote plugins
370
-
371
- **Key insight**: Protocol-based contracts provide the strongest isolation (plugins run as separate processes) but have the highest authoring cost. Convention-based contracts are lowest friction but provide no isolation. Choose based on your trust model and ecosystem size.
372
-
373
- ### 6. Update and Version Management Patterns
374
-
375
- #### Lock Files
376
-
377
- Terraform's `.terraform.lock.hcl` and npm's `package-lock.json` solve the reproducibility problem. The lock file records exact versions and integrity hashes. `install` respects the lock file; `update` modifies it.
378
-
379
- **When to implement**: As soon as you have more than one environment that must produce identical behavior (i.e., almost always).
380
-
381
- #### Pinning Strategies
382
-
383
- | Strategy | Mechanism | Trade-off |
384
- |----------|-----------|-----------|
385
- | Exact pin | `= 1.2.3` | Maximum reproducibility, manual updates |
386
- | Compatible pin | `~> 1.2` | Auto-patch updates, minor version control |
387
- | Range pin | `>= 1.0, < 2.0` | Flexible, risk of breaking changes |
388
- | Latest | No pin | Convenient, unreproducible |
389
- | Vendored | Copy in repo | Total control, stale risk |
390
-
391
- #### Auto-Update Patterns
392
-
393
- - **Dependabot/Renovate**: For package-registry plugins, automated PRs for version bumps
394
- - **`mise upgrade`**: Built-in command to update all tool versions
395
- - **`brew update && brew upgrade`**: Two-step: update index, then upgrade packages
396
- - **`asdf plugin update --all`**: Git pull all plugin repos
397
- - **VSCode**: Background auto-update with optional user approval
398
-
399
- ### 7. Discovery Mechanisms
400
-
401
- Ranked by effectiveness at scale:
402
-
403
- 1. **In-tool search** (VSCode, Terraform): Users never leave the tool. Highest conversion.
404
- 2. **Dedicated website with search** (npmjs.com, marketplace.visualstudio.com): Good for browsing, lower conversion than in-tool.
405
- 3. **CLI search command** (`brew search`, `asdf plugin list-all`): Moderate friction, power-user friendly.
406
- 4. **Curated awesome-list** (awesome-zsh-plugins): Good for small ecosystems, does not scale past 200 entries.
407
- 5. **GitHub topic tags**: Lowest effort, poorest discoverability. Only works for developers who think to search GitHub.
408
-
409
- ### 8. Trust and Security Patterns
410
-
411
- | Mechanism | Used By | Effect |
412
- |-----------|---------|--------|
413
- | Verified publisher | VSCode, npm | Identity trust |
414
- | Code signing | Terraform, Homebrew | Integrity trust |
415
- | Download counts | VSCode, npm | Social proof |
416
- | Automated scanning | npm audit, Snyk | Vulnerability detection |
417
- | Sandboxing | VSCode Extension Host, Deno permissions | Runtime isolation |
418
- | Review process | Homebrew core, App Store | Quality gatekeeping |
419
- | Reproducible builds | Homebrew bottles, Nix | Build trust |
420
-
421
- **For small ecosystems**: A manual review of plugin PRs to a shortname registry is sufficient. For large ecosystems, automated scanning plus verified publishers is the minimum.
422
-
423
- ## Code Examples
424
-
425
- ### Example 1: Minimal Plugin System (Convention-Based)
426
-
427
- ```javascript
428
- // host-tool/src/plugin-loader.js
429
- import { readdirSync, existsSync } from 'fs';
430
- import { join } from 'path';
431
-
432
- function discoverPlugins(pluginDir) {
433
- if (!existsSync(pluginDir)) return [];
434
-
435
- return readdirSync(pluginDir, { withFileTypes: true })
436
- .filter(d => d.isDirectory())
437
- .map(d => {
438
- const manifestPath = join(pluginDir, d.name, 'plugin.json');
439
- if (!existsSync(manifestPath)) return null;
440
-
441
- const manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
442
- return {
443
- name: d.name,
444
- version: manifest.version,
445
- description: manifest.description,
446
- entryPoint: join(pluginDir, d.name, manifest.main || 'index.js'),
447
- commands: manifest.commands || [],
448
- };
449
- })
450
- .filter(Boolean);
451
- }
452
-
453
- // Usage
454
- const plugins = discoverPlugins(join(process.env.HOME, '.mytool/plugins'));
455
- ```
456
-
457
- ### Example 2: Git-Based Plugin Install (asdf-style)
458
-
459
- ```bash
460
- #!/usr/bin/env bash
461
- # mytool-plugin-add: Install a plugin from git URL or shortname
462
-
463
- PLUGIN_DIR="${MYTOOL_HOME:-$HOME/.mytool}/plugins"
464
- REGISTRY_URL="https://raw.githubusercontent.com/org/mytool-plugins/main/registry.json"
465
-
466
- install_plugin() {
467
- local name="$1"
468
- local url="$2"
469
-
470
- # If no URL, resolve from shortname registry
471
- if [ -z "$url" ]; then
472
- url=$(curl -s "$REGISTRY_URL" | jq -r ".\"$name\"" 2>/dev/null)
473
- if [ "$url" = "null" ] || [ -z "$url" ]; then
474
- echo "[ERROR] Plugin '$name' not found in registry"
475
- return 1
476
- fi
477
- fi
478
-
479
- local dest="$PLUGIN_DIR/$name"
480
- if [ -d "$dest" ]; then
481
- echo "[WARN] Plugin '$name' already installed. Use 'update' instead."
482
- return 1
483
- fi
484
-
485
- echo "Installing plugin '$name' from $url..."
486
- git clone --depth 1 "$url" "$dest" || return 1
487
-
488
- # Verify plugin contract
489
- if [ ! -f "$dest/plugin.toml" ]; then
490
- echo "[ERROR] Invalid plugin: missing plugin.toml"
491
- rm -rf "$dest"
492
- return 1
493
- fi
494
-
495
- echo "[OK] Plugin '$name' installed"
496
- }
497
-
498
- install_plugin "$@"
499
- ```
500
-
501
- ### Example 3: Shortname Registry (JSON file)
502
-
503
- ```json
504
- {
505
- "$schema": "https://mytool.dev/schemas/registry.json",
506
- "version": 1,
507
- "plugins": {
508
- "nodejs": {
509
- "url": "https://github.com/mytool-plugins/plugin-nodejs",
510
- "description": "Node.js version management",
511
- "maintainer": "core-team",
512
- "tags": ["language", "runtime"]
513
- },
514
- "python": {
515
- "url": "https://github.com/mytool-plugins/plugin-python",
516
- "description": "Python version management",
517
- "maintainer": "core-team",
518
- "tags": ["language", "runtime"]
519
- },
520
- "terraform": {
521
- "url": "https://github.com/community/mytool-terraform",
522
- "description": "Terraform version management",
523
- "maintainer": "community",
524
- "tags": ["tool", "iac"]
525
- }
526
- }
527
- }
528
- ```
529
-
530
- ### Example 4: Plugin Manifest for AI Agent Framework
531
-
532
- ```yaml
533
- # plugin.yaml - AgentSys-style plugin manifest
534
- name: code-review
535
- version: 2.1.0
536
- description: Multi-agent code review with configurable rulesets
537
- author: example-org
538
- license: MIT
539
- min-host-version: "5.0.0"
540
-
541
- commands:
542
- - name: review
543
- description: Run code review on changed files
544
- agent: review-orchestrator
545
- argument-hint: "[path] [--fix] [--severity [level]]"
546
-
547
- agents:
548
- - name: review-orchestrator
549
- model: opus
550
- description: Orchestrates review across multiple specialized agents
551
- - name: style-checker
552
- model: haiku
553
- description: Checks code style compliance
554
-
555
- skills:
556
- - name: orchestrate-review
557
- description: Coordinates multi-agent review workflow
558
-
559
- hooks:
560
- pre-commit:
561
- - skill: orchestrate-review
562
- args: "--quick --changed-only"
563
- ```
564
-
565
- ### Example 5: Vendored Plugin Cache Structure
566
-
567
- ```
568
- .tool/plugins/cache/
569
- code-review/
570
- 2.1.0/
571
- plugin.yaml
572
- commands/
573
- review.md
574
- agents/
575
- review-orchestrator.yaml
576
- style-checker.yaml
577
- skills/
578
- orchestrate-review/
579
- SKILL.md
580
- lib/
581
- shared-utils.js
582
- 2.0.3/ # Previous version kept for rollback
583
- ...
584
- perf-analysis/
585
- 1.5.0/
586
- plugin.yaml
587
- ...
588
- ```
589
-
590
- ## Common Pitfalls
591
-
592
- | Pitfall | Why It Happens | How to Avoid |
593
- |---------|---------------|--------------|
594
- | Building a registry too early | Excitement about the ecosystem's potential | Start with a shortname JSON file; build a registry only when discovery becomes a real user complaint |
595
- | Too-complex plugin contract | Trying to anticipate all use cases | Start with 2-3 required files; add optional capabilities gradually |
596
- | No version pinning | "It works on my machine" mindset | Add a lock file from day one, even if it is just a JSON file mapping plugin names to git SHAs |
597
- | Monolithic bundling | Wanting zero-friction initial experience | Bundle a few essential plugins; make the rest opt-in from the start |
598
- | No plugin validation | Trusting all plugin authors | Validate the plugin contract at install time (check required files exist, manifest is valid) |
599
- | Mixing transport and contract | Thinking "how to download" is the hard problem | Design the plugin interface first; transport is pluggable later |
600
- | Ignoring Windows/cross-platform | Most plugin authors use Unix | Test the plugin contract on all target platforms; avoid shell scripts if you need Windows support |
601
- | No deprecation mechanism | Assuming plugins are forever | Add a `deprecated` field in the registry from day one |
602
- | Over-engineering security for small ecosystems | Copying Terraform's model for 10 plugins | Match security investment to ecosystem size; manual review works for under 50 plugins |
603
- | Breaking the plugin contract | Changing required files/APIs without versioning | Version your plugin contract separately from the host tool version |
604
-
605
- ## Best Practices
606
-
607
- Synthesized from analysis of 40+ ecosystems:
608
-
609
- 1. **Design the contract first, distribution second**. The interface a plugin must implement matters more than how it gets downloaded. Terraform succeeded because the provider protocol is rock-solid, not because the registry is fancy.
610
-
611
- 2. **Use convention over configuration**. The best plugin systems require minimal boilerplate. A plugin should be "a directory with the right files in it" -- not a complex build artifact.
612
-
613
- 3. **Start with a shortname file, not a registry**. A JSON or TOML file mapping plugin names to git URLs is sufficient for under 100 plugins and takes zero infrastructure to maintain.
614
-
615
- 4. **Add a lock file from day one**. Even a simple `plugins.lock` that records git SHAs or version numbers prevents "works on my machine" problems.
616
-
617
- 5. **Validate at install time, not at runtime**. Check that a plugin follows the contract when it is installed. Fail fast with clear error messages. This catches most issues before they cause runtime failures.
618
-
619
- 6. **Separate "official/core" from "community"**. Maintain a small set of high-quality official plugins. Accept community plugins with lighter review. Users need to know what is supported vs best-effort.
620
-
621
- 7. **Provide a scaffold/template**. `mytool new plugin <name>` should generate a working plugin skeleton. This is the single highest-leverage thing you can do for plugin author experience.
622
-
623
- 8. **Support local development without publishing**. Plugin authors must be able to test locally (e.g., symlink a local directory into the plugins folder). Publishing should only be needed for sharing.
624
-
625
- 9. **Version the plugin contract independently**. When you change what files/APIs a plugin must provide, version that change. Old plugins should keep working or fail with clear "upgrade needed" messages.
626
-
627
- 10. **Invest in discovery proportional to ecosystem size**. Under 20 plugins: README list. Under 100: searchable awesome-list or static site. Over 100: in-tool search with quality signals.
628
-
629
- ## Comparative Summary
630
-
631
- | Ecosystem | Pattern | Plugin Count | Contract Type | Discovery | What It Does Best |
632
- |-----------|---------|-------------|---------------|-----------|-------------------|
633
- | Terraform | Dedicated Registry | 3000+ | Protocol (gRPC) | In-tool + website | Version locking, platform-specific binaries |
634
- | VSCode | Dedicated Registry | 50000+ | Capability-declared | In-tool search | Seamless install/update, quality signals |
635
- | Homebrew | Git + JSON API | 6000+ | Convention (Ruby formula) | CLI search + website | Cross-platform binary distribution |
636
- | npm/ESLint | Package Registry | 5000+ | Convention (naming prefix) | npm search | Dependency resolution, existing ecosystem |
637
- | oh-my-zsh | Bundled + Git | 300+ | Convention (shell script) | README list | Zero-friction for included plugins |
638
- | asdf/mise | Git-Based | 500+ | Convention (shell scripts in bin/) | CLI list + shortname file | Language-agnostic, simple contract |
639
- | Claude Code | Vendored + npm | <50 | Convention (markdown + YAML) | Manual | Deterministic, offline-friendly |
640
- | Vim (vim-plug) | Git-Based | 20000+ | Convention (autoload/) | awesome-vim + web | Minimal overhead, community-driven |
641
- | GitHub Actions | Convention + Registry | 20000+ | Convention (action.yml) | Marketplace website | In-workflow reference, versioned via git tags |
642
-
643
- ## Further Reading
644
-
645
- | Resource | Type | Why Recommended |
646
- |----------|------|-----------------|
647
- | [Terraform Plugin Framework Docs](https://developer.hashicorp.com/terraform/plugin/framework) | Official Docs | Best-in-class plugin protocol design |
648
- | [VSCode Extension API](https://code.visualstudio.com/api) | Official Docs | Most mature extension marketplace architecture |
649
- | [asdf Plugin Creation Guide](https://asdf-vm.com/plugins/create.html) | Official Docs | Simple git-based plugin contract |
650
- | [mise Documentation](https://mise.jdx.dev/) | Official Docs | Evolution from asdf model to multi-backend |
651
- | [Homebrew Formula Cookbook](https://docs.brew.sh/Formula-Cookbook) | Official Docs | Ruby-based package formula conventions |
652
- | [HashiCorp go-plugin](https://github.com/hashicorp/go-plugin) | GitHub | gRPC-based plugin system library |
653
- | [steampipe Plugin SDK](https://github.com/turbot/steampipe-plugin-sdk) | GitHub | Terraform-inspired plugin pattern for SQL |
654
- | [Claude Code Plugin Docs](https://docs.anthropic.com/en/docs/claude-code) | Official Docs | AI agent plugin conventions |
655
- | [ESLint Plugin Developer Guide](https://eslint.org/docs/latest/extend/plugins) | Official Docs | npm-based plugin distribution at scale |
656
- | [GitHub Actions Creating Actions](https://docs.github.com/en/actions/creating-actions) | Official Docs | Convention-based action definition |
657
-
658
- ---
659
-
660
- *Generated by /learn from 40 sources (training knowledge -- web fetch was unavailable during generation).*
661
- *See `resources/skill-plugin-distribution-patterns-sources.json` for full source metadata.*