home/writing/prompt-ast

Prompt Ast

GPTClaudeGemini··1,273 copies·updated 2026-07-14
prompt-ast.prompt
# Prompt AST

> Read this when your prompt has more than one shape (per-tenant, per-language, per-audience) and string concatenation is starting to drift.

Prompts are structured data, not strings. That matters the moment `SummarizeArticle` has to ship in more than one shape — a different audience per tenant, a different language per region, a different tone template for a B2B vs consumer card. Building those variants by string-concatenating a monolithic prompt leads to silent drift across environments. The AST gives you typed nodes (`system`, `rule`, `section`, `example`, `user`) that compose, diff, and snapshot-test cleanly.

Available node types:

when to use it

Community prompt sourced from the open-source GitHub repo justi/ruby_llm-contract (MIT). A "Prompt Ast" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.

tags

writingcommunitygeneral

source

justi/ruby_llm-contract · MIT