Logo di Statem

Statem

CommunityPopolare
henryqin1997
statem

Use when a long coding or research task should be managed with statem state-machine runbooks, including creating specs, starting or resuming runs, checking current state, transitioning with goto, saving progress, and reading history.

Panoramica

Autorehenryqin1997
Repositorystatem
Nome della skillstatem
Stelle
1.4K
Fork
132
File inclusi
Solo istruzioni
LicenzaApache-2.0
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da henryqin1997 su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Statem in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/henryqin1997/statem/tree/main/plugins/statem/skills/statem
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/henryqin1997/statem.git /tmp/statem
mkdir -p .claude/skills
cp -r /tmp/statem/plugins/statem/skills/statem .claude/skills/statem
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Statem in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Statem non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Statem non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Statem

Use statem when the task is long-running, iterative, easy to lose track of, or benefits from explicit agent state. Prefer it as a runbook, not as a rigid harness.

Workflow

  1. Find or create a statem spec such as statem.yaml.
  2. Validate it: python3 -m statem validate statem.yaml --json.
  3. Start or resume a run: python3 -m statem start statem.yaml --run-id <id> --json.
  4. Check state before acting: python3 -m statem cur --run-id <id> --json.
  5. Move only through allowed edges: python3 -m statem goto <node> --run-id <id> --json.
  6. Save progress before pausing: python3 -m statem save --run-id <id> --json.
  7. For handoff context, read recent history: python3 -m statem history --run-id <id> --tail 10 --json.

Use statem instead of python3 -m statem if the CLI is installed on PATH.

For dynamic servers, company machines, or disposable git checkouts, prefer a machine-local state directory. Set STATEM_STATE_DIR once, for example $HOME/.local/state/statem/<project>, so runtime state survives checkout replacement. After moving to a new checkout, run statem start <spec> --run-id <id> once to rebind the run to the current spec path.

Commit YAML runbooks with the repo. Do not commit runtime state; treat .statem/ or STATEM_STATE_DIR as local, copy-on-use execution data.

Context Clear

Avoid /clear in normal loops. It flushes the conversation, including any instructions that were supposed to run after it, and can lose useful intent that was not written to durable files. Prefer explicit transitions plus safe compaction.

Before a hard clear, generate a durable resume prompt:

bash
python3 -m statem prompt --run-id <id>

Paste the generated prompt immediately after /clear. The agent must recover from .statem with start, cur, and history; it should not rely on any pre-clear conversation.

Loop Compaction

For cyclic runbooks, prefer an explicit session hygiene node after a full loop. When continuing another cycle and context is noisy, generate a safe compaction instruction:

bash
python3 -m statem compact-prompt --run-id <id>

Run the generated /compact instruction through the host UI, then recover with statem cur and statem history --tail 10. Do not use hidden self-messaging to trigger compaction.

Agents may inspect the full graph with statem state; cur, next, and goto are for disciplined execution and attention anchoring, not for hiding the runbook.

Auto Loop Hook

When the host supports a Stop hook, users may opt into auto-loop behavior with integrations/hooks/statem_stop_hook.py. The hook runs when the agent is about to hand control back to the user. If a statem run is active, the current node is not a terminal/handoff node, and there are outgoing transitions, it returns a continuation prompt that tells the agent to inspect statem cur and keep working from the current node.

Registration examples live in:

  • examples/hooks/README.md
  • examples/hooks/codex-stop-autoloop.hooks.json
  • examples/hooks/claude-stop-autoloop.settings.json

Merge the matching snippet into the host hook configuration and use an absolute script path if the hook is registered outside the statem repository.

Treat this as host-level glue. It must not advance state, run /clear, or hide the graph. The agent should still transition only with statem goto.

Authoring Specs

  • Keep the static spec separate from .statem/ runtime state.
  • Use natural-language checks for low-friction runbooks.
  • Use in_hook for setup after entering a node.
  • Use before_transfer for redo/check loops while still in the current node. It is a spec field, not a CLI command; statem goto runs it automatically.
  • Use out_hook to persist current-node progress before leaving.
  • Use edge hook as prepare-transfer work after out_hook and before entering the target. If a blocking edge hook fails, the pointer stays at the source so the agent can retry.
  • Use type: command for deterministic shell checks.
  • Use type: predicate for file existence, non-empty files, text matches, and JSON-path checks.
  • Use type: llm_review when another model, agent, or script should review before a transition.

Do not manually edit .statem/runs/<run-id>/state.json unless the user explicitly asks for runtime surgery.

Domande frequenti

Cosa fa la skill IA Statem?

Use when a long coding or research task should be managed with statem state-machine runbooks, including creating specs, starting or resuming runs, checking current state, transitioning with goto, saving progress, and reading history.

Perché usare Statem su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Statem è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Statem in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/henryqin1997/statem/tree/main/plugins/statem/skills/statem. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Statem?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Statem?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Statem: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Statem è gratuita?

Sì. È pubblicata su GitHub da henryqin1997 con licenza Apache-2.0. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇