packages/prompts/README.md
Shared prompt templates and action specs for elizaOS.
This package is the single source of truth for prompt templates used by the runtime. Prompts are authored directly in src/index.ts.
packages/prompts/
├── src/
│ └── index.ts # TypeScript prompt template exports
├── specs/ # Merged action/provider specs (JSON) + generated plugins.generated.json
└── scripts/ # Spec + docs generators
├── generate-action-docs.js
├── generate-plugin-action-spec.js
├── prompt-compression.js
└── check-secrets.js
Prompts use Handlebars-style variables:
{{variableName}} - simple variable substitution{{#each items}}...{{/each}} - iteration{{#if condition}}...{{/if}} - conditionalUse camelCase for variables ({{agentName}}, {{providers}}, {{recentMessages}}).
prompts/*.json (under plugins/**)Some plugins keep hand-edited actions.json / evaluators.json / providers.json next to their source. Those files feed per-plugin codegen (for example generated/specs/spec-helpers.ts via each plugin’s own workflow). They are not inputs to scripts/generate-plugin-action-spec.js, which instead scans plugins/**/*.ts for export const …: Action blocks and writes specs/actions/plugins.generated.json.
# Generate plugin action spec + action docs
bun run build
import { REPLY_TEMPLATE, CHOOSE_OPTION_TEMPLATE } from "@elizaos/prompts";
const prompt = composePrompt({
state: { agentName: "Alice" },
template: REPLY_TEMPLATE,
});
camelCaseTemplate string export in src/index.ts.UPPER_SNAKE_CASE_TEMPLATE export.# Task: to state the objective.{{providers}} where provider context should be injected.{{apiKey}}, {{userEmail}}) and inject only the minimum needed at runtime.bun run check:secrets
Scans packages/prompts/src/**/*.ts, plugin prompt TS modules (paths matching prompts/**/*.ts, workflow-prompts/**/*.ts, etc.), and a few explicit files — see scripts/check-secrets.js.