Skip to main content
The Prompt Library (core/library.mjs, library version 1.1) stores composed prompts on your machine so you can reuse them across sessions and hosts. Entries do not include approval tokens; loading an entry always returns the composer to Draft.

Storage

The library is a single JSON file at ~/.eispatch/library.json with the shape { version, updatedAt, entries }.
  • Atomic writes: data is written to a temporary file (mode 0600) and renamed over the library file.
  • Directory: ~/.eispatch is created with mode 0700.
  • Locking: writers create library.json.lock. A writer waits up to 3 seconds, then fails with Timed out waiting for library lock. A lock older than 10 seconds is treated as stale and removed.
  • Sanitization: capability description and instruction fields pass through pattern-based redaction of URLs and common credential formats before they are saved. Prompt text is stored as written.

Hierarchy

  • Project: from the workspace path. projectKey is proj:<canonical path> (lowercased on Windows) and projectName is the folder name. Without a workspace path, the project is general / General. The General project is listed last.
  • Category: defaults are UI & Frontend, Testing & QA, Architecture & Refactoring, Documentation, Research & Analysis, Automation & Tooling, and General. Categories are sorted alphabetically; prompts within a category are sorted by most recently updated.

Suggested metadata

When you save, EISPATCH suggests (and you can change):
  • Title: the first clause of the prompt (trigger prefix removed), up to 6 words; longer than 48 characters is truncated with …. Empty prompts get Untitled Prompt.
  • Category: the category whose keywords (English and some Nepali) appear most often in the prompt, otherwise General.
  • Tags: up to 4 distinct words of 3 or more characters that are not stop words, plus breakdown when the prompt has tasks.

Library actions

Import rules

  • Entries without originalPrompt are skipped. If none remain, import fails with No prompt entries found in imported JSON.
  • An incoming id is kept if it is not already used; otherwise a new pr_ ID is generated. Existing entries are never overwritten.
  • Missing projectKey, projectName, and category default to general, General, and General.
  • Tasks and capabilities are normalized and sanitized the same way as on save.

Capability validation

When an entry is loaded, its capabilities (prompt-level and per task) are compared by capabilityId with capabilities discovered in the current host. The result is { valid, missingCapabilities, entry }:
  • missingCapabilities lists each unavailable capability once, as { capabilityId, kind, label, scope }. scope is prompt or the task title.
  • Each capability in the returned entry gets available, and enforceable is taken from the live host (or false if the capability is missing).
Validation only reports; it does not change or run anything.

Entry schema

The library is shared across hosts on the same machine. A prompt saved in Antigravity can be loaded in Codex, Claude Code, or OpenCode, and validation will report any capabilities that host does not have.