Repository navigation
agent-help: name installed plugins that declare agent guidance - #3244
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
On Windows, a same-name executable in the current directory can cause the help listing to advertise a managed plugin that delegation rejects, requiring aligned lookup behavior and a regression test.
1 open issue
What changed in this PR
This PR lets agents discover guidance from installed plugins without coupling the core CLI to specific plugins. Discovery uses local install records and does not execute plugins or access the network.
Changes:
- Adds filtered, bounded plugin listings to top-level
agent-helptext and JSON output, while keeping MCP output unchanged. - Records
agent_helpmetadata during installation and backfills missing metadata once per installed tag on no-op upgrades. - Adds regression tests and documents discovery, trust checks, and local-install behavior.
| File | Description |
|---|---|
| docs/development/cli-conventions.md | Documents plugin discovery in agent-help output. |
| docs/architecture/external-commands.md | Explains opt-in guidance, filtering, trust checks, and backfill. |
| cmd/entire/cli/plugin_manifest.go | Adds guidance declaration and metadata-backfill fields. |
| cmd/entire/cli/plugin_install_remote.go | Persists guidance metadata and extends no-op upgrade backfill. |
| cmd/entire/cli/plugin_install_remote_test.go | Tests guidance metadata across release upgrades. |
| cmd/entire/cli/plugin_help_test.go | Tests metadata backfill and once-per-tag fetching. |
| cmd/entire/cli/agent_help_plugins.go | Implements local discovery, filtering, and plugin rendering. |
| cmd/entire/cli/agent_help_plugins_test.go | Tests listings, sanitization, resolution, limits, and install identity. |
| cmd/entire/cli/agent_help_cmd.go | Integrates plugin listings into CLI text and JSON output. |
| cmd/entire/cli/agent_help_cmd_test.go | Updates renderer tests for the plugin-listing parameter. |
Review effort: Balanced
A plugin declares in entire-plugin.yml that it answers `entire-<name> agent-help` with `agent_help: true` (read leniently: anything but a YAML boolean true is false, so a typo can't fail the install). Install and upgrade copy it into the manifest. The bare `entire agent-help` text names those plugins near the top, "Plugins with agent guidance — run the ones that may bear on your task:", one `entire agent-help <name>` line each, and prints nothing when there are none. It reads only the managed tree and names a plugin only when its manifest declares agent_help, its bin entry is the release binary that manifest describes, no built-in shadows it, and its name is shell-safe. Not in --json or the MCP tool. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rxmv1Yre5x8Re4F6G9FrUm
peyton-alt
force-pushed
the
peyton/agent-help-plugin-listing
branch
from
November 27, 2026 23:09
42ba80c to
f9b3813
Compare
- The release-binary check reuses managedEntryIsPkgBinary (plugin doctor's, same meaning) instead of a duplicate. - runAgentHelp's comment says the bare text path reads the local plugin tree (no git, exec or network). - Docs: agent_help is copied when a tag is installed, so an install made by an older CLI gets it with its next installed release; this CLI should ship before a plugin release that declares it. - Test: names validatePluginName accepts but a shell would split (`foo;bar`, `foo bar`) are left out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rxmv1Yre5x8Re4F6G9FrUm
An upgrade with nothing to install (up to date, or pinned) backfilled only a missing description, returning early when the manifest had one, so an install made before agent_help was recorded never gained it without a new release. It now reads the installed tag's entire-plugin.yml when the manifest lacks the description or agent_help, sets whichever is missing, and saves only if something changed. backfillManifestDescription is renamed backfillManifestMetadata to match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rxmv1Yre5x8Re4F6G9FrUm
With omitempty a manifest couldn't tell "declared false" from "never recorded", so a plugin that doesn't opt in re-fetched entire-plugin.yml on every no-op upgrade. The manifest's agent_help is now a *bool: install always records it, true or false; the backfill fetches only when the description or agent_help is missing and records agent_help either way, so an older install fetches for it once (a failed fetch is retried). The listing treats nil and false as not declared. The three listing tests are one table-driven test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rxmv1Yre5x8Re4F6G9FrUm
Soph
approved these changes
Nov 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why
So the CLI knows when an installed plugin offers agent guidance (for example
entire stream's guidance on teammates' live sessions) and can point agents at it, without the core CLI knowing anything about a specific plugin. This is the small, decoupled part of #3180, which is parked.What
agent_help: truein a plugin'sentire-plugin.ymlmeans the plugin implementsentire-<name> agent-help. It's read leniently (only a YAMLtruecounts; anything else reads as false and never fails an install) and copied into the install manifest (omitempty, so older CLIs are unaffected). Upgrades reinstall, so they copy it too.entire agent-help(text only) prints, right after the repo line:os.SameFile, so a local--forceinstall isn't named), that no built-in shadows, and whose name is safe. Nothing is printed when there are none.--jsonand the MCP tool are unchanged;entire agent-help <plugin>dispatch is main's existing behaviour.docs/architecture/external-commands.md, one sentence indocs/development/cli-conventions.md.Verified
mise run checkpasses; tests (written first): declared → listed; not declared, field absent, local install over a release, none → nothing; built-in-shadowed name skipped; lenient parsing oftrue/false/yes/[1]/absent; install copies the field.entire agent-helpshowsentire agent-help streamfor a release install that declares it, and nothing without the field.claude -ptold to runentire agent-helpfirst ranentire agent-help streamand quoted stream's guidance (runentire stream list --live --touching <path>before editing; stop and tell the user who is on the file). That guidance ships in entire-stream main; the released stream v0.1.1 only prints usage, so a stream release is needed for the full path.🤖 Generated with Claude Code
https://claude.ai/code/session_01Rxmv1Yre5x8Re4F6G9FrUm