Skip to main content

Yield

Yield for Python

Move repeatable coding-agent instructions from words into Python.

Build typed, resumable workflows that stay beside the code they operate on.

PyPI version Python versions Build status MIT license

Website · Documentation · PyPI · GitHub

The package name and import name are both yieldskill. Python reserves yield as a keyword.

Create a workflow

1. Install Yield

Yield supports Python 3.10 or later on macOS, Linux, and Windows. Create a virtual environment and install the public package:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install yieldskill
python -m yieldskill --version

On Windows PowerShell:

py -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install yieldskill
python -m yieldskill --version

Each wheel contains the matching yskill runtime for its platform. You do not need Go, Node.js, or a separate CLI installation.

2. Create the workflow

Create a Python workflow inside your repository:

python -m yieldskill init skills/env-doctor \
  --language python \
  --description "Check the Python environment and explain the required fix."

Replace skills/env-doctor/main.py with this tested workflow:

from yieldskill import define_skill

def program(ctx):
    probe = ctx.run_command(
        "probe-python", "python3 --version || python --version", timeout_seconds=60
    )

    diagnosis = ctx.agent_task(
        "diagnose",
        "Given the probe output, is this environment healthy for the project? "
        "If not, state the single most likely fix.",
        context={"exit_code": probe.exit_code, "stdout": probe.stdout, "stderr": probe.stderr},
        schema={
            "type": "object",
            "required": ["healthy"],
            "properties": {
                "healthy": {"type": "boolean"},
                "fix_hint": {"type": "string"},
            },
        },
    )

    if not diagnosis["healthy"]:
        answer = ctx.ask_user(
            "apply-fix",
            f"The environment needs a fix: {diagnosis.get('fix_hint', 'unknown')}. Apply it now and reply done.",
            options=[{"value": "done"}, {"value": "skip"}],
        )
        if answer != "done":
            ctx.blocked("the environment fix was not applied")
        recheck = ctx.run_command(
            "recheck-python", "python3 --version || python --version", timeout_seconds=60
        )
        ctx.require(recheck.exit_code == 0, "the environment probe passes after the fix", recheck)
        return {"healthy": True, "fixed": True}

    ctx.require(probe.exit_code == 0, "the environment probe passes", probe)
    return {"healthy": True, "fixed": False}


define_skill(program)

The generated skill.json declares Python as the runner. The generated SKILL.md tells a coding agent how to start and resume the workflow.

3. Test the workflow

Use deterministic fixture responses during tests. Save this as skills/env-doctor/fixtures/responses.json:

{
  "diagnose": { "healthy": true }
}

Then test the workflow:

python -m yieldskill doctor skills/env-doctor --test

Yield runs commands for real and supplies agent and user responses from the fixture. A successful test reaches completed without leaving a run journal.

4. Register the skill

Registration lets installed coding agents discover the workflow:

python -m yieldskill register skills/env-doctor --root .

Select the verified agents explicitly when you do not want automatic detection:

python -m yieldskill register skills/env-doctor --root . \
  --agent cursor,codex,claude-code

The generated adapters point back to skills/env-doctor. They do not copy the workflow or install its dependencies again.

5. Run the skill

Start a new coding-agent session so it discovers the registered skill. Where slash skills are supported, run:

/env-doctor

Otherwise, ask the agent in plain language:

Use the env-doctor skill to check this project.

The agent follows the adapter, starts the canonical Python workflow, and asks for each required agent or user response.

How Yield runs and resumes

  1. Your Python function emits one typed operation.
  2. Yield records the request and exits. It does not run a daemon.
  3. The coding agent, user, or CLI supplies the result.
  4. Yield replays the function from its journal until it reaches the next operation.

Replay must produce the same operation sequence. Yield reports divergence instead of giving a recorded response to a different operation.

Where AgentTask fits

ctx.agent_task() delegates one bounded judgment to the coding agent. Pass important evidence explicitly, as this workflow passes the probe result. With its schema, Yield checks the returned JSON shape before the workflow continues; it does not prove the diagnosis is correct. Host workspace and conversation access are host-dependent.

Python primitive Purpose
ctx.run_command() Execute a command and record its exit code and output.
ctx.agent_task() Delegate one bounded judgment; an optional schema validates the result.
ctx.ask_user() Request an explicit human decision.
ctx.require() Bind a required claim to recorded evidence.
ctx.blocked() / ctx.refused() Stop honestly when work cannot or must not continue.

See the primitive guides and CLI reference for the complete contract.

Guarantees and limits

Yield provides deterministic control flow, typed requests and responses, persistent run state, replay with divergence detection, stale and duplicate response rejection, and evidence-bound completion.

Schema validity is not truth. Yield cannot prove that a coding agent performed only the requested work. run_command is different: the Yield CLI executes the command, so its recorded exit code and output are observed facts.

Programs must remain deterministic between operations. Do not read clocks, random values, environment variables, or changing files to choose the next operation. Cross those boundaries through a Yield operation instead.

Yield is not a daemon, hosted runtime, workflow DSL, marketplace, coding-agent loop, multi-agent orchestrator, or security sandbox.

Optional developer helper

Installing yieldskill does not create skills or coding-agent adapters. After learning the manual workflow above, install guided assistance explicitly:

python -m yieldskill helper install --root . --language python

Review the plan and restart the coding agent after installation. The helper can teach, create, convert, check, repair, upgrade, and register workflows. yskill bootstrap remains a compatibility alias.

Coding agents and source

Cursor, Codex, and Claude Code are verified integrations. Yield also provides registry-backed project paths for other coding agents; those paths are not presented as end-to-end verified.

Yield is available under the MIT license.

Release files for yieldskill 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for yieldskill 0.5.2
File
yieldskill-0.5.2-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details
yieldskill-0.5.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
yieldskill-0.5.2-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
yieldskill-0.5.2-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
yieldskill-0.5.2-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details
yieldskill-0.5.2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details

Total release size: 10.9 MB

Release files / yieldskill-0.5.2-py3-none-win_arm64.whl

Download URL yieldskill-0.5.2-py3-none-win_arm64.whl
Size 1.7 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
63377cd41e65787113f13d2e75094cfddd59c02e256b4d1541bc4a47027a6657
BLAKE2b-256 checksum
How to use checksums
19aa9a373a74298ae5c752a04325afac446ad70aeaa02d42e88f3aa53f1b9701
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 11, 2026.

Transparency log

Release files / yieldskill-0.5.2-py3-none-win_amd64.whl

Download URL yieldskill-0.5.2-py3-none-win_amd64.whl
Size 2.0 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
e6a6132ddf73f0b59597b9926b82a2057873f03175f58ad9d87bc68f776c0850
BLAKE2b-256 checksum
How to use checksums
ccdbf9753c4e9244d1630fe17e1e5d78d4934bd6324e64215e0d12757d05d992
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 11, 2026.

Transparency log

Release files / yieldskill-0.5.2-py3-none-manylinux_2_17_x86_64.whl

Download URL yieldskill-0.5.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
4e52707394836b43e92523417065b247fb3eb452f9afd52d47b187a91410ed4a
BLAKE2b-256 checksum
How to use checksums
b7bea57fc2e3b058a6f45feb3a5606a250bf90860885015a95da0db70af261b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 11, 2026.

Transparency log

Release files / yieldskill-0.5.2-py3-none-manylinux_2_17_aarch64.whl

Download URL yieldskill-0.5.2-py3-none-manylinux_2_17_aarch64.whl
Size 1.7 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
df7820b4970fea9f38ef5c0977b1cc8ede293faea7065aeba38eb940db93767b
BLAKE2b-256 checksum
How to use checksums
7de123d6e37de5ef34a864f896adf909d51fbbaddb910ecb72a4b0d9f3b05090
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 11, 2026.

Transparency log

Release files / yieldskill-0.5.2-py3-none-macosx_11_0_x86_64.whl

Download URL yieldskill-0.5.2-py3-none-macosx_11_0_x86_64.whl
Size 1.9 MB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
a3a539be03b72f736b4250fdb1b602bc25a0cac96486e8d554c79e0bc9b07cd2
BLAKE2b-256 checksum
How to use checksums
83138347934bc5320f30a5084466b04c7f5bdb588d5442cf113153ae415474d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 11, 2026.

Transparency log

Release files / yieldskill-0.5.2-py3-none-macosx_11_0_arm64.whl

Download URL yieldskill-0.5.2-py3-none-macosx_11_0_arm64.whl
Size 1.7 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
36bacc10a7133d61659dca4f417bd1a818a31ad8448ef993d843d2e95086164b
BLAKE2b-256 checksum
How to use checksums
ac2d26a199d6b73404ec073a35e550fe12f3b4f0403ffb7191b29d75907fdaa6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 11, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.0

6 release files

This release

0.5.2 This release

6 release files

0.5.1

6 release files

0.5.0

6 release files

0.4.0

6 release files

0.3.0

6 release files

0.2.0

6 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page