npx skills add https://github.com/odysseus0/symphony --skill pushgh CLI 已安装并可在 PATH 中找到。gh auth status 命令成功。origin。pull:当推送被拒绝或同步不干净时(非快进、存在合并冲突风险或分支过时),使用此技能。识别当前分支并确认远程状态。
推送前运行本地验证(make -C elixir all)。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
如果需要,将分支推送到 origin 并设置上游跟踪,使用已配置的任何远程 URL。
如果推送不干净/被拒绝:
pull 技能以合并 origin/main,解决冲突,并重新运行验证。--force-with-lease。确保分支存在一个 PR:
明确使用 .github/pull_request_template.md 编写/更新 PR 正文:
<!-- ... -->)。使用 mix pr_body.check 验证 PR 正文并修复所有报告的问题。
使用 gh pr view 返回的 PR URL 进行回复。
# 识别分支
branch=$(git branch --show-current)
# 最小验证门
make -C elixir all
# 初始推送:尊重当前的 origin 远程仓库。
git push -u origin HEAD
# 如果因为远程仓库已更新而失败,使用 pull 技能。在
# pull 技能解决冲突并重新验证后,重试正常推送:
git push -u origin HEAD
# 如果已配置的远程仓库因认证、权限或工作流
# 限制而拒绝推送,停止并显示确切的错误信息。
# 仅当本地历史记录被重写时:
git push --force-with-lease origin HEAD
# 确保存在一个 PR(仅在缺失时创建)
pr_state=$(gh pr view --json state -q .state 2>/dev/null || true)
if [ "$pr_state" = "MERGED" ] || [ "$pr_state" = "CLOSED" ]; then
echo "当前分支关联的 PR 已关闭;请创建新分支 + PR。" >&2
exit 1
fi
# 编写一个清晰、易于理解的标题,总结已提交的变更。
pr_title="<为此变更编写的清晰 PR 标题>"
if [ -z "$pr_state" ]; then
gh pr create --title "$pr_title"
else
# 每次分支更新时重新考虑标题;如果范围发生变化,则进行编辑。
gh pr edit --title "$pr_title"
fi
# 在验证前,编写/编辑 PR 正文以匹配 .github/pull_request_template.md。
# 示例工作流:
# 1) 打开模板并为此 PR 起草正文内容
# 2) gh pr edit --body-file /tmp/pr_body.md
# 3) 对于分支更新,重新检查标题/正文是否仍与当前差异匹配
tmp_pr_body=$(mktemp)
gh pr view --json body -q .body > "$tmp_pr_body"
(cd elixir && mix pr_body.check --file "$tmp_pr_body")
rm -f "$tmp_pr_body"
# 显示 PR URL 用于回复
gh pr view --json url -q .url
--force;仅将 --force-with-lease 作为最后的手段。pull 技能。每周安装数
132
仓库
GitHub 星标数
55
首次出现
2026年3月10日
安全审计
安装于
codex131
opencode11
gemini-cli11
claude-code11
github-copilot11
amp11
gh CLI is installed and available in PATH.gh auth status succeeds for GitHub operations in this repo.origin safely.pull: use this when push is rejected or sync is not clean (non-fast-forward, merge conflict risk, or stale branch).Identify current branch and confirm remote state.
Run local validation (make -C elixir all) before pushing.
Push branch to origin with upstream tracking if needed, using whatever remote URL is already configured.
If push is not clean/rejected:
pull skill to merge origin/main, resolve conflicts, and rerun validation.--force-with-lease only when history was rewritten.Ensure a PR exists for the branch:
Write/update PR body explicitly using .github/pull_request_template.md:
<!-- ... -->).Validate PR body with mix pr_body.check and fix all reported issues.
Reply with the PR URL from gh pr view.
# Identify branch
branch=$(git branch --show-current)
# Minimal validation gate
make -C elixir all
# Initial push: respect the current origin remote.
git push -u origin HEAD
# If that failed because the remote moved, use the pull skill. After
# pull-skill resolution and re-validation, retry the normal push:
git push -u origin HEAD
# If the configured remote rejects the push for auth, permissions, or workflow
# restrictions, stop and surface the exact error.
# Only if history was rewritten locally:
git push --force-with-lease origin HEAD
# Ensure a PR exists (create only if missing)
pr_state=$(gh pr view --json state -q .state 2>/dev/null || true)
if [ "$pr_state" = "MERGED" ] || [ "$pr_state" = "CLOSED" ]; then
echo "Current branch is tied to a closed PR; create a new branch + PR." >&2
exit 1
fi
# Write a clear, human-friendly title that summarizes the shipped change.
pr_title="<clear PR title written for this change>"
if [ -z "$pr_state" ]; then
gh pr create --title "$pr_title"
else
# Reconsider title on every branch update; edit if scope shifted.
gh pr edit --title "$pr_title"
fi
# Write/edit PR body to match .github/pull_request_template.md before validation.
# Example workflow:
# 1) open the template and draft body content for this PR
# 2) gh pr edit --body-file /tmp/pr_body.md
# 3) for branch updates, re-check that title/body still match current diff
tmp_pr_body=$(mktemp)
gh pr view --json body -q .body > "$tmp_pr_body"
(cd elixir && mix pr_body.check --file "$tmp_pr_body")
rm -f "$tmp_pr_body"
# Show PR URL for the reply
gh pr view --json url -q .url
--force; only use --force-with-lease as the last resort.pull skill for non-fast-forward or stale-branch issues.Weekly Installs
132
Repository
GitHub Stars
55
First Seen
Mar 10, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex131
opencode11
gemini-cli11
claude-code11
github-copilot11
amp11