视觉画布设计
canvas-design
基于设计原则创作静态视觉作品,用于海报与品牌图形。
create-pull-request【文档与办公】Create and manage pull requests using GitHub CLI. Covers branch preparation, writing PR titles and descriptions, creating PRs, handling review feedback, and merge/cleanup workflows. Use when proposing changes from a feature or fix branch for review, merging completed work into the main branch, requesting code review from collaborators, or documenting…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
造 GitHub 拉取請求,含明標題、結構化描述、得宜之分支立。
main)驗分支與基底分支同步且所有改動已提交:
# Check for uncommitted changes
git status
# Fetch latest from remote
git fetch origin
# Rebase on latest main (or merge)
git rebase origin/main
預期: 分支超前 origin/main,無未提交之改動且無衝突。
失敗時: 若 rebase 衝突,解之(見 resolve-git-conflicts 技能),繼以 git rebase --continue。若分支顯著分歧,考慮 git merge origin/main 代之。
察 PR 所含之全差異與提交歷史:
# See all commits on this branch (not on main)
git log origin/main..HEAD --oneline
# See the full diff against main
git diff origin/main...HEAD
# Check if branch tracks remote and is pushed
git status -sb
預期: 所有提交與 PR 相關。差異僅顯所欲之改動。
失敗時: 若有不相關之提交,考慮互動 rebase 以清歷史,再造 PR。
# Push branch to remote (set upstream tracking)
git push -u origin HEAD
預期: 分支現於 GitHub 遠端。
失敗時: 若推被拒,先以 git pull --rebase origin <branch> 拉並解任何衝突。
標題守於 70 字以內。用正文述細節:
gh pr create --title "Add weighted mean calculation" --body "$(cat <<'EOF'
## Summary
- Implement `weighted_mean()` with NA handling and zero-weight filtering
- Add input validation for mismatched vector lengths
- Include unit tests covering edge cases
## Test plan
- [ ] `devtools::test()` passes with no failures
- [ ] Manual verification with example data
- [ ] Edge cases: empty vectors, all-NA weights, zero-length input
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
草稿 PR:
gh pr create --title "WIP: Add authentication" --body "..." --draft
預期: PR 造於 GitHub 且返 URL。描述明述改動與測法。
失敗時: 若 gh 未認證,行 gh auth login。若基底分支誤,以 --base main 指定。
應審查意見並推更新:
# View PR comments
gh api repos/{owner}/{repo}/pulls/{number}/comments
# View PR review status
gh pr checks
# After making changes, commit and push
git add <files>
git commit -m "$(cat <<'EOF'
fix: address review feedback on input validation
EOF
)"
git push
預期: 新提交顯於 PR。審查意見已處。
失敗時: 若推後 CI 察敗,以 gh pr checks 察檢查輸出,修之再請重審。
核准後:
# Merge the PR (squash merge keeps history clean)
gh pr merge --squash --delete-branch
# Or merge with all commits preserved
gh pr merge --merge --delete-branch
# Or rebase merge (linear history)
gh pr merge --rebase --delete-branch
合併後更本地 main:
git checkout main
git pull origin main
預期: PR 已合、遠端分支已刪、本地 main 已更。
失敗時: 若合被失敗檢查或缺核准所阻,先處之。勿未解阻礙而強制合併。
gh pr checks。敗 CI 耗審者之時--delete-branch 以保遠端清commit-changes - 為 PR 造提交manage-git-branches - 分支造與命名慣例resolve-git-conflicts - rebase/合併中之衝突處create-github-release - 合併後之發布