Skip to main content

skillstate-kit

Portable, validated execution state for agent skills.

Convert an existing SKILL.md into a state-backed skill, retain durable checkpoints, and integrate the same execution engine into a Python application.

Python 3.11+ · MIT license · Initial alpha

Install

python -m pip install "skillstate-kit[mcp,http]"
skillstate demo

The core package requires no model account. The demo uses an explicitly scripted model and local tools; it is not a benchmark of real-model performance.

Optional extras:

  • mcp: a project-scoped STDIO MCP server and connection diagnostics.
  • http: a stateless adapter for a configured JSON-compatible chat-completions endpoint.

Use an existing skill

Run these commands in your target project. Replace skills/qa/SKILL.md with your existing skill file:

skillstate init --host codex --host claude-code --host antigravity --mcp
skillstate generate skills/qa/SKILL.md --name qa-state --install
skillstate validate qa-state
skillstate doctor --mcp

After your host discovers the installed generate-skill-state skill, ask it to generate state from an existing skill and install the result. Invoke the generated qa-state skill to run the procedure with checkpoints. Generating a definition does not execute the task.

generate preserves the source procedure and adds bounded progress fields. Domain-specific generation uses the active agent's proposal:

skillstate generate skills/qa/SKILL.md --prepare
skillstate generate skills/qa/SKILL.md --proposal proposal.json --source-hash HASH_FROM_PREPARE --install

The preparation response contains source text, its fingerprint and the proposal schema. The agent writes proposal.json; the library validates it and refuses stale source fingerprints. Structural validation is not proof that every business rule is correct.

You can also supply an explicitly configured endpoint with --base-url and --model. Terminal commands do not borrow your IDE's model credentials.

Claude Desktop Chat

Version 0.1.2 adds an explicit local connection, separate from Claude Code:

skillstate connect claude-desktop
skillstate doctor --mcp

Fully quit and reopen Claude Desktop, use Chat, and approve the tool calls you intend to allow. The installer preserves unrelated settings and uses a separate server name per project. Windows standalone/Microsoft Store and macOS paths are supported; --config PATH selects a custom location. If two Windows configs exist, choose explicitly. Disconnect with skillstate disconnect claude-desktop; run data remains intact.

Live acceptance evidence: Codex used eight real MCP calls to record a synthetic invoice review and hand it to Claude Desktop. Desktop discovered the server and requested tool permission, but the call later timed out without a result; the second review was not completed. An independent MCP transport check subsequently passed. The tested Antigravity desktop session reported MCP tools unavailable, and its separate IDE required login. Generated configuration and transport tests do not establish successful execution in those hosts. No claim of universal desktop compatibility is made.

Python integration

This complete example uses a scripted model. Replace model and record with your own model and service functions:

import asyncio
from skillstate import Skill, SkillRuntime, SQLiteStore, Tool, ToolResult

skill = Skill(
    name="record-job",
    instructions="Record the job, then finish after its result is confirmed.",
    state_schema={
        "type": "object",
        "properties": {"recorded": {"type": "boolean"}},
        "required": ["recorded"],
        "additionalProperties": False,
    },
    initial_state={"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):
    # For a real API, forward operation_id to its idempotency facility when
    # supported and inspect the actual response before reporting success.
    return ToolResult(True, {"recorded": True})

async def main():
    with SQLiteStore() as store:  # Pass a local file path for durable storage.
        store.create("job-001", skill, "worker")
        tool = Tool("record", "Record a job",
                    {"type": "object", "additionalProperties": False}, record)
        runtime = SkillRuntime(store, model, [tool],
                               completion_check=lambda state: state["recorded"])
        result = await runtime.run("job-001", "worker", max_steps=10)
        print(result["status"], result["state"])

asyncio.run(main())

For persistent storage, pass a database path to SQLiteStore. Reopen the same database and run ID to resume; creating a duplicate run is rejected.

Execution contract

  • Explicit set/delete patches with JSON Pointer paths, inline JSON Schema and UTF-8 size limits.
  • State and tool arguments validated before a managed tool executes.
  • Persistent operation intent before tool execution; atomic state, result and event commit afterward.
  • Failed tools retain the prior state. Exceptions, timeouts and ambiguous results block replay until reconciliation.
  • Revision checks prevent competing clients from silently overwriting each other.
  • Immutable skill definitions, source drift detection and sequential owner handoff.
  • Large text artifacts kept outside the active context.

Native host skills provide state and checkpoints. They do not replace host conversation history or intercept every native tool. Use the managed Python runtime with a stateless model for history-free model inputs.

SQLite does not make external APIs transactional. Owner names coordinate local clients; they are not authentication. The library validates reported results but cannot independently prove external business truth. Keep local state private and test recovery behavior for your application.

Compatibility and documentation

Adapters generate project skill files and optional MCP configuration for Codex, Claude Code and Antigravity. They target documented integration surfaces. MCP protocol tests and configuration discovery do not certify every IDE version or live task.

The source distribution includes docs/cli.md, docs/architecture.md, docs/compatibility.md, docs/validation.md, docs/README_TR.md and runnable examples. Download the source archive from this package's files to read them offline. The development repository currently requires collaborator access.

Research

An independent implementation inspired by SKILL.state: Scalable Long-Horizon Agent Skills. Not affiliated with the paper's authors. The compiler, host adapters and operation journal are engineering extensions; no reproduction of the paper's benchmark scores or token savings is claimed.

Download files

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

Source Distribution

skillstate_kit-0.1.2.tar.gz (179.8 kB view details)

Uploaded Source

Built Distribution

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

skillstate_kit-0.1.2-py3-none-any.whl (39.2 kB view details)

Uploaded Python 3

File details

Details for the file skillstate_kit-0.1.2.tar.gz.

File metadata

  • Download URL: skillstate_kit-0.1.2.tar.gz
  • Upload date:
  • Size: 179.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for skillstate_kit-0.1.2.tar.gz
Algorithm Hash digest
SHA256 635042bffd7fa3ad857f011e2de52401e1e63e456747fad84e470bf3628797c8
MD5 44baed8faa370efdc4538073702dc295
BLAKE2b-256 5bc32221b8bc628e7070689ff3d8459e54b109dc12da5eb49bf3c333701f7cd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for skillstate_kit-0.1.2.tar.gz:

Publisher: publish.yml on Atakan-Emre/skillstate-kit

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

File details

Details for the file skillstate_kit-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: skillstate_kit-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 39.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for skillstate_kit-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 62fd2b279cbe22a0b68d6b3d8633776a4cd48c4d2bbbbadd6d3d6ab5cb2cd573
MD5 e225bc350964b886e831c42dc0573c69
BLAKE2b-256 575436a7d7e6113760b1ac407c91f14605b3f66bb9eeee269145dac86b207a7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for skillstate_kit-0.1.2-py3-none-any.whl:

Publisher: publish.yml on Atakan-Emre/skillstate-kit

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

Release history Release notifications | RSS feed

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

This release

0.1.2 This release

2 files

0.1.1

2 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