Skip to content

Commit a87eee0

Browse files
joslattamirdresher
andauthored
docs(plugins): say which spawn paths inject plugin context (#2327)
features/plugins.md said every spawned agent gets a Plugin Context section built from .squad/plugins/runtime.json. Only the SDK's AgentLifecycleManager.spawnAgent() does that; the coordinator in the hosts, the interactive shell, squad watch, squad loop and the other SDK spawn helpers never read plugin state. Correct plugins.md (with a table of spawn paths and a workaround), plugin-security.md, building-extensions.md and the MemPalace sample README. Closes #2326 Co-authored-by: Tamir Dresher <tamir.dresher@gmail.com>
1 parent 423c43e commit a87eee0

4 files changed

Lines changed: 23 additions & 8 deletions

File tree

‎docs/src/content/docs/features/plugins.md‎

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ squad plugin enable my-plugin
1010
squad plugin refresh my-plugin
1111
```
1212

13-
After that, spawned agents can receive the plugin's enabled context. For a knowledge plugin such as Graphify, refresh can generate approved artifacts under `.squad/knowledge/graphify/` so agents have a relationship map across code, docs, and decisions.
13+
After that, the plugin's static files are installed under `.squad/` and its roles are active. Agents spawned through the SDK's `AgentLifecycleManager` receive the enabled plugin context automatically. Agents spawned by the Squad coordinator (in GitHub Copilot or another supported host) or by the Squad interactive shell (`squad` with no arguments) do not yet; see [Runtime behavior](#runtime-behavior). For a knowledge plugin such as Graphify, refresh can generate approved artifacts under `.squad/knowledge/graphify/` that give agents a relationship map across code, docs, and decisions when they read them.
1414

1515
The MVP is declarative-first with a narrow governed runtime for Squad-owned built-in providers. Squad records hook, adapter, and provider metadata, and approved providers can generate static artifacts. It does not execute plugin-supplied code.
1616

@@ -158,19 +158,32 @@ Squad validates and records these dependencies so users know what Copilot plugin
158158

159159
External integration metadata is also record-only. Fields such as `repository`, `upstream.installCommand`, and `mcp.installCommand` explain how a human can install external tools separately; Squad never runs those commands.
160160

161-
Provider contracts are the typed extension seam for memory and knowledge systems. A contract declares the provider `type` (`memory`, `knowledge`, `persistence`, `event`, or `policy`), access `mode` (`read`, `write`, or `read-write`), `protocol` (`static-artifact` or `mcp`), optional static artifact binding, optional MCP binding metadata, and capability labels. These fields let spawned agents understand that a plugin represents a memory or knowledge provider without letting the plugin run code. During the MVP, provider contracts are prompt metadata only: Squad does not start MCP servers, call provider tools, query live memory backends, or install provider packages.
161+
Provider contracts are the typed extension seam for memory and knowledge systems. A contract declares the provider `type` (`memory`, `knowledge`, `persistence`, `event`, or `policy`), access `mode` (`read`, `write`, or `read-write`), `protocol` (`static-artifact` or `mcp`), optional static artifact binding, optional MCP binding metadata, and capability labels. These fields describe a memory or knowledge provider to agents, on spawn paths that inject plugin context, without letting the plugin run code. During the MVP, provider contracts are prompt metadata only: Squad does not start MCP servers, call provider tools, query live memory backends, register a Squad memory provider, or install provider packages.
162162

163163
---
164164

165165
## Runtime behavior
166166

167-
Enabled plugins affect spawned Squad agents through their installed static artifacts and provider contracts. When an agent session is spawned, Squad reads `.squad/plugins/runtime.json`, finds enabled active plugin roles, and injects the installed guidance/metadata files plus provider contract summaries into the agent system context under a `Plugin Context` section.
167+
Enabled plugins can affect spawned agents through their installed static artifacts and provider contracts, but only on spawn paths that inject plugin context. On those paths, Squad reads `.squad/plugins/runtime.json`, finds enabled active plugin roles, and appends the installed guidance/metadata files plus provider contract summaries to the agent system prompt under a `Plugin Context` section.
168168

169-
This is still declarative-first behavior: Squad consumes copied Markdown/metadata from `.squad/`, but it does not install upstream packages, start MCP servers, execute plugin-supplied commands, call provider tools, or query external tools during plugin install or agent spawn.
169+
Today only one spawn path does this:
170+
171+
| How the agent is spawned | Plugin context injected? |
172+
| --- | --- |
173+
| Your own code calls the SDK's `AgentLifecycleManager.spawnAgent()` | Yes |
174+
| Your own code uses another SDK spawn helper, such as `spawnParallel` or `SquadCoordinator` | No. These helpers do not read plugin state. |
175+
| The Squad coordinator (`squad.agent.md`) in GitHub Copilot CLI, VS Code, or another supported host | No. The coordinator's spawn prompt does not read plugin state or plugin artifacts. |
176+
| The Squad interactive shell (`squad` with no arguments) | No. Agent sessions receive the charter only. |
177+
| `squad watch` | No. It runs `copilot -p` with a prompt built from Ralph's charter and the issue instructions. |
178+
| `squad loop` | No. It runs `copilot -p` with the prompt in your `loop.md`. |
179+
180+
On the paths marked No, installed plugin files still sit under `.squad/`, but agents only see them if something points them there. For example, name the file in your request, or add a line such as "Read `.squad/knowledge/graphify/graphify-integration.md` before code relationship work" to the relevant agent charter or skill.
181+
182+
Where plugin context is injected, it is still declarative-first behavior: Squad consumes copied Markdown/metadata from `.squad/`, but it does not install upstream packages, start MCP servers, execute plugin-supplied commands, call provider tools, or query external tools during plugin install or agent spawn.
170183

171184
The MVP also includes a narrow governed runtime for Squad-owned built-in providers. `squad plugin refresh <plugin-id>` and `squad plugin run-lifecycle <plugin-id> <event>` can generate artifacts only when the provider name, lifecycle event, and output paths are allowlisted by Squad. The current approved provider is Graphify, which can refresh deterministic knowledge artifacts under `.squad/knowledge/graphify/`.
172185

173-
Disabled plugins do not contribute prompt context, even if their files remain installed on disk.
186+
Disabled plugins do not contribute to the `Plugin Context` section, even if their files remain installed on disk.
174187

175188
---
176189

@@ -184,7 +197,7 @@ The repository includes local sample plugins that exercise external integration
184197
| `samples/plugin-knowledge-index-server` | Instruction and knowledge MCP profile for the real `jagilber-org/index-server` project and npm package `@jagilber-org/index-server`. It declares a metadata-only `knowledge` provider contract for the Index Server MCP catalog. |
185198
| `samples/plugin-memory-mempalace` | Memory-palace-style provider profile for the real `MemPalace/mempalace` CLI and optional `mempalace-mcp` server. It declares a metadata-only `memory` provider contract for spatial memory. |
186199

187-
Graphify's Copilot support is a separately installed skill/integration, not a Squad memory provider or a Squad-managed Copilot plugin. Index Server is an MCP-governed instruction/knowledge catalog, not a memory provider, although it is adjacent because agents can persist validated knowledge across sessions and repositories. MemPalace is a real memory system, but Squad still does not install its package, start MCP, or configure assistant hooks.
200+
Graphify's Copilot support is a separately installed skill/integration, not a Squad memory provider or a Squad-managed Copilot plugin. Index Server is an MCP-governed instruction/knowledge catalog, not a memory provider, although it is adjacent because agents can persist validated knowledge across sessions and repositories. MemPalace is a real memory system, but Squad still does not install its package, start MCP, or configure assistant hooks. Installing the MemPalace sample does not give agents a memory: it adds no tools, is not wired into `squad memory` or the `memory.*` tools, and does not change your MCP configuration. To let agents use MemPalace, install it and add `mempalace-mcp` to your assistant's MCP configuration yourself.
188201

189202
---
190203

‎docs/src/content/docs/guide/building-extensions.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ squad plugin enable my-extension
154154

155155
**Step 8: Test locally**
156156

157-
Run `squad plugin verify`, then run `squad plugin refresh <plugin-id>` if your plugin declares an approved built-in provider. Load your Squad session and verify the installed Squad knowledge, workflows, and generated artifacts appear and work as expected. If you declared Copilot dependencies, verify those are installed separately through Copilot.
157+
Run `squad plugin verify`, then run `squad plugin refresh <plugin-id>` if your plugin declares an approved built-in provider. Run `squad plugin list --json` to confirm the plugin is enabled and its files are installed under `.squad/`. Agents spawned by the Squad coordinator in GitHub Copilot, or by the Squad interactive shell (`squad` with no arguments), do not read plugin files automatically yet, so to check behavior in a session, point an agent at an installed file or reference it from a charter or skill (see [Runtime behavior](../features/plugins.md#runtime-behavior)). If you declared Copilot dependencies, verify those are installed separately through Copilot.
158158

159159
---
160160

‎docs/src/content/docs/reference/plugin-security.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The plugin MVP is designed for reusable Squad knowledge and configuration, not e
66

77
Copilot plugin dependencies can be declared with `copilot.requires`. They are metadata only: Squad records and displays them so users know which Copilot plugins to install through Copilot's own lifecycle.
88

9-
External packages, repositories, and MCP servers can be described with `repository`, `upstream`, and `mcp`. Typed provider contracts can be described with `providers`. They are also metadata only: Squad may display install hints and inject provider summaries into spawned-agent context, but it must not run package managers, start MCP servers, configure assistant clients, call provider tools, query live provider backends, or install assistant hooks.
9+
External packages, repositories, and MCP servers can be described with `repository`, `upstream`, and `mcp`. Typed provider contracts can be described with `providers`. They are also metadata only: Squad may display install hints and, on spawn paths that inject plugin context (today only the SDK's `AgentLifecycleManager`), add provider summaries to spawned-agent context, but it must not run package managers, start MCP servers, configure assistant clients, call provider tools, query live provider backends, or install assistant hooks.
1010

1111
---
1212

‎samples/plugin-memory-mempalace/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ squad plugin list --json
2525

2626
This example is declarative only. Squad does not install `mempalace`, run `mempalace`, start `mempalace-mcp`, install assistant hooks, or execute memory provider code during plugin install.
2727

28+
Installing this sample does not give agents a memory. It copies one guidance file to `.squad/memory/providers/mempalace-provider.md` and records metadata under `.squad/plugins/`. Agents spawned by the Squad coordinator in GitHub Copilot, or by the Squad interactive shell (`squad` with no arguments), do not see that file unless you point them at it. Only SDK code that spawns agents through `AgentLifecycleManager` adds it to the agent prompt automatically.
29+
2830
Install and configure MemPalace separately:
2931

3032
```bash

0 commit comments

Comments
 (0)