Skip to content

generic-automation-and-it/smooth-ai-stockanalysis / .agents/skills/git-commit-push

git-commit-push

Verified

Commit current changes with conventional commits format and push to remote repository. Use when committing and pushing changes to the upstream remote.

FileKindSize
AGENTS.mdmarkdown1.1 KB
SKILL.mdskill md3.6 KB
agents/openai.yamlconfig301 B
scripts/push.shexecutablescript987 B

scripts/push.sh

View on GitHub
#!/bin/bash
# Push the current branch to origin, handling upstream tracking and optional rename.
# Usage: push.sh [--rename <new-branch-name>]
#   --rename  rename the local branch first, then push with --set-upstream

set -e

if [ "${1:-}" = "--rename" ]; then
    NEW_BRANCH="${2:?--rename requires a branch name}"
    OLD_BRANCH=$(git rev-parse --abbrev-ref HEAD)
    if [ "$OLD_BRANCH" != "$NEW_BRANCH" ]; then
        git branch -m "$NEW_BRANCH"
        echo "Renamed branch '$OLD_BRANCH' -> '$NEW_BRANCH'"
    fi
    git push --set-upstream origin "$NEW_BRANCH"
    exit 0
fi

BRANCH=$(git rev-parse --abbrev-ref HEAD)

# No upstream configured: push and set upstream
if ! git rev-parse --abbrev-ref @{u} >/dev/null 2>&1; then
    echo "Pushing new branch '$BRANCH' to origin..."
    git push -u origin "$BRANCH"
    exit 0
fi

# Upstream configured: skip when nothing to push
if [ -z "$(git log @{u}..HEAD --oneline)" ]; then
    echo "No commits to push"
    exit 0
fi

git push
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 319kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 319kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 319kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 319kUpdated Claude CodeCodexVerifiedInstall