# Release Guard

> STRICT GitHub release gatekeeper. Blocks premature releases (from develop, incomplete CI). Verifies PR merged to main + ALL CI passed before allowing tag/release. Triggers on \"release\", \"tag\", \"publish\", \"deploy\", \"version\".

- **Type:** Skill
- **Install:** `agentstack add skill-d-o-hub-rust-self-learning-memory-release-guard`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [d-o-hub](https://agentstack.voostack.com/s/d-o-hub)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [d-o-hub](https://github.com/d-o-hub)
- **Source:** https://github.com/d-o-hub/rust-self-learning-memory/tree/main/.agents/skills/release-guard
- **Website:** https://d-o-hub.github.io/rust-self-learning-memory/

## Install

```sh
agentstack add skill-d-o-hub-rust-self-learning-memory-release-guard
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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](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".

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [d-o-hub](https://github.com/d-o-hub)
- **Source:** [d-o-hub/rust-self-learning-memory](https://github.com/d-o-hub/rust-self-learning-memory)
- **License:** MIT
- **Homepage:** https://d-o-hub.github.io/rust-self-learning-memory/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-d-o-hub-rust-self-learning-memory-release-guard
- Seller: https://agentstack.voostack.com/s/d-o-hub
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
