← Back to all products
$19
Prompt Engineering Kit
Python prompt template library with chain-of-thought scaffolding, few-shot management, and versioning.
JSONMarkdownPythonLLM
📄 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 11 files
prompt-engineering-kit/
├── LICENSE
├── README.md
├── examples/
│ ├── basic_usage.py
│ └── custom_templates.json
├── free-sample.zip
├── guide/
│ ├── 01_features.md
│ ├── 02_project-structure.md
│ ├── 03_built-in-templates.md
│ └── 04_faq.md
├── index.html
└── src/
└── prompt_engineering_kit.py
📖 Documentation Preview README excerpt
Prompt Engineering Kit
Python prompt template library with variable injection, chain-of-thought scaffolding, few-shot example management, and prompt quality scoring. Zero dependencies.
Part of the AI Toolkit collection by [CodeVault](https://ai-toolkit.codevault.dev).
Features
- Template library — 8 battle-tested prompt templates for common tasks (summarize, code review, classify, extract, etc.)
- Variable injection —
{placeholder}syntax with automatic detection and validation - Chain-of-thought — Multi-step prompt chains that scaffold complex reasoning
- Few-shot examples — Attach input/output examples to any template
- Prompt scoring — Quality analyzer that rates prompts on length, specificity, structure, and clarity
- Strategy tagging — Templates tagged by strategy (zero-shot, few-shot, CoT, role-play, structured output)
- JSON export — Export the entire library as JSON for integration with any LLM pipeline
- CLI interface — List, preview, build, score, and chain prompts from the terminal
Quick Start
# List all available templates
python src/prompt_engineering_kit.py --list
# Build a prompt from a template
python src/prompt_engineering_kit.py --build summarize --vars '{"text":"Your text here","length":"3","style":"professional"}'
# Score a prompt for quality
python src/prompt_engineering_kit.py --score "Tell me about dogs"
# Run a multi-step chain
python src/prompt_engineering_kit.py --chain research --vars '{"topic":"AI safety","length":"3"}'
# Export the full library to JSON
python src/prompt_engineering_kit.py --export-library prompts.json
Project Structure
prompt-engineering-kit/
├── README.md
├── LICENSE
├── src/
│ └── prompt_engineering_kit.py # Core engine (~400 lines)
└── examples/
├── basic_usage.py # Programmatic usage example
└── custom_templates.json # Sample custom template library
CLI Reference
| Flag | Description |
|---|---|
--list | List all templates and chains |
--template NAME | Show a specific template |
--build NAME --vars JSON | Build a prompt from a template |
--chain NAME --vars JSON | Render a multi-step prompt chain |
--score "TEXT" | Score a prompt string for quality |
--score-file FILE | Score a prompt loaded from a file |
--export-library FILE | Export the full library to JSON |
... continues with setup instructions, usage examples, and more.
📄 Code Sample .py preview
examples/basic_usage.py#!/usr/bin/env python3
"""
Basic usage example for the Prompt Engineering Kit.
Demonstrates:
- Listing available templates
- Building a prompt from a template with variable injection
- Scoring a prompt for quality
- Running a chain-of-thought prompt sequence
- Creating custom templates programmatically
"""
import sys
from pathlib import Path
# Allow running from the examples/ directory
sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "src"))
from prompt_engineering_kit import (
CHAIN_LIBRARY,
TEMPLATE_LIBRARY,
FewShotExample,
PromptChain,
PromptStrategy,
PromptTemplate,
ChainStep,
score_prompt,
)
def demo_template_listing() -> None:
"""Show all available built-in templates."""
print("=== Available Templates ===\n")
for name, tmpl in TEMPLATE_LIBRARY.items():
print(f" {name:<20} {tmpl.strategy.name:<20} vars: {tmpl.variables}")
print()
def demo_build_prompt() -> None:
"""Build a prompt from the 'summarize' template."""
print("=== Build a Prompt ===\n")
tmpl = TEMPLATE_LIBRARY["summarize"]