feat(plugins): install Claude Code-format plugins and natively inject AGENTS.md#770
Merged
Conversation
The /init shortcut generates a project-root AGENTS.md but nothing read it back at runtime. Inject it additively after custom instructions (never replacing them), matching the merge semantics of the open AGENTS.md standard. Gated by agent.agents_md.enabled (default true), capped at agent.agents_md.max_chars (default 8000) with an explicit truncation marker. Claude Code mode is unaffected: the claude CLI reads project instruction files natively.
Introduces the ~/.infer/plugins.yaml registry sidecar (lazily created, never seeded by init --overwrite) and surfaces installed Claude Code-format plugins through native primitives: - skills: each enabled plugin's skills/ dir joins the scan at lowest precedence (new 'plugin' scope; local skills always win name clashes) - instructions: each enabled plugin's AGENTS.md is injected as a labeled system prompt section after the project AGENTS.md; read verbatim (no env expansion) and capped at plugins.max_instructions_lines (default 399 per the AGENTS.md standard) plus a max_chars backstop - the same configurable caps now applied to the project AGENTS.md injection - Claude Code mode: plugin rulesets ride --append-system-prompt; the project AGENTS.md is excluded there since claude reads it natively - sandbox: ~/.infer/plugins carve-out (gated on plugins.enabled) so the model can Read plugin SKILL.md bodies; *.env stays protected - env overrides: INFER_PLUGINS_ENABLED, INFER_PLUGINS_DIR Plugin code (hooks/, commands/) is never executed - content only.
infer plugins install <owner/repo | github-url | local-path> downloads the mapped content subset (.claude-plugin/plugin.json, AGENTS.md, skills/**) via the GitHub tree + raw APIs (no git binary; HEAD default ref; GITHUB_TOKEN/GH_TOKEN honored), stages it inside the plugins root, validates skills with the runtime scan rules, prints an activation summary (hooks/commands detected but never executed), and atomically promotes on confirmation. Non-interactive stdin requires --yes. list/update/enable/disable/remove manage ~/.infer/plugins.yaml; remove heals stale registry entries; update re-fetches from the recorded source preserving the enabled state.
…0 -> v0.27.1 (#768) ## Summary Centralized-config changes in one PR: 1. Adds/updates `.github/workflows/infer.yml` as a thin caller of the org reusable workflow `inference-gateway/.github/.github/workflows/infer.yml@v0.16.4`, wiring the `@infer` bot (inference-gateway/infer-action) into this repo. 2. Bumps this repo's Flox `infer` pin (`.flox/env/manifest.toml`) to `v0.133.1` (the latest `inference-gateway/cli` release) and refreshes `.flox/env/manifest.lock`. Setup lives centrally, so future moves (action bump, model, tool scope, CLI version) are a **re-run of `migrate-infer.yml`** instead of a hand-edit per repo. Ran in CI (mirrors `migrate-claude.yml`): - sed the `inference-gateway/cli` pin in `.flox/env/manifest.toml` to the latest release - `flox upgrade infer` + `flox activate -- true` to refresh `.flox/env/manifest.lock` in canonical form ### Notes - Triggers on `@infer` mentions in issues / issue comments. Default model `deepseek/deepseek-v4-flash`. The `infer-action` pin lives in the reusable `infer.yml`. - Also adds a manual `workflow_dispatch` form: from this repo's Actions tab pick **Infer**, type a free-text `prompt`, and the bot works it in that run and opens a PR (no issue needed) - mirroring the `@claude` workflow. - Tools = infer-action's default bash whitelist + the language preset (+ markdownlint where set), configured in `repos.yaml` (the entry's `orchestrators.infer` block). - Requires the maintainer GitHub App (`INFERENCE_GATEWAY_MAINTAINER_APP_ID` / `INFERENCE_GATEWAY_MAINTAINER_APP_PRIVATE_KEY`) installed on this repo plus the provider API-key secrets; both reach the reusable workflow via `secrets: inherit`. Filed by [migrate-infer.yml](https://github.com/inference-gateway/.github/blob/main/.github/workflows/migrate-infer.yml). Co-authored-by: inference-gateway-maintainer[bot] <246577062+inference-gateway-maintainer[bot]@users.noreply.github.com>
The disabled-plugins assertion relied on t.TempDir() being outside the sandbox directories, which holds on macOS (/var/folders) but not on Linux where /tmp is a default sandbox dir. Anchor the plugins root inside the protected .infer/ dir under cwd instead, mirroring the real ~/.infer/plugins layout, so the carve-out is what the test exercises.
ef2fb79 to
4939b62
Compare
This was referenced Jul 6, 2026
Open
inference-gateway-releaser Bot
added a commit
that referenced
this pull request
Jul 6, 2026
## [0.134.0](v0.133.1...v0.134.0) (2026-07-06) ### 🚀 Features * **plugins:** install Claude Code-format plugins and natively inject AGENTS.md ([#770](#770)) ([82c430f](82c430f)) ### 📚 Documentation * fix dead INFER_AGENT_SYSTEM_PROMPT env vars in configuration-reference.md ([#769](#769)) ([b353e6b](b353e6b)), closes [#766](#766) ### 🧹 Maintenance * **deps:** bump infer CLI v0.133.0 -> v0.133.1, infer-action v0.26.0 -> v0.27.1 ([#768](#768)) ([0d9980c](0d9980c))
Contributor
|
🎉 This PR is included in version 0.134.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Summary
Adds a plugin system that installs Claude Code-format plugins (the de-facto packaging standard across agent CLIs) and maps them onto infer's native primitives — plus native injection of the project's own
AGENTS.md, which/initgenerated but nothing ever read back at runtime.Verified end-to-end against the real ponytail repo: 6 skills load with the new
pluginscope, itsAGENTS.mdruleset injects into the system prompt, and its 10 hook scripts / 6 command files are detected and ignored.Design
Content only — plugin code is never executed. Unlike executable plugin models (e.g. OpenCode's JS modules), infer maps a plugin's content onto existing features:
skills/<name>/SKILL.mdpluginscope (local skills win name clashes);/namerouting and autocomplete work unchangedAGENTS.md(root)PLUGIN INSTRUCTIONS (<name>)system-prompt section while enabled.claude-plugin/plugin.jsonhooks/,commands/,agents/custom_instructions(merge semantics of the AGENTS.md standard — nothing is ever replaced). Gated byagent.agents_md.enabled, capped atmax_lines(default 399, per the standard's <400-line contract) with amax_charsbackstop (8000); truncation always explicitly marked. Skipped in Claude Code mode (claudereads it natively); plugin rulesets ride--append-system-promptthere.~/.infer/plugins.yaml, userspace-only, created lazily on first install — never seeded byinfer init, so--overwritecan't clobber it.gitbinary;HEADdefault ref = 1 API call per install;GITHUB_TOKEN/GH_TOKENhonored), downloads only the mapped subset, stages inside the plugins root, validates skills with the exact runtime scan rules, and atomically promotes (os.Rename, trash-restore on overwrite failure). Local-path sources supported for plugin development.AGENTS.mdbecomes always-on prompt content); non-interactive stdin requires--yes. Instruction files are read verbatim — no env expansion — so plugin text can't exfiltrate environment variables. Sandbox carve-out for~/.infer/plugins(gated onplugins.enabled) lets the modelReadplugin SKILL.md bodies while*.envstays protected. Tree paths are traversal-guarded.INFER_PLUGINS_ENABLED,INFER_PLUGINS_DIR,INFER_AGENT_AGENTS_MD_*; per-pluginenable/disableunloads skills and removes the prompt section together.Commands
Testing
task test,task lint,task precommit:runall pass.skills list→debug agent system_promptgreps → disable/enable/update cycle againstDietrichGebert/ponytail.Cross-repo impact
CLI-only; no impact on
schemas, gateway, SDKs, oroperator.infer-actionneeds no changes (env-override pass-through).Docs follow-up ([DOCS] issue for
inference-gateway/docs, to be filed with this PR): new plugins page (install/manage, format mapping, security model), configuration reference additions (plugins.yaml,agent.agents_md.*, env vars), skills page update for the newpluginscope.docs/plugins.mdin this repo covers the same ground in the meantime.Out of scope (phase 2 candidates)
commands/*→ shortcuts translation, opt-in hook-event mapping,.mcp.jsonregistration via the MCP registry, marketplace.json multi-plugin repos, project-scoped plugin enablement.