Skip to content

Custom agent support for 'skills' field to limit which skills are preloaded into context #3940

Description

@evr-novicell

Describe the feature or problem you'd like to solve

Ability to define 'skills' field in a custom agent to limit which skills are preloaded into context

Proposed solution

If I create a custom agent .github/agents/dotnet-developer.md

---
name: dotnet-developer
description: A .NET/C# developer agent focused on writing, refactoring, and debugging dotnet code.
model: claude-sonnet-4.6
tools: []
skills: []
---

You are a senior .NET developer specializing in C# and the dotnet ecosystem.

## Responsibilities
- Write clean, idiomatic, and maintainable C# code following modern .NET conventions.
- Use appropriate dotnet CLI commands (`dotnet build`, `dotnet test`, `dotnet run`) to build, test, and run projects.
- Refactor and debug existing C# code, diagnosing and fixing issues precisely.
- Follow the project's existing patterns, style, and architecture.

## Guidelines
- Prefer the latest stable language features and framework APIs unless the project targets an older version.
- Validate changes by building and running the relevant tests before considering work complete.
- Make surgical, focused changes; do not modify unrelated code.
- Add comments only where the intent is not obvious from the code itself.

## Constraints
- You do not have access to MCP servers.
- Rely on the tools listed above to complete tasks.

and select the agent via CLI with copilot --agent="dotnet-developer"

I would expect:

  1. Agent only has access to tools listed in tools, in this case, no tools should be available. This works ✅ Asking agent to use a tool it does not have access to fails (even though the agent might think it has access to it due to custom agent description).
  2. Agent only has preloaded skills listed in 'skills': in this case, all tools are available, as can be seen by running /skills while inside of the agent. This can also by testing by asking the agent to use a skill which it should not have access to - it succeeds, even though skills tool is not listed in tools either

It is not expected that

  1. Agent has access to skill tool when the skill tool is not listed in tools: []
  2. skills field of the custom agent definition is ignored and all skills are discoverable by the agent when skill tool is not allowed

For example, adding a skill .github/skills/tell-a-joke/SKILL.md:

---
name: tell-a-joke
description: Tell the user a joke. Use when the user asks for a joke, says "make me laugh", "tell me something funny", "cheer me up", or invokes /tell-a-joke. Optionally accepts a topic or category as an argument.
version: 1.0.0
---

# Tell a Joke

Tell the user a joke. If `$ARGUMENTS` is provided, make the joke about that topic. Otherwise, pick one from the fallback list using `dayOfYear % 16` as the index.

## Instructions

1. If a topic was given (`$ARGUMENTS`), craft or recall a joke on that topic.
2. If no topic, pick from the list below.
3. Deliver setup and punchline cleanly — no preamble like "Here's a joke:".
4. Add a single short self-aware remark after the punchline (optional).

## Fallback joke list

0. Why do programmers prefer dark mode? Because light attracts bugs.
1. A SQL query walks into a bar and asks two tables: "Can I join you?"
2. Why do Java developers wear glasses? Because they don't C#.
3. What's a programmer's favourite hangout? The Foo Bar.
4. How do you comfort a JavaScript bug? You console it.
5. Why did the developer go broke? They used up all their cache.
6. Why don't programmers like the outdoors? The sun causes too many reflection issues.
7. Why did the programmer quit? They didn't get arrays.
8. Debugging: being the detective in a crime movie where you're also the murderer.
9. It works on my machine. Ship my machine.
10. There are only 10 types of people: those who understand binary, and those who don't.
11. Knock knock. Who's there? Recursion. Recursion who? Knock knock.
12. A regex walked into a bar. The bartender said "You look like you have a problem." The regex replied: `^You could say that\.$`
13. Why was the function sad after a breakup? Too many arguments.
14. Real programmers count from 0.
15. What do you call a programmer who never comments their code? A job security specialist.

## Tone

Dry, self-aware, light. One joke only — no lists, no follow-ups unless asked.

  1. copilot --agent="dotnet-developer"
  2. tell a joke
  3. Agent responds with:
◐ The user wants to hear a joke. I should invoke the tell-a-joke skill.

● skill(tell-a-joke) 

● Why do Java developers wear glasses? Because they don't C#.

  Ophthalmology and language wars, all in one.

Example prompts or workflows

Users who have many tools and skills available by default could use agents to delimit tools and skills available for specific role oriented workflows (planning, development, debugging, review) without all tools and skills being preloaded every time, which causes bloated context window, slower models and distracting model from doing it's role oriented job.

.github/agents/dotnet-developer.md

---
name: dotnet-developer
description: A .NET/C# developer agent focused on writing, refactoring, and debugging dotnet code.
model: claude-sonnet-4.6
tools: []
skills: ["tell-a-joke"]
---

Run copilot --agent="dotnet-developer" (skills field is defined in the custom agent md file)

copilot --allow-skills="tell-a-joke" (override skills available to an agent)
copilot --allow-skills-add="tell-a-joke" (append)
copilot --allow-skills-remove="tell-a-joke" (uses custom agent with skill field, but removes a specific skill for testing purposes)

Claude seems to have a much wider support for custom agent definitions

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:agentsSub-agents, fleet, autopilot, plan mode, background agents, and custom agentsarea:pluginsPlugin system, marketplace, hooks, skills, extensions, and custom agents
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions