git
Git workflow automation - commit/push with sign-off, create/list/compact/rebase PRs, and contribute to upstream repos. Use this skill whenever the user mentions PR, pull request, create PR, show my PRs, list PRs, squash commits, compact commits, rebase PR, commit and push, push updates, push changes, contribute to a repo, fork and submit, or wants to manage any aspect of Git operations.
What this skill does
# Git
Git workflow automation: commit/push and full PR lifecycle. Scripts are at `${CLAUDE_SKILL_DIR}/scripts/`.
## Push
Commit changes with DCO sign-off and push to origin.
1. **Review** changes: `git status`, `git diff --stat`, `git log --oneline -5`
2. **Stage** specific modified files (prefer targeted adds over `git add -A`)
3. **Commit with sign-off** using conventional commit format:
```bash
git commit -s -m "$(cat <<'EOF'
type: descriptive title
Detailed description of changes.
EOF
)"
```
4. **Push to origin**: `git push origin $(git branch --show-current)`
5. **Verify**: `git status`
Conventional types: **feat**, **fix**, **docs**, **refactor**, **test**, **chore**
---
## Create PR
Fork repos, create branches, commit changes, and submit PRs. Idempotent and safe to re-run.
```bash
# 1. Fork, clone, and create branch
bash ${CLAUDE_SKILL_DIR}/scripts/01-fork-and-setup.sh \
owner/repo ~/code 1 main my-feature
# 2. Make your changes (use Edit tool)...
# 3. Auto-commit and create PR
bash ${CLAUDE_SKILL_DIR}/scripts/03-create-pr.sh \
main "PR title" "PR description"
```
**`01-fork-and-setup.sh <repo> [work_dir] [depth] [base_branch] [feature_branch]`**
- Creates fork if needed (detects existing forks, even with different names)
- Clones repo or uses existing local copy
- Sets up `upstream` and `origin` remotes, creates feature branch
**`03-create-pr.sh <base_branch> <pr_title> [pr_body] [commit_message]`**
- Auto-commits with DCO sign-off, pushes to fork
- Checks for existing PRs (avoids duplicates), returns PR URL
**Current directory mode** โ use `.` as work_dir:
```bash
bash ${CLAUDE_SKILL_DIR}/scripts/01-fork-and-setup.sh owner/repo . "" main fix/issue-123
bash ${CLAUDE_SKILL_DIR}/scripts/03-create-pr.sh main "Fix issue #123"
```
---
## List PRs
```bash
# Your open PRs
bash ${CLAUDE_SKILL_DIR}/scripts/show-prs.sh
# PRs requiring your review
bash ${CLAUDE_SKILL_DIR}/scripts/show-prs.sh --require-review
```
Status: **๐ง Draft** | **โ
Approved** | **โ ๏ธ Changes Requested** | **๐ Needs Review**
---
## Compact Commits
Squash all commits in a PR into a single commit with DCO sign-off.
```bash
gh pr view $PR_NUMBER --json commits,title,body
gh pr checkout $PR_NUMBER
N=$(gh pr view $PR_NUMBER --json commits --jq '.commits | length')
git reset --soft HEAD~$N
git commit --signoff -m "Comprehensive commit message"
git push --force-with-lease
```
---
## Rebase PR
Rebase a PR (or all open PRs) against target base branch and force push.
**Single PR:**
```bash
gh pr view $PR_NUMBER --json baseRefName,isCrossRepository
gh pr checkout $PR_NUMBER
git fetch $REMOTE
git rebase $REMOTE/$BASE_BRANCH
git push --force-with-lease
```
**Batch mode** โ rebase all open PRs:
```bash
gh pr list --author "@me" --state open \
--json number,headRefName,baseRefName,isCrossRepository
```
For each PR: determine remote (upstream for forks, origin for same-repo), rebase, resolve conflicts, force push.
| Condition | Default Remote |
|-----------|---------------|
| Fork PR (`isCrossRepository: true`) | `upstream` |
| Same-repo PR | `origin` |
---
## Notes
- Requires `gh` CLI installed and authenticated, Git configured with name/email, SSH keys for GitHub
- All commits include DCO sign-off (`-s` flag)
- Uses `--force-with-lease` for safe force pushing
- Idempotent โ safe to re-run without duplicating work
- Smart fork detection handles renamed forks
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.