← Back to all products
$39
LLM Prompt Engineering Kit
Prompt template library, chain-of-thought patterns, few-shot examples, prompt versioning system, and A/B testing framework.
MarkdownYAMLPythonReactLLMOpenAI
📄 Product Preview
Try the interactive reader and demo tools below, or get the full product with all content unlocked.
📖 Interactive Reader (Free Preview) ⚙ Try Demo Tools 📦 Download Free Sample📁 File Structure 56 files
llm-prompt-engineering-kit/
├── LICENSE
├── README.md
├── free-sample.zip
├── guide/
│ ├── 01-prompt-patterns.md
│ └── 02-versioning-workflow.md
├── guides/
│ ├── prompt-patterns.md
│ └── versioning-workflow.md
├── index.html
├── prompts/
│ ├── agents/
│ │ ├── guardrail.yaml
│ │ ├── planning_prompt.yaml
│ │ ├── react_prompt.yaml
│ │ ├── self_reflection.yaml
│ │ ├── supervisor.yaml
│ │ └── tool_selection.yaml
│ ├── classification/
│ │ ├── intent.yaml
│ │ ├── language.yaml
│ │ ├── priority.yaml
│ │ ├── sentiment.yaml
│ │ ├── topic.yaml
│ │ └── toxicity.yaml
│ ├── coding/
│ │ ├── bug_fixing.yaml
│ │ ├── code_generation.yaml
│ │ ├── code_review.yaml
│ │ ├── documentation.yaml
│ │ ├── sql_generation.yaml
│ │ └── test_generation.yaml
│ ├── extraction/
│ │ ├── contact_extraction.yaml
│ │ ├── data_parsing.yaml
│ │ ├── entity_extraction.yaml
│ │ ├── key_value_extraction.yaml
│ │ ├── relationship_extraction.yaml
│ │ └── table_extraction.yaml
│ └── summarization/
│ ├── abstractive.yaml
│ ├── bullet_points.yaml
│ ├── changelog.yaml
│ ├── executive_summary.yaml
│ ├── meeting_minutes.yaml
│ └── technical_docs.yaml
├── requirements.txt
├── src/
│ ├── __init__.py
│ ├── __pycache__/
│ │ ├── __init__.cpython-312.pyc
│ │ ├── ab_testing.cpython-312.pyc
│ │ ├── chains.cpython-312.pyc
│ │ ├── diff_tool.cpython-312.pyc
│ │ ├── registry.cpython-312.pyc
│ │ └── template_engine.cpython-312.pyc
│ ├── ab_testing.py
│ ├── chains.py
│ ├── diff_tool.py
│ ├── registry.py
│ └── template_engine.py
└── tests/
├── __pycache__/
│ ├── test_registry.cpython-312.pyc
│ └── test_template_engine.cpython-312.pyc
├── test_registry.py
└── test_template_engine.py
📖 Documentation Preview README excerpt
LLM Prompt Engineering Kit
A complete prompt engineering toolkit: 30 battle-tested prompt templates, a
Python-based template engine with variable substitution and few-shot support,
a versioned prompt registry for tracking changes, an A/B testing harness for
comparing prompt variants, and a semantic diff tool for reviewing prompt edits.
What's Included
Prompt Template Library (30 templates)
Curated, production-ready prompt templates organized by domain:
| Category | Templates | Use Cases |
|---|---|---|
| Extraction (6) | Entity extraction, data parsing, key-value, relationships, tables, contacts | Turning unstructured text into structured data |
| Classification (6) | Sentiment, topic, intent, priority, language, toxicity | Routing, triage, and content moderation |
| Summarization (6) | Executive summary, bullet points, abstractive, changelog, meeting minutes, tech docs | Condensing long content into actionable summaries |
| Coding (6) | Code review, code generation, bug fixing, SQL generation, test generation, documentation | Developer productivity and code quality |
| Agents (6) | ReAct, plan-and-execute, tool selection, supervisor, self-reflection, guardrails | Building AI agent systems |
Every template includes:
- System message with detailed instructions
- User template with named variables
- Few-shot examples (where applicable)
- Token budget estimates
- Model compatibility notes
- Quality notes and gotchas
Python Toolkit
| Module | Purpose |
|---|---|
template_engine.py | Load YAML templates, render with variables, build message arrays |
registry.py | Version prompts, track history, diff between versions, export/import |
chains.py | Chain-of-thought and few-shot pattern builders |
ab_testing.py | A/B test harness with metric collection and statistical comparison |
diff_tool.py | Semantic diff between prompt versions (line-level and structural) |
Guides
- Prompt Patterns — Decision tree for choosing the right pattern (zero-shot, few-shot, CoT, ReAct, etc.)
- Versioning Workflow — How to version, test, shadow-deploy, and roll back prompts
Quick Start
1. Load and Render a Template
from src.template_engine import TemplateEngine
from pathlib import Path
engine = TemplateEngine()
engine.load_directory(Path("prompts/"))
# Get a template and render it
template = engine.get("extraction.entity_extraction")
messages = template.build_messages(
input_text="Acme Corp announced a $50M acquisition of DataCo in Austin, Texas."
)
*... continues with setup instructions, usage examples, and more.*
📄 Code Sample .py preview
src/ab_testing.py
"""
Prompt A/B testing harness with metric collection.
When you have two versions of a prompt and need to know which performs
better, this harness runs both against a test dataset and collects
metrics (accuracy, latency, token usage, human ratings).
The harness supports:
- Side-by-side comparison of two prompt versions
- Automated scoring with custom metric functions
- Statistical significance testing (basic chi-squared)
- Result export for further analysis
- Integration with the PromptRegistry for version tracking
"""
from __future__ import annotations
import json
import logging
import random
import time
from dataclasses import dataclass, field
from typing import Any, Callable
from src.template_engine import PromptTemplate
logger = logging.getLogger(__name__)
@dataclass
class TestCase:
"""A single test input with optional expected output."""
input_variables: dict[str, Any]
expected_output: str = ""
metadata: dict[str, Any] = field(default_factory=dict)
@dataclass
class TestResult:
"""Result of running a single test case against a prompt variant."""
variant_name: str
test_case: TestCase
rendered_prompt: str
llm_output: str
latency_ms: float = 0.0
token_count: int = 0
score: float = 0.0 # From the scoring function
metadata: dict[str, Any] = field(default_factory=dict)
# ... 169 more lines ...