Skip to content

Design a portable prompt-pack file format (.promptkit) #14

Description

@Cryptoteep

Context

Right now prompts are TypeScript modules. That's great for developers but bad for two use cases:

  1. Sharing — you can't easily drop a prompt into someone else's project without matching deps.
  2. Non-developers — prompt engineers who don't write TS can't author prompts.

Proposal (RFC)

Define a portable prompt-pack format: a single YAML or JSON file describing one or more prompts, their inputs, templates, and eval cases.

# sentiment.promptkit.yaml
pack: 1
prompts:
  - name: classify-sentiment
    version: 1.1.0
    description: Classify sentiment into N labels.
    input:
      text: { type: string, required: true }
      labels:
        type: array
        items: { type: string }
        default: [positive, negative, neutral]
    template: |
      Classify the sentiment of: "{{text}}"
      Labels: {{labels}}
      ->

Then:

  • promptkit load sentiment.promptkit.yaml → returns PromptDefinition[].
  • promptkit run sentiment.promptkit.yaml#classify-sentiment ….
  • Export from TS: import { loadPack } from 'promptkit/pack'.

Open questions

  • YAML or JSON only? (YAML is nicer for multi-line templates; adds a dep.)
  • How to express validate declaratively? Limited subset, or validate: { minLength: 1 } style?
  • Versioning of the pack format itself.
  • Should packs be installable from a registry URL?

Acceptance

  • Format spec written in docs/pack-format.md.
  • loadPack() loader + tests.
  • promptkit load command.
  • At least one example pack.

Looking for feedback on the format before implementation. Please comment with use cases!

/label "enhancement" "area:loader" "help wanted"

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:loaderFilesystem loader and prompt discoveryenhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions