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}}- conditional
Use camelCase for variables ({{agentName}}, {{providers}}, {{recentMessages}}).
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 buildimport { REPLY_TEMPLATE, CHOOSE_OPTION_TEMPLATE } from "@elizaos/prompts";
const prompt = composePrompt({
state: { agentName: "Alice" },
template: REPLY_TEMPLATE,
});- Add a
camelCaseTemplatestring export insrc/index.ts. - Add the paired
UPPER_SNAKE_CASE_TEMPLATEexport.
- Start with a task description — begin prompts with
# Task:to state the objective. - Include providers placeholder — use
{{providers}}where provider context should be injected. - Use JSON output format — standardize on JSON response format for consistent parsing.
- Add clear instructions — explicit instructions for the LLM.
- End with output format — always specify the expected output format.
- Do not embed real secrets in prompt templates. Prompts are source-controlled.
- Avoid including PII (emails, phone numbers, addresses, IDs) in templates or examples.
- Prefer placeholders (e.g.,
{{apiKey}},{{userEmail}}) and inject only the minimum needed at runtime.
bun run check:secretsScans 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.