xmlsquishsource. compose. build.
中文

XML PROMPT PROJECT MANAGER · v1.2.1

Your prompt projects deservea proper build.

Create a project, or discover an existing project and workspace from xmlsquish.toml; format sources, resolve locked dependencies, compile cacheable binary XSIR, optimize and link, then publish .prompt, reproducible .pack, or relocatable .sopack.

Rust 2024 · Project-level incremental builds · Human / Short / NDJSON

build / site-demo:agentDSL → IR → optimize → link → backend
01Author sources
agent.xmlxs:arg
persona.xmlexpand + arg
tasks.xmlimport + call
02Compile XSIR & link
<xs:expand ref="demo:persona">
  <xs:arg name="audience" value="researchers"/>
</xs:expand>
<xs:expand ref="demo:task"/>
03Deliver artifacts
ir/agent/site-demo/*.xsirlinked targetagent.promptagent.psdbg
Project manifest + XML modules → binary XSIR → link → .prompt + .psdbg.
  1. 01 / AUTHOR

    Create a project. Declare dependencies.

    new generates a canonical project in an absent directory; then declare targets in xmlsquish.toml while add / remove update dependencies transactionally.

  2. 02 / COMPILE

    Compile and cache XSIR

    Compile each XML module to canonical binary XSIR; the content-addressed cache reuses unchanged pure transformations.

  3. 03 / DELIVER

    Link and publish the prompt

    Link the frozen module graph and instantiate the entry, atomically publishing .prompt plus .xsir and self-contained .psdbg companions selected by --emit.

v1.1.0 · AGENT SKILLS

Make Agent Skills auditable project dependencies.

Declare local or Git skills in the workspace-root manifest, pin their complete trees in the lockfile, and safely reconcile copies into .agents/skills. The bundled prompt-squish guide installs with one command, too.

Read the Agent Skills guide
xmlsquish.toml      [skills]
       ↓                declare
xmlsquish.lock      [[skill]] + BLAKE3
       ↓                sync-skills
.agents/skills/    review-checks/

$ xmlsquish install-skill --project

SHOW, DON'T JUST MINIFY

One project manifest. One reusable build.

Switch among the manifest, entry source, binary XSIR summary, linked target, final .prompt, and .psdbg. The example command runs from the repository root.

Explicit audience argument

JavaScript is disabled: both argument sets and all sources and outputs are shown below.

arg.audience = researchers, explicitly passed by the caller.

arg.audience = everyone, explicitly passed by the caller.

xmlsquish.toml / researchers · focused audience

Source
manifest-version = 1

[package]
name = "site-demo"
version = "1.0.0"
source-root = "."

[target.agent]
entry = "agent.xml"

agent.xml / researchers · focused audience

Source
<xs:entry xmlns:xs="https://xmlsquish.moesegfault.dev/ns" xmlns:demo="https://example.com/macros/demo">
  <xs:import src="persona.xml"/>
  <xs:import src="tasks.xml"/>
  <prompt>
    <xs:expand ref="demo:persona"><xs:arg name="audience" value="researchers"/></xs:expand>
    <xs:expand ref="demo:task"/>
  </prompt>
</xs:entry>

ir/agent/site-demo/*.xsir / researchers · focused audience

Build stage / companion
XSIR/1 canonical binary module set
target/xmlsquish/artifacts/ir/agent/site-demo/agent.xsir  2535 bytes  blake3:8571019ad9b88ee5
target/xmlsquish/artifacts/ir/agent/site-demo/persona.xsir  2425 bytes  blake3:f0fb1883049c3f43
target/xmlsquish/artifacts/ir/agent/site-demo/tasks.xsir  1664 bytes  blake3:2ec94ab1ea5f9300

agent.prompt / researchers · focused audience

Final .prompt
<prompt> <Persona> <audience> researchers </audience> <voice> clear &amp; kind </voice> </Persona> <task> Explain the trade-offs. </task> </prompt>

agent.psdbg / researchers · focused audience

Build stage / companion
PSDBG/1 self-contained debug companion
target/xmlsquish/artifacts/agent.psdbg  9600 bytes  blake3:de19134660fcbefb

xmlsquish.toml / everyone · broad audience

Source
manifest-version = 1

[package]
name = "site-demo"
version = "1.0.0"
source-root = "."

[target.agent]
entry = "agent.xml"

agent.xml / everyone · broad audience

Source
<xs:entry xmlns:xs="https://xmlsquish.moesegfault.dev/ns" xmlns:demo="https://example.com/macros/demo">
  <xs:import src="persona.xml"/>
  <xs:import src="tasks.xml"/>
  <prompt>
    <xs:expand ref="demo:persona"><xs:arg name="audience" value="everyone"/></xs:expand>
    <xs:expand ref="demo:task"/>
  </prompt>
</xs:entry>

ir/agent/site-demo/*.xsir / everyone · broad audience

Build stage / companion
XSIR/1 canonical binary module set
target/xmlsquish/artifacts/ir/agent/site-demo/agent.xsir  2529 bytes  blake3:fbf198aaf0936012
target/xmlsquish/artifacts/ir/agent/site-demo/persona.xsir  2425 bytes  blake3:f0fb1883049c3f43
target/xmlsquish/artifacts/ir/agent/site-demo/tasks.xsir  1664 bytes  blake3:2ec94ab1ea5f9300

agent.prompt / everyone · broad audience

Final .prompt
<prompt> <Persona> <audience> everyone </audience> <voice> clear &amp; kind </voice> </Persona> <task> Explain the trade-offs. </task> </prompt>

agent.psdbg / everyone · broad audience

Build stage / companion
PSDBG/1 self-contained debug companion
target/xmlsquish/artifacts/agent.psdbg  9591 bytes  blake3:b85d179e2ae77002

The data records the current manager artifact contract. The browser only presents it; binary XSIR is never passed off as XML.

Explore the source & examples

EXPLICIT CONTEXT. LOCAL STATE.

Share definitions. Isolate invocations.

SourceUnits are frozen by canonical URI. Every invocation creates a new expansion frame; only explicit arguments and fills cross the boundary.

Parent / agent.xml
xs:arg value
researchers
file.name
agent.xml
xs:argExplicit argument enters a fresh frame
Child / persona.xml
arg.audience
researchers
file.name
persona.xml ⌁

Relative src and file.* bind to the definition site, not the caller. Arguments are never inherited; every declared parameter must be explicitly supplied.

arg

Immutable arguments

Required Unicode string parameters are supplied explicitly by the caller.

arg.audience = researchers
file

Definition site

uri / dir / name describe the source that defines the current macro.

file.name = persona.xml
match

Lexical captures

Named captures live inside an ifr block; outer bindings return when it exits.

match.head · match.tail
slot / fill

Structural channel

XML node sequences remain separate from scalar arguments, with no implicit string conversion.

<xs:slot name="body"/>

SMALL LANGUAGE. USEFUL BOUNDARIES.

Compose. Select. Emit. Explicitly.

01

Import modules. Expand macros.

Modules contain macro definitions. A separate entry imports modules and constructs the prompt; expand recursively produces macro return values.

<xs:import src="persona.xml"/>
<xs:expand ref="demo:persona">
  <xs:arg name="audience" value="researchers"/>
</xs:expand>
02

Make choices at compile time.

ifr matches scalar strings with lexically scoped named captures. The complete source closure is loaded and validated before execution, including unselected branches.

<xs:ifr get="file.name" pattern="^tasks[.]xml$">
  <task>Explain the trade-offs.</task>
</xs:ifr>
03

Only insert emits a variable.

insert emits arg.*, file.*, or match.* as XML-escaped text, never reinterpreting it as markup or macros.

<answer><xs:insert get="arg.text"/></answer>
<!-- arg.text is text, never markup. -->

FROM SOURCE TO YOUR WORKFLOW

Manage the project. Then ship to your agent.

new, fmt, build, add, remove, and inspect share one manager and event protocol. New creates projects; build keeps independent work moving and publishes successful targets atomically.

new requires an absent destination; it is distinct from init for existing directories. Other commands discover xmlsquish.toml upward or accept --manifest-path.

Install from the current workspace source (Rust 1.88+) ↗
terminal / xmlsquish

# Install from the current workspace source (Rust 1.88+)

cargo install --git https://github.com/kleedaisuki/prompt-squish --locked

# Create a canonical project in an absent directory

xmlsquish new hello-prompts

# Format project sources; --check only reports

xmlsquish fmt --check --manifest-path hello-prompts/xmlsquish.toml

# Build prompt, XSIR, and debug companion

xmlsquish build --offline --manifest-path hello-prompts/xmlsquish.toml

# Add a dependency and update manifest plus lockfile

xmlsquish add prompt-kit@^1 --registry default --dry-run

# Remove a direct dependency alias

xmlsquish remove prompt-kit --dry-run

# Inspect typed IR, links, sources, cache, or artifacts

xmlsquish inspect link agent --manifest-path examples/site-demo/xmlsquish.toml

# NDJSON events for CI and tools

xmlsquish --message-format=json build --manifest-path examples/site-demo/xmlsquish.toml

One event protocol. Three terminal experiences.

Human offers progress and summaries; Short is line-oriented and grep-friendly; --message-format=json emits versioned, sequenced newline-delimited JSON (NDJSON). --plain is undecorated and append-only.

{"version":{"major":3,"minor":0},"sequence":0,"payload":{"type":"planning_started"}}
{"version":{"major":3,"minor":0},"sequence":1,"payload":{"type":"action_succeeded","data":{"kind":"compile","cache":"persistent"}}}
{"version":{"major":3,"minor":0},"sequence":2,"payload":{"type":"job_finished","data":{"status":"success"}}}

MEASURE THE RIGHT TRANSFORMATION

Cache modules. Link targets. Publish atomically.

The plan separates scan, compile, link, instantiate, backend, and publish. Only deterministic pure transformations enter the persistent action cache.

Project sources3XML filesxmlsquish.toml
Reusable XSIR3XSIR modules*.xsir
Published target1promptagent.prompt
7 / 3 modulesBuild actions
147 UTF-8 bytesagent.prompt

Counts describe the demo project structure. They do not pretend binary XSIR is text or equate a cache hit with end-to-end speed; final bytes exclude BOM.

THE FINE PRINT, UP FRONT.

Clear boundaries. Fewer surprises.

Build trusted sources and dependencies only: the frontend can read local and resolved package sources. Macros cannot read environment values, time, or launch subprocesses, and insert does not prevent prompt injection. --locked / --offline / --frozen control resolution; they are not a filesystem sandbox.

Read the full semantics and boundaries ↗
Explicit computational boundaries and budgets

Projects define boundaries. XSIR enables reuse.

The frontend preserves XML semantics; canonical binary XSIR is reusable across targets; the linker resolves imports and relocations; the publisher commits only a complete .prompt / .psdbg generation. Cache state is disposable, never authoritative project state.

project → resolve → XML → binary XSIR → link → .prompt + .psdbgDSL specification ↗

Maintainable sources. Deliverable prompts.

v1.2 · DISTRIBUTION

One compiler. Three distribution roles.

Telemetry is off by default. Opt-in evidence stays in project metadata, outside reproducible products.