Skip to content

PackC

Compiler for the PromptPack open standard


PackC compiles prompt source files into PromptPack-compliant packages—a vendor-neutral, framework-agnostic format that works with any AI runtime or provider.

Today’s AI prompt development is fragmented. Each framework has its own format for prompts, tools, conversations, and test scenarios. When teams switch providers or frameworks, they rebuild their entire prompt infrastructure from scratch.

PromptPack solves this with an open specification built on three principles:

  • Vendor Neutrality: A framework-agnostic JSON format that works across any runtime
  • Completeness: Prompts, tools, guardrails, and resources in a single file
  • Discipline: Treating prompts as version-controlled, testable engineering artifacts

PackC is the reference compiler for this standard.

  • Compiles YAML/JSON sources into .pack.json files conforming to PromptPack spec
  • Validates structure against the official schema
  • Optimizes for production with minification and preprocessing
  • Versions packages for distribution and deployment

Terminal window
# Install PromptKit (includes PackC)
brew install promptkit
# Or with Go
go install github.com/AltairaLabs/PromptKit/tools/packc@latest
# Create a prompt source file
cat > greeting.yaml <<EOF
apiVersion: promptkit.altairalabs.ai/v1alpha1
kind: PromptConfig
spec:
task_type: greeting
name: Greeting Assistant
description: A friendly assistant that greets users
system_prompt: |
You are a friendly assistant. Greet the user warmly.
parameters:
temperature: 0.7
max_tokens: 150
EOF
# Compile to PromptPack format
packc compile-prompt greeting.yaml --output greeting.pack.json
# Validate against the spec
packc validate greeting.pack.json

The resulting .pack.json can be used with any PromptPack-compatible runtime—not just PromptKit.

Next: Your First Pack Tutorial


A key benefit of PromptPack is portability. Packs compiled with PackC work with:

  • PromptKit SDK (Go)
  • Any PromptPack-compatible runtime in other languages
  • Custom integrations that read the standard JSON format

Build once, deploy everywhere. No vendor lock-in.

Diagram

Step-by-step guides for learning PackC:

  1. First Pack - Create your first PromptPack
  2. Multi-Prompt Packs - Bundle multiple prompts
  3. Validation Workflow - Ensure pack quality
  4. Pack Management - Organize and version packs
  5. CI/CD Pipeline - Automate pack builds

🔧 How-To Guides (Accomplish Specific Tasks)

Section titled “🔧 How-To Guides (Accomplish Specific Tasks)”

Focused guides for specific tasks:

💡 Explanation (Understand the Concepts)

Section titled “💡 Explanation (Understand the Concepts)”

Deep dives into PackC and PromptPack:

Complete command and format specifications:


Transform YAML/JSON prompts into PromptPack-compliant packages:

Terminal window
packc compile prompts/my-app.yaml \
--output dist/my-app.pack.json \
--optimize \
--version 1.0.0

Ensure packs conform to the PromptPack specification:

Terminal window
packc validate my-app.pack.json --strict

Checks:

  • ✅ Schema compliance with PromptPack spec
  • ✅ Required fields present
  • ✅ Template syntax valid
  • ✅ Tool definitions complete

Production-ready output:

Terminal window
packc compile prompts/*.yaml --optimize
  • Minify JSON output
  • Remove comments and whitespace
  • Validate templates
  • Check for common errors

A compiled pack follows the PromptPack specification:

{
"apiVersion": "promptkit.altairalabs.ai/v1alpha1",
"kind": "PromptPack",
"metadata": {
"name": "my-app",
"version": "1.0.0"
},
"prompts": [
{
"id": "greeting",
"system": "You are helpful.",
"template": "Greet the user."
}
]
}

This format is:

  • Self-contained: Everything needed to run the prompt
  • Portable: Works with any compatible runtime
  • Versionable: Track changes with semantic versioning
  • Testable: Include test metadata for validation

Learn more at promptpack.org.


Automate pack builds in your pipeline:

- name: Compile PromptPacks
run: |
packc compile prompts/*.yaml --output-dir dist/
packc validate dist/*.pack.json --strict
.PHONY: build-packs
build-packs:
packc compile prompts/*.yaml --output-dir dist/packs/
.PHONY: validate-packs
validate-packs:
packc validate dist/packs/*.pack.json --strict

  • Follow the PromptPack specification for maximum portability
  • Don’t add custom fields outside the spec
  • Test packs with multiple runtimes if possible
  • Use semantic versioning (MAJOR.MINOR.PATCH)
  • Update version on breaking changes
  • Keep changelog of prompt changes
  • Always validate after compilation
  • Use --strict mode in CI/CD
  • Test packs with Arena before distribution