itsmostafa/llm-engineering-skills/prompt-engineering
- community
Checking that the SKILL.md file is still in the repository.
Crafting effective prompts for LLMs. Use when designing prompts, improving output quality, structuring complex instructions, or debugging poor model responses.
Install
npx vskill@latest install itsmostafa/llm-engineering-skills/prompt-engineeringSKILL.md
Prompt Engineering
Prompt engineering is the practice of designing inputs that guide LLMs to produce desired outputs. Effective prompts reduce errors, improve consistency, and unlock model capabilities.
Table of Contents
- Core Principles
- Be Clear and Direct
- Use Examples (Multishot)
- Reasoning Guidance
- XML Tags
- Role Prompting
- Long Context
- Output Control
- Self-Verification
- Best Practices
- References
Core Principles
Golden rule: Show your prompt to a colleague with minimal context. If they're confused, the model will be too.
- Be explicit - State exactly what you want; never assume the model knows your preferences
- Provide context - Include what the output is for, who the audience is, and what success looks like
- Use structure - Sequential steps, XML tags, and clear formatting reduce ambiguity
- Show examples - Demonstrations outperform descriptions for complex formats
Be Clear and Direct
Treat the model as a capable but context-free collaborator. Specify:
- What the task results will be used for
- What audience the output is meant for
- What a successful completion looks like
Vague vs Specific
Sequential Steps
Use numbered lists for multi-step tasks:
Use Examples (Multishot)
Provide 3-5 diverse examples to demonstrate expected behavior. Examples reduce misinterpretation and enforce consistent formatting.
Structure
Tips
- Make examples relevant to actual use cases
- Include edge cases and potential challenges
- Vary examples to prevent unintended pattern matching
- Wrap in
<example>tags for clarity
Reasoning Guidance
For complex tasks, guide the model to reason before answering, but ask for concise conclusions or verifiable work rather than unrestricted hidden chain-of-thought.
Basic
Guided
Specify what steps to consider:
Structured (Recommended)
Separate private analysis instructions from the required answer format:
When you need auditability, ask for brief supporting rationale, calculations, cited evidence, or a checklist of checks performed. Do not require full chain-of-thought unless the target model or product explicitly supports exposing it.
XML Tags
Use XML tags to separate prompt components. This prevents instruction/content confusion and improves parseability.
Common Tags
Nested Structure
Reference Tags in Instructions
Be explicit when referring to tagged content:
Role Prompting
Set expertise context via system prompts to improve domain-specific performance.
System Prompt Pattern
Effective Roles
When to Use
- Complex analysis requiring domain expertise
- Tasks where tone/style matters (legal, medical, executive)
- When a specific perspective would improve output quality
Long Context
For prompts with large documents (20K+ tokens):
Document Placement
Place long documents at the top, before instructions:
Quote Grounding
Ask the model to cite sources before analyzing:
Multi-Document Metadata
Include source information for attribution:
Output Control
Verbosity Specification
Format Constraints
Scope Boundaries
Prevent drift from original intent:
Self-Verification
For high-stakes outputs, include verification steps:
Uncertainty Acknowledgment
Best Practices
- Start specific, then generalize - Begin with detailed prompts; relax constraints only after validating output quality
- Test with edge cases - Include unusual inputs in your evaluation to catch failure modes
- Iterate on examples - When outputs miss the mark, add an example demonstrating the correct behavior
- Separate instructions from content - Use XML tags to prevent the model from confusing your instructions with input data
- Put documents before queries - For long context, place source material at the top of the prompt
- Ask for verifiable reasoning artifacts - Prefer concise rationale, calculations, citations, or checklists over full hidden chain-of-thought
- Constrain output format explicitly - Specify structure, length, and style to reduce post-processing
- Version your prompts - Track changes to understand what modifications improved or degraded performance
- Use system prompts for role, user prompts for task - Keep role context stable; vary task instructions
- Validate with fresh eyes - Have someone unfamiliar with the task review your prompt for clarity
References
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/prompt-engineering/SKILL.md
Popularity
- Repository stars
- 16
- 7-day trend score
- 14
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/itsmostafa/llm-engineering-skills/prompt-engineering)