Prompt Compiler · case study

From a rough request to a plan you can check.

Prompt Compiler turns a vague request into a structured prompt, a step-by-step execution plan and a policy check. Its core runs offline and gives the same result every time. A companion tool, PR Safety, gives an advisory verdict on a pull request before you merge it.

15-second animated tour from the project README. Silent.Compile a request, then check a pull request.

Clearer instructions, fewer surprises.

For people who hand work to AI models and coding agents, and want to see the plan and the risks first.

Compile

Structure the request

Type a feature idea, bug report or research question. Get a system prompt, a user prompt, an execution plan and an expanded prompt that is ready to paste into any model.

Check

See the risk first

A policy layer sets a risk level, an execution mode, data sensitivity and allowed tools. A readiness check then says whether the prompt is ready to run under that policy.

Review

Decide on a pull request

Paste a pull request’s title, description and changed files. PR Safety answers merge, hold, split or rebase, and shows the signals behind the answer. It advises and never blocks a merge.

One engine, several outputs.

Every output is generated from the same structured description of the request.

  1. Read the request

    Offline heuristics work out what is being asked, in which domain, and which cues suggest risk. Conservative mode, on by default, keeps the output grounded in what you actually wrote.

  2. Describe it once

    The result becomes an intermediate representation with steps, constraints and policy fields. The prompts, the plan and the checks are all generated from it.

  3. Plan the steps

    Coordinated tasks are split into ordered steps. Steps can be tagged explore, decide, execute or verify to tell an agent how much freedom to take; a clear, simple request gains no extra text.

  4. Check readiness

    The policy layer and the readiness check flag risky requests before anything runs downstream.

  5. Enrich, optionally

    When enabled, a server-side model call through OpenRouter can enrich the result. If that call fails, the compiler falls back to the offline output.

Decisions worth a closer look.

Prompt Compiler is a personal project, built with the help of AI coding assistants. These are the parts I would walk a reviewer through first.

  • An offline, deterministic core. Compiling needs no API key and no network, which keeps results repeatable and easy to test.
  • Regression gates around it. A large pytest suite, including dedicated gate tests, keeps the core’s behaviour from drifting as features are added.
  • PR Safety. An offline merge-readiness advisor with a web view, a promptc pr-safety --from-git command-line mode and a Markdown report to paste into the pull request.
  • One engine, several surfaces. A FastAPI backend, a Next.js web app, a Chrome extension on the Chrome Web Store and a VS Code extension packaged by CI, not yet on the Marketplace.
  • Grounded by default. Missing information leads to a clarifying question rather than invented libraries or requirements.

Built with.

Limits worth knowing: PR Safety only looks at what you paste. It does not call the GitHub API or any model, and its verdict is advice for the person reviewing, not a gate.