skillstate-kit
Portable execution state for AI agents.
Keep task progress, observations, evidence and operation outcomes outside conversational history. Use the same Python engine through the SDK, CLI or MCP, with project integrations for Codex and Claude.
PyPI · Documentation · Research alignment · Validation
Quick start
Requires Python 3.11 or newer. Run inside the project you want to integrate:
python -m pip install -U "skillstate-kit[mcp]"
skillstate init --host codex --mcp
skillstate doctor --mcp
The example selects Codex. Use --host claude-code or --host antigravity for another project host, or skillstate connect claude-desktop for Desktop Chat. Installation, upgrades and removal.
Restart or reload your agent's project discovery, then give it a normal task:
Implement duration parsing and verify it with regression tests.
Installed instructions guide the agent to find the intended run, continue from current state, record evidence and validate completion. Host support and instruction-following remain necessary. No custom Python agent is required for this integration.
The base pip install skillstate-kit also supports skillstate init using the CLI. MCP is an optional extra; http adds a stateless JSON model adapter.
Choose the state model
| Requirement | Interface |
|---|---|
| Track a multi-step coding task | Built-in task profile with evidence-backed milestones |
| Represent domain facts and procedural rules | Generate a task-specific semantic skill schema |
| Control every model input and registered tool call | Python SkillRuntime with a stateless model callback |
The task profile records the goal, active/completed/remaining steps, blockers and artifact references. It does not replace a domain model for inventory, invoices or other business rules.
Use an existing skill
skillstate generate skills/qa/SKILL.md --name qa-state --install
skillstate validate qa-state
Replace the source path with your existing file. Direct generation preserves instructions and adds tracking state. For domain-specific fields, use the installed generate-skill-state skill or the source-bound --prepare / --proposal workflow. Generated proposals undergo structural and source-integrity checks; generation does not execute or certify the task.
For Python test tracking without an existing skill file:
skillstate generate . --profile python-tests --name tests-state --install
See the generation and CLI reference.
Task lifecycle
Find intended run → Read current state → Execute active work
↑ ↓
Continue ← Record verified milestone
↓
Validate and complete
task_startcreates an ordered plan or resumes an identical intended task.task_checkpointrecords artifact-backed milestones and resource fingerprints.- Repeating a completed milestone requires an explicit revalidation reason.
task_completechecks required steps, evidence integrity, freshness and blockers.- Generic task updates can change blockers; they cannot replace milestone progress.
- Pending or uncertain operations require reconciliation before further work.
Inspect progress with skillstate run find and skillstate run context RUN_ID.
Use skillstate run events RUN_ID for audit history. An intentionally new task
needs a new run ID; resuming an existing task never requires resetting it.
Evidence validates what was recorded and whether referenced resources changed. Applications must still verify business outcomes. Native host tools are not universally intercepted or sandboxed by this library.
Host integrations
| Host | Project setup |
|---|---|
| Codex | skillstate init --host codex --mcp |
| Claude Code | skillstate init --host claude-code --mcp |
| Claude Desktop Chat | skillstate connect claude-desktop |
| Antigravity | skillstate init --host antigravity --mcp |
skillstate hosts detect reports discovery evidence. skillstate doctor codex
checks a selected adapter. Claude Desktop uses a separate application-level
connection and requires a full restart. Keep machine-specific MCP configuration
local. Detection or a healthy local server does not establish live host acceptance.
Installation preserves unrelated configuration and managed instruction blocks.
skillstate disconnect HOST removes owned integration settings while retaining
state. Setup, thin plugins and host limitations.
Python integration
This runnable example uses a scripted model and a simulated tool. It requires no credentials. Replace the callbacks with your application integrations:
import asyncio
from skillstate import Skill, SkillRuntime, SQLiteStore, Tool, ToolResult
async def main():
skill = Skill(
"record-job",
"Record the job; finish after its result is confirmed.",
{
"type": "object",
"properties": {"recorded": {"type": "boolean"}},
"required": ["recorded"],
"additionalProperties": False,
},
{"recorded": False},
)
def model(context):
if context["state"]["recorded"]:
return {"patch": [], "action": None, "done": True}
return {
"patch": [{"op": "set", "path": "/recorded", "value": True}],
"action": {"name": "record", "arguments": {}},
"done": False,
}
def record(arguments, operation_id):
return ToolResult(True, {"recorded": True, "operation_id": operation_id})
tool = Tool("record", "Record a job", {"type": "object", "additionalProperties": False}, record)
with SQLiteStore() as store:
store.create("example", skill, "worker", {"job": "example"})
runtime = SkillRuntime(store, model, [tool], completion_check=lambda s: s["recorded"])
result = await runtime.run("example", "worker")
print(result["status"], result["state"])
if __name__ == "__main__":
asyncio.run(main())
Expected output:
completed {'recorded': True}
Replace model(context) with your synchronous or asynchronous model callback, and record with a real tool that checks its result. Forward operation_id to the external service's idempotency facility when supported.
The example uses an in-memory store for easy reruns. Use SQLiteStore("jobs.sqlite3") for durable storage. Create each run once; resume by reopening that database and calling runtime.run with the existing run ID and owner. See the runnable source and runtime contract.
Model decision contract
{
"patch": [{"op": "set", "path": "/recorded", "value": true}],
"action": {"name": "record", "arguments": {}},
"done": false
}
Finish with {"patch": [], "action": null, "done": true}. State updates use explicit set/delete operations and JSON Pointer paths. Setting null does not delete a key. No reasoning-trace field is accepted.
Execution guarantees and boundaries
| Concern | Contract |
|---|---|
| Invalid decisions | Validate state patches and registered tool arguments before effects |
| Concurrent writes | Reject stale revisions and wrong owners |
| Failed or uncertain tools | Preserve the checkpoint; require explicit reconciliation when uncertain |
| Completed task progress | Use evidence-backed lifecycle calls and explicit revalidation |
| Application context | Enforce byte budgets; keep audit history outside ordinary model context |
| Persistence | Shared SQLite store, immutable skill definitions and integrity-checked artifacts |
The managed runtime supplies current instructions, state and latest observation plus fixed tool/schema contracts. A stateless model callback is required to avoid reintroducing history. Native Codex/Claude integrations retain the host's own conversation behavior and do not guarantee lower provider token usage.
Owner IDs coordinate trusted local clients; they are not authentication. Python callbacks run with application permissions. SQLite cannot atomically roll back remote side effects. Security boundaries · Execution contract.
Validation and performance
The test suite covers schema rejection, persistence, concurrent revisions, uncertain operations, artifact integrity, installer preservation and real MCP transport. See release validation for exact tested versions.
Reproducible experiments are documented separately:
- External smolagents correctness and forced-process continuation.
- Paired Codex coding experiment: correctness, repeated work, actual tokens and latency.
- Host acceptance and scope.
The recorded small coding trial incurred additional token and latency overhead. Performance depends on workload and host behavior; universal savings are not claimed.
Research
Independent implementation inspired by SKILL.state: Scalable Long-Horizon Agent Skills, by Sanket Badhe, Priyanka Tiwari and Jonghyun Chung. No affiliation or endorsement is implied.
The research alignment document distinguishes the managed runtime from native-host integration, maps implemented contracts to tests and records intentional differences. Paper benchmark results are not claimed for this package.
Development
python -m pip install uv
uv sync --locked --extra dev
uv run ruff check src tests examples scripts
uv run ruff format --check src tests examples scripts
uv run pytest --cov=skillstate --cov-fail-under=85
uv run python -m build
uv run twine check dist/*
Python/OS tests and clean-package checks run in CI. The package is alpha. MIT license · Contributing · Changelog · Security reporting.
Metadata
Release files for skillstate-kit 0.2.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 | Provenance | Actions |
|---|---|---|---|---|
| skillstate_kit-0.2.2.tar.gz | 218.6 kB | With provenance | Details for skillstate_kit-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| skillstate_kit-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for skillstate_kit-0.2.2-py3-none-any.whl |
Total release size: 269.0 kB
Release files / skillstate_kit-0.2.2.tar.gz
| Download URL | skillstate_kit-0.2.2.tar.gz |
|---|---|
| Size | 218.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a874c2cb89355000b9b2f3ac1a8034dcfc75ad51a23034af845f564340f85467
|
|
BLAKE2b-256 checksum How to use checksums |
730c471fde669cef12c1ddeecb2054d1703a2933d5bbdfa888c41e930ec14a53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Sep 7, 2026.
Transparency logRelease files / skillstate_kit-0.2.2-py3-none-any.whl
| Download URL | skillstate_kit-0.2.2-py3-none-any.whl |
|---|---|
| Size | 50.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ba4928aacd0739432e9641ab4cc054f34550e5fd535736cd5350365419b109a
|
|
BLAKE2b-256 checksum How to use checksums |
2f78ea6a71401e527cd455262a7eedd1735f07bc7a5d5df652f83dadfb81a8e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Sep 7, 2026.
Transparency logSecurity for skillstate-kit 0.2.2
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for skillstate_kit-0.2.2.tar.gz
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 Sep 7, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.