一键导入
git-workflow
Git branch management, commit conventions, and PR creation workflow. Use for all tasks that require code changes, regardless of language or scope.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Git branch management, commit conventions, and PR creation workflow. Use for all tasks that require code changes, regardless of language or scope.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Set up docs-ssot SSOT documentation structure — migrate existing docs, build, and validate
Documentation update workflow. Use when modifying files in docs/ directory or any markdown files (*.md).
Maps GitHub labels to Skills and Context documents. Use when creating issues (github-issue-creation) or working on issues (fix-issue command).
How to run watch, keygen, and sign wallet CLI commands. Use when executing wallet commands or testing wallet functionality.
Solidity smart contract development workflow. Use when modifying smart contracts in apps/eth-contracts/contracts/.
TypeScript/JavaScript development workflow for apps/ directory. Use when modifying TypeScript code in xrpl-grpc-server or JavaScript in eth-contracts.
| name | git-workflow |
| description | Git branch management, commit conventions, and PR creation workflow. Use for all tasks that require code changes, regardless of language or scope. |
Standard Git workflow for all tasks in this repository.
This is the FIRST step for ANY task that involves code changes.
Before writing any code or making any changes, you MUST check the current branch:
git branch --show-current
Current Branch?
│
├─ main → ❌ DO NOT work here
│ → Create a new branch first (see "Creating a New Branch")
│
├─ Feature branch for this task → ✅ Continue working
│
└─ Different feature branch → ⚠️ Ask user which branch to use
main BranchNEVER make changes directly on main. Always create a new branch first:
# 1. Ensure main is up to date
git fetch origin
git reset --hard origin/main
# 2. Create new branch
git checkout -b {type}/{brief-description}-{issue-number}
Ask the user:
"You are currently on branch
{current-branch}. Should I:
- Continue working on this branch?
- Switch to
mainand create a new branch for this task?"
$ git branch --show-current
main
# → Must create new branch before any work!
$ git branch --show-current
feature/add-taproot-support-123
# → OK to continue if this is the correct branch for the task
Always create from latest main:
git fetch origin
git checkout main
git reset --hard origin/main
git checkout -b {type}/{brief-description}-{issue-number}
Format: {type}/{brief-description}-{issue-number}
| Type | Prefix | Example |
|---|---|---|
| Feature | feature/ | feature/add-taproot-support-123 |
| Bug fix | fix/ | fix/db-connection-error-456 |
| Refactoring | refactor/ | refactor/clean-arch-layer-789 |
| Documentation | docs/ | docs/update-readme-311 |
| DevOps/CI | ci/ | ci/add-lint-workflow-100 |
| Chore | chore/ | chore/update-deps-200 |
main: Never branch from feature branchesDo NOT create multiple branches for the same issue.
❌ Prohibited Pattern:
issue-123 → fix/first-attempt-123
→ fix/second-attempt-123 ← Do NOT create this
→ fix/another-fix-123 ← Do NOT create this either
✅ Correct Pattern:
issue-123 → fix/description-123
→ Create PR → Review → Merge
→ (If needed) Create new issue with new branch
Before creating a new branch, always check the following:
# 1. Check for existing branches
git branch -a | grep "{issue-number}"
# 2. Check for existing PRs
gh pr list --search "{issue-number}"
This project uses Conventional Commits format.
Commit messages are validated by lefthook commit-msg hook.
{type}({scope}): {brief description}
- {detail 1}
- {detail 2}
Closes #{issue_number}
| Type | Description | Release Impact |
|---|---|---|
feat | New feature | MINOR |
fix | Bug fix | PATCH |
docs | Documentation only | - |
refactor | Code refactoring (no feature/fix) | - |
test | Adding or updating tests | - |
ci | CI/CD changes | - |
chore | Maintenance tasks | - |
build | Build system changes | - |
perf | Performance improvements | PATCH |
style | Code style (formatting, etc.) | - |
revert | Revert a previous commit | - |
Add ! after type/scope to indicate breaking changes:
feat(btc)!: change address format to bech32m only
fix!: remove deprecated API endpoint
The following are suggested scopes, but other alphanumeric scopes are also permitted.
| Scope | Description |
|---|---|
btc | Bitcoin-related |
bch | Bitcoin Cash-related |
eth | Ethereum-related |
xrp | XRP-related |
db | Database |
api | API changes |
cli | CLI changes |
pr | PR review fixes |
# Feature with scope
git commit -m "feat(btc): add taproot address support
- Add bech32m encoding
- Update address validation
Closes #123"
# Bug fix without scope
git commit -m "fix: resolve database connection timeout
- Increase pool timeout
- Add retry logic
Closes #456"
# Documentation
git commit -m "docs: update architecture guide
- Add layer diagram
- Clarify dependency rules
Closes #789"
# Breaking change
git commit -m "feat(btc)!: require bech32m for all taproot addresses
BREAKING CHANGE: Legacy address format no longer supported
Closes #999"
If commit message validation fails:
ERROR: Commit message does not follow Conventional Commits format.
Expected format: <type>(<scope>): <description>
Types: feat, fix, docs, refactor, test, ci, chore, build, perf, style, revert
Examples:
feat(btc): add taproot address support
fix: resolve database connection timeout
docs: update architecture guide
refactor(api): reorganize endpoint handlers
Your commit message: <your-invalid-commit-message>
Always ask the user before creating a PR.
Multi-phase tasks create multiple commits on a single branch. Do not create a PR until all commits are complete.
After commits are pushed, ALWAYS ask:
> "Would you like me to create a PR? Or is there additional work to do?"
| Situation | Action |
|---|---|
| Single commit task | Ask before creating PR |
| Multi-phase task | Ask after ALL phases are complete |
| User explicitly requests PR | Create PR without asking |
git push -u origin {branch-name}
# Ask user: "Would you like me to create a PR?"
# Only proceed if user confirms
gh pr create --title "{type}: {description}" --body "$(cat <<'EOF'
## Summary
- {change 1}
- {change 2}
## Test plan
- [ ] Verification commands pass
- [ ] Manual testing completed
Closes #{issue_number}
EOF
)"
{type}: {description} (Closes #{issue_number})
Examples:
feat: add taproot address support (Closes #123)fix: resolve database connection timeout (Closes #456)docs: update architecture guide (Closes #789)## Summary
- Brief description of changes
## Changes
- Change 1
- Change 2
## Test plan
- [ ] Unit tests pass
- [ ] Integration tests pass (if applicable)
- [ ] Manual testing completed
## Related
- Closes #{issue_number}
- Related to #{other_issue}
Before EVERY commit, you MUST complete self-review:
Execute verification commands for the modified file types:
| File Type | Required Commands |
|---|---|
Go (*.go) | make go-lint && make tidy && make check-build && make go-test |
TypeScript (*.ts) | See typescript-development skill (Bun for xrpl-grpc-server, npm for eth-contracts) |
Shell (*.sh) | make shfmt |
| Makefile | make mk-lint |
| SQL/HCL | make atlas-fmt && make atlas-lint |
Read the applicable language skill and verify ALL checklist items:
| File Type | Skill | Section to Check |
|---|---|---|
Go (*.go) | go-development | Self-Review Checklist |
| TypeScript/JS | typescript-development | Self-Review Checklist |
Shell (*.sh) | shell-scripts | Verification Checklist |
| Makefile | makefile-update | Verification Checklist |
| SQL/HCL | db-migration | Verification Checklist |
Only proceed to commit after:
⚠️ DO NOT commit until all steps are verified.
git add - Stage changesgit commit - Create commitsgit push - Push to remotegit checkout -b - Create branchesgit push --force - Never force pushgit merge - Don't merge locallygit rebase on shared branches - Avoid rebasingmain - Always use PRs# 0. Check for existing branches/PRs (Required)
git branch -a | grep "{issue-number}"
gh pr list --search "{issue-number}"
# → If exists, continue working on that branch
# 1. Update main
git fetch origin && git checkout main && git reset --hard origin/main
# 2. Create branch (only if none exists)
git checkout -b {type}/{brief-description}-{issue-number}
# 3. Make changes...
# 4. Self-Review (REQUIRED - see "Pre-Commit Self-Review" section)
# - Run verification commands for modified file types
# - Complete self-review checklist from language skill
# - Confirm no linter errors
# 5. Commit (only after self-review is complete)
git add <files>
git commit -m "{type}: {description}
Closes #{number}"
# 6. Push
git push -u origin {branch-name}
# 7. Ask user before creating PR (REQUIRED)
# "Would you like me to create a PR? Or is there additional work?"
# Only create PR if user confirms
gh pr create --title "{type}: {description}"
# Already on PR branch
# 1. Make fixes...
# 2. Self-Review (REQUIRED)
# Run verification commands & complete checklist
# 3. Commit and push
git add <files>
git commit -m "fix(pr): address review comments"
git push