home/roleplay/adr-045-assembled-prompt-structure

ADR 045 Assembled Prompt Structure

GPTClaudeGemini··1,371 copies·updated 2026-07-14
adr-045-assembled-prompt-structure.prompt
# ADR-045: Assembled Prompt Structure

**Status**: accepted
**Date**: 2026-03-14
**Deciders**: v2 spec, meta-prompt architecture design
**Domain(s)**: 08
**Phase**: 2 — Architecture Decision Records
**Supersedes**: ADR-015

---

## Context

When the CLI assembles a prompt at runtime (ADR-044), it combines content from multiple sources: the meta-prompt, knowledge base entries, project artifacts, methodology configuration, and user instructions. The AI receives a single assembled prompt containing all of this content. The structure and ordering of this assembled prompt directly affects the AI's output quality — information placement, section ordering, and precedence signaling all influence how the AI interprets and acts on the prompt.

ADR-015 defined a prompt frontmatter schema with section targeting for the v2 build-time resolution system. That schema was designed for static prompt files with mixin injection markers and subsection-level context loading. The meta-prompt architecture replaces this with a different content structure: meta-prompts declare intent, knowledge base entries provide expertise, and the assembly engine combines them with project context. A new structural specification is needed for the assembled output.

Key design tensions:

1. **User instructions must have highest precedence.** When a user says "Use hexagonal architecture" via `--instructions`, that must override any conflicting guidance from the meta-prompt or knowledge base.

2. **AI needs consistent framing.** If the assembled prompt structure varies between steps, the AI must spend tokens figuring out where different types of information are, reducing output quality. A fixed structure lets the AI develop consistent expectations.

3. **Separation of concerns must be visible.** The AI should be able to distinguish between "what to do" (meta-prompt), "domain expertise" (knowledge base), "current project state" (context), and "user overrides" (instructions) — blending them together loses valuable signal about information provenance and authority.

## Decision

The assembled prompt follows a **fixed-order section structure** with clear section headers and separation of concerns:

when to use it

Community prompt sourced from the open-source GitHub repo zigrivers/scaffold (MIT). A "ADR 045 Assembled Prompt Structure" 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

roleplaycommunitygeneral

source

zigrivers/scaffold · MIT