chore(cursor): Configure worktree setup #20273
Open
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.
Overview
Cursor can run agents in isolated Git worktrees to avoid disturbing your primary working copy, which is cool. Each new worktree needs to have its development environment set up, though. This tries to configure Cursor to do that automatically, so agents can jump straight to running things like
yarn vitestwithout you having to manually runmake setupfirst.Test Plan and Hands on Testing
Make sure Cursor is updated. I think older versions had a bug where the agent could start running commands before the initialization script completed.
Start a new agent in worktree mode. Prompt it with something like:
This will take a few minutes, but it should run the command, and the command should complete without errors.
Changelog
Review requests
yarnis globally available. These assumptions match the recommendations inDEV_SETUP.md, but I still only give it a 50% chance of working. :)DEV_SETUP.md, and then Cursor could theoretically just follow the instructions in there. That would be nice if it works, because it would benefit local mode as well as worktree mode. I haven't tried it, but I could, if we think it's worthwhile.Risk assessment
No risk.