Skills are reusable prompt modules that extend Copilot's capabilities. Load skills from directories to give Copilot specialized abilities for specific domains or workflows.
A skill is a named directory containing a SKILL.md file—a markdown document that provides instructions to Copilot. When loaded, the skill's content is injected into the session context.
Skills allow you to:
Specify directories containing skills when creating a session:
import { CopilotClient } from "copilot-sdk-supercharged";
const client = new CopilotClient({ mode: "coding-agent" });
const session = await client.createSession({
model: "auto",
skills: {
directories: ["./skills/code-review", "./skills/documentation"],
},
permissions: {
onRequest: async () => ({ kind: "approve-once" }),
},
});
// Copilot now has access to skills in those directories
await session.sendAndWait({ prompt: "Review this code for security issues" });
from copilot import CopilotClient
from copilot.session import PermissionDecisionApproveOnce
async def main():
client = CopilotClient(mode="coding-agent")
await client.start()
session = await client.create_session(
model="auto",
permissions={"on_request": lambda req, inv: PermissionDecisionApproveOnce()},
skills={
"directories": [
"./skills/code-review",
"./skills/documentation",
]
},
)
# Copilot now has access to skills in those directories
await session.send_and_wait("Review this code for security issues")
await client.stop()
package main
import (
"context"
copilot "github.com/microsoft/copilot-sdk/go/v2"
"github.com/microsoft/copilot-sdk/go/v2/rpc"
"log"
)
func main() {
ctx := context.Background()
client := copilot.NewClient(&copilot.ClientOptions{Mode: copilot.ModeCodingAgent})
if err := client.Start(ctx); err != nil {
log.Fatal(err)
}
defer client.Stop()
session, err := client.CreateSession(ctx, &copilot.CreateSessionOptions{
Model: "auto",
Skills: copilot.SessionSkillOptions{
Directories: []string{
"./skills/code-review",
"./skills/documentation",
},
},
Permissions: copilot.SessionPermissionOptions{
OnRequest: func(req copilot.PermissionRequest, inv copilot.PermissionInvocation) (rpc.PermissionDecision, error) {
return &rpc.PermissionDecisionApproveOnce{}, nil
},
},
})
if err != nil {
log.Fatal(err)
}
// Copilot now has access to skills in those directories
_, err = session.SendAndWait(ctx, copilot.MessageOptions{
Prompt: "Review this code for security issues",
})
if err != nil {
log.Fatal(err)
}
}
#pragma warning disable MCPSDK001 // PermissionDecision is experimental.
using Microsoft.Copilot;
using Microsoft.Copilot.Rpc;
await using var client = new CopilotClient(new CopilotClientOptions { Mode = CopilotClientMode.CodingAgent });
await using var session = await client.CreateSessionAsync(new CreateSessionOptions
{
Model = "auto",
Skills = new SessionSkillOptions
{
Directories = new List<string>
{
"./skills/code-review",
"./skills/documentation",
}
},
Permissions = new SessionPermissionOptions
{
OnRequest = (req, inv) => Task.FromResult(PermissionDecision.ApproveOnce())
}
});
// Copilot now has access to skills in those directories
await session.SendAndWaitAsync(new MessageOptions
{
Prompt = "Review this code for security issues"
});
import com.microsoft.copilot.CopilotClient;
import com.microsoft.copilot.rpc.*;
import java.util.List;
try (var client = new CopilotClient(new CopilotClientOptions().setMode(CopilotClientMode.CODING_AGENT))) {
client
.start()
.get();
var session = client
.createSession(new CreateSessionOptions()
.setModel("auto")
.setSkills(new SessionSkillOptions()
.setDirectories(List
.of("./skills/code-review", "./skills/documentation")))
.setPermissions(new SessionPermissionOptions()
.setOnRequest(PermissionHandler.APPROVE_ALL)))
.get();
// Copilot now has access to skills in those directories
session
.sendAndWait(new MessageOptions()
.setPrompt("Review this code for security issues"))
.get();
}
Disable specific skills while keeping others active:
const session = await client.createSession({
skills: {
directories: ["./skills"],
disabledSkills: ["experimental-feature", "deprecated-tool"],
},
});
from copilot import CopilotClient
from copilot.session import PermissionHandler
client = CopilotClient(mode="coding-agent")
session = await client.create_session(
permissions={"on_request": PermissionHandler.approve_all},
skills={
"directories": ["./skills"],
"disabled_skills": ["experimental-feature", "deprecated-tool"],
},
)
package main
import (
"context"
copilot "github.com/microsoft/copilot-sdk/go/v2"
)
func main() {
client := copilot.NewClient(&copilot.ClientOptions{Mode: copilot.ModeCodingAgent})
session, _ := client.CreateSession(context.Background(), &copilot.CreateSessionOptions{
Skills: copilot.SessionSkillOptions{
Directories: []string{"./skills"},
DisabledSkills: []string{"experimental-feature", "deprecated-tool"},
},
})
_ = session
}
session, _ := client.CreateSession(context.Background(), &copilot.CreateSessionOptions{
Skills: copilot.SessionSkillOptions{
Directories: []string{"./skills"},
DisabledSkills: []string{"experimental-feature", "deprecated-tool"},
},
})
var session = await client.CreateSessionAsync(new CreateSessionOptions
{
Skills = new SessionSkillOptions
{
Directories = new List<string>
{
"./skills"
},
DisabledSkills = new List<string>
{
"experimental-feature",
"deprecated-tool"
}
}
});
import com.microsoft.copilot.*;
import com.microsoft.copilot.rpc.*;
import java.util.List;
public class SkillDirectoriesExample {
public static void main(String[] args) throws Exception {
try (var client = new CopilotClient(new CopilotClientOptions().setMode(CopilotClientMode.CODING_AGENT))) {
var session = client
.createSession(new CreateSessionOptions()
.setSkills(new SessionSkillOptions()
.setDirectories(List
.of("./skills"))
.setDisabledSkills(List
.of("experimental-feature", "deprecated-tool")))
.setPermissions(new SessionPermissionOptions()
.setOnRequest(PermissionHandler.APPROVE_ALL)))
.get();
}
}
}
import com.microsoft.copilot.rpc.*;
import java.util.List;
var session = client
.createSession(new CreateSessionOptions()
.setSkills(new SessionSkillOptions()
.setDirectories(List
.of("./skills"))
.setDisabledSkills(List
.of("experimental-feature", "deprecated-tool")))
.setPermissions(new SessionPermissionOptions()
.setOnRequest(PermissionHandler.APPROVE_ALL)))
.get();
Each skill is a named subdirectory containing a SKILL.md file:
skills/
├── code-review/
│ └── SKILL.md
└── documentation/
└── SKILL.md
The skills.directories option points to the parent directory (e.g., ./skills). The runtime searches that directory recursively and loads the topmost SKILL.md on each path, so skills grouped in category folders (for example skills/testing/coverage/SKILL.md) are found too. It does not look inside a directory that already holds a SKILL.md: files nested in a skill's folder are that skill's resources, not separate skills. Directories whose names start with . are skipped.
A SKILL.md file is a markdown document that starts with a YAML frontmatter block:
---
name: code-review
description: Specialized code review capabilities
---
# Code Review Guidelines
When reviewing code, always check for:
1. **Security vulnerabilities** - SQL injection, XSS, etc.
2. **Performance issues** - N+1 queries, memory leaks
3. **Code style** - Consistent formatting, naming conventions
4. **Test coverage** - Are critical paths tested?
Provide specific line-number references and suggested fixes.
The frontmatter fields:
name: The skill's identifier (used with skills.disabledSkills to selectively disable it). If omitted, the directory name is used.description: A short description of what the skill does.Both fields are optional, but the frontmatter block itself is required: a SKILL.md without the --- lines is skipped.
The markdown body contains the instructions that are injected into the session context when the skill is loaded.
note
Skill providers are experimental. The API can change in future SDK releases.
A skill provider serves skills from your application's own storage, such as a database in a multi-tenant service, instead of SKILL.md files on disk. Provider skills join the session's skill catalog alongside file-based skills. The model loads them on demand through the skill tool, and users can invoke them like any other skill.
A provider implements two operations:
name, a description, and optionally userInvocable, disableModelInvocation, and argumentHint. The runtime calls it when it loads the session's skills.Pass the provider when you create or resume a session:
import { approveAll, CopilotClient, type SkillProvider } from "copilot-sdk-supercharged";
const releaseSkills = new Map([
[
"release-notes",
{
description: "Writes release notes in the team's format.",
markdown: "Group changes by feature area and link each pull request.",
},
],
]);
const skillProvider: SkillProvider = {
listSkills: () =>
[...releaseSkills].map(([name, skill]) => ({ name, description: skill.description })),
readSkill: (name) => releaseSkills.get(name)?.markdown ?? null,
};
const client = new CopilotClient({ mode: "coding-agent" });
const session = await client.createSession({
permissions: {
onRequest: approveAll,
},
skills: {
provider: skillProvider,
},
});
from copilot import CopilotClient, SkillProviderDescriptor
from copilot.session import PermissionHandler
RELEASE_SKILLS = {
"release-notes": (
"Writes release notes in the team's format.",
"Group changes by feature area and link each pull request.",
),
}
class ReleaseSkills:
async def list_skills(self) -> list[SkillProviderDescriptor]:
return [
SkillProviderDescriptor(name=name, description=description)
for name, (description, _) in RELEASE_SKILLS.items()
]
async def read_skill(self, name: str) -> str | None:
skill = RELEASE_SKILLS.get(name)
return skill[1] if skill else None
async def main():
client = CopilotClient(mode="coding-agent")
await client.start()
session = await client.create_session(
permissions={"on_request": PermissionHandler.approve_all},
skills={"provider": ReleaseSkills()},
)
package main
import (
"context"
"fmt"
"log"
copilot "github.com/microsoft/copilot-sdk/go/v2"
"github.com/microsoft/copilot-sdk/go/v2/rpc"
)
type releaseSkill struct {
description string
markdown string
}
type releaseSkills map[string]releaseSkill
func (s releaseSkills) ListSkills(ctx context.Context) ([]rpc.SkillProviderDescriptor, error) {
descriptors := make([]rpc.SkillProviderDescriptor, 0, len(s))
for name, skill := range s {
descriptors = append(descriptors, rpc.SkillProviderDescriptor{Name: name, Description: skill.description})
}
return descriptors, nil
}
func (s releaseSkills) ReadSkill(ctx context.Context, name string) (string, error) {
skill, ok := s[name]
if !ok {
return "", fmt.Errorf("%w: %s", copilot.ErrSkillNotFound, name)
}
return skill.markdown, nil
}
func main() {
ctx := context.Background()
client := copilot.NewClient(&copilot.ClientOptions{Mode: copilot.ModeCodingAgent})
session, err := client.CreateSession(ctx, &copilot.CreateSessionOptions{
Permissions: copilot.SessionPermissionOptions{
OnRequest: copilot.PermissionHandler.ApproveAll,
},
Skills: copilot.SessionSkillOptions{
Provider: releaseSkills{
"release-notes": {
description: "Writes release notes in the team's format.",
markdown: "Group changes by feature area and link each pull request.",
},
},
},
})
if err != nil {
log.Fatal(err)
}
_ = session
}
#pragma warning disable MCPSDK001 // Skill providers are experimental.
using Microsoft.Copilot;
using Microsoft.Copilot.Rpc;
public sealed class ReleaseSkills : ISkillProvider
{
private readonly Dictionary<string, (string Description, string Markdown)> _skills = new()
{
["release-notes"] = ("Writes release notes in the team's format.", "Group changes by feature area and link each pull request."),
};
public Task<IReadOnlyList<SkillProviderDescriptor>> ListSkillsAsync(CancellationToken cancellationToken) => Task.FromResult<IReadOnlyList<SkillProviderDescriptor>>(_skills.Select(skill => new SkillProviderDescriptor
{
Name = skill.Key,
Description = skill.Value.Description,
}).ToList());
public Task<string?> ReadSkillAsync(string name, CancellationToken cancellationToken) => Task.FromResult(_skills.TryGetValue(name, out var skill) ? skill.Markdown : null);
}
public static class SkillProviderExample
{
public static async Task RunAsync(CopilotClient client)
{
await using var session = await client.CreateSessionAsync(new CreateSessionOptions
{
Permissions = new SessionPermissionOptions
{
OnRequest = PermissionHandler.ApproveAll
},
Skills = new SessionSkillOptions
{
Provider = new ReleaseSkills()
}
});
}
}
The .NET skill provider types raise the MCPSDK001 experimental diagnostic. Suppress it with #pragma warning disable MCPSDK001 or a project-level <NoWarn>MCPSDK001</NoWarn>.
import com.microsoft.copilot.AllowCopilotExperimental;
import com.microsoft.copilot.CopilotClient;
import com.microsoft.copilot.CopilotSession;
import com.microsoft.copilot.SkillProvider;
import com.microsoft.copilot.SkillProviderDescriptor;
import com.microsoft.copilot.rpc.PermissionHandler;
import com.microsoft.copilot.rpc.CreateSessionOptions;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import com.microsoft.copilot.rpc.SessionPermissionOptions;
import com.microsoft.copilot.rpc.SessionSkillOptions;
@AllowCopilotExperimental
class ReleaseSkills implements SkillProvider {
private final Map<String, String> markdown = Map
.of("release-notes", "Group changes by feature area and link each pull request.");
@Override
public CompletableFuture<List<SkillProviderDescriptor>> listSkills() {
return CompletableFuture
.completedFuture(List
.of(new SkillProviderDescriptor("release-notes", "Writes release notes in the team's format.", null, null, null)));
}
@Override
public CompletableFuture<String> readSkill(String name) {
return CompletableFuture
.completedFuture(markdown
.get(name));
}
}
@AllowCopilotExperimental
class SkillProviderExample {
static CopilotSession createSession(CopilotClient client) throws Exception {
return client
.createSession(new CreateSessionOptions()
.setPermissions(new SessionPermissionOptions()
.setOnRequest(PermissionHandler.APPROVE_ALL))
.setSkills(new SessionSkillOptions()
.setProvider(new ReleaseSkills())))
.get();
}
}
The Java skill provider API is @CopilotExperimental, so the consuming class or method must opt in with @AllowCopilotExperimental (or compile with -Acopilot.experimental.allowed=true). See Using experimental APIs.
use std::sync::Arc;
use async_trait::async_trait;
use copilot_sdk::{Error, CreateSessionOptions, SkillProvider, SkillProviderDescriptor};
struct ReleaseSkills;
#[async_trait]
impl SkillProvider for ReleaseSkills {
async fn list_skills(&self) -> Result<Vec<SkillProviderDescriptor>, Error> {
Ok(vec![SkillProviderDescriptor {
name: "release-notes".into(),
description: "Writes release notes in the team's format.".into(),
..Default::default()
}])
}
async fn read_skill(&self, name: &str) -> Result<Option<String>, Error> {
Ok((name == "release-notes")
.then(|| "Group changes by feature area and link each pull request.".to_string()))
}
}
let session = client
.create_session(
CreateSessionOptions::default()
.with_permissions(|__sdk_group| __sdk_group.approve_all_permissions())
.with_skills(|__sdk_group| __sdk_group.with_provider(Arc::new(ReleaseSkills))),
)
.await?;
Read skill returns the skill's SKILL.md text. YAML frontmatter is optional:
allowed-tools is read only from frontmatter.---, the runtime parses it as frontmatter, so don't start a body-only skill with a Markdown thematic break.By default, provider skills are text-only: they have no base directory, so they can't reference bundled scripts, templates, or other files. To give a provider skill such files, see Supporting files. skills.list reports provider skills with the source sdk and an empty path, with or without supporting files.
A provider skill can come with supporting files, such as scripts, references, templates, and assets, the same way a file-based skill's folder can. Your application keeps each skill's files in a folder it controls and sets directory on the listed skill to that folder's absolute path.
When the model activates the skill, the runtime lists the folder the same way it lists a file-based skill's folder. The model gets the same "Base directory for this skill" line and related-files list that a file-based skill gets, in place of the text-only notice, and reads the files with its ordinary file tools. The runtime never reads, copies, or writes the files itself.
import { approveAll, CopilotClient, type SkillProvider } from "copilot-sdk-supercharged";
const skillProvider: SkillProvider = {
listSkills: () => [
{
name: "release-notes",
description: "Writes release notes in the team's format.",
directory: "/srv/skills/release-notes",
},
],
readSkill: (name) =>
name === "release-notes"
? "Run `python3 scripts/changelog.py` and fill in `templates/notes.md`."
: null,
};
const client = new CopilotClient({ mode: "coding-agent" });
const session = await client.createSession({
permissions: {
onRequest: approveAll,
},
skills: {
provider: skillProvider,
},
});
Each SDK sets the folder on its listed-skill type:
| SDK | Field |
|---|---|
| Node.js | directory: "/srv/skills/release-notes" |
| Python | directory="/srv/skills/release-notes" |
| Go | Directory: copilot.String("/srv/skills/release-notes") |
| .NET | Directory = "/srv/skills/release-notes" |
| Java | The sixth SkillProviderDescriptor constructor argument |
| Rust | directory: Some("/srv/skills/release-notes".into()) |
Put all of a skill's files under its directory, one folder per skill. The folder must be reachable where the runtime runs:
directory is a path on the machine or container that runs the runtime. The model can read the files with any file tool, and it can run scripts.sessionFs). With a sessionFs handler, directory uses the handler's path conventions, and your handler serves the files; the runtime lists the folder through it. view, create, edit, and apply_patch reach the files. grep, glob, and shell commands don't, so scripts can't run. The Java SDK has no sessionFs, so Java providers use local disk.The runtime lists the folder after read skill returns, so you can create the folder lazily in read skill. If the folder is missing or empty, or can't be listed within 15 seconds of the runtime calling read skill, the model still gets the base directory line, with no related-files list, as for a file-based skill. If your sessionFs handler is disconnected when the runtime lists skills, those skills are text-only until the next listing.
directory like a configured skills.directories folder: reads under it skip the outside-workspace path prompt, and sandboxed processes get read-only access to it. Reads still go to your permission handler, as they do for file-based skills. Don't return a broad directory, such as your home folder or a folder that holds every tenant's files.readonlyPaths.Your application owns the folder: where it lives, how long it exists, cleaning it up, and keeping the model from changing it. The read-only access covers only sandboxed processes. Outside the sandbox, or when the folder is inside the workspace, the model can write to it unless your permission handler, or your sessionFs handler, refuses.
references/guide.md. The model is told the folder's absolute path.python3 scripts/changelog.py or bash scripts/build.sh, as Using scripts in skills describes. Scripts run only when the folder is on local disk.directory must be absolute in the session's path conventions; on a Windows-style session filesystem it needs a drive or UNC prefix. It's resolved the way file tools resolve paths, so . and .. segments and repeated or trailing separators are removed, and it can't resolve to a filesystem root. It counts toward the catalog's 1 MiB metadata limit, and it isn't shown in skill catalogs. An invalid directory rejects the whole catalog, like any other invalid listed skill.node_modules, bin, obj, and dist, are hidden; a folder with more than 50 entries is summarized; files nested more than 10 folders deep are not listed; SKILL.md is never listed; and at most 100 files are shown.directory. Providers that don't set directory work with older runtimes.To serve SKILL.md files that you already have, such as files stored in a database, parse each file's YAML frontmatter once to build its catalog entry, then return the file unchanged from read skill:
name and description to the listed skill's name and description. Both are required in the catalog; the runtime doesn't fall back to a folder name or the skill body.user-invocable, disable-model-invocation, and argument-hint to the matching optional fields when the frontmatter sets them.allowed-tools from it.Treat provider skills like skill directories: their content is trusted input. The model follows a skill's instructions, and the frontmatter controls how the skill is invoked. allowed-tools doesn't grant permissions in SDK sessions. The runtime reports it in the allowedTools field of the skill.invoked event, and your permission handler still decides every tool request.
Don't serve text that end users or other tenants can edit unless you would let them author a skill file. If you build skills from user input, generate the frontmatter yourself instead of passing user-supplied frontmatter through.
The runtime validates the provider's catalog and content:
Names must match ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$ and be unique, ignoring case.
A catalog can contain at most 1,024 skills and 1 MiB of metadata. Each description and argument hint can be at most 1,024 characters.
Each skill's markdown can be at most 1 MiB of UTF-8.
Each call must complete within 30 seconds. When the runtime stops waiting for a call, because it timed out, the session ended, or a resume replaced the provider, it cancels the request and ignores any later result. Each SDK passes that cancellation to your provider in its usual way:
| SDK | Cancellation signal |
|---|---|
| Node.js | The signal (AbortSignal) in the options passed to listSkills and readSkill is aborted. |
| Python | The provider's asyncio task is cancelled with asyncio.CancelledError. Synchronous providers run to completion. |
| Go | The call's context.Context is cancelled. |
| .NET | The call's CancellationToken is cancelled. |
| Java | The returned CompletableFuture is cancelled with cancel(true), which doesn't interrupt running work. |
| Rust | The provider future is dropped. |
These signals cover calls that the runtime cancels. When the connection closes or the client is force-stopped, the Python, Go, .NET, Java, and Rust SDKs also cancel calls that are still running. The Node.js SDK doesn't: a running call continues until it returns, and the SDK discards its result.
If listing fails or returns an invalid catalog, the runtime reports the problem in the errors list returned by skills.reload. A failed reload keeps the provider skills from the last successful list. If reading a skill fails, the skill tool reports a generic load failure to the model. The SDK never forwards the text of errors your provider throws or returns, so that text can't leak into the conversation.
A provider is bound to one session:
skills.enabled to false, which keeps the provider bound but never called. In mode: "empty", skills stay disabled until you set skills.enabled to true.skills.reload reports a warning.skill tool, user invocations, and custom agents that preload skills, so both operations must be safe for concurrent use.| Language | Field | Type | Description |
|---|---|---|---|
| Node.js | skills.directories | string[] | Directories to load skills from |
| Node.js | skills.disabledSkills | string[] | Skills to disable |
| Node.js | skills.provider | SkillProvider | Experimental provider for SDK-supplied skills |
| Python | skills={"directories": ...} | list[str] | Directories to load skills from |
| Python | skills={"disabled_skills": ...} | list[str] | Skills to disable |
| Python | skills={"provider": ...} | SkillProvider | Experimental provider for SDK-supplied skills |
| Go | Skills.Directories | []string | Directories to load skills from |
| Go | Skills.DisabledSkills | []string | Skills to disable |
| Go | Skills.Provider | SkillProvider | Experimental provider for SDK-supplied skills |
| .NET | Skills.Directories | IList<string> | Directories to load skills from |
| .NET | Skills.DisabledSkills | IList<string> | Skills to disable |
| .NET | Skills.Provider | ISkillProvider | Experimental provider for SDK-supplied skills |
| Java | setSkills(new SessionSkillOptions().setProvider(...)) | SkillProvider | Experimental provider for SDK-supplied skills |
| Rust | with_skills(\|skills\| skills.with_provider(...)) | Arc<dyn SkillProvider> | Experimental provider for SDK-supplied skills |
mode: "empty"The runtime ships with a set of bundled built-in skills that are eligible by
default. When you run the client in mode: "empty" (the recommended baseline for
multi-tenant servers), the SDK excludes every
runtime-bundled built-in skill: it sends an empty includedBuiltinSkills list on
the post-create and post-resume options patch, alongside the empty
installedPlugins list.
This exclusion is the default, not a permanent restriction. To allow selected
runtime-bundled skills, set skills.includedBuiltinSkills (or the language-specific
casing) to their names. You can also opt into your own custom skills under
mode: "empty"—enable skills and pass your own skills.directories—and those
remain fully usable, including a custom skill that shares a name with a built-in.
Under mode: "coding-agent" the field is omitted unless you set the option.
Custom skill directories are scanned when skills first load, including directories
that are missing or empty at that point. Filesystem changes in those directories
do not automatically refresh the catalog on later turns. After adding, editing,
or removing skills, call your session's skills.reload RPC:
| SDK | Reload call |
|---|---|
| Node.js | await session.rpc.skills.reload() |
| Python | await session.rpc.skills.reload() |
| Go | session.RPC.Skills.Reload(ctx) |
| .NET | await session.Rpc.Skills.ReloadAsync() |
| Java | session.getRpc().skills.reload().join() |
| Rust | session.rpc().skills().reload().await? |
Changing the configured skill directories also refreshes the catalog.
Organize by domain - Group related skills together (e.g., skills/security/, skills/testing/)
Use frontmatter - Include name and description in YAML frontmatter for clarity
Document dependencies - Note any tools or MCP servers a skill requires
Test skills in isolation - Verify skills work before combining them
Use relative paths - Keep skills portable across environments
Skills listed in an agent's skills field are eagerly preloaded—their full content is injected into the agent's context at startup, so the agent has access to the skill instructions immediately without needing to invoke a skill tool. Skill names are resolved from the session-level skills.directories.
const session = await client.createSession({
skills: {
directories: ["./skills/security"],
},
agents: {
definitions: [
{
name: "security-auditor",
description: "Security-focused code reviewer",
prompt: "Focus on OWASP Top 10 vulnerabilities",
skills: ["security-scan", "dependency-check"],
},
],
},
permissions: {
onRequest: async () => ({ kind: "approve-once" }),
},
});
note
Skills are opt-in—when skills is omitted, no skill content is injected. Sub-agents do not inherit skills from the parent; you must list them explicitly per agent.
Skills can complement MCP server capabilities:
const session = await client.createSession({
skills: {
directories: ["./skills/database"],
},
mcp: {
servers: {
postgres: {
type: "local",
command: "npx",
args: ["-y", "@modelcontextprotocol/server-postgres"],
tools: ["*"],
},
},
},
permissions: {
onRequest: async () => ({ kind: "approve-once" }),
},
});
SKILL.md filesname, or a name that another skill already uses (see Log directory)skills.reload rescans the skill directories and returns the same problems in its warnings and errors listsIf multiple skills provide conflicting instructions:
skills.disabledSkills to exclude conflicting skillsCan you improve this documentation? These fine people already did:
copilot-cli-release-app[bot], Brett Cannon, copilot-sdk-mirror-writer[bot], Steve Sanderson, Bruno Borges, Antonio Goncalves, Jeremiah Isaacson, Stephen Toub, Sunbrye Ly, Shay Rojansky, Patrick Nikoletich, Ed Burns & Mackinnon BuckEdit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |