You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: skills/create-branch/SKILL.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,9 +25,15 @@ Run:
25
25
git rev-parse --abbrev-ref HEAD
26
26
```
27
27
28
-
**If the result is NOT `main`, `master`, or `develop`:**the session is already on a feature branch. Skip silently — return control to the caller without any output.
28
+
Compare the result against the base branch detected by:
29
29
30
-
**If the result is `main`, `master`, or `develop` (or `HEAD` for detached state):** proceed to Step 2.
30
+
```!
31
+
bash scripts/detect-base-branch.sh
32
+
```
33
+
34
+
**If the current branch is NOT the base branch (and not `HEAD`):** the session is already on a feature branch. Skip silently — return control to the caller without any output.
35
+
36
+
**If the current branch IS the base branch (or `HEAD` for detached state):** proceed to Step 2.
Copy file name to clipboardExpand all lines: skills/review/SKILL.md
+8-24Lines changed: 8 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,32 +27,16 @@ Parse the review scope above for optional file paths or directories.
27
27
28
28
**If no paths provided:**
29
29
30
-
1. Detect current branch:
30
+
Run the scope detection script:
31
31
32
-
```bash
33
-
git rev-parse --abbrev-ref HEAD
34
-
```
32
+
```!
33
+
bash scripts/detect-review-scope.sh
34
+
```
35
35
36
-
2. Detect default branch:
37
-
38
-
```bash
39
-
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||'
40
-
```
41
-
42
-
Fallback: check for `main`, then `master`.
43
-
44
-
3.**If on a feature branch** (current branch differs from the default branch):
45
-
- Get changed files: `git diff <default-branch>...HEAD --name-only`
46
-
- Include uncommitted changes: `git diff --name-only` and `git diff --cached --name-only`
47
-
- Deduplicate the combined file list
48
-
- Announce scope summary: number of changed files, which areas of the codebase are affected
49
-
- Proceed to Step 2 — the user invoked `/review`, intent is clear
50
-
51
-
4.**If on the default branch:**
52
-
- Tell the user: "You're on `<branch>`. No branch diff available."
53
-
- Use **AskUserQuestion**: "What would you like to review?" with options:
54
-
-**Specify files or directories**: accept paths from the user
55
-
-**Review entire project**: no scope constraint
36
+
-**If `SCOPE=branch`**: use the listed files as review scope. Announce scope summary: number of changed files, which areas of the codebase are affected. Proceed to Step 2.
37
+
-**If `SCOPE=default`**: tell the user: "You're on `<CURRENT_BRANCH>`. No branch diff available." Use **AskUserQuestion**: "What would you like to review?" with options:
38
+
-**Specify files or directories**: accept paths from the user
0 commit comments