Skills
Skills package reusable instructions, reference files, and optional tools in a directory. An agent starts with a compact catalog and loads detailed material only when it is relevant, keeping the initial prompt focused. ISH follows the Agent Skills directory convention.
- Python
- TypeScript
- Rust
- Go
- C#
- Java
import asyncio
from ish import Agent, SkillRegistry
registry = SkillRegistry()
registry.add_search_path("./my-skills")
agent = Agent(
name="repository_helper",
model="gpt-4o-mini",
skills=registry,
max_active_skills=5,
)
async def main() -> None:
try:
result = await agent.run("Review the repository using relevant skills.")
print(result.content)
finally:
agent.close()
asyncio.run(main())
import { Agent, IshClient, SkillCatalog } from "ish-harness";
const client = new IshClient();
const catalog = new SkillCatalog(client);
catalog.addSearchPath("./my-skills");
const agent = new Agent({
name: "repository_helper",
model: { provider: "openai_chat", name: "gpt-4o-mini" },
skill_catalog: catalog,
max_active_skills: 5,
});
const result = await agent.run("Review the repository using relevant skills.");
console.log(result.content);
agent.close();
catalog.close();
client.close();
use std::{env, io, sync::Arc};
use ish_harness::{Agent, OpenAIModel, SkillCatalog};
let catalog = SkillCatalog::new();
let (_loaded, _diagnostics) = catalog.add_search_path("./my-skills");
let model = OpenAIModel::new(
"gpt-4o-mini".into(),
"https://api.openai.com/v1".into(),
env::var("OPENAI_API_KEY")?,
0.2,
);
let agent = Agent::builder(Arc::new(model))
.name("repository_helper")
.skills(catalog, Some(5))
.build()
.map_err(io::Error::other)?;
let result = agent
.run("Review the repository using relevant skills.")
.await
.map_err(io::Error::other)?;
println!("{}", result.content);
client, err := ish.NewClient("")
if err != nil {
panic(err)
}
defer client.Close()
catalog, err := ish.NewSkillCatalog(client)
if err != nil {
panic(err)
}
defer catalog.Close()
if _, err := catalog.AddSearchPath("./my-skills"); err != nil {
panic(err)
}
req, err := catalog.AttachToAgent(ish.AgentRunRequest{
AgentName: "repository_helper",
Model: &ish.AgentModel{Provider: "openai_chat", Name: "gpt-4o-mini"},
UserPrompt: ish.StringPtr("Check git hygiene before preparing a change."),
}, ish.IntPtr(5))
if err != nil {
panic(err)
}
result, err := client.RunAgent(req)
if err != nil {
panic(err)
}
fmt.Println(result["content"])
using Ish.Harness;
using var client = new IshClient();
using var catalog = new SkillCatalog(client);
catalog.AddSearchPath("./my-skills");
using var request = catalog.AttachToAgent(new AgentRunRequest
{
AgentName = "repository_helper",
Model = new AgentModel { Provider = "openai_chat", Name = "gpt-4o-mini" },
UserPrompt = "Check git hygiene before preparing a change.",
}, maxActive: 5);
var result = client.Run(request);
Console.WriteLine(result.GetProperty("content").GetString());
import io.github.ishharness.IshClient;
import io.github.ishharness.SkillCatalog;
import java.nio.file.Path;
try (var client = new IshClient(Path.of(System.getenv("ISH_NATIVE_LIBRARY")));
var catalog = new SkillCatalog(client);
var request = new IshClient.AgentRequest(
"gpt-4o-mini",
"Help with repository tasks.",
"Check git hygiene before preparing a change.")
.provider("openai_chat")
.agentName("repository_helper")) {
catalog.addSearchPath("./my-skills");
catalog.attachTools(request, 5);
var result = client.runAgent(request);
System.out.println(result.path("content").asText());
}
Skill discovery
Why skills load on demand
| Phase | What the agent receives | When it receives it |
|---|---|---|
| Catalog | Skill names and short descriptions | When the catalog is attached |
| Instructions | The selected SKILL.md body | After the agent activates that skill |
| References and gated tools | Requested files and tools tied to the skill | Only when the agent needs them and the skill is active |
Directory layout
my-skills/
└── git-hygiene/
├── SKILL.md
├── references/
└── scripts/
SKILL.md(required): YAML frontmatter with a name and description, followed by Markdown instructions.references/(optional): Longer documentation, schemas, or checklists the agent can read on demand.scripts/(optional): Helper scripts that your application may expose through its own tools. Discovering, listing, reading, or activating a skill does not execute files in this directory. A script runs only if an application explicitly exposes and invokes an execution tool.
Example SKILL.md:
---
name: git-hygiene
description: Use when reviewing branch history or preparing a Git change.
---
# Git hygiene
Check the working tree before editing. Keep each change focused and verify it
with the repository's documented checks.
Load a skill catalog
Attach a SkillCatalog to expose search_skills, read_skill, and activate_skill to the agent. See Authoring Skills for file layout and Use Skills with Agents for activation and tool gating.
Trust boundaries
- Skills are instructional and resource bundles, not OS sandboxes or authorization policies. Review every third-party
SKILL.mdandscripts/directory as application code before attaching it to an agent. - While
read_skillenforces strict directory containment under the skill folder, once a skill body enters model context its instructions can steer subsequent model tool calls within whatever capabilities your agent grants. - Skill discovery reads skill metadata and instructions. It does not import or execute code from a skill directory. A
tools.pyfile has no special meaning to the SDKs. - The standard sandbox
executetool sets the command's working directory and applies process limits, but it does not isolate the process from the host filesystem or network. Do not use it as a security boundary for untrusted skill scripts. ISH also exposes Rust-backed kernel-isolated process execution (KernelSandbox/executeKernelProcess); it uses an available OS backend and fails closed when none is available. An application must explicitly provide an agent tool that calls this isolated path and make the skill files available inside its workspace. See Sandbox execution.
Author a skill
Create a folder with a SKILL.md file. Add a short YAML header with a unique name and a specific description, then write the instructions the agent should receive only when the skill is activated. Optional references/ files can hold longer material. See the skill authoring guide for the full format and examples.
Use skills in an agent
Add the skill folder to a SkillCatalog or Python SkillRegistry, then attach that catalog to the agent. The agent can search the compact catalog, read a skill when it is relevant, and activate its instructions. Use max_active_skills to limit active skills and requires_skill to gate tools. See using skills with agents for SDK examples and activation behavior.