跳到主要内容
知仓学习社ZHICANG

ship

Commit, push, and optionally create or update a PR for the current staged changes. Use when the user asks to \"ship\", \"ship it\", \"ship changes\"…

不碰外部(只输出文字)无严重或高危命中tobihagemann/turbo

它会碰到什么

扫了多少1 个文本文件,4 KB
它会碰到什么不碰外部(只输出文字)
命中总数0 处
命中统计严重 0 · 高 0 · 中 0 · 低 0

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

Ship

Commit, push, and optionally create or update a PR for the current staged changes.

Task Tracking

At the start, use update_plan to track each phase, restating any remaining steps of a parent workflow alongside them:

  1. Determine intent
  2. Branch (if needed)
  3. Stage unstaged changes
  4. Run $commit-rules skill
  5. Commit
  6. Push (if requested)
  7. Create or update PR (if requested)

Step 1: Determine Intent

Detect the repository state:

  • Default branch: gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'
  • Current branch name, and whether it tracks an upstream
  • Whether a PR already exists for the current branch (gh pr view)

Sample the prevailing workflow from recent default-branch history (git log --first-parent origin/<default-branch> -n 30 --pretty=%s): judge whether changes mostly land through pull requests (merge-PR commits or (#N)-suffixed squash commits) or are committed directly to the default branch.

Output a one-line summary of the detected state as text. Then use request_user_input to choose how to proceed, offering these options:

  • Commit, push, and create/update the PR — say "create a PR" when no PR exists for the current branch and "update the PR" when one does; on the default branch, Step 2 creates a feature branch first
  • Commit and push — commit, then push to the current branch's remote
  • Commit only — commit the staged changes, do not push

Recommend the option that fits this repo by listing it first and labeling it (Recommended): when the current branch already has a PR, recommend updating it; otherwise follow the prevailing workflow — recommend the PR path for a PR-based history, or commit and push for a direct-commit history.

If the user declines (chooses the free-form "Other" option or asks to abort), leave the changes staged and do not commit.

Step 2: Branch (if Needed)

If the chosen option creates a PR and the current branch is the default branch:

  1. Suggest a branch name based on the changes and use request_user_input to confirm or adjust
  2. Create and switch to the new branch: git checkout -b <branch-name>

Step 3: Check for Unstaged Changes

Run git status to check for unstaged changes. Stage by path the files that belong to the current changeset, using git add -p <file> for one that also carries unrelated changes. This catches files modified by auto-formatters that were not re-staged.

Step 4: Run $commit-rules Skill

Run the $commit-rules skill to load commit message rules and technical constraints.

Step 5: Commit

Commit the already-staged changes (do not stage additional files) with a message following the loaded rules.

If the commit fails due to a pre-commit hook (formatter, linter), fix the issues — or run the project's format/lint script to auto-fix — then re-stage by path the files the hook modified before retrying. Pre-commit hooks may modify files in the working tree without updating the staging area.

Step 6: Push (if Requested)

If the chosen option includes pushing, push to the current branch's remote:

git push

Step 7: Create or Update PR (if Requested)

  • Create PR — run the $create-pr skill
  • Update PR — run the $update-pr skill

When $create-pr hands the body file over for editing instead of posting, report that path and that no PR was opened.

Then call update_plan to mark this step completed and continue with the next step of the active workflow.

Rules

  • Run the $commit-rules skill before every commit; do not commit without loading it first.
  • Never stage or commit files containing secrets (.env, credentials, API keys). Warn if detected.
  • Don't reference .turbo/ content (filenames, acceptance criteria, step numbers, headings) in branch names. .turbo/ is gitignored, so these references would be opaque to anyone reading without local copies.

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。

同名技能的其他版本

有 2 个不同仓库或目录里都有叫 ship 的技能。它们内容并不相同,别混用:

  • tobihagemann/turbo — Commit, push, and optionally create or update a PR for the current staged changes. Use whe