📦 PackC

PromptPack Compiler - Package and optimize prompts for production


What is PackC?

PackC is a compiler that helps you:


Quick Start

# 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 > my-prompt.yaml <<EOF
name: "my-app"
version: "1.0.0"
prompts:
  - id: "greeting"
    system: "You are helpful."
    template: "Greet the user."
EOF

# Compile the pack
packc compile my-prompt.yaml --output my-app.pack.json

# Validate the result
packc validate my-app.pack.json

Next: Your First Compilation Tutorial


Documentation by Type

📚 Tutorials (Learn by Doing)

Step-by-step guides for learning PackC:

  1. First Compilation - Compile in 5 minutes
  2. CI/CD Pipeline - Automate pack builds

🔧 How-To Guides (Accomplish Specific Tasks)

Focused guides for specific PackC tasks:

💡 Explanation (Understand the Concepts)

Deep dives into PackC design:

📖 Reference (Look Up Details)

Complete command and format specifications:


Key Features

Compilation

Transform YAML/JSON prompts into optimized packs:

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

Validation

Ensure pack integrity:

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

Checks:

Optimization

Production-ready output:

packc compile prompts/*.yaml --optimize

CI/CD Integration

Automate pack builds:

# GitHub Actions
- name: Build Packs
  run: packc compile prompts/*.yaml --output-dir dist/

Use Cases

For DevOps Engineers

For Release Managers

For Prompt Engineers


CLI Commands

compile

Compile prompt source files into packs:

packc compile [files...] [options]

Options:

validate

Validate pack structure:

packc validate [files...] [options]

Options:

version

Show PackC version:

packc version

Pack Format

A compiled pack is JSON with this structure:

{
  "name": "my-app",
  "version": "1.0.0",
  "description": "My application prompts",
  "prompts": [
    {
      "id": "greeting",
      "system": "You are helpful.",
      "template": "Greet the user.",
      "variables": [],
      "metadata": {}
    }
  ],
  "metadata": {
    "compiled_at": "2025-11-16T12:00:00Z",
    "compiler_version": "1.0.0",
    "schema_version": "2.0"
  }
}

Integration Examples

Makefile

.PHONY: build-packs
build-packs:
    packc compile prompts/*.yaml --output-dir dist/packs/

.PHONY: validate-packs
validate-packs:
    packc validate dist/packs/*.pack.json

GitHub Actions

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

Docker

FROM golang:1.22
RUN go install github.com/AltairaLabs/PromptKit/tools/packc@latest
COPY prompts/ /prompts/
RUN packc compile /prompts/*.yaml --output-dir /packs/

Best Practices

Version Management

Quality Assurance

Build Optimization


Getting Help