RFC: a standard way for packages to communicate to AI coding agents at install time #13422
Replies: 5 comments
|
I would love to use this, hate having to install random skills not vetted by the package maintainers. |
|
Great idea and converges every former attempt at this. This is a much more simple and proactive approach. |
This assumes that all work happens in a new worktree, where agents reinstall packages from scratch. That's true in many cases, but not all, which could lead to confusion: why are skills sometimes picked up and sometimes ignored? What if many packages have this property set? Should we print a line for each of them, potentially bringing a lot of tokens into the context? |
|
+1 on this! We ship the supabase/agent-skills skill repo and rely on people (or MCP tooling) already knowing to run My take on the open questions: For shape, plain string. For detection, would love to see a shared env var. For interop, one generic, harness-neutral notice. Cross-PM, |
|
How do we make sure these messages will not contain harmful prompts for the agents? Should pnpm print some additional instructions before/after the notice? Like: or are there static analysis tools that we can use to verify the text before printing it? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Background
Agents install packages now. A human who runs
pnpm add xmight read the README, documentation or release notes; an agent almost never does. At the same time packages increasingly ship agent-relevant artifacts — skills, MCP servers, plugin manifests, codemods, migration guides — and there is no sanctioned way to say "this exists" at the one moment the agent is definitely looking at your package.The workaround, and what it costs
We wanted a way to let agents know that drizzle-kit package bundles agent skills. With no install-time channel, we had to build all of this (not released yet):
AGENT=1|true|goose|ampandCURSOR_EXTENSION_HOST_ROLE=agent-exec. It is already out of date the day it ships.postinstallhook in all major package managers.--output jsonfor programmatic consumers.DO_NOT_TRACK/ kill-switch handling.plugin-hints(below).Every package that wants to do this will rebuild that same stack, each slightly differently, and each one becomes a new prompt-injection surface. That's the argument for moving it one layer down.
Initial proposal:
agentNoticestatic field inpackage.jsonA single static string field in
package.json:{ "agentNotice": "Agent skills for Drizzle are bundled at ./skills and readable in place." }This line would be printed during the package installation via
pnpm i/pnpm add, when an agent environment is detected.Safeguarding:
DO_NOT_TRACK, CI detection, and a pnpm setting.drizzle-kit declares: …, so the model treats it as a quoted claim rather than a directive.Prior art: Claude Code's
plugin-hintsAt least one harness has already built this channel, which is a decent sign the need is real. Claude Code defines a
plugin-hintsprotocol: a CLI writes a self-closing marker on its own stderr line —— and the host takes it from there. It strips the line before the model sees it, checks whether the plugin is already installed, deduplicates (once per plugin, once per session), and only then renders a native install prompt.
The limitation that motivates this RFC: it is one vendor, one artifact type, one ecosystem. Implement it and you have reached the users of a single harness.
Related work
Several efforts already let packages ship agent-facing artifacts:
agentskillsfield.skills/directory convention plus a symlinking CLI.agentsproperty.AGENTS.mdfrom apostinstallhook — which pnpm users must explicitly allowlist viapnpm.onlyBuiltDependencies.The problem is that every one of them puts an adoption step in front of the discovery mechanism:
npx skills-npm,npx agentskills export, an extra coordinator dependency with an allowlisted install hook. The overwhelming majority of developers — and therefore of agents — will never take that step, and a convention nobody runs discovers nothing.Discovery only works if it is on by default in something already in the path. Package installing is already in the path of every JS dependency on every machine, agent-driven or not. That reach is the one property none of the tools above can bootstrap for themselves, and it is the whole reason this belongs in the package manager rather than in one more CLI.
Why the package manager is the right layer
fundingis already a static manifest field the package manager surfaces at install time without executing anything.Open questions
agentNoticeas a plain string, or anagents: {}object that could later carry skill/MCP/plugin paths? Or something else entirely?AGENT=1seems to be emerging) so nobody maintains a 28+ entry list (inspiration - Standard Schema)?plugin-hintswhen it detects that harness (which could also be standardized)?package.jsonis a shared namespace. Coordinate with npm/yarn/bun early, or prototype in pnpm and standardize later?All reactions