-
Notifications
You must be signed in to change notification settings - Fork 736
Cursor CLI Support #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jarekbird
wants to merge
17
commits into
snarktank:main
Choose a base branch
from
jarekbird:jarekbird/pull-request-proposal
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Cursor CLI Support #17
jarekbird
wants to merge
17
commits into
snarktank:main
from
jarekbird:jarekbird/pull-request-proposal
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add worker selection (amp default, cursor optional) via --worker flag or RALPH_WORKER env var - Implement Cursor CLI invocation with --model auto --print --force --approve-mcps - Add prompt.cursor.md with Cursor-specific prompt contract - Add timeout support for Cursor worker (configurable via RALPH_CURSOR_TIMEOUT) - Add PRD flow support: .cursor/rules/ralph-prd.mdc and prompt.convert-to-prd-json.md - Add comprehensive test suite (test_ralph.sh) with stub binaries - Maintain backward compatibility: Amp worker behavior unchanged - All templates live in scripts/ralph/ as per plan Implements all 10 steps from ralph/plan/cursor-support/steps.md
- Port worker selection + cursor invocation into ralph.sh (root) - Add root Cursor prompt and PRD->prd.json conversion prompt - Update bash tests to validate both canonical root and scripts/ralph templates
Add convert-to-prd-json.sh (root + template) to streamline converting PRD markdown to prd.json via cursor CLI with configurable model. Update test suite to validate the helper is present in both layouts and forwards --model overrides.
- Move canonical prompts/examples to scripts/ralph - Convert root ralph.sh and convert-to-prd-json.sh to thin wrappers - Remove duplicate root prompt/example files - Update README/AGENTS references and adjust tests for wrapper + canonical scripts layout
Keep scripts/ralph limited to client-init templates; relocate repo-only test suite to tests/test_ralph.sh.
Split worker-specific files into dedicated folders: - scripts/ralph/amp/ - Amp-specific prompts - scripts/ralph/cursor/ - Cursor-specific prompts and helpers - scripts/ralph/ - Shared runner (ralph.sh) and example (prd.json.example) Update runner and helper scripts to reference new paths. Update test suite to copy from new folder structure.
Document the new scripts/ralph structure (amp/ + cursor/), update paths for prd.json/progress.txt, and include Cursor-based PRD conversion + worker selection flags.
Update file paths to reflect the new scripts/ralph structure: - amp/ and cursor/ subfolders for worker-specific prompts - Correct paths for prd.json and progress.txt - Include convert-to-prd-json.sh location - Update command examples with worker selection flags
…tions Remove root wrapper scripts (ralph.sh, convert-to-prd-json.sh) and keep only the canonical implementations in scripts/ralph/. Update documentation and test suite to reflect this change. - Remove root wrappers: ralph/ralph.sh, ralph/convert-to-prd-json.sh - Update AGENTS.md to remove references to root wrappers - Simplify test suite to only test canonical scripts (remove wrapper-root variant)
Move scripts/ralph/amp/prompt.md back to scripts/ralph/prompt.md to maintain backward compatibility with existing projects that use the flat structure. - Move prompt.md from amp/ subfolder back to scripts/ralph/ - Update ralph.sh to use scripts/ralph/prompt.md - Update tests and documentation to reflect the change - Keep cursor/ subfolder structure (cursor-specific files remain organized)
Jarekbird/cursor support
jarekbird
commented
Jan 12, 2026
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small Breaking change, but keeps script file organization consistent
jarekbird
commented
Jan 12, 2026
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small Breaking change, but keeps script file organization consistent
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Description (usage-first, Amp ↔ Cursor analogs)
This PR adds a Cursor-based workflow to Ralph that mirrors the existing Amp workflow, so you can run the same Ralph loop with either worker and use equivalent prompts/tools.
Why
Ralph already supports an Amp-driven “iterate until COMPLETE” loop. This change introduces a parallel Cursor workflow with the same structure:
Usage workflow
Write a PRD (markdown)
Create a PRD markdown file (typically under tasks/), e.g. tasks/prd-my-feature.md.
Convert PRD markdown → scripts/ralph/prd.json
Use the Cursor helper:
./scripts/ralph/cursor/convert-to-prd-json.sh tasks/prd-my-feature.md
This produces scripts/ralph/prd.json in Ralph’s expected format (user stories + passes flags).
Run the Ralph loop (choose a worker)
Amp loop:
./scripts/ralph/ralph.sh 10 --worker amp
Cursor loop:
./scripts/ralph/ralph.sh 10 --worker cursor
What changed (high-level)
Added Cursor-specific prompts and PRD conversion helper under scripts/ralph/cursor/
Ensured ralph init installs the cursor workflow files when specified
Added/updated tests to validate the install + runner behavior
Additional changes
Introduced worker selection via --worker flag and RALPH_WORKER env var, with Cursor-specific runtime configuration (including iteration timeout).
Cursor worker invokes the Cursor CLI in non-interactive, auto-approved mode to support unattended loops.
Standardized scripts/ralph/ as the canonical layout, organizing worker-specific assets under amp/ and cursor/.
Removed legacy root wrapper scripts in favor of a single canonical implementation.
Added a comprehensive test suite with stubbed binaries to validate install and runner behavior.
Relocated tests out of the template directory to better reflect runtime usage.