Cursor Resources

@shaoruu's skills and commands for Cursor

Display a tree view of all files changed in the current git branch with +/- line counts. Use when the user asks for a tree view, file diff summary, branch overview, changed files list, or wants to see what files were modified in a branch.

skill
# Branch Tree View

Show all files changed in the current branch as a folder tree with `+added` / `-removed` line counts.

## Steps

1. Fetch the latest `origin/main` and diff against it (this matches what GitHub shows):

```bash
git fetch origin main --quiet
git diff --numstat origin/main...HEAD | sort -k3
```

2. Parse each line (`added  removed  filepath`) and build a folder tree.

3. Render as a fenced code block using box-drawing characters:

```
.
├── src/
│   ├── components/
│   │   └── Button.tsx          +25 -10
│   └── utils/
│       └── helpers.ts           +8  -3
└── package.json                 +1  -0
```

## Formatting Rules

- Right-align the `+N` / `-N` columns for readability.
- Collapse intermediate directories that contain no direct file changes into a single line (e.g. `src/utils/` instead of nesting `src/` then `utils/`).
- If a directory has many snapshot or auto-generated files with similar diffs, summarize them on one line: `__snapshots__/cloud-agent/  (24 files)  ~+170 ~-210`.
- Use `+0` or `-0` rather than omitting a zero side.
- Compare against `origin/main` (not local `main`) to match what GitHub would show in a PR.

Example prompts

show me a tree view of what changed in this branchwhat files were modified?branch diff summary