fabricatio-skill
An extension of fabricatio.
Installation
This package is part of the fabricatio monorepo and can be installed as an optional dependency:
pip install fabricatio[skill]
# or with uv
# uv pip install fabricatio[skill]
Or install fabricatio-skill along with all other components of fabricatio:
pip install fabricatio[full]
# or with uv
# uv pip install fabricatio[full]
Overview
A text-based skill system for fabricatio agents. Skills are plain markdown files
(YAML frontmatter name/description/tags + markdown body) that inject
just-in-time, task-relevant context into LLM prompts through progressive
disclosure: cheap metadata first, LLM-powered selection next, distilled
essence last — never the full corpus.
Exclusion is just as progressive: a deterministic Rust keyword pre-filter thins oversized pools before any LLM sees them, selection admits only catalog-validated candidates (capped), and distillation drops everything the question does not need. Content that fails an earlier stage never reaches a later prompt.
Key Features
- Markdown-native skills — author skills as
.mdfiles with YAML frontmatter; no schema lock-in beyond three metadata keys. - Progressive pipeline — Level 0 (Rust): file scanning (
scan_skills), keyword search (search_skills, also the deterministic pre-filter for huge libraries); Level 1 (Python): LLM-powered relevance selection (select_skills, delegated to the frameworkUseLLM.achoosechooser over skill briefings — set-validated, auto-retried, SMOL tier, capped) and essence distillation (distill_skills); Level 2: the composedconsult_skillspipeline (select -> distill -> consulted knowledge). Consultation only — answering stays in your Action. - Progressive disclosure dial — every call trades fidelity for tokens via
select=/distill=/ forcednames=. - Lightweight composition — heavy
Skillobjects live in a process-wideSkillRegistry; your roles/actions carry only a list of name handles. - Rust-backed performance — parsing, lookup, and keyword matching are PyO3 (
fabricatio_skill.rust).
Usage
1. Author skill files
Drop markdown files into a skill directory (default roots: skills/, extra/skills/):
---
name: rust-async
description: "How to write async Rust with tokio correctly"
tags: [rust, async]
---
Markdown body with the actual instructions...
Frontmatter notes:
nameis the unique catalog id (the LLM selects by it);descriptionis the whole selection surface — keep it a dense one-liner;tagshelp the Rust keyword pre-filter.- YAML rules apply: quote string values that contain
:(e.g. descriptions), or the field silently parses as empty.
2. Consult — zero-config (canonical path)
Nothing to load. On the first consult_skills() call of a role that has no
skills yet, the default directories (skills/, extra/skills/, relative to
the process working directory) are auto-scanned once and their skills
registered. Authoring files and consulting is the whole loop:
from fabricatio import Action, Event, Role, Task, WorkFlow
from fabricatio_skill import UseSkill
class AnswerWithSkills(Action, UseSkill):
"""Answer the task briefing grounded in consulted skill knowledge."""
output_key: str = "task_output"
async def _execute(self, task_input: Task[str], **_) -> str:
# select relevant skills -> distill what they say (both SMOL tier);
# "" when nothing is relevant. Answering stays YOUR job.
knowledge = await self.consult_skills(task_input.briefing)
if not knowledge:
return task_input.briefing
return await self.aask(f"{knowledge}\n\n---\n\n{task_input.briefing}")
role = (
Role.with_bio(name="skilled", description="answers using the skill library")
.subscribe(
Event.quick_instantiate("ask"),
WorkFlow(name="skill_qa", steps=(AnswerWithSkills,)),
)
.dispatch()
)
# dispatch a Task whose briefing is the question to Event "ask" — done
3. Tune the disclosure level per call
consult_skills() is the progressive-disclosure dial; it returns what the
relevant skills say (or "" when nothing is relevant — a "[]" selection
from the LLM, an exhausted selection retry, or an empty library all mean the
same thing: there is nothing to consult):
| Call | Returns |
|---|---|
await self.consult_skills(q) |
Distilled essence of LLM-selected skills (2 extra LLM calls on the SMOL tier). |
await self.consult_skills(q, k=3) |
Same, but this call fetches at most 3 skills (k=0 = no limit, k=None = the max_selected_skills config). |
await self.consult_skills(q, names=["rust-async"]) |
Forced skills — skips LLM selection entirely. |
await self.consult_skills(q, distill=False) |
Full bodies of selected skills — no compression call. |
await self.consult_skills(q, select=False, distill=False) |
Every registered skill verbatim — zero LLM calls. |
For finer control, step through the levels manually:
picked = await agent.select_skills(question) # metadata-only chooser
if picked: # None = LLM never answered validly
essence = await agent.distill_skills(question, picked) # compress only selected bodies
answer = await agent.aask(f"{essence}\n\n---\n\n{question}")
else:
answer = question # nothing relevant: no skill context
What the LLM sees at each stage (progressive exclusion in action):
- SELECT — the framework
UseLLM.achoosechooser lists every candidate by its briefing (name: description; bodies never enter this prompt) and asks for a JSON array of catalog names. The reply is parsed as a set: unknown names are ignored, duplicates collapse, unparseable replies are retried automatically (up to 3 attempts). A deterministic Rust keyword search (search_skills) pre-filters the pool first when it exceedsprefilter_threshold, and the result is trimmed tomax_selected_skills(or the per-callk). - DISTILL — only the selected skills' bodies enter this prompt, with the instruction to extract just the parts relevant to the question and discard everything else.
4. Explicit loading — custom directories & the registry
Skip the auto-load by registering skills yourself; add_skills is idempotent,
so calling it at the top of _execute against a custom directory is safe:
from fabricatio import Action, Task
from fabricatio_skill import UseSkill, scan_skills
class AnswerWithTeamSkills(Action, UseSkill):
"""Answer using skills from a non-default directory."""
output_key: str = "task_output"
async def _execute(self, task_input: Task[str], **_) -> str:
self.add_skills(scan_skills("team-skills")) # explicit library; idempotent
knowledge = await self.consult_skills(task_input.briefing)
...
The low-level pieces are also exposed for custom pipelines:
from fabricatio_skill import get_skill_registry, scan_skills, search_skills
skills = scan_skills("skills") # Rust: parse all .md files -> [Skill]
registry = get_skill_registry() # process-wide store (Rust)
registry.register(skills)
hits = search_skills("async", skills) # Rust: keyword search over metadata
Configuration
All options below are read through the fabricatio configuration chain (see the
Configuration Guide at ../../docs/source/configuration.rst). Set them under the
[ext.skill] table in fabricatio.toml, equivalently under
[tool.fabricatio.ext.skill] in pyproject.toml, or via
FABRICATIO_EXT__SKILL__<FIELD_UPPER> environment variables.
# fabricatio.toml
[ext.skill]
distill_skills_template = "built-in/distill_skills"
max_selected_skills = 8
prefilter_threshold = 100
default_skill_dirs = ["skills", "extra/skills"]
| Option | Type | Default | Description |
|---|---|---|---|
distill_skills_template |
str |
"built-in/distill_skills" |
Template name for the LLM prompt that distills skill content to its essence. |
max_selected_skills |
int |
8 |
Maximum number of skills the LLM may select per call (0 = unlimited). Caps how many bodies reach distillation. |
prefilter_threshold |
int |
100 |
Pool size above which selection keyword-prefilters with the Rust search_skills before the LLM stage (0 disables the prefilter). |
default_skill_dirs |
List[str] |
["skills", "extra/skills"] |
Default directories auto-scanned on first consult when a role has no skills. |
Access at runtime: from fabricatio_skill.config import skill_config.
Dependencies
Core dependencies:
fabricatio-core- Core interfaces and utilities ...
License
This project is licensed under the MIT License.
Metadata
Release files for fabricatio-skill 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 7.8 MB
Release files / fabricatio_skill-0.1.5-cp314-cp314-win_amd64.whl
| Download URL | fabricatio_skill-0.1.5-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 582.9 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
edab4006e3959c2485323ac687f30a2834568bf4c315edd6259df4219ed17c3d
|
|
BLAKE2b-256 checksum How to use checksums |
8fe6d0af366e23f659036e4a10794e15c9e74bbe4c9316cae4a8a1ac21dea902
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_skill-0.1.5-cp314-cp314-manylinux_2_34_x86_64.whl
| Download URL | fabricatio_skill-0.1.5-cp314-cp314-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 716.7 kB |
| Tags | CPython 3.14 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
b81a4cf17e2750c76a81a1903fe5e360c02907830eef75d8d5bcb2ec65221ee8
|
|
BLAKE2b-256 checksum How to use checksums |
8b5c99ccc313ebcce856ce4aacbbdae6f589cd781b1e0e5e0dae125a71bc5af0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_skill-0.1.5-cp314-cp314-manylinux_2_34_aarch64.whl
| Download URL | fabricatio_skill-0.1.5-cp314-cp314-manylinux_2_34_aarch64.whl |
|---|---|
| Size | 661.8 kB |
| Tags | CPython 3.14 Linux glibc 2.34+ ARM64 |
|
SHA-256 checksum How to use checksums |
e8e51e8701840dc3a2b56309badd36896aef9ef04a68cc7a9b7553f082547e51
|
|
BLAKE2b-256 checksum How to use checksums |
8bf00920e4a873f1f63148b689ea39be32a6962e0dcbc34692776af8114ecbba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_skill-0.1.5-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | fabricatio_skill-0.1.5-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 643.4 kB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
47e09a83fcadf387a6e6ea6c6d4f2fce4fb5a74ed2f5022fc9b8d4481572f2b0
|
|
BLAKE2b-256 checksum How to use checksums |
70e6c76afae948758cd6699ac1ba64ef1f0635681f135cc24a1a32b83ade1d97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_skill-0.1.5-cp313-cp313-win_amd64.whl
| Download URL | fabricatio_skill-0.1.5-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 583.1 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
01bd17d80c957079c9ced29d8ba5397c42362a9971db7f43ddc98db505a250ca
|
|
BLAKE2b-256 checksum How to use checksums |
2877d929c7fda7da1395665fa0dd8b007d6a0872f53dce37c3f2c569e974a43c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_skill-0.1.5-cp313-cp313-manylinux_2_34_x86_64.whl
| Download URL | fabricatio_skill-0.1.5-cp313-cp313-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 716.4 kB |
| Tags | CPython 3.13 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
911b0681827a3f46601fa8be2284418f24ce74d7c7bede7248ca562f807dea92
|
|
BLAKE2b-256 checksum How to use checksums |
79574afbadf6020155dc3f4a69893ae35738bead5c8f4a92e25f08fd09135be2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_skill-0.1.5-cp313-cp313-manylinux_2_34_aarch64.whl
| Download URL | fabricatio_skill-0.1.5-cp313-cp313-manylinux_2_34_aarch64.whl |
|---|---|
| Size | 661.6 kB |
| Tags | CPython 3.13 Linux glibc 2.34+ ARM64 |
|
SHA-256 checksum How to use checksums |
8030fb76c922344b01363a653ee7e38e656a6c3350e77603ef452fe5d54d9406
|
|
BLAKE2b-256 checksum How to use checksums |
994bf6ff654921b550b3aa1a00e06dfca3dcb39952deddbdbbf684f8493622dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_skill-0.1.5-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | fabricatio_skill-0.1.5-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 643.3 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
b7cdef60e757a87eda3944d287f8c441eb04f1a5cdbd1217e0f57adbaf8cd8b0
|
|
BLAKE2b-256 checksum How to use checksums |
b3f6aa5d6ccf30f2c15053b98af4104400e727a06024435c51adea7f2d5db387
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_skill-0.1.5-cp312-cp312-win_amd64.whl
| Download URL | fabricatio_skill-0.1.5-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 583.4 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
91fdc6f93c32761b992e96d6cef33745c639e93dbf0120757191a190a3780659
|
|
BLAKE2b-256 checksum How to use checksums |
807602b5a61518ab57e306ce0c3e3f0dcef859f6102f8326f2883942b294c430
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_skill-0.1.5-cp312-cp312-manylinux_2_34_x86_64.whl
| Download URL | fabricatio_skill-0.1.5-cp312-cp312-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 717.6 kB |
| Tags | CPython 3.12 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
d8aa10ac745115b52a48276f0359446c10bac6a991b492f74286b094d21d2cc2
|
|
BLAKE2b-256 checksum How to use checksums |
c9873978406cfb642eeefcbf40351dfbc6dbaa8ea0d652ddbfdf5b779e48580e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_skill-0.1.5-cp312-cp312-manylinux_2_34_aarch64.whl
| Download URL | fabricatio_skill-0.1.5-cp312-cp312-manylinux_2_34_aarch64.whl |
|---|---|
| Size | 662.6 kB |
| Tags | CPython 3.12 Linux glibc 2.34+ ARM64 |
|
SHA-256 checksum How to use checksums |
8bdcead54edabf2d5c4ca788144c1abf4be84d8ad81dc38fd3fbed5a12c254e2
|
|
BLAKE2b-256 checksum How to use checksums |
e974d30ae15ca915d297cb6476310798704002fbe99be95b0a51d5933cebe125
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_skill-0.1.5-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | fabricatio_skill-0.1.5-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 643.7 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
318df34d226468e4bac4db523e6acc341bcd9f0286f7c4a2e734b2b6ddb1c36c
|
|
BLAKE2b-256 checksum How to use checksums |
347ac57be9b5b262c139a840ca41b279d8f4fc129ab0b990b32db6c44a839ff8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|