Communitygithub.com

jeremylongshore/tons-of-skills-marketplace

执行完整的发布工作流:提交未暂存更改、推送、创建合并PR、基于约定式提交确定语义版本号、生成带注解的Git标签和GitHub Release、清理已合并分支并回到干净的main分支。

tons-of-skills-marketplace 是什么?

该技能(Skill)实现了从当前工作状态到 tagged GitHub Release on main 的完整发布工作流。它自动检测当前分支、Git 状态、最新标签,并利用约定式提交(Conventional Commits)的日志来计算下一个语义版本号(major/minor/patch)。技能依次执行:暂存并提交未提交的更改(选择性暂存,避免意外添加上游 .env 文件)、推送分支、基于特性分支自动创建/合并 PR(含自动关闭 Issue 的关键词)、更新 .claude-plugin 插件清单版本(如果存在)、创建带注解的标签和 GitHub Release(含自动生成 Release Notes),最后删除已合并的特性分支并验证干净状态。该技能适用于 Claude Code 等支持 shell 命令调用和动态读取上下文的 AI 编程助手,交互式模式下会询问用户确认风险操作(如 .env 文件),非交互模式下则硬性中止以防止意外泄露。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/HEAD/plugins/productivity/claude-workflow-skills/skills/promote

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

发布更改(Promote Changes)

从当前工作目录状态运行完整的发布工作流,最终在 main 上创建一个带有标签的 GitHub Release。

当前分支: !git branch --show-current 2>/dev/null || echo "unknown"

Git 状态: !git status --short 2>/dev/null || echo "not a git repo"

最近标签: !git describe --tags --abbrev=0 2>/dev/null || echo "none"

自最近标签以来的最近提交:

!`git log $(git describe --tags --abbrev=0 2>/dev/null || echo "")..HEAD --oneline -10 2>/dev/null || git log --oneline -10`

下一个版本(根据上面的提交计算):

!`(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)`

步骤 0:前置检查

gh auth status 2>&1 || { echo "错误:gh 未认证。请运行:gh auth login"; exit 1; }

检查可能被意外暂存的未跟踪 .env 文件:

git status --short | grep -E '^\?\? .*\.env' && echo "警告:检测到未跟踪的 .env 文件 — 暂存前请检查"
cat .gitignore 2>/dev/null | grep -q '\.env' || echo "警告:.gitignore 未排除 .env 文件"

如果任何 .env 文件会被暂存:

if [ -t 0 ]; then
  # 交互式 — 询问确认后再继续
  read -p "警告:检测到 .env 文件。是否继续?(y/N) " confirm
  [[ "$confirm" =~ ^[Yy]$ ]] || { echo "已中止。"; exit 1; }
else
  # 非交互式 — 硬性中止;未经人工检查风险太高
  echo "错误:在非交互模式下检测到未跟踪的 .env 文件。正在中止。"
  exit 1
fi

步骤 1:提交所有未暂存的更改

如果上面的 Git 状态显示有未暂存或未跟踪的更改:

  1. 查看差异:git diff 和 git diff --cached
  2. 选择性暂存更改 — 优先暂存已跟踪的文件:git add -u,然后检查并逐一添加任何 有意的新文件。除非用户明确确认,否则避免使用 git add -A。
  3. 根据更改草拟一个约定式提交信息 — 以类型前缀开头 (feat:、fix:、docs:、chore: 等)后跟简洁摘要
  4. 使用 heredoc 提交,以便多行信息格式正确

如果没有未提交的内容,则跳至步骤 2。

步骤 2:推送

将当前分支推送到远程:

git push -u origin HEAD

步骤 3:合并到 main(仅限特性分支)

如果已在 main(或仓库的默认分支)上,则跳过此步骤。

如果位于特性分支上:

  1. 扫描从最近标签以来的提交,查找 Issue 引用:

    git log $(git describe --tags --abbrev=0 2>/dev/null || echo "")..HEAD --format="%B"
    

    查找 Closes #N、Fixes #N、Resolves #N(不区分大小写)。收集所有找到的 Issue 编号。 如果未找到:

    if [ -t 0 ]; then
      # 交互式 — 询问用户
      read -p "此更改解决了哪些 GitHub Issues?(例如 12 15 — 或按回车跳过) " issues
    else
      # 非交互式 — 静默跳过
      issues=""
    fi
    
  2. 创建一个目标为 main 的 PR,并在正文中包含关闭关键词,以便 GitHub 在合并时自动关闭 Issue:

    gh pr create --title "<type>: <summary>" --body "$(cat <<'EOF'
    ## 摘要
    <来自提交的要点>
    
    Closes #N, Closes #N
    
    🤖 由 [claude-workflow-skills:promote](https://github.com/ali5ter/claude-workflow-skills) 代表 [Alister](https://github.com/ali5ter) 生成
    EOF
    )"
    

    如果未识别到任何 Issue,则省略 Closes 行。

  3. 启用自动合并(推荐 squash 合并):

    gh pr merge --auto --squash
    
  4. 轮询直至合并:

    gh pr view --json state --jq '.state'
    
  5. 切换到 main 并拉取:

    git checkout main && git pull
    

步骤 4:确认下一个版本

下一个版本已在上方的上下文中根据以下语义版本规则预先计算:

  • 提交主题包含 !:(例如 feat!:``、fix!:``) → major 版本提升
  • 提交主题以 feat 开头 → minor 版本提升
  • 所有其他提交 → patch 版本提升

根据提交列表确认计算出的版本正确。如果不存在之前的标签,则使用 v1.0.0。仅在计算版本明显错误时(例如注入命令返回了错误或空输出)才进行覆盖。

步骤 5:同步插件清单(如果存在)

如果 .claude-plugin/plugin.json 存在,将其 version 字段更新为 <next-version>(不带 v 前缀 — 插件清单使用裸的语义版本号,如 1.2.3):

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');
"

然后提交并推送:

git add .claude-plugin/plugin.json
git commit -m "chore: sync plugin.json version to v<next-version>"
git push

如果 .claude-plugin/plugin.json 不存在,则完全跳过此步骤。

步骤 6:标签和发布

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>"

步骤 7:关闭已解决的 Issue(仅限 main 分支)

如果在步骤 3 中创建了 PR,则跳过此步骤 — GitHub 会通过 PR 正文中的 Closes #N 关键词在 PR 合并时自动关闭 Issue。

如果是在 main 上直接进行发布(没有 PR),则立即关闭任何识别到的 Issue:

gh issue close <N> --comment "已在 $(gh release view v<next-version> --json url --jq '.url') 中解决"

步骤 8:清理已合并的特性分支

如果在步骤 3 中合并了特性分支,请同时在本地和远程删除它:

git branch -d <feature-branch>
git push origin --delete <feature-branch>

步骤 9:确认干净状态

git status
git log --oneline -5

输出来自 gh release view v<next-version> --json url --jq '.url' 的 GitHub Release URL。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

jeremylongshore/tons-of-skills-marketplace

Use when asked to structure a landing page for positioning, plan a conversion-optimized page layout, or design a launch page. Examples: "landing page for product launch", "conversion-optimized layout for SaaS

jeremylongshore/tons-of-skills-marketplace

Use when asked to design growth-optimized landing pages, activation funnel layouts, or experiment-friendly page structures. Examples: "growth-optimized landing", "activation funnel layout", "A/B testable page

jeremylongshore/tons-of-skills-marketplace

Use when asked to structure a landing page, design page layout for conversion, or plan landing page information architecture. Examples: "landing page structure for SaaS", "conversion-optimized layout

jeremylongshore/tons-of-skills-marketplace

Generate polished demo videos from a single prompt. Use when the user asks to create a demo video, product walkthrough, feature showcase, or animated presentation. Trigger with "make a demo video", "create a product video", "demo walkthrough", or "feature showcase video".

jeremylongshore/tons-of-skills-marketplace

Track cryptocurrency portfolio with real-time valuations, allocation analysis, and P&L tracking. Use when checking portfolio value, viewing holdings breakdown, analyzing allocations, or exporting portfolio data. Trigger with phrases like "show my portfolio", "check crypto holdings", "portfolio allocation", "track my crypto", or "export portfolio".

jeremylongshore/tons-of-skills-marketplace

Agent skill at plugins/productivity/content-multiplier/skills/channel-formats/SKILL.md

jeremylongshore/tons-of-skills-marketplace

Operate an evidence-backed editorial queue, balance topic and format coverage, schedule approved drafts, and reconcile backlog state with the publishing system. Use when choosing or scheduling the next blog work. Trigger with "show the editorial calendar" or "pick the next topic".

jeremylongshore/tons-of-skills-marketplace

Configure CI/CD pipeline for AppFolio property management integrations. Trigger: "appfolio CI".

jeremylongshore/tons-of-skills-marketplace

Diagnose and fix common AppFolio API integration errors. Trigger: "appfolio error".

jeremylongshore/tons-of-skills-marketplace

Build property management dashboard with AppFolio API data. Trigger: "appfolio property dashboard".

jeremylongshore/tons-of-skills-marketplace

Automate tenant management and lease operations with AppFolio. Trigger: "appfolio tenant management".

jeremylongshore/tons-of-skills-marketplace

Collect AppFolio API debug evidence for support tickets. Trigger: "appfolio debug".

jeremylongshore/tons-of-skills-marketplace

Deploy AppFolio integration service to cloud infrastructure. Trigger: "deploy appfolio".

jeremylongshore/tons-of-skills-marketplace

Query AppFolio properties, units, and tenants via REST API. Trigger: "appfolio hello world".

jeremylongshore/tons-of-skills-marketplace

Configure AppFolio Stack API authentication with OAuth 2.0. Use when setting up property management API access, registering as an AppFolio Stack partner, or configuring client credentials for API calls. Trigger: "install appfolio", "setup appfolio", "appfolio auth", "appfolio API key".

jeremylongshore/tons-of-skills-marketplace

Set up local development for AppFolio property management API integration. Trigger: "appfolio local dev".

jeremylongshore/tons-of-skills-marketplace

Production readiness checklist for AppFolio integrations. Trigger: "appfolio production checklist".

jeremylongshore/tons-of-skills-marketplace

Handle AppFolio API rate limits with throttling and backoff. Trigger: "appfolio rate limit".

jeremylongshore/tons-of-skills-marketplace

Reference architecture for AppFolio property management integration. Trigger: "appfolio architecture".

jeremylongshore/tons-of-skills-marketplace

Apply production-ready patterns for AppFolio REST API integration. Trigger: "appfolio patterns".

相关技能