Skip to main content

Skill Specification (SKILL.md)

A skill is a folder with a SKILL.md file and optional reference material or scripts. ISH follows the Agent Skills specification so the same skill layout can be used across SDKs.

from ish import SkillRegistry

catalog = SkillRegistry()
result = catalog.add_search_path("./skills")
print("Loaded:", result.loaded)
print("Diagnostics:", result.diagnostics)

matches = catalog.search("financial", limit=5)
prompt = catalog.get_catalog_prompt(max_items=10)
activation = catalog.activate_current("pdf-financial-extractor", max_active=5)

Directory Layout​

skills/
└── pdf-financial-extractor/
├── SKILL.md
├── scripts/
│ └── parse_tables.py
└── references/
├── gaap-definitions.md
└── target-schema.json
  • SKILL.md (Required): Structured YAML frontmatter between --- markers, followed by Markdown instructions loaded at activation time.
  • references/ (Optional): Supplementary documentation or schemas enumerated lazily when read_skill is called without file_path. Hidden dot-prefixed entries (.DS_Store, .gitkeep) are skipped, and paths are sorted lexicographically.
  • scripts/ (Optional): Helper files addressable via read_skill or invocable through an execution tool supplied by your application. Discovery, listing, reading, and activation do not execute these files.
  • assets/ (Optional): Static templates or sample outputs bundled with the skill directory.

Safe skill discovery​

How the shared loader scans skill folders​

SkillCatalog preserves registration order in SkillCatalogInner.order and returns (loaded_names, diagnostics):

  1. Deterministic ordering: When scanning a parent directory, subdirectories containing SKILL.md are sorted lexicographically by subdirectory name so get_catalog_prompt and search results remain deterministic across filesystems.
  2. Fault-tolerant YAML parsing: parse_skill_markdown looks for an opening --- line and a matching closing --- line, deserializing the YAML header with serde_yaml. If the closing delimiter is missing or YAML deserialization fails, the parser leaves metadata empty and treats the full raw text as the body instead of crashing discovery.
  3. Name & description fallbacks:
    • If name is missing or whitespace-only after trimming, it defaults to the parent folder's directory name.
    • If description is missing or whitespace-only, it defaults to "Skill <dir_name>".
  4. Non-fatal diagnostics: Unreadable SKILL.md files append (manifest_path, error_message) to diagnostics without aborting valid sibling skills. Reloading a skill with an existing name replaces its Skill entry in place without duplicating its key in order.

YAML Frontmatter​

Place frontmatter at the top of SKILL.md:

---
name: pdf-financial-extractor
description: Extract balance sheets, income statements, and cash flows from quarterly SEC 10-Q/10-K PDFs. Use when handling corporate financial reports or financial table parsing tasks.
license: Apache-2.0
compatibility: python>=3.10, requires pdfplumber
metadata:
author: finance-automation-team
version: "1.2.0"
category: finance
---

Frontmatter fields​

FieldSpec StatusSpec Limits & Loader NotesPurpose
nameRequired (falls back to dir name in loader)agentskills.io spec: max 64 chars, [a-z0-9-]+ matching parent folder nameUnique lookup key for activate_skill, read_skill, and requires_skill
descriptionRequired (falls back to "Skill <dir_name>")agentskills.io spec: max 1024 chars; imperative capabilities and trigger conditionsSurfaced in Tier 1 catalog prompt and matched by search_skills
licenseOptionalStandard SPDX identifier (Apache-2.0, MIT)Licensing metadata
compatibilityOptionalagentskills.io spec: max 500 charsRuntime or dependency expectations
metadataOptionalArbitrary YAML key-value mappingAuthoring, versioning, and taxonomy notes

Write a useful skill description​

Because Tier 1 only exposes (name, description) entries (up to max_items, default 40, switching to an overflow prompt above max_items), the description determines both catalog selection and search_skills substring recall:

  1. State concrete artifacts and tasks (domain nouns, file formats, protocols).
  2. State exact trigger conditions ("Use when...").

Good Examples​

  • "Extract balance sheets, income statements, and cash flows from quarterly SEC 10-Q/10-K PDFs. Use when handling corporate financial reports or financial table parsing tasks."
  • "Standard Git hygiene, interactive rebases, cherry-picking, and conventional commit generation. Use when resolving git conflicts, preparing pull requests, or rewriting commits."

Bad Examples​

  • "Handles PDFs." (Too broad; low signal during model selection and search_skills queries).
  • "A set of Python scripts for our company." (Omits capabilities and trigger phrases).

Add skill instructions​

The Markdown body of SKILL.md is injected into the tool result only when activate_skill runs:

# PDF Financial Extractor

Follow these steps when extracting financial statements:

1. **Format Validation**: Verify the document contains selectable text rather than scanned images.
2. **Table Extraction**:
- Execute the bundled parser script: `python scripts/parse_tables.py --input <path>`
3. **Data Normalization**:
- Validate extracted column headers against the schema in `references/target-schema.json`.
- Ensure negative values (enclosed in parentheses `(1,234)`) are converted to `-1234`.
4. **Output Generation**:
- Write the normalized JSON output to `./workspace/extracted_financials.json`.

When the model calls read_skill(name, file_path):

  • read_skill_reference checks [file_path, "references/" + file_path, "scripts/" + file_path] relative to the skill directory.
  • Every candidate is validated through both lexical path normalization (normalize_under, popping .. components without escaping skill_dir) and filesystem canonicalization (fs::canonicalize when the target exists, blocking symlink escapes).
  • Traversal outside the skill directory returns PermissionError ("Access denied: '<rel>' outside skill directory."); valid relative paths that do not exist return FileNotFoundError.

Reading a script returns its text; it does not run it. To run one, the agent needs an execution tool and the script must be present under that tool's workspace root. For example, when scripts/parse_tables.py is inside ./workspace, an application can explicitly run python scripts/parse_tables.py --input report.pdf through its sandbox process API.

Choose the execution boundary deliberately:

  • The standard workspace execute agent tool runs a command with the workspace as its working directory and applies process limits. It does not isolate filesystem or network access. Treat it as a convenience for trusted code, not as a security boundary.
  • KernelSandbox in Python and executeKernelProcess / execute_kernel_process in the other SDKs use the shared Rust process implementation with an OS isolation backend when one is available. Configure network access and resource limits for the workload. This path fails closed when kernel isolation is unavailable; it does not silently fall back to unrestricted execution.
  • WASI is another Rust-backed option for WebAssembly modules, with capability profiles and an instruction fuel limit. It is not a general runner for arbitrary Python, Bash, or JavaScript scripts.

The SDK classes are language wrappers around these Rust operations. The same boundary applies regardless of the SDK. See Sandbox execution for per-language examples and platform details. For untrusted skill scripts, expose a tool that calls the kernel-isolated process API; do not route them through the standard workspace execute tool.

Skills have the same file-based format in every SDK. Discovery, listing, reading, and activation do not import or execute files in the skill directory; tools.py is not a special skill file. Applications may explicitly expose a tool that runs a script, and should choose an execution boundary appropriate to the trust level.

Files under scripts/ remain ordinary skill resources. Discovery, listing, reading, and activation do not execute them. The skill instructions may tell the agent when a script is useful, but the application decides whether to expose an execution tool. If it does, use the kernel-isolated process API for untrusted scripts and ensure the skill directory is available inside the sandbox workspace.


Skill loading​

Once your SKILL.md directories are in place, load them with SkillCatalog (SkillRegistry in Python) to inspect diagnostics, search entries, generate catalog prompts, or activate a skill directly.