# 507 Release

> 对外发布：在用户明确要求发布、推送或发版时，定版本号、打 tag、推送远端，并按项目实际探测的发布渠道（npm、GitHub Release）发布。每个不可逆对外动作执行前都向用户显式确认。Use when user says release, publish, push, 发版, 发布, 推送, 发包, 打 tag, 升版本, 升级版本号, 发新版本, 上线, 发到 npm, 发 GitHub Release。默认只做用户明确点名的对外动作，不自动扩到全部渠道。

- **Type:** Skill
- **Install:** `agentstack add skill-ssdiwu-507-skills-507-release`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ssdiwu](https://agentstack.voostack.com/s/ssdiwu)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ssdiwu](https://github.com/ssdiwu)
- **Source:** https://github.com/ssdiwu/507-skills/tree/main/code/507-release

## Install

```sh
agentstack add skill-ssdiwu-507-skills-507-release
```

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

## About

# 对外发布（release）

把已完成的本地提交推向外部：定版本号、打 tag、推送远端，并按项目实际探测到的发布渠道发布。它和 `507-commit` 的分界是**可逆性**——commit 停在可逆的本地提交，release 才触碰基本不可逆的对外动作（远端、公开包、公开 Release）。

## 安全边界

- 本 skill 只在用户明确要求发布、推送或发版时使用；
- **版本号决定权归用户**：用户明确指定时直接用；未指定时显性询问用户选 `patch` / `minor` / `major` 或给具体号；用户给出"升一个版本号"这类半模糊指令时，按 semver（语义化版本）原则据 `CHANGELOG` 变更类型补全具体位；
- **每个不可逆对外动作执行前都向用户显式确认**：push、npm publish、GitHub Release 各是一道确认门，未经确认不执行；
- 不自动扩到用户没有点名的渠道；探测到的渠道逐个向用户确认后再发布；
- 不执行 `git push --force`（强制推送）到主干；
- 发布渠道的凭据、令牌和密钥不写入仓库或日志。

## 与 commit 的边界

`507-commit` 产出本地提交；本 skill 从"版本号已定、本地提交已就绪"开始。工作区仍有未提交改动时，先回到 `507-commit`（或相应实现）完成提交，不带着脏工作区发布。

## 前置门禁

发布前逐项确认，任一不满足则停止并向用户报告：

1. 工作区干净（所有相关改动已 commit）；
2. `CHANGELOG.md` 的 `Unreleased`（未发布）段有内容；
3. 待发布提交与分支符合用户预期；
4. 版本号、`CHANGELOG` 定版段与 tag 三者一致；
5. 必要验证已通过或用户已明确知情放行。

## 工作流程

### 1. 定版本号

- 读取当前最新 tag 与 `CHANGELOG` 顶部版本段，确认起点版本；
- 按安全边界确认目标版本号：用户明确指定则用；未指定则显性询问；半模糊指令按 semver 据 `Unreleased` 内容补全（仅缺陷修复/文档 → `patch`，向后兼容的新功能 → `minor`，有 `Breaking`（破坏性变更）→ `major`）；
- 把 `CHANGELOG` 的 `Unreleased` 段迁移为 `## [x.y.z] - YYYY-MM-DD`，保留段内分类与条目；
- 项目存在版本号 manifest（如 `package.json` 的 `version`）时，同步更新到同一版本号。

### 2. 创建定版提交

将版本定版改动（`CHANGELOG` 迁移、manifest 版本号等）精确暂存，创建一个定版提交，遵循项目既有提交规范。

### 3. 打 tag

按项目惯例打 tag，默认 `v`（如 `v0.2.2`），指向定版提交。

### 4. 推送远端（确认门）

**向用户显式确认后**，把定版提交与 tag 一并推送到远端：

```bash
git push origin 
git push origin    # 或 git push origin --tags，按项目惯例
```

push 被 reject（远端有新提交）时停止，报告冲突，不自动 `--force` 或 `--rebase`，交用户处理。

### 5. 发布渠道（探测 + 确认门，按需）

逐个探测项目实际的发布渠道；**每个渠道执行前都向用户显式确认**。用户没有点名或不同意时跳过该渠道，不静默发布。

#### npm

- 探测条件：仓库根存在 `package.json`；
- 确认后执行 `npm publish`（预发布版本按项目惯例用 `npm publish --tag` 打 dist-tag）；
- 未登录或凭据缺失时停止并报告，不把凭据写入任何文件。

#### GitHub Release

- 探测条件：git remote 指向 GitHub 且 `gh`（GitHub CLI）可用；
- release notes 默认从 `CHANGELOG` 对应版本段提取，不另行编造；
- 确认后用 `gh release create  --notes "..."` 创建，预发布版本加 `--prerelease`。

其它发布渠道（容器镜像、二进制产物等）由用户点名时按对应工具执行；本 skill 不预置全部渠道清单。

## 失败处理

- 任何步骤失败即停，**不自动回滚**已完成的动作；
- 报告失败发生点、已成功完成的动作（如"tag 已推上、npm 未发"）和未完成项；
- 由用户决定是否补发、撤销或修复后重试。

## 完成与接力

- **完成信号**：用户点名的全部对外动作已执行并确认成功（如 tag 已推、npm 已发、Release 已建），各渠道状态已报告。
- **产物**：版本定版提交、tag、推送结果、各渠道发布链接或结果；失败时为失败点和已完成动作清单。
- **候选出口**：发布内容本身有问题时进入 `507-fix`；发布前需要交付审查时进入 `507-review`；发布完成后通常直接结束。
- **回退条件**：前置门禁不满足、push 被远端 reject、凭据缺失或用户在任一确认门拒绝时停止，不强行发布。

## Source & license

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

- **Author:** [ssdiwu](https://github.com/ssdiwu)
- **Source:** [ssdiwu/507-skills](https://github.com/ssdiwu/507-skills)
- **License:** MIT

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-ssdiwu-507-skills-507-release
- Seller: https://agentstack.voostack.com/s/ssdiwu
- 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%.
