원클릭으로
git-commit-push-pr
Commit all changes, push to remote, and create a GitHub pull request with an auto-generated description if one doesn't already exist.
메뉴
Commit all changes, push to remote, and create a GitHub pull request with an auto-generated description if one doesn't already exist.
Generate a self-contained, human-friendly companion HTML report from a markdown AI-agent response (or any markdown document). The output is a single .html file with no external dependencies, an explicit light/dark mode toggle (with OS-preference default and persistence), and a layout chosen to fit the content type (explainer, comparison, decision doc, review feedback, status report, etc.).
Dispatch a code reviewer subagent to catch issues before they cascade. Use after completing features, fixing complex bugs, or before merging.
Track project tasks and epics in individual markdown files under docs/tasks/, with docs/PROJECT.md as the central index. Supports bootstrapping new projects and managing ongoing work.
Create a new Linear ticket using the linear CLI
Configure a Hetzner Cloud Floating IP persistently on Ubuntu servers using Netplan. Ensures the floating IP survives reboots and is externally accessible.
Initialize a fresh Hetzner Ubuntu server with a non-root user configured for Docker application deployment. Sets up secure SSH access, Docker permissions, and a dedicated data directory.
| name | git-commit-push-pr |
| description | Commit all changes, push to remote, and create a GitHub pull request with an auto-generated description if one doesn't already exist. |
| allowed-tools | ["Bash","Read","Grep"] |
Stage all changes, commit with a meaningful message, push to the remote, and create a GitHub pull request with a well-structured description. If a PR already exists for the current branch, it skips creation and outputs the existing PR URL.
gh CLI installed and authenticated (gh auth status)Use this skill when you need to:
No manual placeholders required. All values are auto-detected:
gh repo view --json defaultBranchRefgit branch --show-current# Get the repository's default branch name (main, master, develop, etc.)
DEFAULT_BRANCH=$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name')
echo "Default branch: $DEFAULT_BRANCH"
CURRENT_BRANCH=$(git branch --show-current)
echo "Current branch: $CURRENT_BRANCH"
# If on the default branch, create a new feature branch
if [ "$CURRENT_BRANCH" = "$DEFAULT_BRANCH" ]; then
# Derive a branch name from the changed files
# Look at the diff stat to determine a descriptive name
CHANGED_SUMMARY=$(git diff --stat --no-color | tail -1)
CHANGED_DIRS=$(git diff --name-only | head -5 | xargs -I{} dirname {} | sort -u | head -1)
# Generate a branch name based on the primary directory of changes
# The agent should pick a meaningful name based on what the changes actually do
BRANCH_NAME="feat/${CHANGED_DIRS//\//-}"
# Clean up the branch name: lowercase, replace special chars
BRANCH_NAME=$(echo "$BRANCH_NAME" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9\/-]/-/g' | sed 's/--*/-/g' | sed 's/-$//')
echo "Creating feature branch: $BRANCH_NAME"
git checkout -b "$BRANCH_NAME"
CURRENT_BRANCH="$BRANCH_NAME"
fi
# Stage all tracked and untracked changes
git add -A
# Verify there are changes to commit
if git diff --cached --quiet; then
echo "ERROR: No changes to commit. Working tree is clean."
exit 1
fi
# Show summary of staged changes
echo "Staged changes:"
git diff --cached --stat
# Analyze the staged changes to build a meaningful commit message
# The agent should examine the diff to determine:
# - Type prefix: feat, fix, docs, refactor, chore, test, style
# - Scope: primary area of change (optional)
# - Summary: concise description of what changed and why
# Review the diff for context
git diff --cached --stat
git diff --cached --name-only
# Commit with the generated message
# Example format: "feat(auth): add OAuth2 login flow"
# Example format: "fix: resolve null pointer in user lookup"
# Example format: "docs: update API reference for v2 endpoints"
git commit -m "<generated commit message>"
# Push the branch to origin, setting upstream tracking
git push -u origin "$CURRENT_BRANCH"
# Verify push succeeded
echo "Branch pushed: $CURRENT_BRANCH"
# Check if a PR already exists for this branch
EXISTING_PR=$(gh pr list --head "$CURRENT_BRANCH" --state open --json number,url --jq '.[0].url')
if [ -n "$EXISTING_PR" ]; then
echo "PR already exists: $EXISTING_PR"
echo "New commits have been pushed to the existing PR."
# Stop here - no need to create a new PR
exit 0
fi
echo "No existing PR found. Will create one."
# Gather information for the PR description
# - Commit log since diverging from the default branch
# - Diff stat against the default branch
# - File-level changes for context
COMMIT_LOG=$(git log "$DEFAULT_BRANCH"..HEAD --pretty=format:"- %s" --no-merges)
DIFF_STAT=$(git diff "$DEFAULT_BRANCH"...HEAD --stat)
CHANGED_FILES=$(git diff "$DEFAULT_BRANCH"...HEAD --name-only)
# The agent should analyze the above to produce a structured PR body:
#
# ## Summary
# <1-3 bullet points describing the overall purpose of the changes>
#
# ## Changes
# <bullet list of specific changes made, grouped logically>
#
# ## Notes
# <any additional context, testing notes, or considerations>
# Create the PR with a descriptive title and body
# Title should match the primary commit message or summarize all changes
gh pr create \
--base "$DEFAULT_BRANCH" \
--title "<descriptive PR title>" \
--body "$(cat <<'EOF'
## Summary
<1-3 bullet points summarizing the purpose>
## Changes
<bullet list of changes>
## Notes
<additional context or testing notes>
EOF
)"
# Output the new PR URL
gh pr view --json url --jq '.url'
After running all steps, you should have:
gh CLI must be authenticated. Run gh auth status to verify before starting..env, credentials, API keys). The agent should warn if it detects potentially sensitive files.--force. It only performs safe, non-destructive git operations.gh CLI not authenticatedgh auth login and follow the promptsgh auth statusgit remote -vgit remote add origin https://github.com/<OWNER>/<REPO>.gitgit push fails because the remote branch exists with different history, investigate manuallygit log main..HEAD that there are commits to include