A free MIT package on npm

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.

Install in one command
~/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
Real output of pirl-framework 1.2.1 in a new Git repository. Only the repository path is shortened to ~/shop-api.

One agent plans, codes & grades itself

The problem

One prompt, one agent

“Looks good”
Prompt→Agent codes→Agent checks↺ same agent
“Looks good.”— no plan, no quality gates, no record

Nothing defines “done”. The coding agent that wrote the code is the one that checks it.

With PIRL

A possible FAIL
Plan→Implement→Review
PASSFAILBLOCKED

Quality 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-evaluation
Review can say: ✓ Pass✕ Fail■ Blocked Missing evidence gives BLOCKED, never a guessed PASS.
Self-evaluation: The process-auditor role evaluates each role, fixes the cause in PIRL's own instructions when an issue meets its improvement threshold, writes a record and tells you what it changed.
You stay in charge: Each layer runs only when you ask for it. A finished layer does not start the next one.
Work outside a Plan: Standalone tasks — documentation, an investigation or a small fix you assign directly — are done within the scope you set, checked by the coding agent and reported under the same core rules.
A 3-minute recording of real Claude Code sessions running PIRL on a small demo repository: a Plan, its implementation, and a Review in a new session. Long waits are sped up, as the video marks.

Your coding agent becomes a team

9 roles

Plan

No code yet
Settle what to build business-analystsolution-architectcode-analystux-designer

Implement

one Plan
Write the change backend-developerfrontend-developertechnical-writer Check it, in a sub-agent code-reviewercode-analystux-designer

Review

new session
Challenge the diff and check the layout code-reviewerux-designer Roles that join by volume or for RISKs and BLOCKs, in a sub-agent code-analystsolution-architectbusiness-analyst
process-auditorruns after every layer in its own sub-agent. It evaluates each role, fixes the cause in PIRL's own instructions when an issue meets its improvement threshold, and writes a record.
roleMarked roles run in a sub-agent. No role checks its own work.·Each Plan picks the smallest team with the expertise the task needs.

This page, built with PIRL

A real run

This 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.

1

Plan

Session 1

The request became one Plan task with six requirements and seven quality gates.

Plan filelanding-page-real-data_20261128-151843/01-plan-usage-guide-20261128-151843.md
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.
2

Implement

Session 1

A sub-agent checked the quality gates in three rounds. One gate still failed after the two repairs PIRL allows.

Implementation Record, in the Plan filelanding-page-real-data_20261128-151843/01-plan-usage-guide-20261128-151843.md
## 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
3

Review

A separate cloud session

A 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.

Review report, round 1landing-page-real-data_20261128-151843/t01-usage-guide/round-01-review-usage-guide-20261128-162832.md
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

LayerRecordIssueFile fixed
Planplan-20261128-152623-T01product-file-made-by-running-app.agents/instructions/layered-task-execution.instructions.md, .agents/instructions/plan.instructions.md
Implementimplement-20261128-161914-T01set-qg-fail-names-only-some-members.agents/instructions/layered-task-execution.instructions.md
Reviewreview-20261128-163941-T01review-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 steps
A 23-second recording of a real install in a new Git repository: npx pirl-framework, choosing Claude Code and Cursor, the files it writes and the commit.
~/shop-api--host claude,cursor
.pirl/ PIRL itself: rules, roles, skills, scripts
.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
The files a real install wrote for two coding agents. The 5 skills: plan, implement, review, standalone, maintain.

Supported coding agents and the adapter files PIRL writes for them

Coding agent--hostInstructions loaded in every sessionSkills
Claude Codeclaude.claude/rules/pirl.md.claude/skills/pirl-*/
GitHub Copilotcopilot.github/instructions/pirl.instructions.md.github/skills/pirl-*/
Codex CLIcodexA marked block in AGENTS.md.agents/skills/pirl-*/
Cursorcursor.cursor/rules/pirl.mdc.cursor/skills/pirl-*/
Gemini CLIgeminiA marked block in GEMINI.md.gemini/skills/pirl-*/
Antigravityantigravity.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 to CLAUDE.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 mcp as 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 toExample 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-standalone and pirl-maintain into 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-plan in 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
CommandWhat it does
npx pirl-frameworkInstalls PIRL. Once it is installed, shows its status and offers to add hosts, update PIRL or remove hosts.
npx pirl-framework@latest updateUpdates .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 syncRegenerates 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

FAQ

What 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.