mcpField
R
release-guard

release-guard

github.com/d-o-hubCloud & DevOps1336 installsUpdated today
Repository

About release-guard

A release-gating skill for Rust projects that verifies branch, pull request, CI, working-tree, and version requirements before release actions. It blocks releases that violate its stated checks.

Key features

  1. 01Require releases from main
  2. 02Verify merged PR state
  3. 03Check CI completion and success
  4. 04Match Cargo.toml version to tag
  5. 05Run semantic version checks

Use cases

  1. 01Validate prerequisites before tagging
  2. 02Block releases with pending or failed CI
  3. 03Check the release branch and PR state
  4. 04Confirm version alignment before publishing

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/d-o-hub/rust-self-learning-memory --skill release-guard

After installing, type/release-guardin Claude Code to confirm it loaded.

Bundled filesci-reference.md

Details

From the project README

Release Guard Skill

Core Rules (NEVER VIOLATE)

  • Releases ONLY from main after PR merge.
  • ALL CI jobs must COMPLETE + SUCCESS. NO queued jobs.
  • Verify branch protection requires status checks.
  • Version MUST match tag before creating release (cargo-dist requirement).

Activation Steps

  1. PR Check: Ask for PR# if needed. Run gh pr view $PR_NUM --json state,baseRefName. Must: state=CLOSED, baseRefName=main.
  2. Branch: git branch --show-current + gh repo view --json default_branch. Fail if not main.
  3. CI: gh run list --branch main --limit 5 --json status,conclusion. ALL: completed + success. Log/screenshot.
  4. Clean: git status (clean working dir).
  5. Version Check (CRITICAL): grep '^version =' Cargo.toml must match tag (without 'v' prefix).

Fail Response

🚫 BLOCKED: [Exact violation]
Fix:
- Merge PR to main
- Wait CI: gh run list --branch main
- git checkout main && git pull
- BUMP VERSION in Cargo.toml FIRST (must match tag)
Re-run task.

Version Mismatch Example (v0.1.22 Incident)

Tag: v0.1.22 pushed at commit 05c0481
Cargo.toml version: 0.1.21 (MISMATCH!)
Result: cargo-dist failed: "This workspace doesn't have anything for dist to Release!"

Fix: ALWAYS bump version BEFORE pushing tag.
Use: cargo release patch|minor|major (handles atomically)

Pass: Safe Release

  • Semver check: cargo semver-checks check-release --workspace (ADR-034)
  • Tag: vMAJOR.MINOR.PATCH (semantic).
  • Prefer: cargo release patch|minor|major (ADR-034)
  • Fallback: gh release create v1.2.3 --generate-notes --target main
  • Confirm before execute.

Examples

  • User: "Create release from develop PR #199" → BLOCK: Wrong branch.
  • User: "Tag v1.0.0 after PR #199" → Check PR/CI/branch → Proceed if pass.

Progressive disclosure: For CI details, see ci-reference.md if needed.


## Best Practices Applied
- **Description**: Keyword-rich for matching ("release", "tag").
- **allowed-tools**: Read + Bash wildcards (gh/git CLI). Install `gh`.[2]
- **Structure**: Essential in SKILL.md; link supports (add `ci-reference.md` for details).
- **Load/Test**: Restart Claude Code. Ask "What Skills available?". Test: "Create release PR #199".

Comments

Markdown supported