Prompt engineering

From grandamenium/cortextos · View interactive version

Prompt engineering is an AI agent skill from the GitHub repository grandamenium/cortextos. Techniques for writing effective prompts for Claude. Covers structured outputs, chain of thought, few-shot examples, and system prompt design.

How to use this skill

Skill file

Prompt Engineering

Techniques for getting the best results from Claude.

Core Techniques

Be Specific and Direct

Bad: "Tell me about dogs"

Good: "List the top 5 dog breeds for apartment living, with a one-sentence reason for each"

Use XML Tags for Structure

<context>
You are a customer support agent for Acme Corp.
</context>

<instructions>
Respond to the customer query below. Be helpful but concise.
</instructions>

<query>
{{customer_message}}
</query>

Chain of Thought

Think through this step by step:
1. First, identify the key variables
2. Then, set up the equation
3. Finally, solve and verify

Few-Shot Examples

Here are examples of the format I want:

Input: "The food was great but service was slow"
Output: {"sentiment": "mixed", "food": "positive", "service": "negative"}

Input: "Everything was perfect!"
Output: {"sentiment": "positive", "food": "positive", "service": "positive"}

Now analyze: "{{input}}"

Structured Output with Prefill

Start Claude's response to force a format:

messages=[
    {"role": "user", "content": "Extract the name and age from: 'John is 30'"},
    {"role": "assistant", "content": '{"name": "'}
]

System Prompt Design

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.