Basic Workflow - johnpeterman72/CursorRIPER.sigma GitHub Wiki

๐Ÿ”„ Basic CursorRIPERโ™ฆฮฃ Workflow

Understanding the RIPER workflow is key to maximizing your productivity with AI assistance. This guide explains how to use the framework effectively.

๐ŸŽฏ The RIPER Philosophy

RIPER stands for:

  • Research - Understand the problem
  • Innovate - Explore solutions
  • Plan - Design the approach
  • Execute - Implement the solution
  • Review - Validate the results

Each mode has specific purposes and restrictions to keep you and the AI focused.

๐Ÿ”„ The Workflow Cycle

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐Ÿ” RESEARCH โ”‚ โ† Start here
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ ๐Ÿ’ก INNOVATE  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐Ÿ“ PLAN     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ โš™๏ธ EXECUTE   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ ๐Ÿ”Ž REVIEW    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ” Research Mode (ฮฉโ‚)

Purpose: Gather information and understand requirements

What You Can Do:

  • โœ… Read existing code and documentation
  • โœ… Ask questions about the project
  • โœ… Analyze current implementation
  • โœ… Document findings

What You Cannot Do:

  • โŒ Write or modify code
  • โŒ Create new files
  • โŒ Make design decisions

Example Workflow:

/research

"Analyze the current authentication system and identify security vulnerabilities"

!af src/auth/login.js      # Add relevant files to context
!ad src/auth/             # Add authentication folder

Memory Updates:

  • ๐Ÿ“‹ projectbrief.md - Requirements documented
  • ๐Ÿ’ป techContext.md - Technical findings recorded

๐Ÿ’ก Innovate Mode (ฮฉโ‚‚)

Purpose: Explore ideas and potential solutions

What You Can Do:

  • โœ… Suggest new approaches
  • โœ… Explore alternatives
  • โœ… Discuss pros and cons
  • โœ… Create conceptual designs

What You Cannot Do:

  • โŒ Implement solutions
  • โŒ Write actual code
  • โŒ Make final decisions

Example Workflow:

/innovate

"What are modern alternatives to session-based authentication?"

!ac authenticationConcepts   # Track conceptual ideas
!adoc OAuth2 Specification   # Reference relevant docs

Memory Updates:

  • ๐Ÿ”ฎ activeContext.md - Ideas and concepts tracked
  • ๐Ÿ›๏ธ systemPatterns.md - Potential patterns noted

๐Ÿ“ Plan Mode (ฮฉโ‚ƒ)

Purpose: Create detailed implementation plans

What You Can Do:

  • โœ… Create specifications
  • โœ… Design architecture
  • โœ… Sequence implementation steps
  • โœ… Define success criteria

What You Cannot Do:

  • โŒ Write production code
  • โŒ Execute the plan
  • โŒ Skip planning steps

Example Workflow:

/plan

"Create a detailed plan to migrate from sessions to JWT authentication"

# The AI will create a numbered checklist:
1. Install required dependencies (jsonwebtoken, bcrypt)
2. Create JWT utility functions
3. Modify user model for refresh tokens
4. Update login endpoint
5. Create token refresh endpoint
6. Update middleware for JWT validation
7. Migrate existing sessions
8. Update client-side token handling

Protection Planning:

!cp Identify critical sections that need protection
!cg Mark sections that require review before changes

Memory Updates:

  • ๐Ÿ”ฎ activeContext.md - Plan details stored
  • ๐Ÿ“Š progress.md - Milestones defined

โš™๏ธ Execute Mode (ฮฉโ‚„)

Purpose: Implement exactly according to plan

What You Can Do:

  • โœ… Write code following the plan
  • โœ… Create and modify files
  • โœ… Run tests
  • โœ… Fix bugs

What You Cannot Do:

  • โŒ Deviate from the plan
  • โŒ Add unplanned features
  • โŒ Search web (stay focused!)
  • โŒ Redesign on the fly

Example Workflow:

/execute

"Implement step 2 from our plan: Create JWT utility functions"

# AI writes code exactly as planned
!af src/utils/jwt.js       # Track new files
!ac generateToken()        # Track new functions

Protection in Execution:

// !cp PROTECTED - JWT Secret
const JWT_SECRET = process.env.JWT_SECRET;
// !cp END-P

// !cc CRITICAL - Token Generation
function generateToken(user) {
    return jwt.sign(
        { id: user.id, email: user.email },
        JWT_SECRET,
        { expiresIn: '24h' }
    );
}
// !cc END-C

Memory Updates:

  • ๐Ÿ“Š progress.md - Implementation progress tracked
  • ๐Ÿ›ก๏ธ protection.md - Protected regions recorded

๐Ÿ”Ž Review Mode (ฮฉโ‚…)

Purpose: Validate implementation against requirements

What You Can Do:

  • โœ… Check code quality
  • โœ… Verify against plan
  • โœ… Identify issues
  • โœ… Suggest improvements

What You Cannot Do:

  • โŒ Modify code
  • โŒ Implement fixes
  • โŒ Change requirements

Example Workflow:

/review

"Review the JWT implementation against our security requirements"

!ac generateToken()        # Review specific functions
!af test/auth.test.js     # Check test coverage

Review Outputs:

  • โœ… PASS: Matches plan exactly
  • โš ๏ธ WARNING: Minor deviations found
  • โŒ FAIL: Does not match plan

Memory Updates:

  • ๐Ÿ“Š progress.md - Review results recorded
  • ๐Ÿ”ฎ activeContext.md - Issues documented

๐Ÿ”„ Mode Transitions

Forward Progression:

/r โ†’ /i โ†’ /p โ†’ /e โ†’ /rev

When to Switch Modes:

  1. Research โ†’ Innovate

    • When you understand the problem
    • Requirements are clear
    • Ready to explore solutions
  2. Innovate โ†’ Plan

    • When you've chosen an approach
    • Ready to create specifications
    • Need concrete steps
  3. Plan โ†’ Execute

    • When plan is complete
    • All steps are clear
    • Ready to implement
  4. Execute โ†’ Review

    • When implementation is done
    • Need to validate work
    • Ready for quality check

Jumping Between Modes:

You can jump to any mode when needed:

/review โ†’ /research   # Need more information
/execute โ†’ /plan      # Plan needs revision
/innovate โ†’ /execute  # Emergency fix (not recommended)

๐Ÿ“Ž Context Management Throughout Workflow

Research Phase Context:

!ad src/              # Broad context
!adoc README.md       # Documentation
!ag main             # Git history

Innovation Phase Context:

!ac conceptA()        # Conceptual references
!an "Design Ideas"    # Notepad references
!adoc "Best Practices" # External docs

Planning Phase Context:

!af config.json       # Specific files
!ar coding-standards  # Project rules
!ad src/components/   # Target directories

Execution Phase Context:

!pf critical.js       # Pin critical files
!ac implementedFunc() # Track new code
!cc                   # Clear old context

Review Phase Context:

!ag feature-branch    # Git differences
!af test-results.log  # Test outputs
!ac reviewTarget()    # Specific functions

๐Ÿ›ก๏ธ Protection Throughout Workflow

When to Add Protection:

  1. During Planning:

    • Identify sensitive areas
    • Mark future protection needs
  2. During Execution:

    • Protect as you write
    • Guard critical logic
  3. During Review:

    • Verify protection coverage
    • Add missing protections

Protection Strategy:

// Research: Identify sensitive areas
// Plan: Design protection strategy
// Execute: Implement with protection
// !cp PROTECTED - Never modify
const CRITICAL_CONFIG = {
    apiKey: process.env.API_KEY,
    secretKey: process.env.SECRET_KEY
};
// !cp END-P

// Review: Verify all critical code is protected

๐Ÿ” Permission Awareness

Permission Checking:

!ckp              # Check current mode permissions
!pm write_code    # Can I write code now?
!vm read_files    # What mode for reading files?

Common Permission Errors:

  1. "Cannot write code in RESEARCH mode"

    • Switch to EXECUTE mode first
  2. "Cannot search web in EXECUTE mode"

    • Complete execution, then switch to RESEARCH
  3. "Cannot modify plan in EXECUTE mode"

    • Switch back to PLAN mode

๐Ÿ’ก Workflow Best Practices

1. Complete Each Phase

Don't skip steps. Each mode builds on the previous.

2. Use Memory Bank

Your progress is saved automatically. Reference it:

"According to our plan in progress.md..."
"As documented in projectbrief.md..."

3. Maintain Context Focus

  • Research: Broad context
  • Plan: Specific targets
  • Execute: Narrow focus
  • Review: Comparison context

4. Protect Early and Often

Add protection during planning and execution, not as an afterthought.

5. Trust the Process

The restrictions exist to improve outcomes. Embrace them!

๐ŸŽฏ Common Workflows

Feature Development:

  1. /r - Research existing code
  2. /i - Explore feature approaches
  3. /p - Plan implementation
  4. /e - Build feature
  5. /rev - Validate completion

Bug Fixing:

  1. /r - Investigate bug
  2. /p - Plan fix approach
  3. /e - Implement fix
  4. /rev - Verify fix works

Refactoring:

  1. /r - Analyze current code
  2. /i - Explore refactoring options
  3. /p - Plan refactoring steps
  4. /e - Execute refactoring
  5. /rev - Ensure functionality preserved

๐Ÿš€ Advanced Workflow Tips

Parallel Workflows:

Work on multiple features by switching context:

!cc                    # Clear context
!cm                    # Set mode-appropriate context
!af feature-b.js       # Focus on different feature

Workflow Shortcuts:

/r  โ†’ /i  โ†’ /p  โ†’ /e  โ†’ /rev   # Quick mode switches
!cm                             # Auto-set context for mode

Emergency Workflow:

For urgent fixes (use sparingly):

/p                     # Quick plan
"Emergency fix for [issue]"
/e                     # Immediate execution

๐Ÿ“š Next Steps

Now that you understand the basic workflow:


โ† First Project | Home | Core Concepts โ†’