Integration - johnpeterman72/CursorRIPER GitHub Wiki
Integration
The CursorRIPER Framework is designed to integrate with various development tools and workflows. This page explains how to integrate the framework with your existing development environment.
IDE Integration
Cursor Custom Modes
The framework can be enhanced with Cursor IDE's Custom Modes feature for a more integrated experience.
Setting Up Custom Modes
-
Enable Custom Modes:
- Open Cursor Settings
- Go to Features → Chat → Custom Modes
- Toggle the feature on
-
Create RIPER Modes:
For each mode, click "Add custom mode" and configure as follows:
Research Mode
- Name: Research
- Icon: 🔍
- Shortcut: Ctrl+Alt+R (or your preference)
- Tools:
- ✅ Search Codebase
- ✅ Read File
- ✅ Search Files
- ✅ Web Search
- ❌ All other tools
- Custom Instructions:
Only gather information and understand existing code. Do not make suggestions, implementations, or plans. Begin every response with [MODE: RESEARCH]. Only seek to understand what exists, not what could be. Ask clarifying questions when needed.
Innovate Mode
- Name: Innovate
- Icon: 💡
- Shortcut: Ctrl+Alt+I
- Tools:
- ✅ Search Codebase
- ✅ Read File
- ✅ Search Files
- ✅ Web Search
- ❌ All other tools
- Custom Instructions:
Brainstorm potential approaches without concrete planning or implementation. Present all ideas as possibilities, not decisions. Begin every response with [MODE: INNOVATE]. Discuss advantages and disadvantages of different approaches. Seek feedback on ideas.
Plan Mode
- Name: Plan
- Icon: 📝
- Shortcut: Ctrl+Alt+P
- Tools:
- ✅ Search Codebase
- ✅ Read File
- ✅ Search Files
- ✅ Web Search
- ✅ Terminal (read-only)
- ❌ All other tools
- Custom Instructions:
Create detailed technical specifications without any implementation. Begin every response with [MODE: PLAN]. Ask clarifying questions first, then draft a comprehensive plan. Convert the plan into a numbered checklist of specific actions. Do not write or suggest code.
Execute Mode
- Name: Execute
- Icon: ⚙️
- Shortcut: Ctrl+Alt+E
- Tools:
- ✅ Search Codebase
- ✅ Read File
- ✅ Search Files
- ✅ Edit File
- ✅ Create File
- ✅ Terminal
- ✅ Apply Edits
- Custom Instructions:
Implement exactly what was planned in Plan mode, without deviation. Begin every response with [MODE: EXECUTE]. If any issues require deviation, immediately return to Plan mode. Mark items as complete as they are implemented. Track progress against the plan.
Review Mode
- Name: Review
- Icon: 🔍
- Shortcut: Ctrl+Alt+V
- Tools:
- ✅ Search Codebase
- ✅ Read File
- ✅ Search Files
- ❌ All other tools
- Custom Instructions:
Validate implementation against the approved plan, explicitly flagging any deviations. Begin every response with [MODE: REVIEW]. Format deviation notices as ":warning: DEVIATION DETECTED: [description]". Conclude with explicit verdict on whether implementation matches plan exactly.
Benefits of Custom Modes Integration
- Visual Indicators: Icons and visual cues for each mode
- Tool Permissions: Proper tool restrictions for each mode
- Quick Access: Easy switching via Cursor's mode dropdown
- Visual Feedback: Clear indication of current mode
- Native Integration: Seamless experience within Cursor
Keyboard Shortcuts
In addition to custom mode shortcuts, you can set up keyboard shortcuts for common framework commands:
- Open Cursor Settings → Keyboard Shortcuts
- Add custom shortcuts for:
- Start Phase:
Ctrl+Shift+S
- Research Mode:
Ctrl+Shift+R
- Innovate Mode:
Ctrl+Shift+I
- Plan Mode:
Ctrl+Shift+P
- Execute Mode:
Ctrl+Shift+E
- Review Mode:
Ctrl+Shift+V
- Start Phase:
Configure these to send the appropriate command text to the chat.
Rules Integration
The framework leverages Cursor's Rules system for AI behavior modification. Some additional integrations include:
- Context-aware completions: Create additional rules for specific file types
- Custom prompts: Add specialized prompts for project-specific tasks
- File templates: Use rules to standardize new file creation
Version Control Integration
Git Hooks
Set up Git hooks to manage memory bank updates and validations:
Pre-commit Hook
Create .git/hooks/pre-commit
:
#!/bin/bash
# Check if memory bank files have been updated
if git diff --cached --name-only | grep -q "memory-bank/"
then
echo "Memory bank files have been modified. Validating..."
# Add validation logic here
fi
# Create automatic backups of memory bank before commits
BACKUP_DIR="memory-bank/backups/$(date +%Y%m%d_%H%M%S)"
mkdir -p "$BACKUP_DIR"
cp memory-bank/*.md "$BACKUP_DIR/"
echo "Created memory bank backup in $BACKUP_DIR"
Make it executable:
chmod +x .git/hooks/pre-commit
Post-checkout Hook
Create .git/hooks/post-checkout
:
#!/bin/bash
# Check if memory bank structure exists after checkout
if [ ! -d "memory-bank" ]; then
echo "Warning: Memory bank directory missing. Creating basic structure..."
mkdir -p "memory-bank"
# Add logic to create basic memory files if needed
fi
Make it executable:
chmod +x .git/hooks/post-checkout
.gitignore Configuration
Configure .gitignore to handle memory bank files appropriately:
# Include memory bank core files
!memory-bank/*.md
# Exclude backup directories
memory-bank/backups/
# Exclude temporary files
memory-bank/*.tmp
memory-bank/*.bak
# Include rules directory
!.cursor/rules/
Branching Strategy
Implement a branching strategy that works well with the framework:
- feature/* branches for new features
- plan/feature/* branches for planning phase
- execute/feature/* branches for implementation
- review/feature/* branches for review
This allows for clear separation of concerns and easier tracking of work in progress.
CI/CD Integration
GitHub Actions Integration
Create a GitHub Action workflow for memory bank validation:
name: Memory Bank Validation
on:
push:
paths:
- 'memory-bank/**'
- '.cursor/rules/**'
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Validate Memory Bank Structure
run: |
# Check for required files
for file in projectbrief.md systemPatterns.md techContext.md activeContext.md progress.md; do
if [ ! -f "memory-bank/$file" ]; then
echo "::error::Missing required memory bank file: $file"
exit 1
fi
done
- name: Validate Markdown
uses: actionshub/markdownlint@main
with:
path: memory-bank/
Jenkins Pipeline Integration
Create a Jenkinsfile with framework validation:
pipeline {
agent any
stages {
stage('Validate Framework') {
steps {
sh '''
# Check framework files
if [ ! -d ".cursor/rules" ]; then
echo "Missing framework files"
exit 1
fi
# Check memory bank
if [ ! -d "memory-bank" ]; then
echo "Missing memory bank"
exit 1
fi
# Additional validation steps
'''
}
}
// Other stages...
}
}
Team Collaboration Integration
Shared Memory Bank
For team environments, consider these approaches:
- Git-based sharing: Everyone works with the same memory bank files in version control
- Cloud storage sync: Sync memory-bank directory to a shared cloud folder
- Automated consolidation: Script to merge individual memory banks
Documentation Generation
Automatically generate documentation from the memory bank:
#!/bin/bash
# Generate project documentation from memory bank
OUTPUT_DIR="docs/generated"
mkdir -p "$OUTPUT_DIR"
# Extract project overview from projectbrief.md
echo "# Project Documentation" > "$OUTPUT_DIR/overview.md"
echo "" >> "$OUTPUT_DIR/overview.md"
grep -A 10 "Project Overview" memory-bank/projectbrief.md >> "$OUTPUT_DIR/overview.md"
# Extract architecture from systemPatterns.md
cp memory-bank/systemPatterns.md "$OUTPUT_DIR/architecture.md"
# Generate current status report
echo "# Current Status Report" > "$OUTPUT_DIR/status.md"
echo "Generated on $(date)" >> "$OUTPUT_DIR/status.md"
echo "" >> "$OUTPUT_DIR/status.md"
grep -A 20 "Project Status" memory-bank/progress.md >> "$OUTPUT_DIR/status.md"
Knowledge Base Integration
Export memory bank information to team knowledge bases:
- Confluence Integration: Script to sync memory bank to Confluence pages
- Notion Integration: Export to Notion database
- Wiki Integration: Generate wiki pages from memory bank files
Example script for Confluence:
import requests
import json
import markdown
import os
# Configure these variables
CONFLUENCE_URL = "https://your-company.atlassian.net/wiki"
SPACE_KEY = "PROJ"
API_TOKEN = os.environ.get("CONFLUENCE_API_TOKEN")
AUTH = ("[email protected]", API_TOKEN)
# Function to create or update a page
def update_confluence_page(title, content_markdown, parent_id=None):
# Convert markdown to HTML
content_html = markdown.markdown(content_markdown)
# Check if page exists
response = requests.get(
f"{CONFLUENCE_URL}/rest/api/content?title={title}&spaceKey={SPACE_KEY}",
auth=AUTH
)
data = response.json()
if data["results"]:
# Update existing page
page_id = data["results"][0]["id"]
version = int(data["results"][0]["version"]["number"])
update_data = {
"id": page_id,
"type": "page",
"title": title,
"space": {"key": SPACE_KEY},
"body": {
"storage": {
"value": content_html,
"representation": "storage"
}
},
"version": {"number": version + 1}
}
response = requests.put(
f"{CONFLUENCE_URL}/rest/api/content/{page_id}",
json=update_data,
auth=AUTH
)
else:
# Create new page
create_data = {
"type": "page",
"title": title,
"space": {"key": SPACE_KEY},
"body": {
"storage": {
"value": content_html,
"representation": "storage"
}
}
}
if parent_id:
create_data["ancestors"] = [{"id": parent_id}]
response = requests.post(
f"{CONFLUENCE_URL}/rest/api/content",
json=create_data,
auth=AUTH
)
return response.status_code
# Update pages for each memory bank file
with open("memory-bank/projectbrief.md", "r") as f:
update_confluence_page("Project Brief", f.read())
with open("memory-bank/progress.md", "r") as f:
update_confluence_page("Project Progress", f.read())
External Tools Integration
VS Code Integration
Though primarily designed for Cursor IDE, you can adapt the framework for VS Code:
- Install the "Custom Editor API" extension
- Create a settings.json that maps framework commands to VS Code commands
- Use a VS Code-friendly version of the memory bank management scripts
Jira Integration
Connect the framework with Jira for project management:
from jira import JIRA
import re
import os
# Configure these variables
JIRA_URL = "https://your-company.atlassian.net"
API_TOKEN = os.environ.get("JIRA_API_TOKEN")
PROJECT_KEY = "PROJ"
# Connect to Jira
jira = JIRA(server=JIRA_URL, basic_auth=("[email protected]", API_TOKEN))
# Extract tasks from progress.md
with open("memory-bank/progress.md", "r") as f:
content = f.read()
# Find tasks in "What's Left To Build" section
tasks_section = re.search(r"## What's Left To Build\n(.*?)(?=\n##)", content, re.DOTALL)
if tasks_section:
tasks_text = tasks_section.group(1)
tasks = re.findall(r"- (.*?):\s*(HIGH|MEDIUM|LOW)\s*-\s*(.*?)$", tasks_text, re.MULTILINE)
for task in tasks:
task_name, priority, description = task
# Map priority
jira_priority = {
"HIGH": "High",
"MEDIUM": "Medium",
"LOW": "Low"
}.get(priority, "Medium")
# Create issue
issue_dict = {
'project': {'key': PROJECT_KEY},
'summary': task_name,
'description': description,
'issuetype': {'name': 'Task'},
'priority': {'name': jira_priority}
}
jira.create_issue(fields=issue_dict)
print("Synced tasks to Jira")
Slack Integration
Create a Slack bot that reports on framework activity:
import requests
import json
import os
from datetime import datetime
# Configure these variables
SLACK_WEBHOOK_URL = os.environ.get("SLACK_WEBHOOK_URL")
PROJECT_NAME = "My Project"
# Extract current status from progress.md
with open("memory-bank/progress.md", "r") as f:
content = f.read()
# Extract project status
status_match = re.search(r"Overall Completion: (\d+)%", content)
completion = status_match.group(1) if status_match else "Unknown"
# Create message
message = {
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": f"{PROJECT_NAME} Status Update"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": f"*Current Status*: {completion}% complete\n*Last Updated*: {datetime.now().strftime('%Y-%m-%d %H:%M')}"
}
}
]
}
# Send to Slack
requests.post(SLACK_WEBHOOK_URL, json=message)
Integration Best Practices
- Automation First: Automate as much of the integration as possible
- Versioned Integrations: Keep integration scripts in version control
- Fail Safe: Design integrations to fail gracefully and avoid data loss
- Bidirectional Sync: Where possible, enable two-way synchronization
- Environment Variables: Use environment variables for sensitive tokens
- Consistent Naming: Use consistent naming conventions across integrations
- Documentation: Document all integrations in the memory bank
CursorRIPER: Adaptive development, persistent intelligence.