Prompt engineering

From giuseppe-trisciuoglio/developer-kit · View interactive version

Prompt engineering is an AI agent skill from the GitHub repository giuseppe-trisciuoglio/developer-kit. Provides workflows to write, debug, and optimize prompts for LLMs, including few-shot example selection, chain-of-thought structuring, system prompt design, and template composition. Use when the user asks to write or improve a prompt, wants help with few-shot examples, chain-of-thought, system prom

How to use this skill

Skill file

Prompt Engineering

Overview

Use this skill to design prompt systems that are clear, testable, and reusable.

It covers prompt drafting, optimization, evaluation, and production-oriented

patterns for few-shot prompting, reasoning workflows, templates, and system

prompts.

Keep the main workflow in this file and load the targeted reference files only

for the pattern you are applying.

When to Use

Use this skill when:

Read the relevant files in references/ when you need deeper guidance on a

specific pattern.

Core Patterns

1. Few-Shot Learning

Example Selection Strategy
Few-Shot Example (Sentiment Classification)
Classify the sentiment as Positive, Negative, or Neutral.

Text: "I love this product! It exceeded my expectations."
Sentiment: Positive
Reasoning: Enthusiastic language, positive adjectives, satisfaction

Text: "The app keeps crashing when I upload large files."
Sentiment: Negative
Reasoning: Complaint about functionality, frustration indicator

Text: "It arrived on time, as described."
Sentiment: Neutral
Reasoning: Factual statement, no strong emotion either way

Text: "{user_input}"
Sentiment:
Reasoning:

2. Chain-of-Thought Reasoning

Implementation Patterns
CoT Template Structure
Let's approach this step-by-step:

Step 1: {break_down_the_problem}
Analysis: {detailed_reasoning}

Step 2: {identify_key_components}
Analysis: {component_analysis}

Step 3: {synthesize_solution}
Analysis: {solution_justification}

Final Answer: {conclusion_with_confidence}

3. Prompt Optimization

Optimization Process

Track these metrics: accuracy, consistency, token efficiency, robustness, safety. See references/optimization-frameworks.md for measurement utilities.

4. Template Systems

Template Design Principles
Template Structure Example
# System Context
You are a {role} with {expertise_level} expertise in {domain}.

# Task Context
{if background_information}
Background: {background_information}
{endif}

# Instructions
{task_instructions}

# Examples
{example_count}

# Output Format
{output_specification}

# Input
{user_query}

5. System Prompt Design

System Prompt Components
System Prompt Framework
You are an expert {role} specializing in {domain} with {experience_level} of experience.

## Core Capabilities
- List specific capabilities and expertise areas
- Define scope of knowledge and limitations

## Behavioral Guidelines
- Specify interaction style and communication approach
- Define error handling and uncertainty protocols
- Establish quality standards and verification requirements

## Output Requirements
- Specify format expectations and structural requirements
- Define content inclusion and exclusion criteria
- Establish consistency and validation requirements

## Safety and Ethics
- Include content policy adherence
- Specify bias mitigation requirements
- Define harm prevention protocols

Implementation Workflows

Workflow 1: Create New Prompt from Requirements

  1. Analyze Requirements
  1. Select Pattern Strategy
  1. Draft Initial Prompt
  1. Validate and Test

Workflow 2: Optimize Existing Prompt

  1. Performance Analysis
  1. Optimization Strategy
  1. Implementation and Testing

Workflow 3: Scale Prompt Systems

  1. Modular Architecture Design
  1. Production Integration

Quality Gates

Best Practices

Constraints and Warnings

Integration with Other Skills

This skill integrates seamlessly with:

Resources and References

Common Pitfalls and Solutions

| Pitfall | Fix |

|---|---|

| Wrong output format | Add a concrete output example at the end of the prompt |

| Inconsistent answers | Add 2-3 few-shot examples showing expected reasoning |

| Hallucination | Add "If unsure, say 'I don't know'" + constrain the answer domain |

| Too verbose | Add explicit word/sentence limit + "Be concise" instruction |

| Missed edge cases | Add an edge-case few-shot example |

Constraints

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.