Cursor Resources

@shaoruu's skills and commands for Cursor

Fetch all remotes and cleanly checkout a git branch. Use when the user says /switch-to followed by a branch name, or asks to switch branches, checkout a branch, or jump to a branch.

skill
# Switch To Branch

Cleanly fetch and checkout a target branch.

## Usage

The user provides a branch name after `/switch-to`, e.g.:
```
/switch-to cursor/composer-pane-drop-indicators-ed3c
```

## Steps

### 1. Check for uncommitted changes

Run `git status --porcelain` in the repo root.

If there is any output (uncommitted changes exist):
- Tell the user exactly what uncommitted changes exist (list the files).
- **Stop and ask the user** whether to proceed. Do NOT continue unless the user explicitly says to ignore the changes.
- If the user says ignore/proceed, run `git stash` before continuing (so changes aren't lost), and tell the user their changes were stashed.

### 2. Fetch all remotes

```bash
git fetch --all
```

### 3. Checkout the branch

```bash
git checkout <branch>
```

If the branch doesn't exist locally but exists on a remote, use:
```bash
git checkout -t origin/<branch>
```

If the branch doesn't exist anywhere, tell the user and stop.

### 4. Confirm

Tell the user:
- Which branch they're now on (`git branch --show-current`)
- How many commits ahead/behind the remote, if applicable (`git status -sb`)

Example prompts

/switch-to feature-branch/switch-to maincheckout the staging branch