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:
~/.eispatchis created with mode0700. - Locking: writers create
library.json.lock. A writer waits up to 3 seconds, then fails withTimed out waiting for library lock. A lock older than 10 seconds is treated as stale and removed. - Sanitization: capability
descriptionandinstructionfields 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.
projectKeyisproj:<canonical path>(lowercased on Windows) andprojectNameis the folder name. Without a workspace path, the project isgeneral/ 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 getUntitled 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
breakdownwhen the prompt has tasks.
Library actions
Import rules
- Entries without
originalPromptare skipped. If none remain, import fails withNo prompt entries found in imported JSON. - An incoming
idis kept if it is not already used; otherwise a newpr_ID is generated. Existing entries are never overwritten. - Missing
projectKey,projectName, andcategorydefault togeneral,General, andGeneral. - 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 bycapabilityId with capabilities discovered in the current host. The result is { valid, missingCapabilities, entry }:
missingCapabilitieslists each unavailable capability once, as{ capabilityId, kind, label, scope }.scopeispromptor the task title.- Each capability in the returned entry gets
available, andenforceableis taken from the live host (orfalseif the capability is missing).
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.