发布并公布
- 作者仓库星标 0
- 作者仓库 skills-registry
- 领域
- 人工智能
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @tomevault-io · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 需要 · GitHub
- 兼容的系统
- macOS
- 运行环境要求
- Bun
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
git status --porcelain # must be empty — clean working tree
git describe --exact-match --tags HEAD 2>&1 # must equal v<version>
git rev-parse --abbrev-ref HEAD # note the branch name
## Preconditions
This skill runs **after** git wrapup. By the time it's invoked:
- `package.json` version is bumped
- `server.json` version is bumped (top-level + each package entry)
- `CHANGELOG.md` has a new entry for this version with a concrete date (never `[Unreleased]`)
- README badges and version-bearing files are in sync
- Release commit (`chore: release v<version>`) exists
- Annotated tag (`v<version>`) exists locally
- Working tree is clean
If any are missing, halt and tell the user to finish wrapup first. Do not attempt to redo wrapup work from inside this skill.
## Failure Protocol
**Stop on the first non-zero exit.** No retries, no remediation from inside the skill. Report to the user:
1. Which step failed
2. The exact error output
3. Which destinations already received the release (npm published? tag pushed?) so they know the partial state
The user fixes locally and re-invokes, or runs the remaining steps manually. Publishes hard-fail with "version already exists" if replayed — that's the signal the step already succeeded.
## Steps
### 1. Sanity-check wrapup outputs
Read `package.json` → capture `version`. Read `server.json` → verify top-level `version` matches and every `packages[].version` matches. Then verify git state:
```bash
git status --porcelain # must be empty — clean working tree
git describe --exact-match --tags HEAD 2>&1 # must equal v<version>
git rev-parse --abbrev-ref HEAD # note the branch name
```
If working tree is dirty, HEAD isn't on `v<version>`, or `server.json` versions drift from `package.json`, halt.
### 2. Run the verification gate
All three must succeed:
```bash
bun run devcheck
bun run rebuild
bun test
```
Any non-zero exit → halt with the failing command's output.
`devcheck` runs lint + format + typecheck + `bun audit`. `rebuild` is a clean + `bun build` to catch build-time regressions `devcheck` alone can miss.
### 3. Push to origin
```bash
git push
git push --tags
```
If the remote rejects either push, halt. On a fresh branch, `git push` may need `-u origin <branch>` — read the error and re-run if that's the only gap.
### 4. Publish to npm
```bash
bun publish --access public
```
`bun publish` uses whatever npm auth the user has configured in `~/.npmrc`. If 2FA is enabled on the npm account, the command will prompt for an OTP or open a browser — that's expected; the user completes it interactively.
**Friction reducers (optional, configure once):**
| Option | How |
| :----------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------- |
| **npm granular access token** with "Bypass 2FA for publish" | Generate at npmjs.com → replace `_authToken` in `~/.npmrc` → no OTP prompt at all |
| **1Password CLI TOTP injection** (requires `brew install --cask 1password-cli` + signed-in `op`) | `bun publish --access public --otp="$(op item get 'npm' --otp)"` |
Halt on publish error other than "version already exists" (which means this step already ran).
### 5. Publish to MCP Registry
```bash
bun run publish-mcp
```
This repo's `publish-mcp` script is defined in `package.json` and runs `scripts/validate-mcp-publish-schema.ts` before invoking `mcp-publisher`. Reads `server.json` at the repo root.
Prereqs:
- A GitHub PAT with `read:org` + `read:user` scopes, reachable by the `publish-mcp` script (conventionally stored in Keychain under service `mcp-publisher-github-pat` on macOS)
- `mcp-publisher` CLI installed (`npm i -g mcp-publisher` or `brew install mcp-publisher`)
If the Keychain entry doesn't exist:
```bash
security add-generic-password -a "$USER" -s mcp-publisher-github-pat -w
# paste PAT at the silent prompt
```
Halt on any publisher error other than "cannot publish duplicate version".
### 6. Report the deployed artifacts
Print clickable URLs for every destination that succeeded:
- **npm:** `https://www.npmjs.com/package/@cyanheads/git-mcp-server/v/<version>`
- **MCP Registry:** `https://registry.modelcontextprotocol.io/v0/servers?search=io.github.cyanheads/git-mcp-server`
- **GitHub release tag:** `https://github.com/cyanheads/git-mcp-server/releases/tag/v<version>`
Skip any destination that was skipped or failed in its step.
## Optional: Create a GitHub Release
The annotated tag is enough for npm/MCP Registry. A GitHub Release adds a human-readable changelog page and optional assets. Skip unless the project publishes releases to GitHub Releases specifically.
```bash
gh release create "v<version>" \
--title "v<version>" \
--notes-file <(awk "/^## v<version>/,/^## v/" CHANGELOG.md | sed '$d')
```
The `awk` expression extracts just the current version's section from `CHANGELOG.md`.
## Checklist
- [ ] Working tree clean; HEAD tagged `v<version>`
- [ ] `package.json` and `server.json` versions match
- [ ] `bun run devcheck` passes
- [ ] `bun run rebuild` succeeds
- [ ] `bun test` passes
- [ ] `git push` succeeds
- [ ] `git push --tags` succeeds
- [ ] `bun publish --access public` succeeds
- [ ] `bun run publish-mcp` succeeds
- [ ] Deployed artifact URLs reported to the user
---
> Source: [cyanheads/git-mcp-server](https://github.com/cyanheads/git-mcp-server) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-22 -->
章节与文件索引
按说明文件中的顺序排列。
前提条件
失败协议
1. 健全性检查总结输出
2. 运行验证门
3.推送到原点
文件/命令 -> package.json · server.json · CHANGELOG.md · [Unreleased] · chore: release v<version> · v<version> · version · packages[].version
内容校验值 -> e135adbac28b
当前原文的自动摘译,尚未人工审校。
前提条件
该技能在 git 打包之后运行。调用时:
package.json版本已升级server.json版本已升级(顶级 + 每个包条目)CHANGELOG.md此版本有一个新条目,并带有具体日期(绝不会[Unreleased]) 自述文件标记和版本承载文件同步失败协议
在第一个非零出口处停止。无需重试,也无需从技能内部进行补救。向用户报告: 哪个步骤失败了 确切的错误输出 哪些目标已经收到了发布(npm 已发布?已推送标签?),以便他们了解部分状态 用户在本地修复并重新调用,或手动运行其余步骤。如果重播,则发布硬故障并显示“版本已存在”——这是该步骤已经成功的信号。
1. 健全性检查总结输出
阅读
package.json→捕获version。读取server.json→ 验证顶级version匹配以及每个packages[].version匹配。然后验证 git 状态:如果工作树脏了,HEAD 不在v<version>上,或者server.json版本偏离了package.json,则停止。2. 运行验证门
所有三个都必须成功:任何非零退出 → 停止并显示失败命令的输出。
devcheck运行 lint + 格式 + 类型检查 +bun audit。rebuild是一个干净的 +bun build,用于捕捉构建时回归devcheck可能会错过。3.推送到原点
如果遥控器拒绝任一推送,则停止。在新分支上,
git push可能需要-u origin <branch>——读取错误并重新运行(如果这是唯一的差距)。