Prompt Engineering Patterns
Relevant source files
The following files were used as context for generating this wiki page:
Prompt engineering patterns within this repository define the structural and behavioral boundaries for agentic AI systems. These patterns establish a common language for task orchestration, tool utilization, and state management, ensuring that AI assistants operate predictably within complex software engineering environments. The primary focus is on transforming high-level user intent into verifiable technical actions through systematic planning and execution cycles.
The patterns utilize "modes" (such as Planning, Execution, and Verification) and "artifacts" (like implementation plans and task lists) to maintain context and track progress across long-running autonomous sessions. Sources: Google/Antigravity/planning-mode.txt, Amp/gpt-5.yaml, Kiro/Spec_Prompt.txt
Agentic Workflow Patterns
AI agents in this project follow structured workflows to ensure reliability. A recurring pattern is the separation of discovery, planning, and implementation.
Phase-Based Execution
Agents often operate in distinct modes to minimize errors during complex refactors or feature additions.
| Mode | Purpose | Key Artifacts |
|---|---|---|
| Planning | Research codebase, define requirements, and design approach. | implementation_plan.md, requirements.md |
| Execution | Apply code changes, create files, and implement logic. | Source code, tasks.md |
| Verification | Run tests, linting, and manual validation. | walkthrough.md, test logs |
Sources: Google/Antigravity/planning-mode.txt, Kiro/Spec_Prompt.txt
Task Management and TODOs
Agents use internal or external "TODO" files to manage state. This pattern prevents the agent from losing track of sub-tasks during high-latency operations or multi-file edits.
The diagram shows the standard loop where agents verify each incremental change before proceeding. Sources: Amp/gpt-5.yaml:160-190, Qoder/Quest Action.txt:40-60, Anthropic/Claude Code/Prompt.txt:85-110
Tool Utilization Patterns
Prompt patterns dictate how agents interact with the host system via tools. A primary goal is maximizing efficiency through parallel execution and minimizing redundant reads.
Parallel Execution Policy
Independent read or search operations are batched to reduce total latency. For example, reading three separate files should happen in a single turn rather than three sequential turns.
- Allowed Parallelism:
read_file,grep_code,list_dir,search_codebase. - Required Serialization: File writing (
edit_file,search_replace) and terminal commands (run_in_terminal) must be sequential to prevent race conditions or inconsistent states.
Sources: Amp/gpt-5.yaml:80-110, Qoder/Quest Design.txt:120-140, Same.dev/Prompt.txt:70-90
Context Retrieval Strategies
Agents utilize specific tools based on the nature of the query:
- Symbol Search: Used when the query contains actual code identifiers (PascalCase/camelCase).
- Semantic Search: Used for functional descriptions (e.g., "how authentication works").
- Discovery Pass: A broad read-only scan of context before making any logical tool groups.
Sources: Qoder/Quest Design.txt:240-260, Cursor Prompts/Agent CLI Prompt 2025-08-07.txt:60-70
Documentation and Design Patterns
The "Spec Driven Development" pattern involves using AI to document a feature before a single line of code is written. This ensures architectural integrity and user alignment.
Structured Design Documents
When generating design wikis or documentation, the patterns enforce specific templates based on the project type:
- Backend: Focuses on API endpoints, Data Models, and Business Logic layers.
- Frontend: Focuses on Component Architecture, State Management, and Styling Strategy.
- CLI Tools: Focuses on Command Reference and Configuration Files.
Sources: Qoder/Quest Design.txt:320-450
The EARS Format for Requirements
Requirements are often structured using the EARS (Easy Approach to Requirements Syntax) pattern:
- Pattern:
WHEN [event] THEN [system] SHALL [response] - Purpose: To provide unambiguous criteria for agent implementation and verification.
Sources: Kiro/Spec_Prompt.txt:215-240
Verification and Safety Patterns
To ensure high-quality output, agents are prompted with strict verification "gates."
Mandatory Validation Loop
Every code change must be followed by a diagnostic check. The agent is prohibited from marking a task as complete until the code passes these checks.
Communication Constraints
Agents follow "Identity" and "Concision" patterns to maintain professional interaction:
- Tone: Concise, direct, and professional; avoid filler phrases like "Okay, I will now..."
- Identity: Never disclose the specific underlying Language Model (e.g., GPT, Claude) or compare models.
- Sensitive Topics: Refuse discussion on personal, emotional, or malicious code topics.
Sources: Qoder/Quest Design.txt:60-90, Anthropic/Claude Code/Prompt.txt:50-80, Open Source prompts/Gemini CLI/google-gemini-cli-system-prompt.txt:120-140
Conclusion
Prompt Engineering Patterns in this repository move AI assistants from simple chat interfaces to reliable software engineering collaborators. By enforcing strict planning modes, parallel tool utilization, and mandatory verification loops, the system ensures that autonomous changes remain technically accurate and aligned with the project's existing conventions.