Skip to main content

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").

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).

Download files

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

Source Distribution

skilltest_sdk-0.10.0.tar.gz (68.4 kB view details)

Uploaded Source

Built Distributions

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

skilltest_sdk-0.10.0-py3-none-manylinux_2_17_x86_64.whl (1.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

skilltest_sdk-0.10.0-py3-none-manylinux_2_17_aarch64.whl (1.8 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

skilltest_sdk-0.10.0-py3-none-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

skilltest_sdk-0.10.0-py3-none-macosx_10_12_x86_64.whl (1.8 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

skilltest_sdk-0.10.0-py3-none-any.whl (34.0 kB view details)

Uploaded Python 3

File details

Details for the file skilltest_sdk-0.10.0.tar.gz.

File metadata

  • Download URL: skilltest_sdk-0.10.0.tar.gz
  • Upload date:
  • Size: 68.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","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}

File hashes

Hashes for skilltest_sdk-0.10.0.tar.gz
Algorithm Hash digest
SHA256 e333c4161a41818d9d274de88fedb88bd9b73399d2971ae350402aaac9340657
MD5 e9bbae5faade38fe7912e47daa1197cd
BLAKE2b-256 5d278d61a65b6f5f7077b081fc761a49948672eb7e0f5e984bf8ca7e6c30ff1c

See more details on using hashes here.

File details

Details for the file skilltest_sdk-0.10.0-py3-none-manylinux_2_17_x86_64.whl.

File metadata

  • Download URL: skilltest_sdk-0.10.0-py3-none-manylinux_2_17_x86_64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: Python 3, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","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}

File hashes

Hashes for skilltest_sdk-0.10.0-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 fc23b8e83401ccff6c150b8ba15dfeb079dcc28be560fa7aa20106cc8af02fbe
MD5 03e550b869d1f1562c79e0df59250d08
BLAKE2b-256 818778c96c5b3a76712a742f6d904f678d77b2a930d1a8c3db3ce8a665eced7c

See more details on using hashes here.

File details

Details for the file skilltest_sdk-0.10.0-py3-none-manylinux_2_17_aarch64.whl.

File metadata

  • Download URL: skilltest_sdk-0.10.0-py3-none-manylinux_2_17_aarch64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3, manylinux: glibc 2.17+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","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}

File hashes

Hashes for skilltest_sdk-0.10.0-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 dd2fc7a5981a776d69b668448de82f1c4fe9243bb71e37f2200605240f0b465a
MD5 96ec95adce3688314f68434aac07a8c3
BLAKE2b-256 777b3b45f581c259972b64c27221b0cc1371debefd4e05485e680db7f1241702

See more details on using hashes here.

File details

Details for the file skilltest_sdk-0.10.0-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: skilltest_sdk-0.10.0-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","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}

File hashes

Hashes for skilltest_sdk-0.10.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e0ee973541be48b664077c9246661492fd3c52fa6a52a78b8f5753f3cff03e36
MD5 00a792014a5bbc6700e9c99608c1c421
BLAKE2b-256 8e8afe919ec419054f5e60b25c8243e9002376c57281d2b3a891c0640d454f1e

See more details on using hashes here.

File details

Details for the file skilltest_sdk-0.10.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: skilltest_sdk-0.10.0-py3-none-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","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}

File hashes

Hashes for skilltest_sdk-0.10.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d0ee63f4d96cfacb883cbe15018335ac130867efc8b91318a7c2d7197d2469b7
MD5 0991172764b04d2b92d8c2784cc5b39e
BLAKE2b-256 4f6bb825d9cb00adea6e2350ead546665f72e81be9e715e5e82a6923474be710

See more details on using hashes here.

File details

Details for the file skilltest_sdk-0.10.0-py3-none-any.whl.

File metadata

  • Download URL: skilltest_sdk-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 34.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","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}

File hashes

Hashes for skilltest_sdk-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b2b1da258de794dea26778b2e6bcda9f86b1e6e28cbad0010458aa3c65cf7c3
MD5 1206b7b44b2cb7787fec2176d3807fff
BLAKE2b-256 0a29908902bc10b4419d03b2ef1c64ab0e233c54204982d3a16f9599d4f74fb8

See more details on using hashes here.

Supported by

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