skilltest-sdk
The Python SDK for the skilltest
CLI. A thin, typed wrapper and nothing else: it runs the CLI as a subprocess and
parses the stable --format json contract into Pydantic models. Test-framework
integrations build on it — use skilltest-pytest if you
want pytest collection; use this package directly from any other Python code.
Define the whole case — skill, input, evals, an optional simulated user, mocks —
in code and pass it straight to run_skill. Everything a case YAML carries has
a typed builder, so the case and its checks live in one place:
from skilltest_sdk import TestCase, run_skill, boolean, numeric, describe_failures, assistant_text
case = TestCase(
skill="skills/greeter", # resolved relative to the working dir
input="Greet Dr. Smith, who has an appointment today.",
evals=[
boolean("the reply greets Dr. Smith by name"),
numeric("how warm is the tone", min=0, max=10, threshold=7),
],
)
report = run_skill(case)
assert report.passed, describe_failures(report)
# Mix in deterministic checks on the transcript:
assert "Dr. Smith" in assistant_text(report.runs[0].transcript)
Add user(persona=..., done_when=...) for a multi-turn case, and mocks=[...]
of stub/spy/deny/rewrite (a called / not_called eval takes the
mock object itself, or a name= you gave it). Validate a skill definition with
validate_skill("skills/greeter").
A stub can answer successive calls differently: pass responses instead of
output, and the n-th call it intercepts in a run gets the n-th item, with
the last item repeating. So
stub("jobctl status", responses=["queued", {"output": "failed", "exit_code": 1}, "passed"])
answers failed on its second call and passed on every call after that.
Or point at existing YAML cases
run_skill also takes a path to a test-case YAML file — or a directory of
them — so a suite that keeps cases as data works unchanged, and the
pytest plugin auto-discovers *.skilltest.yaml files
with no code at all:
report = run_skill("cases/greet.yaml") # or run_skill("cases/") for the tree
The field reference for both forms is docs/schema.md.
Tool events
Each assistant turn carries the normalized tool events the skill took (shell
commands, file edits, tool uses), lifted from oneharness's --events. Assert on
what the skill did with tool_calls (the tool_call events across a
transcript, in order); each ToolEvent has kind, name, input, output,
index:
from skilltest_sdk import TestCase, run_skill, tool_calls, boolean
case = TestCase(
skill="skills/editor",
input="Update the config and commit it.",
evals=[boolean("the change was committed")],
)
report = run_skill(case)
calls = tool_calls(report.runs[0].transcript)
assert any("git commit" in str(c.input) for c in calls)
assert not any("rm -rf" in str(c.input) for c in calls) # never destructive
Streaming (opt-in)
stream_skill takes the same case (or path) and returns a SkillStream you
iterate with async for to receive each event live, and break to
short-circuit — closing the stream tears the harness down, so a bad turn is
cut off instead of paid for in full. .report holds the final report once the
stream runs to completion:
from skilltest_sdk import stream_skill
async def guard(case):
stream = stream_skill(case)
async for ev in stream: # ev: StreamEvent — .case/.platform/.model/.turn/.event
if ev.event.name == "bash" and "rm -rf" in str(ev.event.input):
break
return stream.report
The skilltest binary is resolved from the bin= argument, the
SKILLTEST_BIN env var, or PATH; a provider override comes from provider=
or SKILLTEST_PROVIDER. A failing eval is reported (report.passed is
false), not raised; bad input raises SkilltestUsageError (CLI exit 2) and
provider problems raise SkilltestProviderError (exit 3).
The default provider drives oneharness,
which installs with this package (the oneharness-cli dependency) — no separate
step. The SDK points the CLI at it via SKILLTEST_ONEHARNESS_BIN; set that
variable, or a config provider.bin, to use a different oneharness.
The Pydantic models are generated from the golden schemas in schemas/ —
themselves generated from the CLI's own types — via just gen-contract, and a
drift gate in CI fails if anything is stale, so the models cannot diverge from
the binary. That covers both directions: the report models the SDK parses
(_report.py) and the case models the builders construct (_case.py).
Metadata
Release files for skilltest-sdk 0.12.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| skilltest_sdk-0.12.2.tar.gz | 48.8 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| skilltest_sdk-0.12.2-py3-none-win_arm64.whl | Python 3 | none | Windows ARM64 | Details |
| skilltest_sdk-0.12.2-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| skilltest_sdk-0.12.2-py3-none-manylinux_2_17_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details |
| skilltest_sdk-0.12.2-py3-none-manylinux_2_17_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details |
| skilltest_sdk-0.12.2-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
| skilltest_sdk-0.12.2-py3-none-macosx_10_12_x86_64.whl | Python 3 | none | macOS 10.12+ x86-64 | Details |
| skilltest_sdk-0.12.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.2 MB
Release files / skilltest_sdk-0.12.2.tar.gz
| Download URL | skilltest_sdk-0.12.2.tar.gz |
|---|---|
| Size | 48.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68bd502fbacfdf80478ffc154669439ddc0d78757f91e95446c8570d17b7448a
|
|
BLAKE2b-256 checksum How to use checksums |
9dd7508eacbde17bbd776c76f63bc1b1544400d0a13ffc6dda9ec8cba1fb6586
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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 / skilltest_sdk-0.12.2-py3-none-win_arm64.whl
| Download URL | skilltest_sdk-0.12.2-py3-none-win_arm64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | Python 3 Windows ARM64 |
|
SHA-256 checksum How to use checksums |
9d6f6c77a6d859e4bf3c1478d0aaceda95d0d0da92e42f8f97e30d9c1af5ac6e
|
|
BLAKE2b-256 checksum How to use checksums |
668cde09ae6e9025dec48ef3f325917efeda0bb12b67ea46705da22d87cf4834
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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 / skilltest_sdk-0.12.2-py3-none-win_amd64.whl
| Download URL | skilltest_sdk-0.12.2-py3-none-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
df9c57ff67be374f1ee545855d2a9aa43139ec327dd73f43d702f65f41c43d11
|
|
BLAKE2b-256 checksum How to use checksums |
d9a9dff82f3a5bff8d284ae8d9fee90d69865179ea54a71b14bbc1b6736b9d0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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 / skilltest_sdk-0.12.2-py3-none-manylinux_2_17_x86_64.whl
| Download URL | skilltest_sdk-0.12.2-py3-none-manylinux_2_17_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
e66a79d3fd13f92dfbfa76f9db86b85e0b38f683fb5ff8c01e1317c3ce3e8b0f
|
|
BLAKE2b-256 checksum How to use checksums |
2ab933a96c850429654de9afb9692619b531fb1dd256108abc899a707bc4bd29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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 / skilltest_sdk-0.12.2-py3-none-manylinux_2_17_aarch64.whl
| Download URL | skilltest_sdk-0.12.2-py3-none-manylinux_2_17_aarch64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
b5fbf5a1e2795e46785f61ddb58aed2f552e395c913567246cce58821a3dd4cc
|
|
BLAKE2b-256 checksum How to use checksums |
7a478708970518603d217a8557f29c15f28fc1fe54f956c6dbfbad8348522077
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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 / skilltest_sdk-0.12.2-py3-none-macosx_11_0_arm64.whl
| Download URL | skilltest_sdk-0.12.2-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
87ed91c4293d398b47bb5e7f784dbcc4a9e30fe469041a1725e6463605112a60
|
|
BLAKE2b-256 checksum How to use checksums |
80bbd4c6775496dd2ccf59a78fb6393770357ce70ed308c6053edd83753d8751
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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 / skilltest_sdk-0.12.2-py3-none-macosx_10_12_x86_64.whl
| Download URL | skilltest_sdk-0.12.2-py3-none-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | Python 3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
cb5ae58505310c8da32eb6de6c3d11fb0218ba1faaf7ad5abd39eebc5a7c958b
|
|
BLAKE2b-256 checksum How to use checksums |
6924798542a9cca1ae6ea621dcdfd39ff680e396ee8f280c57650b5852a08000
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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 / skilltest_sdk-0.12.2-py3-none-any.whl
| Download URL | skilltest_sdk-0.12.2-py3-none-any.whl |
|---|---|
| Size | 35.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
93f6d8f9dd7f1c31b604602d15d4b23e9ce902275b1115ce0f41e0469c6d0116
|
|
BLAKE2b-256 checksum How to use checksums |
9cb985cf88ccdc20c1a6cc3b1db05ffb176ed6e7b65d467452c3b1202d424acc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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}
|