PackC
Compiler for the PromptPack open standard
What is PackC?
Section titled “What is PackC?”PackC compiles prompt source files into PromptPack-compliant packages—a vendor-neutral, framework-agnostic format that works with any AI runtime or provider.
Why PromptPack?
Section titled “Why PromptPack?”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.
What PackC Does
Section titled “What PackC Does”- Compiles YAML/JSON sources into
.pack.jsonfiles conforming to PromptPack spec - Validates structure against the official schema
- Optimizes for production with minification and preprocessing
- Versions packages for distribution and deployment
Quick Start
Section titled “Quick Start”# Install PromptKit (includes PackC)brew install promptkit
# Or with Gogo install github.com/AltairaLabs/PromptKit/tools/packc@latest
# Create a prompt source filecat > greeting.yaml <<EOFapiVersion: 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. parameters: temperature: 0.7 max_tokens: 150EOF
# Compile to PromptPack formatpackc compile-prompt greeting.yaml --output greeting.pack.json
# Validate against the specpackc validate greeting.pack.jsonThe resulting .pack.json can be used with any PromptPack-compatible runtime—not just PromptKit.
Next: Your First Pack Tutorial
Framework Agnostic
Section titled “Framework Agnostic”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.
Documentation by Type
Section titled “Documentation by Type”📚 Tutorials (Learn by Doing)
Section titled “📚 Tutorials (Learn by Doing)”Step-by-step guides for learning PackC:
- First Pack - Create your first PromptPack
- Multi-Prompt Packs - Bundle multiple prompts
- Validation Workflow - Ensure pack quality
- Pack Management - Organize and version packs
- 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:
- Installation - Get PackC running
- Compile Packs - Compilation options
- Validate Packs - Validation strategies
- Organize Packs - Project structure
- CI/CD Integration - Automate builds
💡 Explanation (Understand the Concepts)
Section titled “💡 Explanation (Understand the Concepts)”Deep dives into PackC and PromptPack:
- Pack Format - Understanding the PromptPack structure
- Compilation - How compilation works
- Validation - Schema validation details
📖 Reference (Look Up Details)
Section titled “📖 Reference (Look Up Details)”Complete command and format specifications:
- compile - Compile command reference
- validate - Validate command reference
- inspect - Inspect command reference
- compile-prompt - Single prompt compilation
Key Features
Section titled “Key Features”Compilation to Open Standard
Section titled “Compilation to Open Standard”Transform YAML/JSON prompts into PromptPack-compliant packages:
packc compile prompts/my-app.yaml \ --output dist/my-app.pack.json \ --optimize \ --version 1.0.0Schema Validation
Section titled “Schema Validation”Ensure packs conform to the PromptPack specification:
packc validate my-app.pack.json --strictChecks:
- ✅ Schema compliance with PromptPack spec
- ✅ Required fields present
- ✅ Template syntax valid
- ✅ Tool definitions complete
Production Optimization
Section titled “Production Optimization”Production-ready output:
packc compile prompts/*.yaml --optimize- Minify JSON output
- Remove comments and whitespace
- Validate templates
- Check for common errors
PromptPack Format
Section titled “PromptPack Format”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.
CI/CD Integration
Section titled “CI/CD Integration”Automate pack builds in your pipeline:
GitHub Actions
Section titled “GitHub Actions”- name: Compile PromptPacks run: | packc compile prompts/*.yaml --output-dir dist/ packc validate dist/*.pack.json --strictMakefile
Section titled “Makefile”.PHONY: build-packsbuild-packs: packc compile prompts/*.yaml --output-dir dist/packs/
.PHONY: validate-packsvalidate-packs: packc validate dist/packs/*.pack.json --strictBest Practices
Section titled “Best Practices”Use the Open Standard
Section titled “Use the Open Standard”- Follow the PromptPack specification for maximum portability
- Don’t add custom fields outside the spec
- Test packs with multiple runtimes if possible
Version Management
Section titled “Version Management”- Use semantic versioning (MAJOR.MINOR.PATCH)
- Update version on breaking changes
- Keep changelog of prompt changes
Quality Assurance
Section titled “Quality Assurance”- Always validate after compilation
- Use
--strictmode in CI/CD - Test packs with Arena before distribution
Resources
Section titled “Resources”- PromptPack Specification: promptpack.org
- Questions: GitHub Discussions
- Issues: Report a Bug
Related Tools
Section titled “Related Tools”- Arena: Test prompts before compiling - Validate prompt behavior
- SDK: Use compiled packs in Go applications - One of many possible runtimes