|
1 | 1 | --- |
2 | 2 | name: barodoc-release |
3 | | -description: Barodoc changeset and release workflow. Use when adding a changeset, updating the changelog, preparing a release, or merging the "Version packages" PR. Prefer this skill whenever the user mentions changeset, release, version bump, changelog, or publishing barodoc packages to npm. |
| 3 | +description: Barodoc changeset and release workflow. Use when adding a changeset, updating the changelog, preparing a release, or merging the "Version packages" PR. Prefer this skill whenever the user mentions changeset, release, version bump, changelog, or publishing barodoc packages to npm. Agents must use GitHub CLI (gh) for issue, PR, merge, and release-PR monitoring. |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | # Barodoc Changeset & Release |
7 | 7 |
|
8 | 8 | This skill covers how to add changesets, keep the docs changelog in sync, and complete a release. Linked packages (core, theme-docs, barodoc CLI, plugins) are versioned together. |
9 | 9 |
|
| 10 | +## GitHub CLI (`gh`) — **required for agents** |
| 11 | + |
| 12 | +Automated runs (issue → branch → PR → merge → monitor **chore: release packages** → merge) **must** use **`gh`**. Do not substitute the GitHub web UI for these steps unless a human explicitly opts out. |
| 13 | + |
| 14 | +- **Issue:** `gh issue create` |
| 15 | +- **PR:** `gh pr create`, `gh pr view`, `gh pr merge` |
| 16 | +- **Monitor:** `gh pr list`, `gh pr checks` (poll until the Version PR exists and is green) |
| 17 | +- **Prereq:** `gh auth status` succeeds in the environment running the agent. |
| 18 | + |
10 | 19 | ## Version bump: prefer patch |
11 | 20 |
|
12 | 21 | - Use **patch** for bug fixes, docs-only changes, and small improvements. |
@@ -88,31 +97,41 @@ Details: **.changeset/README.md** and **DEVELOPMENT.md** in the repo. |
88 | 97 |
|
89 | 98 | ## End-to-end checklist (issue → changeset → PR → npm) |
90 | 99 |
|
91 | | -Use this when **shipping code** that touches **published packages** (`packages/*`, `barodoc` CLI, plugins). Agents can run the same flow with **GitHub CLI** (`gh`). |
| 100 | +Use when **shipping code** that touches **published packages** (`packages/*`, `barodoc` CLI, plugins). **Run every GitHub step with `gh`** (see above). |
92 | 101 |
|
93 | 102 | | # | Step | What to do | |
94 | 103 | |---|------|------------| |
95 | | -| 1 | **Issue** | Create a tracking issue: `gh issue create --title "..." --body "..."`. Reference it in the feature PR body with `Fixes #N` so it closes on merge. | |
| 104 | +| 1 | **Issue** | `gh issue create --title "..." --body "..."`. Put `Fixes #N` in the feature PR body (`gh pr create --body` or edit) so the issue closes on merge. | |
96 | 105 | | 2 | **Changeset** | Add `.changeset/<name>.md` listing each **touched** package and bump type (`patch` unless feature/breaking). | |
97 | 106 | | 3 | **Site changelog** | Add `docs/src/content/changelog/vX.Y.Z.mdx` using the **next patch** version (see `packages/theme-docs/package.json`). | |
98 | | -| 4 | **Branch & commit** | Feature branch; **one commit or PR** should include code + changeset + changelog together. | |
99 | | -| 5 | **Open & merge PR** | `gh pr create` → `gh pr merge` into `main` (after CI is green). | |
100 | | -| 6 | **Wait for Version PR** | The **Release** workflow (`changesets/action`) opens a PR titled **`chore: release packages`** (branch often `changeset-release/main`). Poll until it appears: `gh pr list --state open --search "chore: release packages"`. | |
101 | | -| 7 | **Merge release PR** | `gh pr merge <number> --merge` — this bumps versions, updates package `CHANGELOG.md` files, and **publishes to npm** (per `.github/workflows/release.yml`). | |
| 107 | +| 4 | **Branch & commit** | Feature branch; **one PR** should include code + changeset + changelog together. | |
| 108 | +| 5 | **Open & merge PR** | `git push -u origin <branch>` → `gh pr create --base main --head <branch> --title "..." --body "Fixes #N\n\n..."` → wait for checks (`gh pr checks <N>` or poll) → `gh pr merge <N> --merge` (use squash only if repo policy allows; default here is `--merge`). | |
| 109 | +| 6 | **Monitor Version PR** | After merge to `main`, **poll** until the release PR exists: e.g. every 10–15s run `gh pr list --state open --search "chore: release packages" --json number,title,url`. Optionally `gh run watch` on the latest **Release** workflow on `main` while waiting. | |
| 110 | +| 7 | **Merge release PR** | `gh pr merge <number> --merge` — bumps versions, updates package `CHANGELOG.md` files, **publishes to npm** (`.github/workflows/release.yml`). Confirm with `gh pr view <number> --json state` after merge. | |
102 | 111 |
|
103 | 112 | ### When **not** to use changeset / release PR |
104 | 113 |
|
105 | 114 | - **Skill-only**, **plans**, or **docs** that do not ship with a versioned package. |
106 | 115 | - **Repo/tooling** changes that do not affect `@barodoc/*` or `barodoc` publish artifacts. |
107 | 116 |
|
108 | | -In those cases: issue + PR to `main` is enough; **no** `.changeset/` and **no** `vX.Y.Z.mdx` unless the docs site itself should announce something on `/changelog`. |
| 117 | +Still use **`gh`** for issue + PR + merge to `main`; only **skip** `.changeset/`, `vX.Y.Z.mdx`, and step 6–7 (no Version PR / npm). |
109 | 118 |
|
110 | | -### Optional `gh` snippets |
| 119 | +### `gh` commands (reference) |
111 | 120 |
|
112 | 121 | ```bash |
113 | | -# List open release PRs |
114 | | -gh pr list --state open --search "chore: release packages" |
| 122 | +# Auth (must work before anything else) |
| 123 | +gh auth status |
| 124 | + |
| 125 | +# Feature PR |
| 126 | +gh pr create --base main --head <branch> --title "..." --body $'Summary\n\nFixes #N' |
| 127 | +gh pr checks <PR_NUMBER> # wait until pass |
| 128 | +gh pr merge <PR_NUMBER> --merge |
| 129 | + |
| 130 | +# Find and merge Version packages PR (poll until listed) |
| 131 | +gh pr list --state open --search "chore: release packages" --json number,title,url |
| 132 | +gh pr merge <N> --merge |
115 | 133 |
|
116 | | -# Merge release PR (replace N) |
117 | | -gh pr merge N --merge |
| 134 | +# Optional: watch the Release workflow on main after pushing |
| 135 | +gh run list --workflow=release.yml --limit 1 |
| 136 | +gh run watch <RUN_ID> |
118 | 137 | ``` |
0 commit comments