ClaudeMap

HEXIS

Compile an agent skill (SKILL.md) into an extended finite state machine, so the order of operations is enforced by the program while models reason inside the states.

SDKs & Toolingstate-machineskill-compilerreliabilitytracespython

HEXIS addresses the usual way skills fail: the document sits in context and the model chooses every next step, so clearly stated requirements still get skipped, reordered or applied in the wrong situation. It compiles a SKILL.md into an extended finite state machine — plain JSON in the efsm-v1 format with typed variables, tool/model/judge/user/end actions, ordered guarded transitions, bounded loops and a fallback state — and enforces the order of operations in the program while language models do the reasoning inside states. The CLI covers compile (a model drafts the machine and redrafts under static-check feedback until validation passes), update (folds execution traces in, one model decision per step, and a candidate machine is accepted only if it passes the checks and replays every previously accepted trace; answers are cached and runs resume), guide (writes GUIDE.md and PROMPT.md — a system prompt any tool-using agent, e.g. Claude Code or OpenCode, can execute state by state) and run. Guards use a small whitelisted expression language that never calls eval. Works with any OpenAI-compatible endpoint; native tool execution uses OpenCode, or --executor local runs bash. Ships four compiled example machines (data analysis 15 states, theorem-grounded math 12, corpus QA 21, spreadsheet editing 17) and a hermetic test suite of more than 350 tests. Python 3.11+, MIT, alpha status; accompanies the paper 'Compiling Agent Skills into Extended Finite State Machines'.

What it does

  • compile / update / run / guide CLI: a model drafts the machine; static checks (schema, guards, reachability, termination, clause coverage) bounce drafts back until they pass
  • Trace-driven evolution: one decision per step, and a candidate is accepted only if it replays every previously accepted trace — a wrong decision cannot break the machine
  • efsm-v1 machines are plain JSON with guarded transitions, bounded loops and a fallback state; guards run in a whitelisted expression language, never eval
  • Every build ships GUIDE.md and PROMPT.md so any tool-using agent (e.g. Claude Code) can execute the machine state by state; 350+ hermetic tests

When to use it

Skill authors who want deterministic ordering, bounded loops and verifiable termination for multi-step procedures, and researchers studying agent reliability — the repo accompanies a paper on compiling skills into EFSMs.

Getting started

pip install hexis-agent          # imported as `hexis`; command is `hexis-agent`; Python >= 3.11
export API_KEY=...               # any OpenAI-compatible endpoint
M="--model <model> --base-url https://your-endpoint/v1"

hexis-agent compile --skill path/to/skill --out build/ $M
hexis-agent update --build build/ --traces traces/ $M
hexis-agent run --machine build/ --input request="..." --workdir work/ --executor local $M

Things to know

MIT, alpha status. Executes tool calls whose arguments — including shell commands — are generated by language models: run it in an isolated environment and only with machines and task files you trust (SECURITY.md). update sends trace steps and the skill's clauses to the configured model endpoint, and build directories keep copies of traces and every model question. Native tool execution uses OpenCode; --executor local runs bash in a subprocess instead. Compiling and updating consume model calls at roughly one call per trace step.

Repository

Worldbuilder013/HEXIS

Charted

Related on the map

  • Harness Bridge

    SDK / Tool

    A local launcher that points Claude Code and seven other coding harnesses at any OpenAI-, Anthropic- or Responses-compatible endpoint — without editing a single config file.

    • launcher
    • local-models
    • cli
    • menu-bar
  • Claude for Siri

    SDK / Tool

    Answers macOS Spotlight and Siri prompts with your signed-in Claude Code account — an experimental macOS 27 model-delegation provider.

    • macos
    • siri
    • spotlight
    • model-delegation
  • Extract your own local chat history from ten AI coding assistants into one normalized JSONL — for fine-tuning, analytics, or backing up years of conversations. Standard library only.

    • cli
    • data-export
    • jsonl
    • backup