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.

Start with your coding agent

uvx --from yieldskill yskill bootstrap --language python

Review and confirm the plan. Restart your coding agent. Then ask it to create a new skill workflow:

Use Yield to create a tested skill workflow for releasing my package.

To convert an existing SKILL.md, ask:

Use Yield to convert my existing release SKILL.md into a tested skill workflow.

Advanced: build manually

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

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

python -m yieldskill register skills/env-doctor \
  --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.

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.

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

yieldskill-0.3.0-py3-none-win_arm64.whl (1.7 MB view details)

Uploaded Python 3Windows ARM64

yieldskill-0.3.0-py3-none-win_amd64.whl (2.0 MB view details)

Uploaded Python 3Windows x86-64

yieldskill-0.3.0-py3-none-manylinux_2_17_x86_64.whl (1.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

yieldskill-0.3.0-py3-none-manylinux_2_17_aarch64.whl (1.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

yieldskill-0.3.0-py3-none-macosx_11_0_x86_64.whl (1.9 MB view details)

Uploaded Python 3macOS 11.0+ x86-64

yieldskill-0.3.0-py3-none-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file yieldskill-0.3.0-py3-none-win_arm64.whl.

File metadata

  • Download URL: yieldskill-0.3.0-py3-none-win_arm64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for yieldskill-0.3.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 84c8d1774f2e7d107434efd4c4624c9461bab1c6e51a17572ca3338bfdac423e
MD5 3f83d0ce217b6d6cc35652c34e4dc317
BLAKE2b-256 0bbe2811d7f91e3c8fd66488a0ac59b021181ad9499a7e08f7df087c57802660

See more details on using hashes here.

Provenance

The following attestation bundles were made for yieldskill-0.3.0-py3-none-win_arm64.whl:

Publisher: npm-publish.yml on operatorstack/yield

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yieldskill-0.3.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: yieldskill-0.3.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for yieldskill-0.3.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a537a18f1c44d9210823a4bb6993eb0a9c768db78a064e9d39878e4f5fe8e8db
MD5 8fd92e0f71a8be9d1d0b17ff5deef49a
BLAKE2b-256 9a9e106cf7dac641d27ec942e5d1c54c2ad04df00eae1e18f431dc1a2e677176

See more details on using hashes here.

Provenance

The following attestation bundles were made for yieldskill-0.3.0-py3-none-win_amd64.whl:

Publisher: npm-publish.yml on operatorstack/yield

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yieldskill-0.3.0-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for yieldskill-0.3.0-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 682ccc15a676972d62d7fc0b075387c971af0c80271ba7570e4f64be420eb79e
MD5 ef9517da47675eb4518b1ffbb69ae3bb
BLAKE2b-256 57849a1324a8a9f380b32210855c3581d1cdf74ab71d9612046aa514558d337a

See more details on using hashes here.

Provenance

The following attestation bundles were made for yieldskill-0.3.0-py3-none-manylinux_2_17_x86_64.whl:

Publisher: npm-publish.yml on operatorstack/yield

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yieldskill-0.3.0-py3-none-manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for yieldskill-0.3.0-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 89f0be134026510cdd0f49819bde49ccf852e1ef8e13680453a78a06c1352878
MD5 5bb2f62c782664566e39eb97a09fc634
BLAKE2b-256 2ee64f7825d016517c2270bfe37dc9d20edccfc02385afa1697d89c349b59b7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for yieldskill-0.3.0-py3-none-manylinux_2_17_aarch64.whl:

Publisher: npm-publish.yml on operatorstack/yield

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yieldskill-0.3.0-py3-none-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for yieldskill-0.3.0-py3-none-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 67e7a5ae2b29e86082c6bd971f2bdcd6c22cc2b0eced49e6b2325aca29c46684
MD5 a678bb2a0148fc6005ec6ba3882fba84
BLAKE2b-256 6105d0c8e4c2b555ab488f8fe65a66d71c953eec58f5fe5e72d3dec3118897a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for yieldskill-0.3.0-py3-none-macosx_11_0_x86_64.whl:

Publisher: npm-publish.yml on operatorstack/yield

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yieldskill-0.3.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for yieldskill-0.3.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b5e88aeff6bc3de166170426d1dc193714b540127c2fa3f371f32260b0a32eb7
MD5 532524c092351feb54ef406d22fff3c9
BLAKE2b-256 d0a01d74da0a5f27837360eaeb642fd3a6b08d355c3aad8b1a6323b19f4b3a23

See more details on using hashes here.

Provenance

The following attestation bundles were made for yieldskill-0.3.0-py3-none-macosx_11_0_arm64.whl:

Publisher: npm-publish.yml on operatorstack/yield

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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