Skip to content

Conversation

@jarekbird
Copy link

@jarekbird jarekbird commented Jan 12, 2026

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

  1. Write a PRD (markdown)
    Create a PRD markdown file (typically under tasks/), e.g. tasks/prd-my-feature.md.

  2. 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).

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

- 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)
Copy link
Author

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

Copy link
Author

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 jarekbird changed the title Jarekbird/pull request proposal Cursor CLI Support Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant