Skip to content

agent-help: name installed plugins that declare agent guidance - #3244

Merged
gtrrz-victor merged 4 commits into
mainfrom
peyton/agent-help-plugin-listing
Nov 30, 2026
Merged

gtrrz-victor merged 4 commits into
mainfrom
peyton/agent-help-plugin-listing

Conversation

@peyton-alt

@peyton-alt peyton-alt commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

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: true in a plugin's entire-plugin.yml means the plugin implements entire-<name> agent-help. It's read leniently (only a YAML true counts; 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:
    Plugins with agent guidance — run the ones that may bear on your task:
      entire agent-help stream
    
    only for installed plugins that declare it, whose bin entry is the installed release binary (os.SameFile, so a local --force install isn't named), that no built-in shadows, and whose name is safe. Nothing is printed when there are none. --json and the MCP tool are unchanged; entire agent-help <plugin> dispatch is main's existing behaviour.
  • About 100 lines of code; docs: one paragraph in docs/architecture/external-commands.md, one sentence in docs/development/cli-conventions.md.

Verified

  • mise run check passes; tests (written first): declared → listed; not declared, field absent, local install over a release, none → nothing; built-in-shadowed name skipped; lenient parsing of true/false/yes/[1]/absent; install copies the field.
  • Smoke test with a real build: entire agent-help shows entire agent-help stream for a release install that declares it, and nothing without the field. claude -p told to run entire agent-help first ran entire agent-help stream and quoted stream's guidance (run entire 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

@peyton-alt
peyton-alt requested a review from a team as a code owner November 27, 2026 21:22
Copilot AI balanced review requested due to automatic review settings November 27, 2026 21:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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-help text and JSON output, while keeping MCP output unchanged.
  • Records agent_help metadata 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

Comment thread cmd/entire/cli/agent_help_plugins.go Resolved
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
peyton-alt force-pushed the peyton/agent-help-plugin-listing branch from 42ba80c to f9b3813 Compare November 27, 2026 23:09
@peyton-alt peyton-alt changed the title agent-help: list installed plugins that declare agent guidance agent-help: name installed plugins that declare agent guidance Nov 27, 2026
peyton-alt and others added 3 commits November 27, 2026 15:26
- 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
@gtrrz-victor
gtrrz-victor merged commit 5eec300 into main Nov 30, 2026
24 checks passed
@gtrrz-victor
gtrrz-victor deleted the peyton/agent-help-plugin-listing branch November 30, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants