Logo von Pi Durable Dev Rules

Pi Durable Dev Rules

Community
Agents365-ai
pi-durable-dev-rules

Developer reference for building applications, tools, and agents on the Pi Durable agent harness (@earendil-works/pi-durable) and the pi-ai model layer. Use when writing or debugging code that imports @earendil-works/pi-durable or pi-ai: assembling a Harness over memory/SQLite/JSONL/Durable Object storage, submitting input and waiting for answers, defining tools with TypeBox schemas and structured output, calling tools from tools, hooks and guards, durable tasks with checkpoints and ownership, subagents and child tasks, documents and migrations, code mode, tool search, per-conversation environments, compaction, recovery after a crash, storage and environment conformance tests, or choosing models and providers. Also use when a durable/agent-runtime behavior question comes up: what survives a restart, why an input stayed queued, why a task is blocked or orphaned, how abort cascades, or what the Pico5 specification requires.

Übersicht

HerausgeberAgents365-ai
Repository365-skills
Skill-Namepi-durable-dev-rules
Sterne
99
Forks
16
Mitgelieferte Dateien
13
LizenzMIT
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • 13 mitgelieferte Dateien

    Skripte, Vorlagen und Referenzmaterial, die das Modell bei der Arbeit lesen kann. Die Dateien sind schreibgeschützt und werden niemals ausgeführt.

  • Open Source

    Von Agents365-ai auf GitHub veröffentlicht. Prüfen Sie den Quellinhalt vor der Installation.

Installation

Installieren Sie den KI-Skill Pi Durable Dev Rules in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner — liest SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/Agents365-ai/365-skills/tree/main/plugins/pi-durable-dev-rules/skills/pi-durable-dev-rules
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill anlegen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format lesen kann, kann diesen Skill nutzen — kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Agents365-ai/365-skills.git /tmp/365-skills
mkdir -p .claude/skills
cp -r /tmp/365-skills/plugins/pi-durable-dev-rules/skills/pi-durable-dev-rules .claude/skills/pi-durable-dev-rules
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Pi Durable Dev Rules in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Pi Durable Dev Rules automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Pi Durable Dev Rules nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Keys.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

Pi Durable Dev Rules

@earendil-works/pi-durable is a durable agent harness: conversations, model turns, tool calls, tasks, and your own documents are committed to storage before anything is shown, so a process that dies mid-turn is picked up where it stopped. It ships in the pi monorepo next to @earendil-works/pi-ai (model access, tools, messages) and @earendil-works/chord (tracked JSON state).

Two things about it decide most design choices:

  • The API is experimental. Version 1.2.0 tracks the monorepo; breaking changes land in every release. Quote and write against the version you have installed, and treat a signature difference as a version difference rather than a mistake.
  • It is a library for building agentic applications, not a coding-agent CLI. For the Pi CLI, its extensions, skills, MCP, and SDK, use the sibling skill pi-dev-rules.

When to use this skill

  • Writing or reviewing code that imports @earendil-works/pi-durable or @earendil-works/pi-ai.
  • Assembling a harness: storage backend choice, HarnessOptions, settings, the registry, and an execution environment.
  • Conversations: submit/wait, the busy inbox (steer, follow-up, write), reset and handoff, forks, per-conversation agent changes.
  • Tools: TypeBox schemas, three output channels, nested calls with executeTool(), callers, deferred tools and tool search, replay safety, output limits, image handling.
  • Durable tasks: phases and checkpoints, ownership, waiting and failFast, abort, recovery, migration.
  • Subagents and child tasks, foreground versus background, reporting answers back.
  • Documents: scopes, history and fork semantics, migrations, checkpoints, observation.
  • Code mode (QuickJS scripts over the conversation's tools), hooks and guards, compaction, usage.
  • Runtime questions: what survives a crash, why an input is still queued, why a task is blocked or orphaned, how an abort cascades, why a partial answer is visible or missing.
  • Extending the harness: storage backends and execution environments verified with the conformance suites, custom tasks and prompt sections.

Reference index: load the file you need

FileCovers
references/durable-guide.mdThe package's own guide, bundled verbatim: quick start, concepts, persist and resume, extensions, tools (including nested calls and callers), code mode, system prompt, per-conversation agent, settings, environment, reload, watching, busy conversations, reset and handoff, compaction, agent events, hooks, more conversations and forks, abort and subagents, child tasks, the task graph, your own state, usage and cost, storage, errors, and the runnable examples. Start here.
references/durable-api.mdThe exact public surface: entry-point map, Context, Harness/Session/Conversation/ConversationHandle, submissions, the Tx transaction surface, documents, entries, extensions and sections, hooks, tools and ToolExecutionApi, tasks and TaskRuntime, environment, storage, testing, observation, error classes, and the export inventory per subpath
references/durable-runtime.mdHow work actually executes: the commit line and its rules, one input end to end, task checkpoints, the ownership tree, recovery by case, compaction, the inbox boundaries, live state and progress cadence, the failure model, the knobs that change behavior, and the deliberate non-goals
references/durable-recipes.mdProject setup, the catalogue of all 32 runnable examples, and 19 recipes with code: minimal chat, persistence and exactly-once input, live UI, agent events, structured-output tools, tool-calling tools, foreground and background subagents, child tasks with durable waits, coding agent, plan mode, per-conversation sandbox, tool override and wrappers, extension state and migration, hooks, compaction, code mode, tool search, conformance testing, plus the pitfall checklist
references/durable-spec.mdThe normative Pico5 specification bundled verbatim (5340 lines): records and lifetimes, documents and mutation ownership, transactions and storage ownership, tasks and the effect sandwich, structured concurrency, submissions and the inbox, extensions/hooks/tools, the built-in tasks, document observation, the storage contract and failure model, the backends, API footguns, and non-goals. Read section 12 before shipping
references/pi-ai-models.mdThe model layer bundled verbatim: createModels()/builtinModels(), provider factories and auth, querying the model catalog, environment variables, defining tools with TypeBox, constrained sampling, the event reference, image input, usage and cost, retries, and the message types that end up in entries
references/codemode-sandbox.md@earendil-works/pi-codemode bundled verbatim: what a script may call, the injected globals, the sandbox module surface, determinism and memory limits, and local versus remote sandboxes

Cheat sheet

bash
npm install @earendil-works/pi-durable @earendil-works/pi-ai @earendil-works/chord
node --conditions=source --experimental-strip-types app.ts     # run TS directly against the source
ts
import { BACKGROUND_CONTEXT } from "@earendil-works/chord/context";
import { builtinModels } from "@earendil-works/pi-ai/providers/all";
import { createRegistry, Harness, AssistantEntry } from "@earendil-works/pi-durable";
import { openNodeSqliteStorage } from "@earendil-works/pi-durable/storage/sqlite/node";

const context = BACKGROUND_CONTEXT;
const harness = await Harness.open(await openNodeSqliteStorage("./session.sqlite"), {
	models: builtinModels(), registry: createRegistry(), env: (target) => new NodeExecutionEnv({ cwd: target.cwd ?? process.cwd() }),
}, context);
const root = await harness.root(context, { agent: { model: { provider: "openai", modelId: "gpt-6-sol" } } });

harness.resume();                                              // continue unfinished work from a previous process
const submission = await root.submit({ type: "input", content: "Hello", requestId: "greeting-1" }, context);
const settled = await submission.wait(context);                // "done" | "unanswered"
if (settled.status === "done" && settled.type === "input") {
	const answer = await root.commit((tx) => tx.entry(AssistantEntry, settled.answer), context);
}
await harness.close(context);

Storage: MemoryStorage (nothing persisted), openNodeSqliteStorage(path) (the default for anything long-running; WAL, commits survive process crashes), openNodeJsonlStorage(directory, context) (append-only, keeps the whole history in memory), openDurableObjectSqliteStorage(ctx.storage). One process owns a storage at a time.

Hard rules

  • Writes go through one commit line, and nothing is shown before its commit is stored. Inside a commit callback read only through tx; read every table row you need before the first table write (ReadAfterWrite), and never await slow work there: no models, tools, processes, network, humans, nested commits, or session waiters.
  • Every asynchronous call takes a Context. Cancelling it cancels only that call or wait, never the durable work. Use BACKGROUND_CONTEXT where nothing should cancel, and withCancel() at a host boundary. withoutAbortSignal() is for mandatory cleanup such as close().
  • Report what you did only after it is committed. The pattern for a task step is: commit the intent, perform the effect, commit the result. A crash between the effect and the commit reruns that step, so make steps idempotent, use runtime.memo() for first-writer-wins decisions, and set replay: "safe" on a tool only when a rerun is genuinely safe. An unsafe tool that is interrupted gives the model an interrupted error result with the output committed so far.
  • A tool has three output channels. output is what the model reads, structuredOutput is what programs calling the tool read (validated against structuredOutputSchema, required unless the result is an error), details is for the host UI. Only output and details enter the transcript.
  • Every tool call is its own durable task owned by its caller. Nested calls made with api.executeTool() return their result to the caller instead of the transcript and reuse a key on rerun; cancelling the context stops only the wait. A nested result's usage is already counted under its own tool, so forwarding it double-counts it.
  • Ownership decides lifetime. Every task names its owner at creation; every conversation is ownerless or owned by a task. Abort flows down; a task finishes only once its ordinary owned work drained (stored as completing until then); a background: true task is a boundary that ordinary aborts and idle waits skip. Never create owned work from an abort handler (the task is abort-marked): compensate inline, or use background conversation-owned tasks with runtime.waitForTask().
  • A run owns its own writes. Do not append raw entries to a conversation with an active run: use a write submission, which a raw tx.appendEntry() cannot replace and which runs the stale check.
  • pi.-prefixed names belong to the built-ins for task names, document kinds, and entry kinds (pi.user, pi.assistant, pi.system, pi.tool-result, pi.reset, pi.compaction, pi.agent, pi.provider, pi.live, pi.inbox, pi.usage, pi.generation, pi.tool). Nothing enforces this and reusing one collides with harness behavior.
  • A storage error ends the harness. The failing call rejects, every later call and pending wait rejects with SessionFailed, watches end with session_failed, and onReport gets the error once. Nothing is retried; reopen to recover and resubmit with the same requestId. An invalid request fails only that call (StorageRequestError), and your own code fails only its own unit.
  • Documents are addressed by kind, not by object. Kinds and visible names are persisted protocol: a value migration cannot rename a kind (copy and retire), and a stored version newer than the code, or older without migrate, fails access. Only a typed tx.doc() creates an absent document.
  • Values from snapshot(), document states, and watches are tracked containers. Never mutate them; copy first. A watch keeps at most 100 undelivered frames before collapsing into one full-value replacement, so a consumer that must see every transition has to journal it itself.
  • Extensions are selected whole. Hooks and wrappers apply only where their extension is selected, so a conversation that selects tools as an explicit array and omits a guard runs without it. Wrappers are pure; uninstalling an extension stops new use but does not free resources of a running call.
  • Prompt sections must be stable. A section whose text changes without a real content change (a clock, a random value) appends a pi.system entry on every request and defeats provider prompt caching. Settings can be getters: they are read at every use and never stored.
  • The API is experimental, and the Pico5 specification is a design document. Read references/durable-guide.md for behavior, references/durable-spec.md when a rule matters, and section 12 (API footguns) of the spec before shipping.

Mitgelieferte Dateien

Das Modell liest diese Dateien bei Bedarf, während der Skill geladen ist. Sie werden als lesbare Dateien bereitgestellt und niemals ausgeführt.

Häufig gestellte Fragen

Was macht der KI-Skill Pi Durable Dev Rules?

Developer reference for building applications, tools, and agents on the Pi Durable agent harness (@earendil-works/pi-durable) and the pi-ai model layer. Use when writing or debugging code that imports @earendil-works/pi-durable or pi-ai: assembling a Harness over memory/SQLite/JSONL/Durable Object storage, submitting input and waiting for answers, defining tools with TypeBox schemas and structured output, calling tools from tools, hooks and guards, durable tasks with checkpoints and ownership, subagents and child tasks, documents and migrations, code mode, tool search, per-conversation envi...

Warum Pi Durable Dev Rules in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Pi Durable Dev Rules besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Pi Durable Dev Rules in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/Agents365-ai/365-skills/tree/main/plugins/pi-durable-dev-rules/skills/pi-durable-dev-rules ein. TypingMind liest die Datei SKILL.md, bündelt die zugehörigen Dateien und installiert alles als Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Pi Durable Dev Rules nutzen?

Jedes Modell, das Sie in TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Pi Durable Dev Rules verwenden?

So viele Sie möchten. Solange ein Modell Skills unterstützt, können Sie Pi Durable Dev Rules damit verwenden – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama und weitere – alles in TypingMind mit Ihren eigenen API-Schlüsseln.

Ist der KI-Skill Pi Durable Dev Rules kostenlos?

Ja. Der Skill wird von Agents365-ai auf GitHub unter der Lizenz MIT veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: eine Datei namens SKILL.md mit einem Namen und einer Beschreibung sowie allen Skripten, Vorlagen oder Referenzdateien, die das Modell möglicherweise benötigt. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und benötigen daher weder Server noch API-Schlüssel oder Laufzeitumgebung. Sie funktionieren mit jedem Modell.

Alle

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇