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.mdfrontmatter 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()andload()resolve identically (a broken copy never shadows a valid one) and degrade loudly (#FALLBACKwarnings via logging and optionalon_warning)content_hash— SHA-256 digest of one document for evolution trackinghash_skill_tree/inspect_skill_dir/read_skill_resource— whole-tree tamper hash (injective manifest), structural inventory (has_scriptsis a structural fact), bounded in-tree resource readseffective_tools/effective_tools_for_skill— grant ∩ allowed-tools composition (skills can narrow below the grant, never widen beyond it; absence ofallowed-toolsimplies nothing)format_available_skills_xml— deterministic discovery prompt blockevaluate_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-closedTrustVerdict(blocked / requires_review / attachable). The curated shelf (first-party + catalog-vendored skills) lives underregistry/. 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe9c608792345ccf78238c831767852e444c6b98f002c14381346beb29220f48
|
|
| MD5 |
bca8fc88112655aa7ec1fb14ddabfcd1
|
|
| BLAKE2b-256 |
be75b1e44d0bfa5604c74824707cc7f69717b1f1aaeba0656a2f6db7628d3144
|
Provenance
The following attestation bundles were made for abstractskill-0.2.0.tar.gz:
Publisher:
release.yml on lpalbou/AbstractSkill
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
abstractskill-0.2.0.tar.gz -
Subject digest:
fe9c608792345ccf78238c831767852e444c6b98f002c14381346beb29220f48 - Sigstore transparency entry: 2352758978
- Sigstore integration time:
-
Permalink:
lpalbou/AbstractSkill@2885f2aa4cbfe15bcc6976339c333150c018e1e5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lpalbou
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2885f2aa4cbfe15bcc6976339c333150c018e1e5 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2b8a3ebaa2273402e902d6685bdf85c7cd0b2f669bca0af25c9ba57bc21518a
|
|
| MD5 |
bf9176e05a4a4627275a5b45de2e9ef9
|
|
| BLAKE2b-256 |
a0285b18d88b43d03457de1ad6c647c752987dce277bcdb4e9bb125cf936e17c
|
Provenance
The following attestation bundles were made for abstractskill-0.2.0-py3-none-any.whl:
Publisher:
release.yml on lpalbou/AbstractSkill
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
abstractskill-0.2.0-py3-none-any.whl -
Subject digest:
c2b8a3ebaa2273402e902d6685bdf85c7cd0b2f669bca0af25c9ba57bc21518a - Sigstore transparency entry: 2352759450
- Sigstore integration time:
-
Permalink:
lpalbou/AbstractSkill@2885f2aa4cbfe15bcc6976339c333150c018e1e5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lpalbou
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2885f2aa4cbfe15bcc6976339c333150c018e1e5 -
Trigger Event:
workflow_dispatch
-
Statement type: