Appearance
Prompt Engineering
Patterns for structuring prompts and workflows that keep AI agents focused, verifiable, and on track. Each sub-file covers a distinct technique for guiding agent behavior.
Topics
- Prompt Structure: Structural template and core principles for writing effective prompts. Covers the eight-section template, three core moves (preferred mistakes, order of operations, positive instructions), mechanical levers like delimiters and few-shot examples, and system/user message placement for API calls. Use when drafting or revising any prompt.
- Target Convergence Prompt: Prompt pattern that defines acceptance criteria and a convergence loop so agents iterate until the end state is met. Use when writing prompts for tasks that need self-correcting iteration.
- Adaptive Goal Decomposition: Extend the target convergence pattern with on-demand subgoals so agents decide dynamically whether to work directly or decompose. Use when goals have criteria too broad to satisfy in a single pass.
- Task List: Structured task files with ordered steps, verification checks, and execution notes for multi-session continuity. Use when organizing agent work into trackable, resumable units.
- Session Continuity Protocol: File-based protocol using TASKS.md, LOG.md, and git commits to maintain perfect continuity across agent sessions. Use when designing prompts for agents that work across multiple independent sessions.
- Test Plan as Spec: Embed test code directly in acceptance criteria so the test plan and feature spec are the same document. Use when writing specs that must stay in sync with tests — eliminates spec/test drift by making duplication impossible.
- Structured Prompt Template: Six-section template (frontmatter, purpose, variables, instructions, workflow, report) for production-ready prompts with dynamic variables. Use when creating reusable prompt files that need a consistent structure and clear input/output contracts.
- Work Tracking: WORK.md conventions for tracking parallel workstreams across git worktrees with session logs and handoff protocols. Use when managing multi-session agent work in worktrees.
See also
- Coding Agents: Setup, configuration, and environment for the AI agents these prompts target.
- Evals: Testing agent behaviors with simulated user conversations to verify prompt effectiveness.