prompt-engineering

Craft optimized prompts for large language models with structured techniques.

53|1|Updated Dec 18, 2025
One-click install
npx skills add https://github.com/cosmix/claude-code-setup --skill prompt-engineering-cosmix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prompt-engineering
Source: https://github.com/cosmix/claude-code-setup/tree/main/skills/prompt-engineering
Command: npx skills add https://github.com/cosmix/claude-code-setup --skill prompt-engineering-cosmix

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill covers crafting prompts for LLMs to improve consistency, usefulness, and reliability of results.

Core Features & Use Cases

  • Prompt Techniques: Chain-of-thought, few-shot, role prompts, and formatting.
  • Iteration & Testing: Refine prompts with failure analysis and examples.
  • System Prompts: Create robust system prompts for code assistants and chatbots.

Quick Start

Write a prompt to extract structured product data from a free text description with a JSON output.

Frequently Asked Questions about prompt-engineering

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write prompts that consistently produce reliable outputs from language models?

Craft prompts with clear task definitions, structured context, explicit constraints, and examples. Use techniques like chain-of-thought reasoning and few-shot learning to guide the model toward consistent, high-quality results across summarization, coding, classification, and other domains.

What's the difference between chain-of-thought and few-shot prompting?

Chain-of-thought prompts ask models to show reasoning steps before answering, improving accuracy on complex tasks. Few-shot prompting provides input-output examples within the prompt to demonstrate the desired behavior and format without retraining.

How do I test and iterate on prompts to handle edge cases?

Analyze prompt failures systematically, identify failure patterns, add targeted examples that address those cases, and retest. Version control your prompts and document which refinements improved consistency for specific tasks.

Can I use prompt engineering to extract structured data like JSON from unstructured text?

Yes. Define the output format explicitly in your prompt, provide examples of text-to-JSON conversion, specify constraints on field values, and use role prompts to set context. This reliably extracts product data, metadata, and other structured information.

What makes a system prompt effective for a code assistant or chatbot?

A robust system prompt defines the assistant's role, sets behavioral constraints, specifies output formatting requirements, and includes fallback instructions for error cases. Combine role definition with explicit formatting and iterative testing against real queries.