You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the feature or problem you'd like to solve
Custom agents (.agent.md files) have no native way to inherit, extend, or compose shared rules from a base prompt. As soon as you have more than two or three specialist agents that need to share the same code-quality, scope, or style rules, every agent file ends up duplicating the same blocks of guidance, and the rules drift between agents over time.
There is currently no extends: / base: / include: mechanism in the agent frontmatter, no way to reference a shared rules document as a structural parent, and no way to share MCP servers or tools across agents from a single declaration (related: #1756).
Proposed solution
Add first-class support for agent inheritance / composition. A few possible shapes (any one would solve the underlying problem):
extends in frontmatter — point at one or more parent .agent.md files; the runtime concatenates parent prompt + child prompt, with the child taking precedence on conflicts.
---
name: my-specialistextends:
- my-base
---
include directive in agent prompt body — explicit, ordered inclusion of shared .md snippets so multiple specialists can compose from a small library of rule fragments (style, security, repo conventions, etc.).
Single source of truth for shared rules (style, scope boundaries, output contracts, security/PII rules, repo conventions).
Eliminates copy/paste drift across a fleet of specialist agents.
Makes it practical to ship cohesive "agent suites" that all share the same baseline rules.
Encourages small, focused specialist agents instead of monolithic ones.
Easier to evolve guidance: change the base, every specialist picks it up on next invocation.
Example prompts or workflows
Multi-specialist suite
A team builds several agents for a single problem area (an orchestrator plus a handful of specialists). All of them should enforce the same code-quality rules, the same scope rules, and the same output format. With extends: my-base, those rules live in one file. Without it, every specialist file has to be kept in lockstep manually.
Org-wide style baseline
An organization defines a single org-base.agent.md with shared rules (no secrets in code, follow AGENTS.md, prefer ecosystem tools, structured output sections). Every team's specialist agents extend it. Updating the org baseline updates every agent at once.
Layered MCP / tool inheritance
A with-github.agent.md parent declares the GitHub MCP server and a curated tool set. Multiple specialist agents extend it instead of redeclaring MCP wiring in each frontmatter.
Composable rule fragments
A specialist composes from several small docs:
Each fragment is small and reusable across many agents.
Deprecating an agent cleanly
When a base agent is renamed or split, every dependent agent surfaces immediately because the extends reference is a structural link the runtime can validate, instead of a hand-written "read this file first" instruction that may be silently ignored by the model.
Additional context
Current workaround
Since there is no native inheritance, the practical workaround is to maintain a canonical base prompt as a regular document and instruct each specialist agent to read it first. Concretely:
Create a shared base document, e.g. a *-base.agent.md (or any plain .md path).
In every specialist's <default_context> (or equivalent), include an explicit directive to read the base file before doing anything else.
Document a precedence rule in the base ("base rules apply unless a specialist explicitly overrides; specialists must call out overrides explicitly") because there is no runtime resolution.
Describe the feature or problem you'd like to solve
Custom agents (
.agent.mdfiles) have no native way to inherit, extend, or compose shared rules from a base prompt. As soon as you have more than two or three specialist agents that need to share the same code-quality, scope, or style rules, every agent file ends up duplicating the same blocks of guidance, and the rules drift between agents over time.There is currently no
extends:/base:/include:mechanism in the agent frontmatter, no way to reference a shared rules document as a structural parent, and no way to share MCP servers or tools across agents from a single declaration (related: #1756).Proposed solution
Add first-class support for agent inheritance / composition. A few possible shapes (any one would solve the underlying problem):
extendsin frontmatter — point at one or more parent.agent.mdfiles; the runtime concatenates parent prompt + child prompt, with the child taking precedence on conflicts.includedirective in agent prompt body — explicit, ordered inclusion of shared.mdsnippets so multiple specialists can compose from a small library of rule fragments (style, security, repo conventions, etc.).mcp-serversandtoolsto be declared in a referenced parent agent so specialists do not have to redeclare them (overlaps with Allow external custom agents (installed from plugins) to access globally configured MCP servers #1756).Benefits:
Example prompts or workflows
Multi-specialist suite
A team builds several agents for a single problem area (an orchestrator plus a handful of specialists). All of them should enforce the same code-quality rules, the same scope rules, and the same output format. With
extends: my-base, those rules live in one file. Without it, every specialist file has to be kept in lockstep manually.Org-wide style baseline
An organization defines a single
org-base.agent.mdwith shared rules (no secrets in code, followAGENTS.md, prefer ecosystem tools, structured output sections). Every team's specialist agents extend it. Updating the org baseline updates every agent at once.Layered MCP / tool inheritance
A
with-github.agent.mdparent declares the GitHub MCP server and a curated tool set. Multiple specialist agents extend it instead of redeclaring MCP wiring in each frontmatter.Composable rule fragments
A specialist composes from several small docs:
Each fragment is small and reusable across many agents.
Deprecating an agent cleanly
When a base agent is renamed or split, every dependent agent surfaces immediately because the
extendsreference is a structural link the runtime can validate, instead of a hand-written "read this file first" instruction that may be silently ignored by the model.Additional context
Current workaround
Since there is no native inheritance, the practical workaround is to maintain a canonical base prompt as a regular document and instruct each specialist agent to read it first. Concretely:
*-base.agent.md(or any plain.mdpath).<default_context>(or equivalent), include an explicit directive to read the base file before doing anything else.mcp-serversand tool config in each specialist, since shared frontmatter is not supported (see Allow external custom agents (installed from plugins) to access globally configured MCP servers #1756).This works, but has clear limits:
A first-class
extends/includemechanism would replace this convention with something the runtime can validate and merge deterministically.Related issues