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.
Prompt Compiler · case study
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.
What it does
For people who hand work to AI models and coding agents, and want to see the plan and the risks first.
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.
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.
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.
How it works
Every output is generated from the same structured description of 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.
The result becomes an intermediate representation with steps, constraints and policy fields. The prompts, the plan and the checks are all generated from it.
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.
The policy layer and the readiness check flag risky requests before anything runs downstream.
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.
What I built
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.
promptc pr-safety --from-git command-line mode and a Markdown report to paste into the pull request.Stack
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.