Gem release

From clacky-ai/openclacky · View interactive version

Gem release is an AI agent skill from the GitHub repository clacky-ai/openclacky. Automates the complete process of releasing a new version of the openclacky Ruby gem. Supports both stable releases (auto-increment) and pre-release versions (user-specified, e.g., 1.0.0.beta.1). Handles version bumping, testing, building, RubyGems publishing, GitHub Releases, and OSS CDN mirroring.

How to use this skill

Skill file

Gem Release Skill

Automates the complete openclacky gem release workflow via SKILL_DIR/scripts/release.sh.

Usage

Workflow

The release script (SKILL_DIR/scripts/release.sh) handles everything end-to-end:

  1. Pre-release checks (clean working directory, required tools)
  2. Run test suite (bundle exec rspec) + web search smoke tests (real network — verifies Bing/DDG parsers still work against live HTML)
  3. Bump version in lib/clacky/version.rb
  4. Update Gemfile.lock via bundle install
  5. Commit and push to origin, wait for CI
  6. Build gem (gem build openclacky.gemspec)
  7. Publish to RubyGems (gem push)
  8. Create git tag and push
  9. Create GitHub Release with .gem asset (uses CHANGELOG.md for notes)
  10. Upload .gem to Tencent Cloud OSS CDN
  11. Update latest.txt on OSS (stable only, unless --update-latest)
  12. Rebuild and sync scripts/ to OSS
  13. Cleanup build artifacts

Agent Instructions

1. Determine version and release type

Read current version:

grep 'VERSION =' lib/clacky/version.rb

Stable release (default): Increment patch version (e.g., 1.0.5 → 1.0.6). Confirm with user if unsure which part to bump (major/minor/patch).

Pre-release: Use the exact version the user specified (e.g., 2.0.0.beta.1). Before proceeding, warn about pre-release caveats (see section below).

2. Write CHANGELOG

This is the one step the agent handles manually — the script does not write changelog entries because it requires reviewing git history and exercising judgment.

  1. Find the previous version tag:

```bash

git describe --tags --abbrev=0

```

  1. Gather commits since last release:

```bash

git log <previous_tag>..HEAD --oneline

```

  1. Write a new section in CHANGELOG.md following this format:

```markdown

## [X.Y.Z] - YYYY-MM-DD

### Added

### Improved

### Fixed

### More

```

  1. Categorization rules:
  1. External contributor attribution:

```bash

gh api orgs/clacky-ai/members --paginate --jq '.[].login' | sort

```

BSD grep on macOS rejects -P with "invalid option", and the loop silently yields nothing:

```bash

git log <previous_tag>..HEAD --oneline | grep -oE '#[0-9]+' | while read pr; do

num=${pr#\#}

gh pr view $num --json number,author --jq '"#\(.number) \(.author.login)"'

done

```

next to the merged one (`feat: discover custom-endpoint models in the add-model dialog

(#559) (#560)), and gh pr view 559` answers "Could not resolve to a PullRequest".

When that happens, ask the commit which PR actually merged it:

```bash

gh api repos/clacky-ai/openclacky/commits/<sha>/pulls \

--jq '.[] | "PR #\(.number) | \(.user.login) | \(.state)"'

```

Attribute the bullet to the PR that resolves and carries a real author; a number that

resolves to nobody is not a contributor reference.

  1. Commit the changelog:

```bash

git add CHANGELOG.md

git commit -m "docs: update CHANGELOG for v<version>"

```

3. Run the release script

Stable release:

bash "SKILL_DIR/scripts/release.sh" <version>

Pre-release (skip latest.txt):

bash "SKILL_DIR/scripts/release.sh" <version> --prerelease

Pre-release (update latest.txt — only if user explicitly requested):

bash "SKILL_DIR/scripts/release.sh" <version> --prerelease --update-latest

Dry run (preview only):

bash "SKILL_DIR/scripts/release.sh" <version> --dry-run

The script runs all steps sequentially and stops on any failure. Monitor the output — if a step fails, diagnose and fix before retrying.

4. Present release summary

After the script completes successfully, present a concise summary. The output will often be read in WeChat, so keep it compact and avoid template-like formatting that triggers message folding.

Rules:

Format (flexible — adapt as needed, but roughly):

v{version} released.

[One sentence highlight — the biggest user-visible change.]

Added:
- [translate each "Added" item]
- ...

Improved:
- [translate each "Improved" item]
- ...

Fixed:
- [translate each "Fixed" item]
- ...

Upgrade: click "Upgrade" in Web UI bottom-left, or `gem update openclacky`
Fresh install: curl -sSL https://raw.githubusercontent.com/clacky-ai/openclacky/main/scripts/install.sh | bash

RubyGems: https://rubygems.org/gems/openclacky/versions/{version}
GitHub: https://github.com/clacky-ai/openclacky/releases/tag/v{version}

Pre-Release Caveats

When releasing a pre-release version, inform the user of these behaviors:

| Concern | Behavior | Impact |

|---------|----------|--------|

| Version check notification | Gem::Version("0.9.38") < Gem::Version("1.0.0.beta.1") is true | The upgrade dot WILL appear in the Web UI for most users |

| gem update (official source) | Does NOT install prereleases without --pre | Users who click "Upgrade" will see notification but upgrade silently does nothing |

| OSS CDN upgrade (mirror users) | Downloads exact .gem from latest.txt | If latest.txt points to prerelease, mirror users WILL get the beta |

| OSS latest.txt | Fresh installs fetch latest.txt | By default, do NOT update latest.txt for pre-releases |

Ask the user whether to use --update-latest before running the script.

Error Handling

The script uses set -euo pipefail and stops on any failure. Common issues:

1. Manually run bundle exec rspec spec/integration/web_search_smoke_spec.rb --tag smoke to verify

2. If it's the anti-scrape block, temporarily edit spec/integration/web_search_smoke_spec.rb to skip the relevance check on failure (e.g., using skip "Bing returned anti-scrape garbage...")

3. Commit the change ("ci: skip bing smoke test relevance check on anti-scrape") and re-run the release script

After fixing an issue, you can re-run the script — it's safe to retry. If a partial release happened (e.g., gem pushed but tag not created), handle remaining steps manually.

File Locations

Dependencies

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.