Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

System Prompt Builder

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

It can:

  • validate prompt projects;
  • compose reusable fragments through a separate layout;
  • 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 published command from PyPI with uv:

uv tool install system-prompt-builder

Upgrade an existing uv installation with:

uv tool upgrade system-prompt-builder

Alternatively, install and upgrade the command with pipx:

pipx install system-prompt-builder
pipx upgrade system-prompt-builder

Evaluation dependencies are included by default; model credentials and provider configuration remain your responsibility.

For development, install the locked environment with Pipenv:

pipenv sync --dev

Quick start

Initialize the current repository:

spb init

The command creates .spb/config.yaml, a starter system prompt at .spb/prompts/project-assistant.md, its layout under .spb/layouts/, a reusable instruction fragment under .spb/fragments/, and .spb/skills/local/, and an empty .spb/evals/ directory. It refuses to overwrite any managed starter path.

Validate and render the prompt:

spb validate
spb render .spb/prompts/project-assistant.md --harness pi_agent

The render command writes:

.spb/build/pi_agent/project-assistant.md
.spb/build/pi_agent/project-assistant.manifest.yaml

Link the rendered prompt into a Pi project:

spb link .spb/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. .spb/prompts/*.md contains versioned prompt sources with YAML front matter.
  3. .spb/fragments/ contains reusable instructions selected by system prompts; .spb/layouts/ places them in the final text.
  4. Skill providers supply Markdown instructions for eager inclusion.
  5. Repeatable --var NAME=VALUE options provide declared template values.

A system prompt can select reusable instruction bundles under .spb/fragments/ and bind them to named fragments aliases. Its separate layout under .spb/layouts/ inserts those aliases into the final prompt. Inline pseudo-XML sections remain supported for existing prompt sources. See the prompt authoring guide for both formats.

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 init [DIRECTORY] [--harness HARNESS]
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, DeepEval, llm, pytest, Ruff, mypy, and Sphinx, with an optional LLMLingua integration.

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.5.0rc1

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.5.0rc1
File Size Uploaded Provenance Actions
system_prompt_builder-0.5.0rc1.tar.gz 45.7 kB With provenance Details for system_prompt_builder-0.5.0rc1.tar.gz

Built distribution (wheel)

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

Total release size: 96.0 kB

Release files / system_prompt_builder-0.5.0rc1.tar.gz

Download URL system_prompt_builder-0.5.0rc1.tar.gz
Size 45.7 kB
Tags Source
SHA-256 checksum
How to use checksums
567ccd3153b0069b2fd9712b8ea59b283c6e5a16159c8421a1e0dae11a5088ad
BLAKE2b-256 checksum
How to use checksums
d9911bb6a3c24f037e5f2753301aee86ac782c631f24e1a3b0804ca378908b72
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 Nov 29, 2026.

Transparency log

Release files / system_prompt_builder-0.5.0rc1-py3-none-any.whl

Download URL system_prompt_builder-0.5.0rc1-py3-none-any.whl
Size 50.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be57f619fe5369bb210c84f993ce2e95aec7b31d731bef2df442709ef6dfe4ea
BLAKE2b-256 checksum
How to use checksums
b5e3c7322c0c747883c36489789e493672569365466b0419f8240a1f882d4544
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 Nov 29, 2026.

Transparency log

Security for system-prompt-builder 0.5.0rc1

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.5.0rc1.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 Nov 29, 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