Skip to content

Commit b80e541

Browse files
Merge branch 'main' into codeassistant
2 parents e778083 + 0a99f41 commit b80e541

39 files changed

Lines changed: 1191 additions & 319 deletions
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
---
2+
name: release-openspec
3+
description: >-
4+
Use this skill when releasing OpenSpec: audit merged work and changeset
5+
coverage, decide whether a catch-up changeset PR is needed, prepare or resume
6+
the Changesets Version Packages PR, cut a beta or stable release, verify
7+
publishing, and polish GitHub release notes. Also use when asked whether an
8+
open release PR is complete, what the next release step is, or to continue a
9+
release paused for human approval.
10+
---
11+
12+
# Release OpenSpec
13+
14+
Run the OpenSpec release workflow as a resumable state machine. Inspect live GitHub state on every invocation and take only the next safe action. Do not assume an earlier invocation completed.
15+
16+
## Principles
17+
18+
- Treat `Fission-AI/OpenSpec` and `origin/main` as the release source of truth.
19+
- Default to a read-only audit when the user asks for status, readiness, or advice.
20+
- Treat a request to release, prepare a release, continue, or resume as authorization to perform the applicable release actions.
21+
- Preserve the user's checkout. Never discard unrelated changes or switch their current branch just to prepare a changeset.
22+
- Use a temporary worktree from current `origin/main` for release-authored commits when the checkout is dirty or not on `main`.
23+
- Never approve your own PR. Human review is a deliberate gate.
24+
- Treat merge-queue entry as an intermediate state, not a merge. Advance only after GitHub reports `mergedAt` and the commit is present on `main`.
25+
- Never create the automated Version Packages PR manually. The Changesets action owns it.
26+
- Never push an empty commit merely to retrigger CI. Diagnose the failed or missing run first.
27+
- Report URLs, the state reached, and the exact human action needed whenever pausing.
28+
29+
## Know the two PR types
30+
31+
Keep these distinct in output and decisions:
32+
33+
- **Changeset PR**: A normal human-authored PR that adds one or more `.changeset/*.md` files. Prefer adding a changeset to the feature/fix PR; create a catch-up changeset PR only for already-merged work that should be included.
34+
- **Version Packages PR**: The automated `changeset-release/main` PR titled `chore(release): version packages`. Merging or adding changesets to `main` updates this same PR. Merging it publishes the stable release.
35+
36+
An open Version Packages PR does not prohibit a catch-up changeset PR. It means a catch-up PR is useful only when the audit finds missing release-worthy work. Once that PR merges, wait for the existing Version Packages PR to update.
37+
38+
## Start with a release audit
39+
40+
1. Verify the repository and tools:
41+
- Resolve the GitHub repository with `gh repo view --json nameWithOwner,url`.
42+
- Require authenticated `gh`, `git`, and `pnpm` before write actions.
43+
- Stop before release mutations if the canonical repository is not `Fission-AI/OpenSpec`.
44+
2. Refresh without modifying the worktree:
45+
46+
```bash
47+
git fetch origin main
48+
```
49+
50+
Do not fetch every tag indiscriminately. This repository may contain a conflicting historical local tag, which can make `git fetch --tags` fail even though `origin/main` fetched successfully.
51+
52+
3. Find the latest stable GitHub release. Exclude drafts and prereleases; do not use `git describe`, because a beta tag may be newer than the stable baseline.
53+
54+
```bash
55+
gh release list --repo Fission-AI/OpenSpec \
56+
--exclude-drafts --exclude-pre-releases --limit 100 \
57+
--json tagName,publishedAt \
58+
--jq 'max_by(.publishedAt) | {tagName, publishedAt}'
59+
```
60+
61+
Ensure that exact stable tag resolves locally before using it as a `git log` boundary. Fetch only that tag if it is missing. If a same-named local tag disagrees with the canonical remote, report the mismatch and use a separately resolved canonical commit; never force-rewrite the user's tag as part of an audit.
62+
63+
4. Find open release-related PRs:
64+
65+
```bash
66+
gh pr list --repo Fission-AI/OpenSpec --state open \
67+
--head changeset-release/main \
68+
--json number,title,headRefName,baseRefName,url,reviewDecision,statusCheckRollup
69+
```
70+
71+
Identify the Version Packages PR by `headRefName == "changeset-release/main"`, not title alone. Separately list likely changeset PRs and inspect their files; require positive additions to `.changeset/*.md`. Do not mistake the Version Packages PR's changeset deletions for authored changesets, and do not rely on titles because a feature/fix PR may add release tracking.
72+
5. Read the live release policy in `.changeset/README.md`, pending `.changeset/*.md` files on `origin/main`, and the Version Packages PR body/files when it exists.
73+
6. List first-parent commits since the latest stable tag:
74+
75+
```bash
76+
git log --first-parent --date=short \
77+
--pretty=format:'%h%x09%ad%x09%s' <stable-tag>..origin/main
78+
```
79+
80+
7. Map release-worthy merged PRs to existing changesets. Use PR files and changeset history; do not infer coverage from similar wording alone.
81+
8. Classify the audit as:
82+
- `missing-tracking`: user-facing work intended for this release lacks a changeset;
83+
- `awaiting-changeset-review`: a suitable changeset PR already exists;
84+
- `awaiting-merge-queue`: an approved changeset or Version Packages PR is queued but has not landed on `main`;
85+
- `awaiting-version-update`: required changesets are on `main`, but the Version Packages PR has not incorporated them;
86+
- `awaiting-version-review`: the Version Packages PR is current but lacks approval;
87+
- `ready-to-publish`: the Version Packages PR is current, approved, and green;
88+
- `publishing`: the Version Packages PR merged but artifacts are incomplete;
89+
- `needs-finalization`: npm, tag, and GitHub Release exist but notes are still raw;
90+
- `complete`: package, tag, GitHub Release, and polished notes agree.
91+
92+
Present a compact audit with the stable baseline, proposed version, covered changes, possible omissions, intentionally skipped internal/docs work, open PRs, and next action.
93+
94+
## Decide changeset coverage
95+
96+
Follow `.changeset/README.md` rather than assuming every merged PR needs a changeset.
97+
98+
Include work selected for release tracking, especially:
99+
100+
- new user-facing features or commands;
101+
- notable fixes or hotfixes;
102+
- breaking changes or deprecations;
103+
- user-visible performance improvements.
104+
105+
Normally skip documentation-only work, tests, CI/tooling, and internal refactors. Flag ambiguous user-visible changes instead of silently excluding them. Ask the user only when the ambiguity materially changes release scope or the semantic version; otherwise use best judgment and let PR review be the approval gate.
106+
107+
## Create or continue a changeset PR
108+
109+
Do this only for `missing-tracking`.
110+
111+
1. If an open changeset PR already covers the missing work, reuse it. Inspect its `headRefName`, head repository, and `maintainerCanModify`; fetch that exact head branch from its owning repository into a temporary worktree, make the update there, and push back to the same PR head. Stop if the branch is not writable. Do not create a duplicate PR or replacement branch.
112+
2. Read `.changeset/README.md` immediately before authoring.
113+
3. Only when no suitable PR exists, create a short `changeset-<scope>` branch from current `origin/main`. Use a temporary worktree so the operator's checkout remains untouched.
114+
4. Prefer one changeset per coherent release unit. A single catch-up changeset may summarize several small items selected for the same release.
115+
5. Use the exact package name `"@fission-ai/openspec"`, the highest required semantic bump, only relevant headings, and user-focused descriptions.
116+
6. Validate before pushing:
117+
118+
```bash
119+
pnpm exec changeset status
120+
```
121+
122+
7. Commit, push, and open a PR whose body lists the covered merged PRs and explains why the catch-up is needed.
123+
8. Stop after returning the PR URL and request human approval. Do not approve it yourself.
124+
125+
On a later invocation, if the PR is approved and checks are green, merge or enqueue it only when the user asked to continue or complete the release. If GitHub uses a merge queue, inspect `mergeQueueEntry`, queue checks, and `mergedAt`; remain in `awaiting-merge-queue` until the PR actually lands on `main`. Then wait for the Changesets action on `main` to update the existing Version Packages PR. Poll with concise progress updates; do not push an empty commit or another branch update, because that can dismiss approval and restart the queue.
126+
127+
## Validate the Version Packages PR
128+
129+
Before calling it ready:
130+
131+
1. Confirm it targets `main` from `changeset-release/main` and is generated by the expected automation.
132+
2. Enumerate every pending `.changeset/*.md` file on current `main`, excluding `.changeset/README.md`. Verify the PR consumes every one and contains the corresponding changelog content. If any pending changeset should be deferred, stop: remove or revise it through a separately reviewed change and wait for automation to regenerate the Version Packages PR before continuing.
133+
3. Fetch `baseRefOid` and `headRefOid` with `gh pr view`, require `baseRefOid` to equal current `origin/main`, and create clean detached temporary worktrees for both revisions. If the head object is missing locally, fetch the immutable `pull/<number>/head` ref first. Never validate from the operator's current worktree.
134+
4. In the base worktree, run `pnpm exec changeset status --output changeset-status.json` and read the expected package/version from that file. Install locked dependencies in the temporary worktree first if the Changesets CLI is unavailable.
135+
5. Compare the base status and complete pending-changeset set against the head worktree: `package.json`, `CHANGELOG.md`, removed changeset files, PR body, and proposed version must all agree. This is a base-to-head comparison because the head has already consumed the changesets and cannot calculate the pending release itself.
136+
6. Remove the temporary worktrees after validation, then inspect all required checks and review state with `gh pr view` / `gh pr checks`.
137+
138+
If current but unapproved, return the URL and pause for human approval. If approved and green, merge or enqueue only when the user asked to release or continue. With merge queue enabled, do not treat approval, auto-merge enablement, or queue entry as the stable publish trigger; wait for `mergedAt` and confirmation that the merge reached `main`.
139+
140+
## Verify stable publishing
141+
142+
After the Version Packages PR merges:
143+
144+
1. Find the release workflow run for the merge commit and wait for completion.
145+
2. Verify all three artifacts independently:
146+
- `npm view @fission-ai/openspec@<version> version`
147+
- remote tag `v<version>` points at the expected commit;
148+
- `gh release view v<version>` exists and is not a prerelease.
149+
3. If only some artifacts exist, report partial state and resume verification before retrying any publish action. Never republish a version already on npm.
150+
4. Once all artifacts exist, read [references/release-notes.md](references/release-notes.md), polish the GitHub Release, and verify the saved title/body.
151+
152+
## Cut a beta
153+
154+
Only enter this path when the user explicitly asks for a beta or prerelease.
155+
156+
1. Run the same audit and confirm pending changesets produce a next stable version.
157+
2. Explain that beta publishing does not consume changesets or replace the stable Version Packages PR.
158+
3. Trigger the existing `release-prepare.yml` workflow on `main`; do not calculate or set the beta version locally.
159+
4. Verify the workflow-selected version, npm `beta` dist-tag, remote tag, and prerelease GitHub Release.
160+
5. Do not merge the stable Version Packages PR as part of a beta request.
161+
162+
## Handle failures
163+
164+
- For failed CI, inspect the failing check and logs before proposing a rerun or code change.
165+
- For a stale Version Packages PR, first confirm a successful `push` run of `release-prepare.yml` occurred after the latest changeset reached `main`.
166+
- For branch divergence, let the Changesets action update its branch. Do not force-push `changeset-release/main`.
167+
- For a queued PR, inspect merge-group checks and queue state. Do not re-enqueue, update the branch, or rerun unrelated checks while it is progressing normally.
168+
- For a version that already exists on npm, stop and reconcile the tag/GitHub Release rather than incrementing or republishing implicitly.
169+
- For missing GitHub permissions or required review, report the exact gate and URL; preserve the detected state so the next invocation can resume by inspection.
170+
171+
## Completion report
172+
173+
Report:
174+
175+
- released version and stable/beta channel;
176+
- changeset PR and Version Packages PR URLs, when applicable;
177+
- release workflow result;
178+
- npm package, tag, and GitHub Release verification;
179+
- release-notes finalization status;
180+
- any intentionally deferred changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Release OpenSpec"
3+
short_description: "Audit, prepare, publish, and finalize releases"
4+
default_prompt: "Use $release-openspec to audit the current release state and take the next safe release step."
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# GitHub release notes
2+
3+
Read this file only after the npm package, tag, and GitHub Release exist, or when the user explicitly asks to preview or polish release notes.
4+
5+
## Gather source material
6+
7+
1. Bind the release values once and fetch the current release. Replace the example values, but keep every expansion quoted:
8+
9+
```bash
10+
tag="vX.Y.Z"
11+
previous_tag="vA.B.C"
12+
gh release view "$tag" --repo Fission-AI/OpenSpec \
13+
--json body,name,isPrerelease,url
14+
```
15+
16+
2. For a stable release, find the preceding stable release by excluding drafts and prereleases. For a beta, compare against the preceding tag in the same beta series when one exists; otherwise compare against the latest stable release.
17+
3. Fetch GitHub-generated notes to recover first-time contributor attribution and the full changelog link:
18+
19+
```bash
20+
gh api repos/Fission-AI/OpenSpec/releases/generate-notes \
21+
-f "tag_name=$tag" -f "previous_tag_name=$previous_tag" -q '.body'
22+
```
23+
24+
4. Cross-check the final content against the released `CHANGELOG.md` section and the merged Version Packages PR. Never invent an item from commit titles alone.
25+
26+
## Title
27+
28+
Use:
29+
30+
```text
31+
<tag> - <one-to-four-word theme>
32+
```
33+
34+
Lead with the most notable user-facing addition. For two similarly important additions, comma-separate them. For a fix-only release, name the primary fixed area.
35+
36+
## Body
37+
38+
Use only the sections that contain content:
39+
40+
```markdown
41+
## What's New in <tag>
42+
43+
<One direct sentence describing the release theme.>
44+
45+
### New
46+
47+
- **Feature** - What users can now do and when it helps.
48+
49+
### Improved
50+
51+
- **Area** - What became easier, safer, faster, or more consistent.
52+
53+
### Fixed
54+
55+
- **Area** - What now behaves correctly.
56+
57+
## New Contributors
58+
59+
* @username made their first contribution in #PR
60+
61+
**Full Changelog**: <compare-link>
62+
```
63+
64+
## Voice and cleanup
65+
66+
- Write for developers using OpenSpec with AI coding assistants.
67+
- Be direct and practical; avoid marketing language.
68+
- Lead with user capability or impact, not implementation.
69+
- Keep each item to one or two sentences.
70+
- Remove commit hashes, changeset wrappers, raw semantic-bump headings, and inline `Thanks @user` boilerplate.
71+
- Omit internal CI, test, and refactor details unless users experience the result.
72+
- Keep contribution credit in `New Contributors`, not inside feature bullets.
73+
- Preserve GitHub's first-contribution wording and PR link.
74+
- Exclude core maintainer `@TabishB` from `New Contributors`. If no external first-time contributors remain, omit that section.
75+
- Always retain the full changelog compare link.
76+
77+
## Apply and verify
78+
79+
Create a temporary file, write the body to it with the available file-editing tool, bind the final title, then update:
80+
81+
```bash
82+
notes_file="$(mktemp)"
83+
title="$tag - Release Theme"
84+
# Write the polished Markdown body to "$notes_file" before continuing.
85+
gh release edit "$tag" --repo Fission-AI/OpenSpec \
86+
--title "$title" --notes-file "$notes_file"
87+
```
88+
89+
When the user asked only for a preview or audit, show the proposed title/body without editing. When the user asked to run, continue, or complete the release, apply the polished notes without an extra confirmation pause, then fetch the release again and verify the saved title/body.

.changeset/add-skill-cli-auto-approval.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.changeset/add-trae-command-adapter.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.changeset/fix-archive-exit-code.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.changeset/fix-validate-view-resolution-parity.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)