01: Your First Pack
Create your first PromptPack-compliant prompt package in 15 minutes.
What You’ll Build
Section titled “What You’ll Build”A .pack.json file that conforms to the PromptPack open standard—a vendor-neutral format that works with any AI framework, not just PromptKit.
Learning Objectives
Section titled “Learning Objectives”In this tutorial, you’ll learn to:
- Install the PackC compiler
- Create a prompt source file
- Compile to PromptPack format
- Validate against the specification
- Inspect pack contents
Time Required
Section titled “Time Required”15 minutes
Prerequisites
Section titled “Prerequisites”- Basic command-line knowledge
- A text editor
Step 1: Install PackC
Section titled “Step 1: Install PackC”Choose your preferred installation method:
Option 1: Homebrew (Recommended)
brew install promptkitOption 2: Go Install
go install github.com/AltairaLabs/PromptKit/tools/packc@latestVerify installation:
packc versionExpected output:
packc v0.1.0If packc isn’t found after using Go install, add Go’s bin directory to your PATH:
export PATH="$PATH:$(go env GOPATH)/bin"source ~/.zshrc # or ~/.bashrcStep 2: Create Project Structure
Section titled “Step 2: Create Project Structure”Create a directory for your first pack project:
# Create project directorymkdir my-first-packcd my-first-pack
# Create subdirectoriesmkdir -p prompts config packsYour directory structure should look like:
my-first-pack/├── prompts/ # Prompt YAML files├── config/ # Arena configuration└── packs/ # Compiled packs (output)Step 3: Create a Prompt
Section titled “Step 3: Create a Prompt”Create your first prompt file:
cat > prompts/greeting.yaml <<'EOF'apiVersion: promptkit.altairalabs.ai/v1alpha1kind: PromptConfigspec: task_type: greeting name: Greeting Assistant description: A friendly assistant that greets users
system_prompt: | You are a friendly assistant. Greet the user warmly and ask how you can help.
user_template: | User name: Time of day:
template_engine: go
parameters: temperature: 0.7 max_tokens: 150EOFThis creates a simple greeting prompt with template variables.
Step 4: Create Arena Configuration
Section titled “Step 4: Create Arena Configuration”Create an arena.yaml configuration that references your prompt:
cat > config/arena.yaml <<'EOF'prompts: - ../prompts/greeting.yaml
tools_directory: ./toolsEOFStep 5: Compile Your Pack
Section titled “Step 5: Compile Your Pack”Now compile the prompt into a pack:
packc compile \ --config config/arena.yaml \ --output packs/greeting.pack.json \ --id greetingExpected output:
Loaded 1 prompt configs from memory repositoryCompiling 1 prompts into pack 'greeting'...✓ Pack compiled successfully: packs/greeting.pack.json Contains 1 prompts: [greeting]What happened:
- PackC read the arena.yaml configuration
- Loaded the greeting.yaml prompt file
- Compiled it into an optimized pack.json file
- Saved it to packs/greeting.pack.json
Step 6: Inspect Your Pack
Section titled “Step 6: Inspect Your Pack”Look at what was created:
# Check file sizels -lh packs/greeting.pack.json
# Inspect pack contentspackc inspect packs/greeting.pack.jsonExpected output:
Pack Information================ID: greetingName: greetingVersion: 1.0.0Compiler Version: packc-v0.1.0
Template Engine===============Engine: go
Prompts=======- ID: greeting Name: Greeting Assistant Description: A friendly assistant that greets users
System Prompt: You are a friendly assistant. Greet the user warmly and ask how you can help.
User Template: User name: Time of day:
Parameters: - temperature: 0.7 - max_tokens: 150Step 7: Validate Your Pack
Section titled “Step 7: Validate Your Pack”Ensure the pack is valid:
packc validate packs/greeting.pack.jsonExpected output:
Validating pack: packs/greeting.pack.json✓ Pack is validStep 8: View the Pack JSON
Section titled “Step 8: View the Pack JSON”Look at the compiled JSON (optional):
cat packs/greeting.pack.jsonYou’ll see a structured JSON file containing your prompt in a format ready for the PromptKit SDK.
What You Learned
Section titled “What You Learned”Congratulations! You’ve successfully:
- ✅ Installed packc
- ✅ Created a prompt configuration
- ✅ Compiled your first pack
- ✅ Validated the pack
- ✅ Inspected pack contents
Understanding the Pack
Section titled “Understanding the Pack”Your pack contains:
- Prompt metadata - Name, description, task type
- System prompt - Instructions for the AI
- User template - How to format user input with variables
- Parameters - Model settings (temperature, max_tokens)
- Compiler metadata - Version and compilation info
Try It Yourself
Section titled “Try It Yourself”Experiment with your pack:
1. Modify the Prompt
Section titled “1. Modify the Prompt”Edit prompts/greeting.yaml to change the greeting style:
system_prompt: | You are a professional business assistant. Greet the user formally.Then recompile:
packc compile --config config/arena.yaml --output packs/greeting.pack.json --id greeting2. Add Parameters
Section titled “2. Add Parameters”Add more model parameters:
parameters: temperature: 0.9 max_tokens: 200 top_p: 0.953. Inspect Changes
Section titled “3. Inspect Changes”Check the updated pack:
packc inspect packs/greeting.pack.jsonCommon Issues
Section titled “Common Issues”Issue: packc: command not found
Section titled “Issue: packc: command not found”Solution: Add Go bin to PATH:
export PATH="$PATH:$(go env GOPATH)/bin"Issue: arena.yaml not found
Section titled “Issue: arena.yaml not found”Solution: Ensure you’re in the project directory:
cd my-first-packls config/arena.yaml # Should existIssue: Invalid YAML syntax
Section titled “Issue: Invalid YAML syntax”Solution: Check indentation (use spaces, not tabs):
# Validate YAMLcat prompts/greeting.yamlNext Steps
Section titled “Next Steps”Now that you’ve compiled your first pack, you’re ready to:
- Tutorial 2: Multi-Prompt Packs - Build packs with multiple prompts
- How-To: Compile Packs - Learn more compilation patterns
- Reference: compile command - Complete compile documentation
Complete Code
Section titled “Complete Code”Here’s the complete prompt file for reference:
# prompts/greeting.yamlapiVersion: promptkit.altairalabs.ai/v1alpha1kind: PromptConfigspec: task_type: greeting name: Greeting Assistant description: A friendly assistant that greets users
system_prompt: | You are a friendly assistant. Greet the user warmly and ask how you can help.
user_template: | User name: Time of day:
template_engine: go
parameters: temperature: 0.7 max_tokens: 150And the arena configuration:
# config/arena.yamlprompts: - ../prompts/greeting.yaml
tools_directory: ./toolsCongratulations on completing your first pack!
What You’ve Achieved
Section titled “What You’ve Achieved”You’ve created a PromptPack-compliant package that:
- Is portable — Works with any PromptPack-compatible runtime, not just PromptKit
- Is validated — Conforms to the open specification
- Is production-ready — Can be versioned, deployed, and shared
Learn more about the PromptPack standard at promptpack.org.