prompt-engineering
minagayid/Agents/skills/library/prompt-engineering/SKILL.md
Design, refine, and debug LLM prompts for reliable, structured outputs. Use when the user asks to write a prompt, improve prompt reliability, reduce hallucination, or get structured output.
Skill1 starsChanged 3 months ago
What's in it
- Prompt Engineering
- Structure a prompt
- Techniques
- Debugging
- Guidelines
---
name: prompt-engineering
description: Design, refine, and debug LLM prompts for reliable, structured outputs. Use when the user asks to write a prompt, improve prompt reliability, reduce hallucination, or get structured output.
---
# Prompt Engineering
Craft prompts that get reliable, well-shaped results from an LLM.
## Structure a prompt
1. **Role / context** — who the model is and the task's purpose.
2. **Task** — a single, specific instruction. Split unrelated tasks.
3. **Inputs** — clearly delimited (XML tags, fenced blocks) and separated from instructions.
4. **Constraints** — length, tone, what to avoid, how to handle unknowns ("say 'unknown' if not stated").
5. **Output format** — exact schema; ask for JSON/keys explicitly when parsing downstream.
6. **Examples** — 1–3 few-shot examples covering the tricky/edge cases (huge reliability lever).
## Techniques
- **Be specific.** Vague prompts get vague answers; state exactly what "good" looks like.
- **Let it think.** For reasoning tasks, allow step-by-step working before the final answer.
- **Ground it.** Provide the source material and instruct "answer only from the context above" to
cut hallucination; ask for citations/quotes.
- **Structured output.** Give a schema and one example; consider tool/function calling or a
constrained-decoding library (e.g. Instructor) for guaranteed shapes.
- **Set an escape hatch.** Tell the model what to do when it can't comply, so it doesn't invent.
## Debugging
- Isolate failures: is it comprehension, formatting, or knowledge? Fix the right layer.
- Test on a small labeled set; change one thing at a time; keep a prompt changelog.
- Watch for prompt injection when inputs are untrusted — keep instructions and data separated.
## Guidelines
- Prefer the simplest prompt that works; add structure only where it earns its keep.
- Provider-specific: for Anthropic/Claude specifics, consult the `claude-api` skill.
More agent context in minagayid/Agents
25 other files this repository gives its agents.
Skill
- agent-project-scaffoldskills/agent-project-scaffold/SKILL.md
- accessibility-auditskills/library/accessibility-audit/SKILL.md
- changelog-keeperskills/library/changelog-keeper/SKILL.md
- code-review-checklistskills/library/code-review-checklist/SKILL.md
- conventional-commitsskills/library/conventional-commits/SKILL.md
- data-cleaningskills/library/data-cleaning/SKILL.md
- debugging-methodologyskills/library/debugging-methodology/SKILL.md
- dependency-auditskills/library/dependency-audit/SKILL.md
- dockerfile-authorskills/library/dockerfile-author/SKILL.md
- exploratory-data-analysisskills/library/exploratory-data-analysis/SKILL.md
- github-actions-ciskills/library/github-actions-ci/SKILL.md
- incident-postmortemskills/library/incident-postmortem/SKILL.md
- kubernetes-manifestskills/library/kubernetes-manifest/SKILL.md
- pr-descriptionskills/library/pr-description/SKILL.md
- react-componentskills/library/react-component/SKILL.md
- readme-generatorskills/library/readme-generator/SKILL.md
- refactoringskills/library/refactoring/SKILL.md
- rest-api-designerskills/library/rest-api-designer/SKILL.md
- secure-coding-reviewskills/library/secure-coding-review/SKILL.md
- sql-optimizerskills/library/sql-optimizer/SKILL.md
- technical-writingskills/library/technical-writing/SKILL.md
- terraform-moduleskills/library/terraform-module/SKILL.md
- threat-modelskills/library/threat-model/SKILL.md
- unit-test-writerskills/library/unit-test-writer/SKILL.md
- web-performanceskills/library/web-performance/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.

