npx skills add https://github.com/0xbigboss/claude-code --skill git-best-practices当此技能加载时,所有 git 操作请遵循以下指令:
type(scope): description 格式--force-with-lease;任何强制推送前需与用户确认执行 git 操作时请遵循此顺序:
git status 和 git diff HEAD;输出:工作树和未暂存/已暂存的差异git add path/to/file;用 git status 验证广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
type(scope): description 格式,正文可选git push --force-with-lease origin {branch}智能体在长时间运行的任务期间可能会创建 WIP 检查点提交。这些是开发产物,应在创建 PR 前清理。
wip: 作为前缀,或使用标准的约定式提交格式/rewrite-history,以构建清晰的提交历史git add src/auth.ts src/auth.test.tsgit status 验证暂存内容.env 文件、凭据和大二进制文件提交到仓库 — 如果暂存的文件看起来敏感,请警告用户专门使用 --force-with-lease 以防止覆盖上游更改:
git push --force-with-lease origin feat/my-branch
在任何强制推送之前,无论针对哪个分支,都必须与用户确认。
格式:type(scope): description
主题行规则:
常见类型:
| 类型 | 用于 |
|---|---|
feat | 新功能 |
fix | 错误修复 |
docs | 仅文档 |
refactor | 重构(不改变行为) |
perf | 性能改进 |
chore | 维护、依赖项、工具 |
test | 添加或更新测试 |
ci | CI/CD 流水线更改 |
build | 构建系统更改 |
style | 格式化、空格(无逻辑更改) |
正文是可选的 — 仅当更改确实不明显时才添加。主题行说明"做了什么";正文解释"为什么"。
在以下情况下添加正文:
fix(shell): restore Alt+F terminal navigation
fix(shell): use HOMEBREW_PREFIX to avoid path_helper breaking plugins in login shells
macOS path_helper reorders PATH in login shells, putting /usr/local/bin
before /opt/homebrew/bin. This caused `brew --prefix` to resolve the stale
Intel Homebrew, so fzf, zsh-autosuggestions, and zsh-syntax-highlighting
all silently failed to load in Ghostty (which spawns login shells).
Use the HOMEBREW_PREFIX env var (set by brew shellenv in .zshenv) instead
of calling `brew --prefix` — it survives path_helper and is faster.
feat(install): add claude bootstrap runtime management
- migrate Claude defaults to declarative files under claude/defaults
- add claude-bootstrap check/fix/uninstall with backup-first migration
- stop stowing full claude/codex runtime trees and tighten drift checks
fix(pool-party): handle stale settlement state on reconnect
PoolSettlement contract stays in pending state when the participant
disconnects mid-settlement. Check settlement timestamp and expire
stale entries on reconnect.
Fixes SEND-718
chore(submodule): update claude-code
Bump claude-code to 88d0c75 (feat(skills): add tiltup, specalign, and e2e skills).
对于简单的版本更新,bump 或 bump claude-code submodule 是可接受的。
refactor(api)!: change auth endpoint response format
The /auth/token endpoint now returns { access_token, expires_in }
instead of { token, expiry }. All clients must update their parsers.
在分支或创建 PR 之前,发现仓库的分支拓扑结构。运行这些命令并存储结果:
# Default branch (PR target for most repos)
gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'
# Current branch
git branch --show-current
# Production branch (if different from default)
git branch -r --list 'origin/main' 'origin/master' 'origin/production'
当 gh 不可用或仓库没有远程时的备用方案:
# Infer default branch from local refs
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@'
# Last resort: check local branches and fail loudly if unknown
if git rev-parse --verify main >/dev/null 2>&1; then
echo main
elif git rev-parse --verify master >/dev/null 2>&1; then
echo master
else
echo "ERROR: unable to determine default branch (main/master not found)." >&2
exit 1
fi
存储发现的分支名称并在后续操作中引用它。在所有后续命令中使用实际的分支名称。
首先使用仓库的分支命名约定。如果未记录约定,请使用:
格式:type/description-TICKET-ID
示例:
feat/add-login-SEND-77fix/pool-party-stall-SEN-68chore/update-depshotfix/auth-bypass存在问题时包含问题 ID。没有问题时省略。
首先使用仓库的分支流程策略。如果策略未记录,一个常见的基线是:
{production-branch} (production deploys)
└── {default-branch} (staging/testnet deploys, PR target)
├── feat/add-feature-TICKET
├── fix/bug-description-TICKET
└── hotfix/* (branches off production branch for hotfixes)
首先使用仓库的合并策略(在许多组织中这是必需的)。
如果不存在策略,这些默认设置是合理的:
| PR 目标 | 策略 | 理由 |
|---|---|---|
| 功能 → 默认分支 | 压缩合并 | 清晰的历史,每个功能一个提交 |
| 默认 → 生产 | 合并提交 | 保留发布边界;可见的部署点 |
| 热修复 → 生产 | 压缩合并 | 生产环境上的单一原子修复 |
务实的规模优于任意限制。无论 PR 规模大小,每次提交都应讲述一个清晰的故事。一个 PR 应该作为一个连贯的单元进行审查 — 如果审查者无法在脑海中掌握完整的更改,请考虑拆分。
使用仓库原生的 PR 工具(gh pr create、GitLab CLI 或 Web UI),并包含:
对于具有混乱 WIP 历史的分支,使用 /rewrite-history 来:
每个重写的提交都引入一个连贯的想法,并建立在前一个提交的基础上 — 就像教程一样,向读者展示该功能是如何构建的。
每周安装次数
58
仓库
GitHub 星标数
37
首次出现
2026年2月13日
安全审计
安装于
codex50
opencode47
gemini-cli46
github-copilot45
amp44
kimi-cli44
When this skill is loaded, follow these directives for all git operations:
type(scope): description format--force-with-lease for force pushes; confirm with the user before any force pushFollow this sequence when performing git operations:
git status and git diff HEAD; output: working tree and unstaged/staged deltagit add path/to/file for each file; verify with git statustype(scope): description with optional bodygit push --force-with-lease origin {branch} only for rewritten history and only after user confirmationAgents may create WIP checkpoint commits during long-running tasks. These are development artifacts, cleaned up before PR.
wip: or use standard conventional commit format/rewrite-history before opening a PR to craft a clean narrativegit add src/auth.ts src/auth.test.tsgit status before committing.env files, credentials, and large binaries out of commits — warn the user if staged files look sensitiveUse --force-with-lease exclusively to protect against overwriting upstream changes:
git push --force-with-lease origin feat/my-branch
Always confirm with the user before any force push, regardless of branch.
Format: type(scope): description
Subject line rules:
Common types:
| Type | Use for |
|---|---|
feat | New functionality |
fix | Bug fix |
docs | Documentation only |
refactor | Restructuring without behavior change |
perf | Performance improvement |
chore | Maintenance, dependencies, tooling |
Body is optional — only add one when the change is genuinely non-obvious. The subject line carries the "what"; the body explains "why."
Add a body when:
fix(shell): restore Alt+F terminal navigation
fix(shell): use HOMEBREW_PREFIX to avoid path_helper breaking plugins in login shells
macOS path_helper reorders PATH in login shells, putting /usr/local/bin
before /opt/homebrew/bin. This caused `brew --prefix` to resolve the stale
Intel Homebrew, so fzf, zsh-autosuggestions, and zsh-syntax-highlighting
all silently failed to load in Ghostty (which spawns login shells).
Use the HOMEBREW_PREFIX env var (set by brew shellenv in .zshenv) instead
of calling `brew --prefix` — it survives path_helper and is faster.
feat(install): add claude bootstrap runtime management
- migrate Claude defaults to declarative files under claude/defaults
- add claude-bootstrap check/fix/uninstall with backup-first migration
- stop stowing full claude/codex runtime trees and tighten drift checks
fix(pool-party): handle stale settlement state on reconnect
PoolSettlement contract stays in pending state when the participant
disconnects mid-settlement. Check settlement timestamp and expire
stale entries on reconnect.
Fixes SEND-718
chore(submodule): update claude-code
Bump claude-code to 88d0c75 (feat(skills): add tiltup, specalign, and e2e skills).
For trivial bumps, bump or bump claude-code submodule is acceptable.
refactor(api)!: change auth endpoint response format
The /auth/token endpoint now returns { access_token, expires_in }
instead of { token, expiry }. All clients must update their parsers.
Before branching or opening a PR, discover the repo's branch topology. Run these commands and store the results:
# Default branch (PR target for most repos)
gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'
# Current branch
git branch --show-current
# Production branch (if different from default)
git branch -r --list 'origin/main' 'origin/master' 'origin/production'
Fallback whengh is unavailable or the repo has no remote:
# Infer default branch from local refs
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@'
# Last resort: check local branches and fail loudly if unknown
if git rev-parse --verify main >/dev/null 2>&1; then
echo main
elif git rev-parse --verify master >/dev/null 2>&1; then
echo master
else
echo "ERROR: unable to determine default branch (main/master not found)." >&2
exit 1
fi
Store the discovered branch name and reference it throughout. Use the actual branch name in all subsequent commands.
Use repository branch naming conventions first. If no convention is documented, use:
Format: type/description-TICKET-ID
Examples:
feat/add-login-SEND-77fix/pool-party-stall-SEN-68chore/update-depshotfix/auth-bypassInclude the ticket ID when an issue exists. Omit when there is no ticket.
Use repository branch flow policy first. If policy is undocumented, a common baseline is:
{production-branch} (production deploys)
└── {default-branch} (staging/testnet deploys, PR target)
├── feat/add-feature-TICKET
├── fix/bug-description-TICKET
└── hotfix/* (branches off production branch for hotfixes)
Use repository merge policy first (required in many organizations).
If no policy exists, these defaults are reasonable:
| PR target | Strategy | Rationale |
|---|---|---|
| Feature → default branch | Squash merge | Clean history, one commit per feature |
| Default → production | Merge commit | Preserves the release boundary; visible deploy points |
| Hotfix → production | Squash merge | Single atomic fix on production |
Pragmatic sizing over arbitrary limits. Each commit tells a clear story regardless of PR size. A PR should be reviewable as a coherent unit — if a reviewer cannot hold the full change in their head, consider splitting.
Use repo-native PR tooling (gh pr create, GitLab CLI, or web UI) with:
For branches with messy WIP history, use /rewrite-history to:
Each rewritten commit introduces one coherent idea, building on the previous — like a tutorial teaching the reader how the feature was built.
Weekly Installs
58
Repository
GitHub Stars
37
First Seen
Feb 13, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex50
opencode47
gemini-cli46
github-copilot45
amp44
kimi-cli44
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
120,000 周安装
test| Adding or updating tests |
ci | CI/CD pipeline changes |
build | Build system changes |
style | Formatting, whitespace (no logic change) |