chore(release): add agent release workflow#79
Conversation
Why Release prep currently depends on a manual checklist for package metadata, generated bundles, release note preview, commit creation, and tag creation. A repeatable command reduces the chance of cutting a tag before the package version and dist bundle are ready. User impact Maintainers can run one command to prepare the version bump and tag, then opt into pushing when ready to trigger the release workflow. Verification node --check scripts/release.mjs node scripts/release.mjs --help node scripts/release.mjs 1.0.6 --pus node scripts/release.mjs 1.0.6 extra npm run release -- 1.0.6 --dry-run --allow-non-main --allow-dirty --skip-checks npm -w packages/cli run build npm -w packages/cli run typecheck npm -w packages/cli run lint npm -w packages/cli test Release note: skip
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThis PR standardizes release preparation around a repo-local ChangesAI-Driven Release Workflow
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/release.mjs`:
- Around line 98-111: The script's updateVersions function directly mutates the
package-lock JSON (LOCKFILE_PATH) which is brittle; instead, after setting
cliPackage.version and writing CLI_PACKAGE_PATH, invoke npm to regenerate the
lockfile entry so npm handles format differences: update the updateVersions
function to write the new version to CLI_PACKAGE_PATH (using CLI_PACKAGE_PATH
and the existing writeJson), then run an npm command (e.g., npm install
--package-lock-only targeting the CLI package/workspace or using appropriate
workspace flags) from the repo root so npm updates the package-lock entry for
"packages/cli" rather than manually editing lockfile.packages["packages/cli"];
only fall back to the existing direct modification if the npm command fails, and
surface the error.
- Around line 85-91: The assertMainBranch function currently hardcodes "main";
update it to accept configurable default branch names by checking an environment
variable (e.g., RELEASE_MAIN_BRANCH) or a list of allowed names (e.g.,
["main","master","trunk"]) and use gitOutput(["branch","--show-current"]) to
compare against that configurable value/set; modify assertMainBranch and any
callers to prefer the env var if present, falling back to the existing "main" or
the list, and ensure the thrown Error message reflects the configured allowed
branches.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: affc5c42-be1b-41ab-8909-ea1da2adb798
📒 Files selected for processing (6)
AGENTS.mdCLAUDE.mddocs/architecture.mddocs/engineering.mdpackage.jsonscripts/release.mjs
Why Release work is fragile enough that agents should follow the same guarded workflow as humans. A repo-local skill and command make the release command discoverable from Codex, Claude, Cursor, and Gemini. User impact Maintainers can ask an agent to prepare or publish an Agent Note release and get the same version bump, release note preview, tag, workflow monitoring, and npm verification steps. Verification git diff --check shasum .codex/skills/agentnote-release/SKILL.md .claude/skills/agentnote-release/SKILL.md .cursor/skills/agentnote-release/SKILL.md .gemini/skills/agentnote-release/SKILL.md shasum .codex/commands/release.md .claude/commands/release.md .cursor/commands/release.md .gemini/commands/release.md npm run release -- 1.0.6 --dry-run --allow-non-main --allow-dirty --skip-checks Release note: skip
Why
The release workflow is maintainer guidance rather than a public CLI feature. Keeping it as repo-local Markdown skills matches the CodeRabbit workflow pattern and avoids maintaining an extra release script.
User impact
Agents can still prepare or publish releases through /release, while the source of truth stays in Markdown and explicitly maps x.y.z inputs to vx.y.z git tags.
Verification
git diff --check
node -e "JSON.parse(require('fs').readFileSync('package.json','utf8')); console.log('package.json ok')"
git-cliff --config .github/cliff.toml --unreleased --tag v1.0.6 --strip header
npm -w packages/cli run typecheck
Release note: skip
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/commands/release.md:
- Line 13: Update the git-cliff preview command in the release instructions to
use the repository's canonical invocation: replace the short `git-cliff
--unreleased --tag vx.y.z` usage with the full form `git-cliff --config
.github/cliff.toml --unreleased --tag vx.y.z --strip header` so the command in
the .claude/commands/release.md text matches the repo release workflow guidance.
In @.codex/commands/release.md:
- Line 13: Update the git-cliff preview command in the release instructions to
match the canonical form: replace the existing `git-cliff --unreleased --tag
vx.y.z` usage with the full preview command including the config and strip flags
so it reads `git-cliff --config .github/cliff.toml --strip header --unreleased
--tag vx.y.z`; ensure the same canonical command appears wherever the preview
step (git-cliff) is described so previews match the documented release workflow.
In @.cursor/skills/agentnote-release/SKILL.md:
- Line 22: Step 2 is ambiguous about editing packages["packages/cli"].version in
package-lock.json; instead, update the package version in
packages/cli/package.json and then run npm install (or npm ci) at the repo root
so npm updates package-lock.json automatically and synchronizes
packages["packages/cli"].version to x.y.z; reference the
packages/cli/package.json change and the packages["packages/cli"].version field
in the lockfile when making this guidance.
In @.gemini/skills/agentnote-release/SKILL.md:
- Line 22: Clarify that Step 2 should not be manual editing of
package-lock.json; instead update packages/cli/package.json to the new x.y.z
version and then run npm install in the workspace root so npm updates
packages["packages/cli"].version in package-lock.json automatically; mention the
specific files/keys to touch: packages/cli/package.json and package-lock.json
and the command npm install to synchronize the lockfile.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 5c8d1517-5fa7-4515-8415-88961fc95c4d
📒 Files selected for processing (12)
.claude/commands/release.md.claude/skills/agentnote-release/SKILL.md.codex/commands/release.md.codex/skills/agentnote-release/SKILL.md.cursor/commands/release.md.cursor/skills/agentnote-release/SKILL.md.gemini/commands/release.md.gemini/skills/agentnote-release/SKILL.mdAGENTS.mdCLAUDE.mddocs/architecture.mddocs/engineering.md
Why
CodeRabbit found two places where the release workflow docs could diverge from the canonical maintainer process: abbreviated git-cliff previews and ambiguous lockfile update guidance.
User impact
Agents following /release now use the same git-cliff command everywhere and run npm install to synchronize package-lock.json instead of implying manual lockfile edits.
Verification
git diff --check
node -e "JSON.parse(require('fs').readFileSync('package.json','utf8')); console.log('package.json ok')"
git-cliff --config .github/cliff.toml --unreleased --tag v1.0.6 --strip header
npm -w packages/cli run typecheck
shasum .codex/skills/agentnote-release/SKILL.md .claude/skills/agentnote-release/SKILL.md .cursor/skills/agentnote-release/SKILL.md .gemini/skills/agentnote-release/SKILL.md
shasum .codex/commands/release.md .claude/commands/release.md .cursor/commands/release.md .gemini/commands/release.md
Release note: skip
Summary
agentnote-releaseskills and/releasecommands for Codex, Claude, Cursor, and Gemini.x.y.zandvx.y.zinputs both produce package versionx.y.zand annotated git tagvx.y.z.Details
The release workflow now lives in repo-local skills, matching the existing CodeRabbit skill pattern. Agents can use
/release <version>or theagentnote-releaseskill to normalize the version, update package metadata, rebuild the CLI bundle, run checks, preview release notes withgit-cliff --unreleased --tag vx.y.z, commit the version bump withRelease note: skip, create the annotated tag, and verify GitHub/npm publication after pushing.This intentionally avoids adding
scripts/release.mjsor a rootnpm run releasecommand. Release policy changes are easier to review and maintain as Markdown because this is maintainer workflow guidance, not public runtime behavior.Verification
git diff --checknode -e "JSON.parse(require('fs').readFileSync('package.json','utf8')); console.log('package.json ok')"git-cliff --config .github/cliff.toml --unreleased --tag v1.0.6 --strip headernpm -w packages/cli run typecheckshasum .codex/skills/agentnote-release/SKILL.md .claude/skills/agentnote-release/SKILL.md .cursor/skills/agentnote-release/SKILL.md .gemini/skills/agentnote-release/SKILL.mdshasum .codex/commands/release.md .claude/commands/release.md .cursor/commands/release.md .gemini/commands/release.mdSummary by CodeRabbit
🧑💬🤖 Agent Note
Total AI Ratio: ████████ 100%
Model:
gpt-5.4aee77adchore(release): add release helper command51975a2chore(release): add agent release skilla833ca0chore(release): keep release workflow in skills5ca071cdocs(release): address release skill review💬 Prompts & Responses (5 shown / 6 total)
aee77adchore(release): add release helper command🧑 Prompt
🤖 Response
51975a2chore(release): add agent release skill🧑 Prompt
🤖 Response
a833ca0chore(release): keep release workflow in skills🧑 Prompt
🤖 Response
🧑 Prompt
🤖 Response
5ca071cdocs(release): address release skill review🧑 Prompt
🤖 Response