Prompting Patterns
# Prompting Patterns
Effective prompting is essential for AI-assisted engineering.
This playbook uses structured prompts.
---
# Prompt Structure
A good prompt typically contains:
1. Context
2. Objective
3. Constraints
4. Expected output format
5. Validation criteria
---
# Example Prompt
Context:
We are implementing a REST API using Fastify.
Objective:
Create an endpoint to retrieve a list of users.
Constraints:
Follow repository structure and validation rules.
Output:
Provide a TypeScript implementation.
---
# Why This Works
Structured prompts provide clarity and reduce hallucinations.
The AI understands both the environment and the expected output.when to use it
Community prompt sourced from the open-source GitHub repo SD-Khan/ai-assisted-engineering-playbook (MIT). A "Prompting Patterns" 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
codingcommunitydeveloper
source
SD-Khan/ai-assisted-engineering-playbook · MIT
more in Coding
Coding✓ tested
Senior code review (strict mode)
senior staff engineer running a merciless but fair review
Coding✓ tested
Debug by hypothesis, not by guessing
debugging partner who forms theories before touching code
Coding✓ tested
Generate tests from described behavior
test engineer who writes tests that would actually catch regressions