# RIPER-5 in Cursor: The Research-to-Review Workflow, Setup Guide and Rule File

> RIPER-5 (Research, Innovate, Plan, Execute, Review) as a Cursor .mdc rule and SKILL.md, with Plan Mode, memory bank, model routing and a Stripe example.

Canonical: https://www.agentickit.co/blog/riper-5-cursor-workflow
Last updated: 2026-10-25

**RIPER-5 is a five-mode protocol for AI coding agents: Research, Innovate, Plan, Execute, Review. The agent may only do what the current mode allows, and it can only change mode when you say so. In Cursor you install it as an `.mdc` rule (always on) or a `SKILL.md` (on demand), and it stops the agent from jumping straight to code.**

*By Rakshit Yadav. Published 2026-10-25, last updated 2026-10-25.*

Most bad agent output has the same root cause: the agent started writing code before it understood the repo. RIPER-5 fixes that with one idea, a hard separation between thinking and typing. This guide gives you the rule file, the skill version, how it fits with Cursor Plan Mode and a memory bank, how to route a cheaper or stronger model to each phase, and a worked Stripe billing example. I have not benchmarked it against other workflows, so treat the benefits below as what the structure does, not as measured gains.

## What RIPER-5 is, and the problem it solves

Give an agent "add Stripe billing" and it will usually open a file and start editing. It guesses your auth helper, invents a `subscriptions` table that clashes with the one you have, and picks a webhook pattern you did not choose. You then review a 600-line diff built on three wrong assumptions.

RIPER-5 is a community protocol (not an official Cursor feature) that splits the work into five modes. Each mode has a short list of things it is permitted and forbidden to do. The agent declares its mode at the top of every reply, so you can see at a glance whether it is reading, brainstorming, planning, coding or checking.

## The five modes

| Mode | Allowed | Forbidden | Output |
|---|---|---|---|
| **Research** | Read files, search, summarize how things work today | Suggestions, edits, plans | Facts about the codebase |
| **Innovate** | Propose 2-3 approaches with trade-offs | Committing to one, writing code | Options and a recommendation |
| **Plan** | Write an ordered checklist with exact files and functions | Editing source files | A numbered plan |
| **Execute** | Implement the approved plan, nothing else | Deviating from the plan | Code changes |
| **Review** | Compare the diff to the plan, flag deviations | Fixing silently | A pass/fail list |

### The mode-switch guardrails

The guardrails matter more than the modes:

1. **Declare the mode.** Every reply starts with `[MODE: RESEARCH]` (or the current mode).
2. **Switch only on command.** The agent moves to the next mode only when you type something like `ENTER PLAN MODE`. It never promotes itself.
3. **Execute needs a plan.** If there is no approved plan in the conversation, Execute is refused.
4. **Deviation stops the work.** If Execute hits something the plan did not anticipate, the agent stops and asks. It does not improvise.
5. **Review is read-only.** Review lists every difference, including small ones. Fixes go back through Plan.

## The full `.mdc` rule file

Save as `.cursor/rules/riper-5.mdc`. With `alwaysApply: true` it is in context every turn, which suits a protocol that must never be forgotten. If you only want it for big features, set `alwaysApply: false` and use the skill below instead.

```markdown
---
description: RIPER-5 mode protocol. Research, Innovate, Plan, Execute, Review.
alwaysApply: true
---

# RIPER-5 protocol

Begin EVERY reply with the current mode in brackets: [MODE: RESEARCH],
[MODE: INNOVATE], [MODE: PLAN], [MODE: EXECUTE] or [MODE: REVIEW].
Default mode when a task starts: RESEARCH.

You may change mode ONLY when the user types one of:
ENTER RESEARCH MODE, ENTER INNOVATE MODE, ENTER PLAN MODE,
ENTER EXECUTE MODE, ENTER REVIEW MODE.
Never switch on your own. If you think another mode is needed, say so and wait.

## RESEARCH
- Read files, search the repo, explain how the current code works.
- Do NOT suggest changes, propose designs or edit anything.
- End with: what you learned, and what you still do not know.

## INNOVATE
- Give 2-3 approaches with pros, cons and which existing files each touches.
- Recommend one. Do NOT write code or a step list.

## PLAN
- Produce a numbered checklist. Each item names the exact file and function.
- Include test steps and anything out of scope.
- Do NOT edit source files. Save the plan to .cursor/plans/<task>.md if asked.

## EXECUTE
- Refuse to start unless an approved plan exists in this conversation.
- Implement ONLY the plan, item by item. No refactors, no extra features.
- If something unexpected appears, STOP and ask. Do not improvise.

## REVIEW
- Compare the diff to the plan line by line.
- Report each deviation, even small ones, as: item / planned / actual.
- Do NOT fix anything. End with PASS or FAIL.
```

## The `SKILL.md` version

If you want RIPER-5 only when a task is large, make it a skill. Skills load when the description matches, or when you invoke them by name. See [what a Cursor skill is](/blog/best-cursor-skills) for the folder layout. Save as `.cursor/skills/riper-5/SKILL.md`:

```markdown
---
name: riper-5
description: Use for any feature touching more than 2 files, or when asked to
  "use RIPER", "research first" or "plan before coding". Runs the
  Research, Innovate, Plan, Execute, Review protocol.
---

# RIPER-5

Work in five modes, one at a time, declaring [MODE: X] at the top of each reply.

1. RESEARCH: read only. Report current behavior and open questions.
2. INNOVATE: 2-3 options with trade-offs, one recommendation. No code.
3. PLAN: numbered checklist with exact files and functions. No source edits.
4. EXECUTE: implement the approved plan only. Stop on anything unexpected.
5. REVIEW: diff vs plan, list deviations, PASS or FAIL. Fix nothing.

Switch modes only when the user says "ENTER <MODE> MODE".
Never start EXECUTE without an approved plan.
```

**Rule or skill?** The rule costs a little context every turn but is never skipped. The skill costs nothing until it triggers, but depends on the description matching. I use the skill for features and keep trivial edits outside the protocol. Pick one home, not both.

## How it fits with Plan Mode and the memory bank

**Cursor Plan Mode.** Plan Mode (`Shift+Tab`) already makes the agent plan before editing. RIPER-5 is a superset: Plan Mode covers the "P", while Research, Innovate and Review add the steps on either side. A practical blend is to run Research and Innovate in normal chat, switch to Plan Mode for the plan, then `ENTER EXECUTE MODE`. If Plan Mode is enough for your task, use it and skip the protocol.

**Memory bank.** A memory bank is a set of files that carries project facts between chats; the setup is covered in [Cursor memory bank setup](/blog/cursor-memory-bank-setup). They solve different problems. The memory bank answers "what is true about this project," so Research starts from facts instead of rediscovering them. RIPER-5 answers "what is the agent allowed to do right now." Keep stack facts in the memory file, and write the approved plan to `.cursor/plans/` so a fresh chat can resume at Execute.

**"Magic context".** People searching this term usually want the agent to always have the right context without pasting it. Research mode does that job on demand: it forces the agent to read the relevant files and write down what it found before anything else happens. That summary becomes the context for Plan and Execute.

## Route models by phase

Model routing means using different models for different phases of the same task. The phases have different demands, so this is a reasonable fit, though I am not quoting prices or benchmarks because they change and I have not verified them here.

| Phase | What matters | Suggested tier |
|---|---|---|
| Research | Reading breadth, speed | Cheaper, fast model |
| Innovate | Judgment on trade-offs | Stronger model |
| Plan | Precision, spotting gaps | Stronger model |
| Execute | Following the plan exactly | Stronger model for risky code, cheaper for mechanical edits |
| Review | Comparing diff to plan | Cheaper model, or a different model than the one that wrote the code |

In Cursor, switch the model in the chat picker between modes. Using a different model for Review is useful on its own: a second model is less likely to share the first one's blind spots. The plan is the contract between phases, which is why a well-written plan lets a cheaper model execute it.

## Worked example: adding Stripe billing

The task: add a Pro subscription to a Next.js SaaS using Stripe Checkout.

**Before (no protocol).** The prompt "add Stripe billing with a Pro plan" produces edits to `app/api/checkout/route.ts`, a new `subscriptions` table that duplicates the existing `users.plan` column, and a webhook handler that does not verify the signature. You find all of this in review, after it is written.

**After (RIPER-5).**

1. `[MODE: RESEARCH]` The agent reads the auth helper, the `users` schema and the existing API routes. It reports: plan lives in `users.plan`, there is no webhook route, and env vars are validated in `lib/env.ts`. Open question: is the checkout hosted by Stripe or embedded?
2. `ENTER INNOVATE MODE` It offers Stripe Checkout (hosted) versus Elements (embedded), with the files each touches, and recommends hosted Checkout because the schema already has one plan column.
3. `ENTER PLAN MODE` A numbered plan: add `STRIPE_*` keys to `lib/env.ts`; add `app/api/checkout/route.ts`; add `app/api/stripe/webhook/route.ts` that verifies the signature and updates `users.plan`; add a test for the webhook; out of scope: customer portal. You fix one item (idempotent webhook handling) and approve.
4. `ENTER EXECUTE MODE` The agent works item by item. At item 3 it finds the webhook needs the raw request body, which the plan did not mention. It stops and asks instead of guessing, and you amend the plan.
5. `ENTER REVIEW MODE` It compares the diff to the plan and flags one deviation: it added a helper file the plan did not list. You decide whether to keep it.

Net result: you reviewed a research summary, an option list and a plan, all short, before reading any code. The mistakes surfaced when they were cheap to fix. The price is more round trips. For this feature that was worth it.

For a security pass at the end, ask the [security-auditor](/agents/security-auditor) agent to look at the webhook and key handling, since Review checks plan conformity, not security.

## Pitfalls and when not to use it

- **Ceremony on small tasks.** A rename or a copy fix does not need five modes. Skip it.
- **Agents that ignore the rule.** Long chats dilute instructions. If the `[MODE: X]` header disappears, the protocol is no longer active; start a fresh chat and resume from the saved plan.
- **Vague plans.** "Update the database" is not a plan. Demand file and function names.
- **Rubber-stamping Review.** A model grading its own work is lenient. Use a second model or read the diff yourself.
- **Both rule and skill installed.** Duplicated instructions waste context and can conflict.
- **Treating it as safety.** The protocol is a prompt, not a sandbox. It reduces off-plan edits but cannot prevent them.

Skip RIPER-5 for throwaway spikes, one-file fixes, and tasks where you already know the exact change.

## FAQ

**What does RIPER-5 stand for?** Research, Innovate, Plan, Execute, Review. The "5" is the number of modes.

**Is RIPER-5 a built-in Cursor feature?** No. It is a community prompt protocol that you add as a rule or skill. Cursor's built-in Plan Mode covers only the planning step.

**Should I use a rule or a skill?** Use a rule if you want it on every turn. Use a skill if you only want it for larger features and are fine with the agent matching on the description.

**Does it work in Claude Code?** The same text works as a `SKILL.md` or in `CLAUDE.md`. AgenticKit ships skills to both `.cursor/` and `.claude/`.

**Does model routing really save money?** It can, because exploration and checking are read-heavy. I have not measured the saving, so test on your own tasks.

**How is this different from a memory bank?** A memory bank stores project facts. RIPER-5 controls what the agent may do at each step. They work well together.

## Next steps

Copy the rule, run it on your next multi-file feature, and see whether the plan catches what you would have caught in review. Related reading: the [shipping workflow](/blog/cursor-workflow-shipping-saas) and [Cursor rules for SaaS founders](/blog/cursor-rules-saas-founders). To get 34 agents, 61 skills and 47 commands in your repo with one command, see [pricing](/pricing).


## Related
- [rules-grader](https://www.agentickit.co/tools/rules-grader)
- [config-converter](https://www.agentickit.co/tools/config-converter)
- [tech-lead](https://www.agentickit.co/agents/tech-lead)
- [code-reviewer](https://www.agentickit.co/agents/code-reviewer)
- [security-auditor](https://www.agentickit.co/agents/security-auditor)
- [project-conventions](https://www.agentickit.co/skills/project-conventions)
- [security-basics](https://www.agentickit.co/skills/security-basics)
- [/feature-spec](https://www.agentickit.co/commands/feature-spec)
- [/audit](https://www.agentickit.co/commands/audit)
