Meta-Prompt
A prompt that writes a prompt (or a plan, or a
spec): a reusable, templated instruction that takes a small request and
expands it into a large, structured artifact an agent then executes. The
template carries fixed scaffolding written exactly as it must
appear, plus labelled placeholders —
<requested content> slots you replace, and
conditional
<if task_type is feature or complexity is medium/complex, include these sections:>
blocks that expand only when relevant. The meta-prompt author fixes the
shape of good output; the invocation fills the
content. Because the artifact is one file (e.g. a Claude Code
slash command like plan_w_team.md), it is deployed over and
over — "it only takes one time to build out a great [prompt]" and it
"gives value every single time" (see Reusable Workflow
Library).
Concretely: plan_w_team.md takes two arguments — a
USER_PROMPT (what to build) and an
ORCHESTRATION_PROMPT (how to staff and sequence the team) —
and generates a full implementation plan with
## Task Description, ## Objective,
## Relevant Files, ## Step by Step Tasks,
## Acceptance Criteria, ## Team Orchestration,
and ### Team Members. A Stop hook then runs
validators that assert the generated plan actually contains
those required sections before the plan is accepted — the meta-prompt's
output format is enforced, not merely requested.
The template is instructing an agent to build the plan "as you would" — teaching the primary agent how to produce the artifact, so the leverage compounds: you author the generator once and it produces well-shaped specs on demand.
Claims
- A meta-prompt fixes the shape of good output as an enforced template and fills only the request-specific content per invocation. principle — durable: separating the stable structure (written exactly) from the variable content (placeholders) is what makes a prompt reusable rather than a one-off.
- Template with explicit placeholders and conditional
sections: replace
<requested content>, write everything else verbatim, expand<if …>blocks only when the condition holds. best practice — context: authoring reusable prompt/plan generators; the discipline of "exact-except-in-marked-slots" is what keeps generated artifacts well-formed, and it's contingent on the consuming agent honoring the format. - Enforce the meta-prompt's output format with a validator (e.g. a Stop hook that checks the artifact contains the required sections) rather than trusting the generation. best practice — context: pipelines where a downstream agent depends on the artifact's structure; the check buys reliability at the cost of the hook plumbing, and is worth it when malformed output would silently break the next stage.
- Authoring the generator once amortizes across every future invocation — build the reusable prompt, not the one-off. observation — the value case for meta-prompting is reuse; a single-use expansion doesn't justify the templating overhead.
- A higher-order prompt (HOP) is a meta-prompt that takes
another prompt as a parameter — "a function that takes a function as an
argument" — wrapping an arbitrary inner prompt in a fixed execution
shell. best practice
— context: reusing one consistent workflow (parse → load → execute →
save receipts) across many concrete task-prompts; the stable shell goes
in the higher-order prompt and the variable steps in the passed-in
lower-order prompt. A second independent source (IndyDevDan's
hop_automatefor browser automation) demonstrates the shape. It is a sibling of the expand-a-request meta-prompt, not a replacement. - "Meta-agentics" are the family of generators that build agentics — a meta-skill that builds skills, a meta-prompt that builds prompts, a meta-agent that builds agents (plus a meta-prime); author the generator once and reuse it everywhere. best practice — context: operators building specialized agentics at scale; a second independent source (IndyDevDan) keeps meta-agent/meta-prime/meta-prompt/meta-skill as first-class reusable artifacts and templates his ~800-line prompt format into the meta-prompt so every generated prompt is identical across devices, teammates, and agents. Corroborates the "author the generator once" thesis and is why such generators are the artifacts most worth distributing identically. See Agentic Distribution.
Related
- Reusable Workflow Library — a meta-prompt is a reusable workflow artifact; a slash command is how it's cataloged and re-invoked.
- Spec-Driven Development — the meta-prompt's output is a spec/plan; meta-prompting is one way to generate the spec that SDD then implements against.
- Agent Task Graph — the plan a
meta-prompt generates is where the team's task graph is declared
(
## Team Orchestration,### Team Members). - Agent Supervision — the Stop-hook format check is automated review of an agent's output before it's accepted.
- Layered Agentic Architecture — meta-prompts (incl. HOPs) live in the command / orchestration layer that staffs and drives the sub-agent team.
- Agentic Distribution — meta-agentics (the generators) are the artifacts most worth distributing identically across every device, teammate, and agent.
- Distillate: Claude Code Task System: Orchestrating a Team of Agents Through a Task Graph
- Distillate: My
4-Layer Claude Code + Playwright CLI Skill (Agentic Browser Automation
& UI Testing) — the higher-order prompt
(
hop_automate), a meta-prompt that takes a prompt as a parameter. - Distillate: The Library Meta-Skill: How I Distribute Private Skills, Agents and Prompts — meta-agentics (meta-agent/meta-prime/meta-prompt/meta-skill) as first-class, distributable generators.
Linked from
- Agent Rituals
- Agent Task Graph
- Agentic Distribution
- Claude Code Task System: Orchestrating a Team of Agents Through a Task Graph
- Finally. Agent Loops Clearly Explained. — loop engineering, decoded for the rest of us
- This Week
- Intent Context
- Layered Agentic Architecture
- Loop Engineering
- My 4-Layer Claude Code + Playwright CLI Skill (Agentic Browser Automation & UI Testing)
- Reusable Workflow Library
- Spec-Driven Development
- The Library Meta-Skill: How I Distribute Private Skills, Agents and Prompts