Skip to content

Commit be24c76

Browse files
authored
fix: add sync-with-main step to release skill (#519)
* fix: add sync-with-main step to release skill * fix: resolve branch-naming conflict and improve behind-detection in release skill
1 parent 8ddd145 commit be24c76

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

.claude/skills/release/SKILL.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ You are preparing a release for `@optave/codegraph`.
1515

1616
---
1717

18+
## Step 0: Isolate and sync
19+
20+
1. **Create a worktree** — run `/worktree` to get an isolated copy of the repo. All subsequent steps run inside the worktree.
21+
2. **Sync with main** — fetch origin and check how far behind the current branch is:
22+
```bash
23+
git fetch origin
24+
git rev-list --count HEAD..origin/main
25+
```
26+
If the count is > 0 (behind main), detach to `origin/main` so all subsequent work starts from the latest main:
27+
```bash
28+
git checkout origin/main
29+
```
30+
Do **not** create the `release/VERSION` branch here — Step 8 creates it once VERSION is known.
31+
1832
## Step 1a: Gather context
1933

2034
Run these in parallel:
@@ -133,8 +147,8 @@ Run `grep` to confirm the new version appears in `package-lock.json` and that al
133147

134148
## Step 8: Create branch, commit, push, PR
135149

136-
1. Create branch: `git checkout -b release/VERSION`
137-
2. Stage only the files you changed: `CHANGELOG.md`, `package.json`, `package-lock.json`, `crates/codegraph-core/Cargo.toml`, `docs/roadmap/ROADMAP.md`, `docs/roadmap/BACKLOG.md` if changed, `README.md` if changed
150+
1. Create branch: `git checkout -b release/VERSION` (if on detached HEAD from Step 0, this creates the branch at the current commit)
151+
2. Stage only the files you changed: `CHANGELOG.md`, `package.json`, `package-lock.json`, `docs/roadmap/ROADMAP.md`, `docs/roadmap/BACKLOG.md` if changed, `README.md` if changed
138152
3. Commit: `chore: release vVERSION`
139153
4. Push: `git push -u origin release/VERSION`
140154
5. Create PR:

0 commit comments

Comments
 (0)