Skip to main content

AbstractSkill

AbstractSkill is the shared Python library for Agent Skills (SKILL.md) in the AbstractFramework ecosystem.

It provides a small, dependency-light foundation for:

  • parsing and validating SKILL.md frontmatter and instructions
  • discovering skills on disk (progressive disclosure: metadata first)
  • computing stable content hashes for skill evolution and replay safety
  • formatting compact <available_skills> prompt blocks for hosts and agents
  • composing a skill's tool declarations with an operator grant (never widening)
  • classifying skill trust: validated skills, do-not-use advisories, and a fail-closed verdict (trust model)

Flows run; skills are activated. AbstractSkill owns the portable skill contract so abstractruntime, abstractgateway, and thin clients can share identical semantics without duplicating parsers.

Install

pip install abstractskill

Note: pip install delivers the LIBRARY only. The curated skills themselves (the shelf below) live in this repository under registry/ and are consumed from a checkout — they are deliberately not packaged into the wheel today (a shelf you install should be a shelf you can byte-verify against the repository's validation records).

Where the skills live — and how an agent uses them

The curated shelf is in this repository:

registry/skills/            # 14 curated skills (one folder per SKILL.md)
registry/validations.yaml   # trust records: byte pins per skill tree
registry/advisories.yaml    # do-not-use advisories (empty at v1, by design)
registry/guidance.yaml      # class-level curation guidance
registry/catalog.yaml       # the vendoring catalog (pinned upstream commits)
docs/skills-catalog.md      # human-readable index: descriptions + links

To point an abstractcode agent at this shelf (trust gate included), set three environment variables to the checkout's absolute paths:

export ABSTRACTCODE_SKILLS_ROOTS=/path/to/abstractskill/registry/skills
export ABSTRACTCODE_SKILLS_VALIDATIONS=/path/to/abstractskill/registry/validations.yaml
export ABSTRACTCODE_SKILLS_ADVISORIES=/path/to/abstractskill/registry/advisories.yaml

then activate per session with /skills use <name> (discovery alone lists; activation composes). The trust gate is location-independent — records bind to content hashes, never paths — so the shelf works from any checkout location. Any other host consumes the same shelf through select_skills_for_context (see Quick start below).

Quick start

from pathlib import Path

from abstractskill import FilesystemSkillLoader, format_available_skills_xml, parse_skill_md

# Parse a SKILL.md file
doc = parse_skill_md(Path("my-skill/SKILL.md").read_text(encoding="utf-8"))
print(doc.metadata.name, doc.metadata.description)

# Discover skills under one or more roots (later roots override earlier ones).
# NOTE: discovery is for LISTING only — it applies no trust gate. Do not pipe
# discover() straight into activation.
loader = FilesystemSkillLoader([Path.home() / ".abstract" / "skills", Path(".abstract/skills")])
skills = loader.discover()
print(format_available_skills_xml(skills))

# Load full instructions when a skill is activated
loaded = loader.load("my-skill")
print(loaded.document.content_hash)

To ACTIVATE skills into a context, gate them through trust in one call so the order (load → hash → evaluate_trust → compose) cannot be skipped:

from abstractskill import TrustRegistry, select_skills_for_context, format_available_skills_xml

registry = TrustRegistry.load(
    validations_path="registry/validations.yaml",
    advisories_path="registry/advisories.yaml",
)
selection = select_skills_for_context(
    registry, shelf_root="registry/skills",
    names=["coredoc", "backlog"],  # names-only is enough: sources derive from the registry
    enabled=[],  # names the operator explicitly review-enabled for this context
)
# Only trust-gated skills reach the prompt; blocked skills never appear.
block = format_available_skills_xml(
    list(selection.active), descriptions=selection.activation_descriptions
)

Package scope

  • parse_skill_md — YAML frontmatter + markdown body (LF/CRLF/CR; spec-validated name/description/compatibility)
  • FilesystemSkillLoader — list metadata and load full documents; discover() and load() resolve identically (a broken copy never shadows a valid one) and degrade loudly (#FALLBACK warnings via logging and optional on_warning)
  • content_hash — SHA-256 digest of one document for evolution tracking
  • hash_skill_tree / inspect_skill_dir / read_skill_resource — whole-tree tamper hash (injective manifest), structural inventory (has_scripts is a structural fact), bounded in-tree resource reads
  • effective_tools / effective_tools_for_skill — grant ∩ allowed-tools composition (skills can narrow below the grant, never widen beyond it; absence of allowed-tools implies nothing)
  • format_available_skills_xml — deterministic discovery prompt block
  • evaluate_trust + TrustRegistry / ValidationRecord / AdvisoryEntry / GuidanceEntry — validated-skill attestations bound to tree hashes, a do-not-use advisory registry (four mandated fields, graded severity), and a fail-closed TrustVerdict (blocked / requires_review / attachable). The curated shelf (first-party + catalog-vendored skills) lives under registry/. See the trust model.
  • select_skills_for_context + SkillSelection — the one trust-gated activation pipeline (load → hash → evaluate → gate); hash-pinned enables; declared MCP/tool dependencies surfaced for host-side refusal.
  • load_catalog / CatalogEntry / SkillCatalog — curated vendoring catalog (pinned upstream commits, expected tree hashes).
  • derive_demand + DemandReport — derived demand tier from declared tool/MCP requirements joined against a host inventory (informational; hosts enforce grants).

Hashing contract: hash = bytes, parse = meaning

content_hash and hash_skill_tree are byte-exact deliberately — tamper detection must never call two byte-different trees "the same". A CRLF-authored skill and its LF twin parse identically but hash differently: vendor skills from archives or byte-copies, never through EOL-rewriting checkouts (e.g. git autocrlf), or hash verification will honestly report the rewrite as a mismatch.

Out of scope for this release: gateway registry APIs, zip .skill packaging, and runtime activation handlers. Those layers live in abstractgateway and abstractruntime and consume this library.

Documentation

Full documentation is in docs/ and on GitHub Pages: getting started, architecture (with diagrams), the API reference, the trust model, and the trust-network position. See also SECURITY.md for the trust guarantees this library does and does not make.

Development

python -m pip install -e ".[test]"
python -m pytest -q
python -m build
python -m pip install mkdocs-material
cp CHANGELOG.md docs/changelog.md && cp SECURITY.md docs/security.md
mkdocs build

License

MIT — see LICENSE.

Download files

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

Source Distribution

abstractskill-0.2.0.tar.gz (79.1 kB view details)

Uploaded Source

Built Distribution

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

abstractskill-0.2.0-py3-none-any.whl (52.8 kB view details)

Uploaded Python 3

File details

Details for the file abstractskill-0.2.0.tar.gz.

File metadata

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

File hashes

Hashes for abstractskill-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fe9c608792345ccf78238c831767852e444c6b98f002c14381346beb29220f48
MD5 bca8fc88112655aa7ec1fb14ddabfcd1
BLAKE2b-256 be75b1e44d0bfa5604c74824707cc7f69717b1f1aaeba0656a2f6db7628d3144

See more details on using hashes here.

Provenance

The following attestation bundles were made for abstractskill-0.2.0.tar.gz:

Publisher: release.yml on lpalbou/AbstractSkill

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

File details

Details for the file abstractskill-0.2.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for abstractskill-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2b8a3ebaa2273402e902d6685bdf85c7cd0b2f669bca0af25c9ba57bc21518a
MD5 bf9176e05a4a4627275a5b45de2e9ef9
BLAKE2b-256 a0285b18d88b43d03457de1ad6c647c752987dce277bcdb4e9bb125cf936e17c

See more details on using hashes here.

Provenance

The following attestation bundles were made for abstractskill-0.2.0-py3-none-any.whl:

Publisher: release.yml on lpalbou/AbstractSkill

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

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

Supported by

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