Skip to main content

System Prompt Builder

System Prompt Builder (spb) composes reproducible, versioned system prompts from Markdown, reusable skills, template variables, and harness-specific tool metadata.

It can:

  • validate prompt projects;
  • render prompts for a selected agent harness;
  • resolve local and commit-pinned Git skill providers;
  • record prompt, skill, variable, and output provenance in YAML manifests;
  • produce optional LLMLingua-compressed artifacts;
  • evaluate prompt releases through direct model calls and DeepEval;
  • compare prompt versions and compressed variants with score gates.

Documentation

The complete documentation is published at:

https://www.iwillig.me/system-prompt-builder/

Use these pages as entry points:

Requirements

  • Python 3.14 or later
  • Git when using Git skill providers

Install

Install the current release from a checkout:

git clone https://github.com/iwillig/system-prompt-builder.git
cd system-prompt-builder
uv tool install .

For development, install the locked environment with Pipenv:

pipenv sync --dev

Quick start

Create .spb/config.yaml:

version: 1
support-harness:
  - pi-agent

tool-provider-metadata:
  pi-agent:
    tools:
      - name: read
        summary: Read a file from the project.
      - name: bash
        summary: Execute a command in the project.

skill-providers:
  - name: local
    type: local
    path: skills/local

Create prompts/project-assistant.md:

---
name: Project assistant
version: 1.0.0
skills: []
variables:
  project_name:
    required: true
---
You are a coding agent for {{{project_name}}} running in {{harness.name}}.

Available tools:
{{#tools}}
- `{{name}}`: {{summary}}
{{/tools}}

Validate and render the prompt:

spb validate
spb render prompts/project-assistant.md --harness pi-agent \
  --var project_name=example

The render command writes:

build/pi-agent/project-assistant.md
build/pi-agent/project-assistant.manifest.yaml

Link the rendered prompt into a Pi project:

spb link build/pi-agent/project-assistant.md .pi/SYSTEM.md
pi --approve

Pi reads .pi/SYSTEM.md after project trust is granted.

Core model

A project has four main inputs:

  1. .spb/config.yaml defines supported harnesses, tool metadata, and skill providers.
  2. prompts/*.md contains versioned prompt sources with YAML front matter.
  3. Skill providers supply reusable Markdown instructions.
  4. Repeatable --var NAME=VALUE options provide declared template values.

spb render composes these inputs in deterministic order. It writes the full prompt and a manifest containing source and output hashes, resolved skill hashes, pinned Git revisions, harness identity, and non-secret variable values.

Prompt versions are author-managed semantic versions. If the rendered content for an existing name, version, and harness changes, spb rejects the write unless --replace-release is provided.

Common commands

spb validate
spb render PROMPT --harness HARNESS [--var NAME=VALUE]
spb link SOURCE DESTINATION
spb eval validate SUITE
spb eval run PROMPT --harness HARNESS --suite SUITE
spb eval compare PROMPT --harness HARNESS --suite SUITE
spb benchmark run PROMPT --harness HARNESS --suite SUITE
spb benchmark compare BASELINE CANDIDATE --harness HARNESS --suite SUITE

See the CLI reference for every option and default.

Development

Run all local quality gates:

just check

Build the documentation with warnings treated as errors:

just docs

Build and validate the wheel and source distribution:

just package-check

The project uses Click, Chevron, PyYAML, pytest, Ruff, mypy, Sphinx, and optional DeepEval, llm, and LLMLingua integrations.

License

Copyright © 2026 Ivan Willig. Licensed under the GNU Affero General Public License v3.0 or later.

Metadata

Release files for system-prompt-builder 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for system-prompt-builder 0.1.1
File Size Uploaded Provenance Actions
system_prompt_builder-0.1.1.tar.gz 24.3 kB With provenance Details for system_prompt_builder-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for system-prompt-builder 0.1.1
File Interpreter ABI Platform Actions
system_prompt_builder-0.1.1-py3-none-any.whl Python 3 none any Details for system_prompt_builder-0.1.1-py3-none-any.whl

Total release size: 51.3 kB

Release files / system_prompt_builder-0.1.1.tar.gz

Download URL system_prompt_builder-0.1.1.tar.gz
Size 24.3 kB
Tags Source
SHA-256 checksum
How to use checksums
97de60f33079fce1cdcc9388ef763820a568929762c280b1dd1e4cc4a001912c
BLAKE2b-256 checksum
How to use checksums
f4e5ee27a865ac6ecfde751287205d685113b89957200e758bffe0aa28cb1f15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / system_prompt_builder-0.1.1-py3-none-any.whl

Download URL system_prompt_builder-0.1.1-py3-none-any.whl
Size 27.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ae1a3721f1784305d0e38f7153c0de1393a59e0509d51e96f011a0d312e182f
BLAKE2b-256 checksum
How to use checksums
ad96a7e8e6aa995d22f9bb577c5336174c3a7a78da12937992b42a8ffcdb0a06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for system-prompt-builder 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for system_prompt_builder-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page