Project configuration ===================== Every prompt project uses ``.spb/config.yaml`` to declare supported harnesses, tool metadata, and skill providers. Paths in the configuration are resolved from the project root passed through ``--project-root``. Environment file ---------------- SPB loads ``.spb/.env`` from the selected project root before running a CLI command. Commands without ``--project-root`` use the current directory. Existing process environment variables take precedence. Variable interpolation is not supported. The file is optional and contains plaintext; protect it from other users and do not commit it. New projects get a ``.spb/.gitignore`` that ignores ``.env`` and ``.env.*`` except ``.env.example``. For existing projects, check your Git ignore rules before creating the file. For evaluation models, an ``llm`` key alias can use an environment variable named ``SPB_LLM_KEY_`` followed by the uppercase alias with non-alphanumeric characters replaced by underscores. For example, ``huggingface-endpoint`` uses ``SPB_LLM_KEY_HUGGINGFACE_ENDPOINT``. Aliases that normalize to the same name share a variable. This key takes precedence over the key stored by ``llm``. Keys must not be empty or contain leading or trailing whitespace. Provider errors and tracebacks may contain secrets; review output before sharing it. Complete example ---------------- .. code-block:: yaml version: 1 project_name: example_prompts author: Example team support_harness: - pi_agent - eca tool_provider_metadata: pi_agent: tools: - name: read summary: Read a file from the project. - name: bash summary: Execute a command in the project. eca: tools: [] skill_providers: - name: local type: local path: .spb/skills/local - name: team type: git gitrepo: https://example.com/engineering/agent-skills.git revision: 0123456789abcdef0123456789abcdef01234567 skill_root: skills Configuration keys ------------------ Configuration field names, harness identifiers, and provider names must use lowercase ``snake_case``. Free-text descriptions and paths keep their original spelling. For existing projects, rename ``project-name`` to ``project_name``, ``support-harness`` to ``support_harness``, ``tool-provider-metadata`` to ``tool_provider_metadata``, ``skill-providers`` to ``skill_providers``, and ``skill-root`` to ``skill_root``. Replace the harness name ``pi-agent`` with ``pi_agent`` in configuration and in ``--harness`` arguments. Existing rendered artifacts under ``build/`` are not moved; render again to write to ``.spb/build/pi_agent/``. Update links to point to the new location. ``version`` Configuration format version. The current format uses ``1``. ``project_name`` Optional non-empty string exposed as ``{{project}}`` to prompt bodies and template-mode fragments. When omitted, the Mustache lookup is empty. Use ``spb init`` to generate a snake_case project name from the directory name. ``author`` Optional project metadata. It is not used during prompt rendering. ``support_harness`` Required non-empty list used by project validation to identify supported harnesses. Add matching tool metadata for every harness used for rendering. ``tool_provider_metadata`` Required mapping from harness name to harness metadata. Each harness may define a ``tools`` list. Tool entries are passed to the Mustache rendering context without additional schema transformation. ``skill_providers`` List of named local or Git providers. It may be empty or omitted when prompts do not import skills. ``renders`` Optional list of prompt and harness pairs used by ``spb render`` without arguments. Prompt paths are relative to the project root. The harness must be listed in ``support_harness``. .. code-block:: yaml renders: - prompt: .spb/prompts/project-assistant.md harness: pi_agent ``prompts`` (experimental) Optional mapping of named source or artifact definitions. Catalog keys use lowercase letters, digits, underscores and hyphens, beginning with a letter. Paths are project-root-relative, cannot contain ``..``, and existing symlinks must resolve within the project. Artifact files need not exist during static validation. Values in ``variables`` must be strings; do not put secrets in configuration. .. code-block:: yaml prompts: coding-live: kind: source prompt: .spb/prompts/coding.md harness: pi_agent variables: style: concise coding-release: kind: artifact prompt: .spb/build/pi_agent/coding.md manifest: .spb/build/pi_agent/coding.manifest.yaml ``spb.catalog.list_catalog(project_root)`` validates and lists entries without rendering or contacting providers. This is an experimental parsing API only: artifact verification and source resolution are not yet implemented. Listing is not a guarantee that later reads are safe from replacement or that an artifact is authentic. ``links`` Optional list of ``source`` and ``destination`` paths, relative to the project root. Run ``spb link`` after rendering to create these symbolic links. Sources must be existing files; validation does not require them to exist yet. .. code-block:: yaml links: - source: .spb/build/pi_agent/project-assistant.md destination: .pi/SYSTEM.md Harness tool metadata --------------------- A prompt can iterate over the selected harness's tool list: .. code-block:: markdown {{#tools}} - `{{name}}`: {{summary}} {{/tools}} ``spb`` requires each tool entry to be a YAML mapping. The prompt decides which fields it reads. ``name`` and ``summary`` are conventional fields rather than a fixed tool schema. Add a ``parameters`` JSON Schema when an evaluation needs to expose the tool as a model-callable function: .. code-block:: yaml - name: read summary: Read a file from the project. parameters: type: object properties: path: type: string required: [path] additionalProperties: false The schema is optional for prompt rendering. Mock evaluations require it for every configured tool they offer to the model. Mock evaluation calls never execute the real tool implementation. This repository configures its own ``pi_agent`` tools this way, and its ``built_in_tools`` fragment renders them into the rendered prompt: .. literalinclude:: ../.spb/config.yaml :language: yaml Local skill providers --------------------- A local provider reads Markdown files from a project directory: .. code-block:: yaml skill_providers: - name: local type: local path: .spb/skills/local The reference ``local/code-review`` resolves to ``.spb/skills/local/code-review.md``. Local provider keys are: ``name`` Provider name used before the slash in prompt skill references. ``type`` Must be ``local``. ``path`` Directory containing Markdown skill files under ``.spb/skills/``, relative to the project root. Git skill providers ------------------- A Git provider reads skills from a pinned repository revision: .. code-block:: yaml skill_providers: - name: team type: git gitrepo: https://example.com/engineering/agent-skills.git revision: 0123456789abcdef0123456789abcdef01234567 skill_root: skills Git provider keys are: ``name`` Provider name used before the slash in prompt skill references. ``type`` Must be ``git``. ``gitrepo`` Repository clone URL. ``revision`` Required immutable hexadecimal commit SHA between 40 and 64 characters. Branches and tags are rejected. ``skill_root`` Directory containing Markdown skills inside the checked-out repository. Git providers are cached under ``.spb/cache/``. Rendering checks out the configured revision in detached mode. It records resolved Git skills in ``.spb/skills.lock.yaml`` with their repository, revision, path, and SHA-256 content digest. Generated project files ----------------------- ``.spb/cache/`` Local Git provider checkouts. ``.spb/skills.lock.yaml`` Resolved Git provider revisions and skill digests. Rendering updates entries for the Git providers used by the current prompt. ``.spb/build/`` Rendered prompts, manifests, compressed variants, and evaluation artifacts.