Skip to main content

agentskills-fs

PyPI Python 3.12 | 3.13 License: MIT

Local filesystem skill provider for the Agent Skills SDK.

Serves Agent Skills from a local directory tree. Each subdirectory containing a SKILL.md file is a skill.

Installation

pip install agentskills-fs

Requires Python 3.12 or newer. Installs agentskills-core and pyyaml as dependencies.

Expected Directory Layout

skills/
├── incident-response/
│   ├── SKILL.md              # YAML frontmatter + markdown body
│   ├── references/           # supplementary docs (optional)
│   ├── scripts/              # executable scripts (optional)
│   └── assets/               # diagrams, data files (optional)
└── another-skill/
    └── SKILL.md

Usage

from pathlib import Path
from agentskills_core import SkillRegistry
from agentskills_fs import LocalFileSystemSkillProvider

provider = LocalFileSystemSkillProvider(Path("./skills"))
registry = SkillRegistry()
await registry.register("incident-response", provider)

skill = registry.get_skill("incident-response")
meta = await skill.get_metadata()
body = await skill.get_body()
script = await skill.get_script("page-oncall.sh")

Blocking file I/O runs in a worker thread, so a slow or networked filesystem does not stall other coroutines.

SKILL.md content is cached per provider instance after the first read — a single skill is otherwise re-read up to five times in one agent session. Call invalidate() when skills change on disk.

provider.invalidate("incident-response")  # forget one skill
provider.invalidate()                      # forget everything

Security

  • Path-traversal protection - Skill IDs and resource names are validated to stay within the root directory. Attempts to escape (e.g. ../../etc/passwd) raise SkillNotFoundError or ResourceNotFoundError.
  • File size limits - Files exceeding 10 MB (default) are rejected before reading into memory. Configure via the max_file_bytes parameter.
  • Error-message sanitization - Error messages reference the skill_id rather than full filesystem paths, preventing internal path leakage.

For the full security policy, see SECURITY.md.

API

LocalFileSystemSkillProvider(root, *, max_file_bytes=10_485_760)

Parameter Type Default Description
root Path - Path to the directory containing skill subdirectories
max_file_bytes int 10_485_760 (10 MB) Maximum allowed file size in bytes
Method Returns Description
get_metadata(skill_id) dict[str, Any] Parsed YAML frontmatter from SKILL.md
get_body(skill_id) str Markdown body after the frontmatter
get_script(skill_id, name) bytes Raw content of a script file
get_asset(skill_id, name) bytes Raw content of an asset file
get_reference(skill_id, name) bytes Raw content of a reference file
list_resources(skill_id) dict[str, list[str]] Resource filenames grouped by kind
invalidate(skill_id=None) None Drop cached SKILL.md content for one skill, or all skills

Resource Discovery

This provider sets supports_resource_listing = True and can enumerate a skill's bundled files:

listing = await provider.list_resources("incident-response")
# {"references": ["severity-levels.md"], "scripts": ["page-oncall.sh"], "assets": []}

All three keys are always present; unused categories are empty lists. Only regular files directly inside references/, scripts/ and assets/ are reported. Dotfiles, subdirectories, and symlinks resolving outside the skill root are skipped rather than raising, so one stray entry cannot make a whole skill unlistable — and listing can never offer a name that a subsequent read would reject.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentskills_fs-0.3.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentskills_fs-0.3.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file agentskills_fs-0.3.0.tar.gz.

File metadata

  • Download URL: agentskills_fs-0.3.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for agentskills_fs-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3b51b35fa30ede7a4ad055f5871a780d887859339e8762c80828cb9cbed7ef9a
MD5 fa98b9b837f123b63a1bf0aeb4aa6583
BLAKE2b-256 f40845692ee1830538177026b8c9e113340892ea5a7ea8a4a48c8c304ca434f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentskills_fs-0.3.0.tar.gz:

Publisher: publish.yml on pratikxpanda/agentskills-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentskills_fs-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: agentskills_fs-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for agentskills_fs-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b3984609ff5e02f7611f7fe53a9005030892d1dcc0b5bba97864a5119e01553a
MD5 6703debec109053117f7baddd932e99b
BLAKE2b-256 806acdec116ea5a6da39e37e77fa5a4bcbba63526c8947c370748371adef6542

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentskills_fs-0.3.0-py3-none-any.whl:

Publisher: publish.yml on pratikxpanda/agentskills-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page