All skills
jamesrochabrun avatar

/anthropic-prompt-engineer

@28ac9aa

Master Anthropic's prompt engineering techniques to generate new prompts or improve existing ones using best practices for Claude AI models.

Use this Skill: https://skilld.dev/gh/jamesrochabrun/skills/anthropic-prompt-engineer

This session only. Nothing lands on disk.

referencescommon_mistakes.md

≈728 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Common Prompt Engineering Mistakes

Learn from these common pitfalls to create better prompts.

Mistake 1: Being Too Vague

❌ Problem:

Write something about AI

Why it fails:

  • No clear scope or direction
  • Undefined output format
  • Unknown target audience
  • No length specification

✅ Solution:

Write a 500-word introduction to large language models for software developers.

Include:
- What LLMs are and how they work (high-level)
- 3 practical use cases in software development
- 1 code example of API usage
- Limitations to be aware of

Tone: Technical but accessible
Format: Markdown with headers

Mistake 2: Instruction Confusion

❌ Problem:

Here is some text about Python. It talks about lists and dictionaries.
Can you make it better and also add examples? Use clear language.

Why it fails:

  • Instructions mixed with content
  • Unclear what "better" means
  • No structural separation

✅ Solution:

<instructions>
Improve the following text by:
1. Adding 2 code examples (one for lists, one for dictionaries)
2. Simplifying complex sentences
3. Adding subheadings for each topic
</instructions>

<text_to_improve>
[original text here]
</text_to_improve>

<target_audience>
Beginner Python developers
</target_audience>

Mistake 3: No Examples (When Needed)

❌ Problem:

Extract entities from customer support tickets in a structured format.

Why it fails:

  • "Structured format" is ambiguous
  • No clarity on what entities matter
  • Different interpretations possible

✅ Solution:

<instructions>
Extract entities from customer support tickets.
</instructions>

<examples>
<example>
<input>
My order #12345 never arrived. I contacted support@example.com but no response.
</input>
<output>
{
  "order_id": "12345",
  "issue_type": "delivery",
  "contact_method": "email",
  "email": "support@example.com"
}
</output>
</example>
</examples>

<input>
[new ticket]
</input>

Mistake 4: Prompt Too Long

❌ Problem:

[5000 words of background information]
[500 words of instructions]
[1000 words of examples]

Now answer this simple question: What is the capital of France?

Why it fails:

  • Wastes tokens on irrelevant context
  • Dilutes important information
  • Slower and more expensive
  • May confuse the model

✅ Solution:

What is the capital of France?

Principle: Use minimum necessary context


Mistake 5: Not Controlling Output Format

❌ Problem:

Give me the user's information from this text.

Result: Unpredictable format - might be prose, bullet points, or inconsistent structure

✅ Solution:

<instructions>
Extract user information and return as JSON.
</instructions>

<input>
[text here]
</input>

<output_format>
{
  "name": string,
  "email": string | null,
  "phone": string | null
}
</output_format>

Source: SKILL.md on GitHub

No alerts17d5 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    The skill is a collection of educational resources and templates for prompt engineering. It contains no executable code, malicious instructions, or security vulnerabilities.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer7mo

    6 files scanned · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 28ac9aa. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 11 months ago

README badge

README badge for jamesrochabrun/skills/anthropic-prompt-engineer