PIRL Framework — a Plan · Implement · Review workflow for AI coding agentsAI writes your code in minutes. Who plans, verifies and reviews it?
PIRL makes the coding agent you already use plan the work, implement it and then review it in a separate session. It is a set of instruction files installed into your repository. It calls no model and needs no API key.
npx pirl-framework
See it on npm
Run it at the root of your repository.
~/shop-api $ npx pirl-framework init --host claude,cursor --yesInstalled PIRL 1.2.1 in .pirl/; hosts: claude, cursor; 14 adapter file(s) written.Commit .pirl/ and the adapter files with your repository; Git keeps Plans, reports and records out through .pirl/.gitignore.~/shop-api $ git status --short?? .claude/ ?? .cursor/ ?? .mcp.json ?? .pirl/~/shop-api $ npx pirl-framework statusPIRL 1.2.1 in ~/shop-api/.pirl Hosts: claude, cursor Browser MCP server registered in project files: yes (--no-mcp stops it) Framework files changed since install or update: none
One agent plans, codes & grades itself
The problemOne prompt, one agent
“Looks good”Nothing defines “done”. The coding agent that wrote the code is the one that checks it.
With PIRL
A possible FAILQuality gates are set before the code. A sub-agent verifies the work. A new session reviews it. Every conclusion cites its source.
How PIRL works
3 layers + self-evaluationYour coding agent becomes a team
9 rolesPlan
No code yetImplement
one PlanReview
new sessionvolume or for RISKs and BLOCKs, in a sub-agent
code-analystsolution-architectbusiness-analyst
This page, built with PIRL
A real runThis page was rewritten through PIRL's three layers. The excerpts below are copied from the files of that run. Each excerpt leaves out whole lines only. A “…” line marks each gap.
Plan
Session 1The request became one Plan task with six requirements and seven quality gates.
schema: pirl-plan/v1
…
task_id: T01
title: "Make the landing page a sourced usage guide with real illustrations"
…
implementation_roles: [frontend-developer]
verification_roles: [code-analyst, ux-designer, code-reviewer]
…
- REQ-03 | Source: user's words "kiểm tra từng từ để xem câu có ý nghĩa không" (check every word to see whether each sentence means something) | Requirement: each visible sentence, heading, label and FAQ answer states one idea in a complete sentence or a noun phrase, names things as the sources name them, uses no vague quantifier or hedge ("some", "usually", "seems") where a number or a source exists, and each factual claim in it traces to one source location; the `FAQPage` answers in the JSON-LD are the same text as the visible FAQ answers.Implement
Session 1A sub-agent checked the quality gates in three rounds. One gate still failed after the two repairs PIRL allows.
## Implementation Record - status: failed … - quality_gate_results: QG-01=PASS; QG-02=PASS; QG-03=FAIL; QG-04=PASS; QG-05=BLOCKED; QG-06=PASS; QG-07=PASS … - residual_risk: QG-03 still FAILs after the two repairs allowed for one cause: round 3 found "Each role is evaluated and the run is recorded" (landing/index.html:456, two clauses), "no gates" (:406, short for "quality gates"), and two labels that are neither sentences nor noun phrases, "Can say FAIL" (:412) and "In a new session that did not write the code" (:448); the layout of the changed page is not captured
Review
A separate cloud sessionA session that did not write the page reviewed it. The review named all 17 sentences that still broke the wording gate. The layout gate stayed BLOCKED, because neither host had browser tools.
business_verdict: FAIL
verdict: FAIL
coding_checklist: PASS
…
#### FIND-01
…
| QG | QG-03 |
| Impact | A visitor reads 17 labels and sentences that miss a subject or a verb, join two clauses or use a name the sources do not use; the page does not meet the user's request "kiểm tra từng từ để xem câu có ý nghĩa không" (REQ-03). |
…
| Disposition | repair |
…
#### BLOCK-01
…
| Cause | Caused by the environment: the hosts of both runs expose no browser MCP tools, so no Implement run could capture; the layout verification instructions ("Browser tools") make the layout part BLOCKED with the user as owner in that case (`review.instructions.md` 2.6.3, "AI Agent roles at the Review layer"). |
…
| Disposition | escalate |Self-evaluation: the rule each layer fixed in PIRL itself
| Layer | Record | Issue | File fixed |
|---|---|---|---|
| Plan | plan-20261128-152623-T01 | product-file-made-by-running-app | .agents/instructions/layered-task-execution.instructions.md, .agents/instructions/plan.instructions.md |
| Implement | implement-20261128-161914-T01 | set-qg-fail-names-only-some-members | .agents/instructions/layered-task-execution.instructions.md |
| Review | review-20261128-163941-T01 | review-block-cause-outside-diff-and-plan | .agents/instructions/review.instructions.md |
This version of the page rewrites the 17 sentences of the review's FIND-01.
Install
4 stepsCheck
Python 3.9+
A Git repository
Run
npx pirl-frameworkthen choose your coding agents
Commit
.pirl/ and the adapter files it wrote for your coding agents, so your team shares the same rules
Restart
.claude/
├─ rules/pirl.md instructions for every session
└─ skills/pirl-*/ 5
.cursor/
├─ rules/pirl.mdc
├─ skills/pirl-*/ 5
└─ mcp.json browser MCP server
.mcp.json browser MCP server for Claude Code
Supported coding agents and the adapter files PIRL writes for them
| Coding agent | --host | Instructions loaded in every session | Skills |
|---|---|---|---|
| Claude Code | claude | .claude/rules/pirl.md | .claude/skills/pirl-*/ |
| GitHub Copilot | copilot | .github/instructions/pirl.instructions.md | .github/skills/pirl-*/ |
| Codex CLI | codex | A marked block in AGENTS.md | .agents/skills/pirl-*/ |
| Cursor | cursor | .cursor/rules/pirl.mdc | .cursor/skills/pirl-*/ |
| Gemini CLI | gemini | A marked block in GEMINI.md | .gemini/skills/pirl-*/ |
| Antigravity | antigravity | .agents/rules/pirl.md | .agents/skills/pirl-*/ |
- Your own files — in a file you already own, PIRL writes only between
<!-- pirl:begin -->and<!-- pirl:end -->. It never writes toCLAUDE.md. - Browser MCP server — for layout verification, a new install registers a browser MCP server in the project-level MCP file of each coding agent that has one. It needs Node, npm and a browser. GitHub Copilot has no such file. Register
node .pirl/bin/pirl.mjs mcpas an MCP server yourself. Skip it with--no-mcp. - Scripts and CI — name the hosts:
npx pirl-framework init --host claude,codex.
Ask in plain words
Or call a skill| You want to | Example request |
|---|---|
| Plan | “Create a Plan: customers get an email when an order is cancelled” |
| Implement | “Implement Plan T01” |
| Review | “Review the implementation of Plan T01” |
| Fix per a Review | “Fix per report <report path>” |
| Work outside a Plan | “Update the AGENTS.md of this repository” |
| Change the framework | “Fix the cleanup rule in the router” |
- Skills — the installer writes the skills
pirl-plan,pirl-implement,pirl-review,pirl-standaloneandpirl-maintaininto the skill folder of each coding agent you choose. You can also call each skill with that coding agent's slash command, for example/pirl-planin Claude Code. - Review in a new session — ask for the Review in a session that did not run the Implement layer. In the same session, PIRL does not start it and asks you to open a new one.
- Where the output goes — Plans and Review reports go into
.pirl/unless you name another folder. They stay out of Git. - Which repository — PIRL works on the repository it is installed in. To work on another one, name it in your request.
Commands
Install · update · remove| Command | What it does |
|---|---|
npx pirl-framework | Installs PIRL. Once it is installed, shows its status and offers to add hosts, update PIRL or remove hosts. |
npx pirl-framework@latest update | Updates .pirl/ and keeps your local improvements. On a conflict it changes nothing until you resolve it and run update --continue. |
npx pirl-framework remove --host <list> | Removes those hosts' adapter files. Delete .pirl/ to uninstall. |
node .pirl/bin/pirl.mjs sync | Regenerates the adapter files after .pirl/ changed. |
- Options —
--host <list>,--yes,--dir <folder>,--force(overwrite adapter files edited by hand),--mcp/--no-mcp(register or stop registering the browser MCP server),--help.
Who it is for — developers who build with AI coding agents and want the work planned, verified and reviewed with evidence, by a review that can say “no”.
Questions
FAQWhat is PIRL Framework?
PIRL (Plan – Implement – Review Layer) is a set of instruction files that coordinates software development work for AI coding agents. It plans a request with quality gates, implements one Plan and has a sub-agent verify it, reviews the result in a new session, and evaluates every layer run.
Is it only a code review tool?
No. Review is one of three layers. Plan sets the requirements and quality gates. Implement carries out one Plan. Review checks the result against that Plan.
Can I use it for work that does not need a Plan?
Yes. A standalone task is work you assign directly, such as writing or updating documentation, an investigation or a small fix. PIRL does it within the scope you set, checks its own output and reports what was done, how it was checked and what remains unknown.
How is it different from prompting the agent yourself?
The Plan sets quality gates before any code is written. No role verifies its own output. The review runs in a session that did not write the code. Every conclusion cites its source. When evidence is missing, the verdict is BLOCKED, not a guessed PASS.
Which AI coding agents does it work with?
PIRL works with Claude Code, GitHub Copilot, Codex CLI, Cursor, Gemini CLI and Antigravity. The installer writes the instruction and skill files that each of them reads.
What do I need to run it?
You need Node.js 18 or newer for the installer, Python 3.9 or newer for the validator, the record tool and the skill scripts, and a local Git repository. The browser MCP server used for layout verification also needs npm and a browser.
Does it cost anything or need an API key?
No. PIRL is free under the MIT license. It calls no model and needs no API key. Your coding agent runs it with the model you already chose.
Does it commit, push or deploy for me?
No. PIRL never commits, pushes or deploys unless you ask. It keeps your uncommitted changes. Plans, Review reports and records stay out of Git.
How do I update or remove it?
Run npx pirl-framework@latest update to update .pirl/ and keep your local improvements. Run npx pirl-framework remove --host <list> to remove a host's adapter files. Delete .pirl/ to uninstall.