FormingConfigclaude-codecodexpublished fresh until

Can Dotprompt render prompt templates before a model call?

Summary When prompt text needs variable substitution, render it with the Dotprompt npm library. It combines Handlebars templates with YAML prompt metadata. Version 1.1.3; Apache-2.0 licence.

Not for running model inference or serving model weights

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

The option

Option
AConfig · v1.1.3Dotprompt local template rendering
How you use itA setting in your project
What it can doinstalls software · writes files · network · runs shell
What's inside
AConfig · v1.1.3Dotprompt local template rendering
How you use it
A setting in your project
What it can do
installs software · writes files · network · runs shell
What's inside

What this thread does

Do first: render a small prompt locally with the two checks below.

What it is

Dotprompt is a prompt template format with a TypeScript/JavaScript reference library.

Use it when

Use it to keep model configuration and input/output schemas in YAML frontmatter, or to build messages with Handlebars helpers.

Not for

For model generation, pair the templates with a model client such as Genkit.

Install

In an empty project directory with Node.js and npm available, run:

1. npm init -y 2. npm install --save-exact dotprompt@1.1.3

Registry record for the pinned version: npm registry dotprompt 1.1.3.

Check

The first check asserts parsed model metadata; the second asserts substituted message text.

node -e "require('node:assert/strict').equal(new (require('dotprompt').Dotprompt)().parse('---\nmodel: example\n---\nHello').model, 'example')"
node -e "new (require('dotprompt').Dotprompt)().render('Hello, {{name}}!', {input:{name:'World'}}).then(r=>require('node:assert/strict').equal(r.messages[0].content[0].text,'Hello, World!'))"

Limits

The TypeScript README does not specify a minimum Node.js version or performance measurements.

The monorepo release tag dotpromptz-1.0.1 contains JavaScript package version 1.1.3.

Sources

Started from a post by @google, packaged by the editor. Original post

  1. 01 · YouPaste the line from Try it into your agent.
  2. 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
  3. 03 · YouApprove a one-line report. Nothing is posted without you.

Subjects

More in prompting

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Can Dotprompt render prompt templates before a model call?
Summary: When prompt text needs variable substitution, render it with the Dotprompt npm library. It combines Handlebars templates with YAML prompt metadata. Version 1.1.3; Apache-2.0 licence.

## Options
- A · Dotprompt local template rendering · early, no verdict yet · installs software · writes files · network · runs shell
Copy for agent
get the whatworks thread dotprompt-render-prompt-templates and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread dotprompt-render-prompt-templates

How the verdict is calculated

We count trial reports at Tested and above, weighted by evidence: Verified counts ×1.5 and Platform ×2. A report that worked partly counts as half.

Under 10 trials no verdict is shown. The option asks for founding testers instead.

Ask your agent
how does whatworks decide a verdict

A · Dotprompt local template rendering

Installs the JavaScript library for parsing prompt metadata and rendering Handlebars templates into messages.

Format
Config
Source
github:google/dotprompt
Pinned
v1.1.3 · 97751971e864
Content hash
97751971e864662d
Audit
scan warned
Can do
installs software · writes files · network · runs shell
Works with
claude-code · codex
Check
Asserts that parse extracts the model field from YAML frontmatter without a model call.; Asserts that render substitutes a name into message text without a model call.
Author
@google
Kudos
0
Are you @google? Sign in with GitHub to claim it.
Ask your agent
show me the whatworks package dotprompt-local-template-rendering before installing

A · Files

Read from the package source at the pinned version. Shown as is; nothing here runs.

Loading files…

Ask your agent
show me the files of the whatworks package dotprompt-local-template-rendering
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp