促进
- 作者仓库星标 0
- 作者仓库 skills-registry
- 领域
- 效率工具
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @tomevault-io · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 运行环境要求
- Node.js
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 读取环境变量
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
检查是否有可能被意外暂存的未跟踪 `.env` 文件: 是否会暂存任何 `.env` 文件:
如果上面的 git 状态显示未提交或未跟踪的更改:查看差异:`git diff` 和 `git diff --cached` 有选择地阶段更改 - 更喜欢跟踪文件:`git add -u`,然后单独查看并添加任何有意的新文件。除非用户明确确认,否则请避免使用`git add -A`。根据更改起草传统的提交消息 - 带类型前缀
将当前分支推送到远程:
如果已经在 `main` (或存储库的默认分支)上,请跳过此步骤。如果在功能分支上:扫描自最后一个标签以来的提交以获取问题引用:查找 `Closes #N`、`Fixes #N`、`Resolves #N`(不区分大小写)。收集找到的所有问题编号。如果没有找到:
使用以下 semver 规则在上面的上下文块中预先计算下一个版本: 使用 `!:` 提交主题(例如 `feat!:`、`fix!:`)→ 主要凹凸 以 `feat` 开头的提交主题 → 小凹凸 所有其他提交 → 补丁凹凸 确认给定提交列表的计算版本是正确的。如果之前的标签不存在,则使用
如果`.claude-plugin/plugin.json`存在,将其`version`字段更新为`<next-version>`(无`v`前缀 - 插件清单使用像`1.2.3`一样的裸语义版本):然后提交并推送:如果`.claude-plugin/plugin.json`不存在,则完全跳过此步骤。
如果在步骤 3 中创建了 PR,请跳过此步骤 — 当 PR 通过 PR 正文中的`Closes #N` 关键字合并时,GitHub 将自动关闭问题。如果促销活动直接在`main`上进行(无 PR),请立即关闭所有已识别的问题:
如果在步骤 3 中合并了某个功能分支,请在本地和远程删除它:
# Promote Changes
Runs the full release workflow from current working state to a tagged GitHub release on main.
Current branch: !`git branch --show-current 2>/dev/null || echo "unknown"`
Git status: !`git status --short 2>/dev/null || echo "not a git repo"`
Last tag: !`git describe --tags --abbrev=0 2>/dev/null || echo "none"`
Recent commits since last tag:
```text
!`git log $(git describe --tags --abbrev=0 2>/dev/null || echo "")..HEAD --oneline -10 2>/dev/null || git log --oneline -10`
```
Next version (calculated from commits above):
```text
!`(last=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0"); IFS='.' read -r ma mi pa <<< "${last#v}"; log=$(git log "${last}..HEAD" --format="%s" 2>/dev/null); if echo "$log" | grep -qE "^[a-z]+(\([^)]+\))?!:"; then echo "v$((ma+1)).0.0"; elif echo "$log" | grep -qE "^feat"; then echo "v${ma}.$((mi+1)).0"; else echo "v${ma}.${mi}.$((pa+1))"; fi)`
```
## Step 0: Pre-flight checks
```bash
gh auth status 2>&1 || { echo "ERROR: gh is not authenticated. Run: gh auth login"; exit 1; }
```
Check for untracked `.env` files that could be accidentally staged:
```bash
git status --short | grep -E '^\?\? .*\.env' && echo "WARNING: untracked .env files detected — review before staging"
cat .gitignore 2>/dev/null | grep -q '\.env' || echo "WARNING: .gitignore does not exclude .env files"
```
If any `.env` files would be staged:
```bash
if [ -t 0 ]; then
# Interactive — ask for confirmation before continuing
read -p "WARNING: .env files detected. Continue? (y/N) " confirm
[[ "$confirm" =~ ^[Yy]$ ]] || { echo "Aborted."; exit 1; }
else
# Non-interactive — hard stop; too risky to proceed without human review
echo "ERROR: untracked .env files detected in non-interactive mode. Aborting."
exit 1
fi
```
## Step 1: Commit any uncommitted changes
If the git status above shows uncommitted or untracked changes:
1. Review the diff: `git diff` and `git diff --cached`
2. Stage changes selectively — prefer tracked files: `git add -u`, then review and add any
intentional new files individually. Avoid `git add -A` unless the user explicitly confirms.
3. Draft a conventional commit message from the changes — lead with a type prefix
(`feat:`, `fix:`, `docs:`, `chore:`, etc.) and a concise summary
4. Commit using a heredoc so multi-line messages format correctly
If there is nothing uncommitted, skip to Step 2.
## Step 2: Push
Push the current branch to remote:
```bash
git push -u origin HEAD
```
## Step 3: Merge to main (feature branch only)
Skip this step if already on `main` (or the repo's default branch).
If on a feature branch:
1. Scan commits since the last tag for issue references:
```bash
git log $(git describe --tags --abbrev=0 2>/dev/null || echo "")..HEAD --format="%B"
```
Look for `Closes #N`, `Fixes #N`, `Resolves #N` (case-insensitive). Collect all issue numbers
found. If none are found:
```bash
if [ -t 0 ]; then
# Interactive — ask the user
read -p "Any GitHub issues this resolves? (e.g. 12 15 — or enter to skip) " issues
else
# Non-interactive — skip silently
issues=""
fi
```
2. Create a PR targeting main, including closing keywords in the body so GitHub closes the issues
automatically on merge:
```bash
gh pr create --title "<type>: <summary>" --body "$(cat <<'EOF'
## Summary
<bullet points from commits>
Closes #N, Closes #N
🤖 Generated with [claude-workflow-skills:promote](https://github.com/ali5ter/claude-workflow-skills) on behalf of [Alister](https://github.com/ali5ter)
EOF
)"
```
Omit the `Closes` lines if no issues were identified.
3. Enable auto-merge (squash preferred):
```bash
gh pr merge --auto --squash
```
4. Poll until merged:
```bash
gh pr view --json state --jq '.state'
```
5. Switch to main and pull:
```bash
git checkout main && git pull
```
## Step 4: Confirm next version
The next version is pre-calculated in the context block above using these semver rules:
- Commit subject with `!:` (e.g. `feat!:`, `fix!:`) → **major** bump
- Commit subject beginning with `feat` → **minor** bump
- All other commits → **patch** bump
Confirm the calculated version is correct given the commit list. If no previous tag exists, use
`v1.0.0`. Override only if the calculated version is clearly wrong (e.g. the injection returned
an error or empty output).
## Step 5: Sync plugin manifest (if present)
If `.claude-plugin/plugin.json` exists, update its `version` field to `<next-version>` (no `v`
prefix — plugin manifests use bare semver like `1.2.3`):
```bash
node -e "
const fs = require('fs');
const f = '.claude-plugin/plugin.json';
const d = JSON.parse(fs.readFileSync(f, 'utf8'));
d.version = '<next-version>';
fs.writeFileSync(f, JSON.stringify(d, null, 2) + '\n');
"
```
Then commit and push:
```bash
git add .claude-plugin/plugin.json
git commit -m "chore: sync plugin.json version to v<next-version>"
git push
```
Skip this step entirely if `.claude-plugin/plugin.json` does not exist.
## Step 6: Tag and release
```bash
git tag -a v<next-version> -m "Release v<next-version>"
git push origin v<next-version>
gh release create v<next-version> \
--generate-notes \
--title "v<next-version>"
```
## Step 7: Close resolved issues (main branch only)
Skip this step if a PR was created in Step 3 — GitHub will close the issues automatically when
the PR merges via the `Closes #N` keywords in the PR body.
If the promotion was directly on `main` (no PR), close any identified issues now:
```bash
gh issue close <N> --comment "Resolved in $(gh release view v<next-version> --json url --jq '.url')"
```
## Step 8: Clean up merged feature branch
If a feature branch was merged in Step 3, delete it locally and remotely:
```bash
git branch -d <feature-branch>
git push origin --delete <feature-branch>
```
## Step 9: Confirm clean state
```bash
git status
git log --oneline -5
```
Report the GitHub release URL from `gh release view v<next-version> --json url --jq '.url'`.
---
> Source: [ali5ter/claude-workflow-skills](https://github.com/ali5ter/claude-workflow-skills) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-22 -->
按说明文件中的顺序排列。
第 0 步:飞行前检查
第 1 步:提交所有未提交的更改
第 2 步:推
第 3 步:合并到主分支(仅限功能分支)
第四步:确认下一个版本
文件/命令 -> git branch --show-current 2>/dev/null || echo "unknown" · git status --short 2>/dev/null || echo "not a git repo" · git describe --tags --abbrev=0 2>/dev/null || echo "none" · .env · git diff · git diff --cached · git add -u · git add -A
内容校验值 -> 99fe8771246d
当前原文的自动摘译,尚未人工审校。
第 1 步:提交所有未提交的更改
如果上面的 git 状态显示未提交或未跟踪的更改:查看差异:
git diff和git diff --cached有选择地阶段更改 - 首选跟踪文件:git add -u,然后单独查看并添加任何有意的新文件。除非用户明确确认,否则避免使用git add -A。根据更改起草传统的提交消息 - 带类型前缀