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 (name them to reference from a called / not_called eval). 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 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.6.0.tar.gz (60.7 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.6.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.6.0-py3-none-manylinux_2_17_aarch64.whl (1.8 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

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

Uploaded Python 3macOS 10.12+ x86-64

skilltest_sdk-0.6.0-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: skilltest_sdk-0.6.0.tar.gz
  • Upload date:
  • Size: 60.7 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.6.0.tar.gz
Algorithm Hash digest
SHA256 718cdd02fe4a9548d01b089034f05f49ae106d9572e2f5c2eab8c544f3c98ab4
MD5 5353f2c9a00c2db7a6964de8954fbf40
BLAKE2b-256 4e80bbab979af15b2e52b9ce423bb61da220673ebc0b6cb376277e1ea7e0cf31

See more details on using hashes here.

File details

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

File metadata

  • Download URL: skilltest_sdk-0.6.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.6.0-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 01e9b280182bd9b4279044921f1be0c3a52e41b484c3c66cfb421eb0828a247e
MD5 1641ef965da3972320e87b8eb0502a93
BLAKE2b-256 6ec954a052b878d773fbdfe2ca939a10cfe6b61a253ccfabfcd08cb712d86fd5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: skilltest_sdk-0.6.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.6.0-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 496ea68c74a2421123bbd1835581dc64c23a6abf98ca5f6cc6a3bb85524762b1
MD5 22a54dc40c64d7dca4e70c1127d6a508
BLAKE2b-256 cf92223f95ba2856e9f4c6e297c69bfb9d76736ce6247c08d40b957354af1089

See more details on using hashes here.

File details

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

File metadata

  • Download URL: skilltest_sdk-0.6.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.6.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f93df1c3872b7aab5aa29ca28334f1ee4bce800ee365b33f9e945cbb6e44cb05
MD5 c725321693538a9402d1376359c37ac9
BLAKE2b-256 fdca411881ab2f4c238fea3ed1e9fcdd1127256562d841d6908adb4cdd483b83

See more details on using hashes here.

File details

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

File metadata

  • Download URL: skilltest_sdk-0.6.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.6.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 62de0b0c7336ec64cc63f351b08cc6db6f3e7caf0c03e2b3931534ee500a5ff5
MD5 c571ddc1bc3210613a50dfa0f0f00f9a
BLAKE2b-256 1cf91beee406c21c0fd873e550e27b5a4f970f584b9151c616b365f93fc81000

See more details on using hashes here.

File details

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

File metadata

  • Download URL: skilltest_sdk-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 29.1 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.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c655709a0eb5b545a2b46e679909ea3bd72f2633e806117e18e4ab46d1b275e6
MD5 b480b89a10409d88cbd18ca015b8abae
BLAKE2b-256 7f5188092c440306a45d5dfcb36fd59437f0aa62659d1be676ba123827600734

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