push

작성자: openai

현재 브랜치 변경 사항을 origin으로 푸시하고 해당 풀 리퀘스트를 생성하거나 업데이트합니다. 푸시, 업데이트 게시, 또는 풀 리퀘스트 생성을 요청받았을 때 사용합니다.

npx skills add https://github.com/openai/symphony --skill push

Push

Prerequisites

  • gh CLI is installed and available in PATH.
  • gh auth status succeeds for GitHub operations in this repo.

Goals

  • Push current branch changes to origin safely.
  • Create a PR if none exists for the branch, otherwise update the existing PR.
  • Keep branch history clean when remote has moved.

Related Skills

  • pull: use this when push is rejected or sync is not clean (non-fast-forward, merge conflict risk, or stale branch).

Steps

  1. Identify current branch and confirm remote state.

  2. Run local validation (make -C elixir all) before pushing.

  3. Push branch to origin with upstream tracking if needed, using whatever remote URL is already configured.

  4. If push is not clean/rejected:

    • If the failure is a non-fast-forward or sync problem, run the pull skill to merge origin/main, resolve conflicts, and rerun validation.
    • Push again; use --force-with-lease only when history was rewritten.
    • If the failure is due to auth, permissions, or workflow restrictions on the configured remote, stop and surface the exact error instead of rewriting remotes or switching protocols as a workaround.
  5. Ensure a PR exists for the branch:

    • If no PR exists, create one.
    • If a PR exists and is open, update it.
    • If branch is tied to a closed/merged PR, create a new branch + PR.
    • Write a proper PR title that clearly describes the change outcome
    • For branch updates, explicitly reconsider whether current PR title still matches the latest scope; update it if it no longer does.
  6. Write/update PR body explicitly using .github/pull_request_template.md:

    • Fill every section with concrete content for this change.
    • Replace all placeholder comments (<!-- ... -->).
    • Keep bullets/checkboxes where template expects them.
    • If PR already exists, refresh body content so it reflects the total PR scope (all intended work on the branch), not just the newest commits, including newly added work, removed work, or changed approach.
    • Do not reuse stale description text from earlier iterations.
  7. Validate PR body with mix pr_body.check and fix all reported issues.

  8. Reply with the PR URL from gh pr view.

Commands

# Identify branch
branch=$(git branch --show-current)

# Minimal validation gate
make -C elixir all

# Initial push: respect the current origin remote.
git push -u origin HEAD

# If that failed because the remote moved, use the pull skill. After
# pull-skill resolution and re-validation, retry the normal push:
git push -u origin HEAD

# If the configured remote rejects the push for auth, permissions, or workflow
# restrictions, stop and surface the exact error.

# Only if history was rewritten locally:
git push --force-with-lease origin HEAD

# Ensure a PR exists (create only if missing)
pr_state=$(gh pr view --json state -q .state 2>/dev/null || true)
if [ "$pr_state" = "MERGED" ] || [ "$pr_state" = "CLOSED" ]; then
  echo "Current branch is tied to a closed PR; create a new branch + PR." >&2
  exit 1
fi

# Write a clear, human-friendly title that summarizes the shipped change.
pr_title="<clear PR title written for this change>"
if [ -z "$pr_state" ]; then
  gh pr create --title "$pr_title"
else
  # Reconsider title on every branch update; edit if scope shifted.
  gh pr edit --title "$pr_title"
fi

# Write/edit PR body to match .github/pull_request_template.md before validation.
# Example workflow:
# 1) open the template and draft body content for this PR
# 2) gh pr edit --body-file /tmp/pr_body.md
# 3) for branch updates, re-check that title/body still match current diff

tmp_pr_body=$(mktemp)
gh pr view --json body -q .body > "$tmp_pr_body"
(cd elixir && mix pr_body.check --file "$tmp_pr_body")
rm -f "$tmp_pr_body"

# Show PR URL for the reply
gh pr view --json url -q .url

Notes

  • Do not use --force; only use --force-with-lease as the last resort.
  • Distinguish sync problems from remote auth/permission problems:
    • Use the pull skill for non-fast-forward or stale-branch issues.
    • Surface auth, permissions, or workflow restrictions directly instead of changing remotes or protocols.

openai의 다른 스킬

test-coverage-improver
openai
Improve test coverage in the OpenAI Agents JS monorepo: run `pnpm test:coverage`, inspect coverage artifacts, identify low-coverage files and branches, propose…
release
openai
커밋된 버전을 올리고, 이를 반영하고, 병합된 커밋에 태그를 단 후, Burrito 릴리스 워크플로우를 검증하여 Symphony 릴리스를 진행합니다. 다음과 같이 요청받았을 때 사용합니다…
ukb-topmed-phewas-skill
openai
단일 변이에 대한 간결한 UKB-TOPMed PheWAS 요약을 가져오며, rsID, GRCh37 또는 GRCh38 입력을 받아 필요한 GRCh38 쿼리로 변환합니다. 다음과 같은 경우에 사용하세요…
pull
openai
최신 origin/main을 현재 로컬 브랜치로 가져오고 병합 충돌을 해결합니다(일명 update-branch). Codex가 기능 브랜치를 동기화해야 할 때 사용합니다…
code-review-context
openai
모델 가시 컨텍스트
debug
openai
이슈/세션 식별자로 Symphony 및 Codex 로그를 추적하여 중단된 실행과 실행 실패를 조사합니다. 실행이 멈추거나, 반복적으로 재시도되거나, 실패할 때 사용하세요…
signing-entitlements
openai
macOS 앱의 서명, 자격, 강화된 런타임 및 Gatekeeper 문제를 검사합니다. 코드 서명 실패, 누락된 자격 등을 진단하라는 요청을 받을 때 사용하세요.
swiftui-view-refactor
openai
SwiftUI 뷰 파일을 리팩토링하고 검토하며, 작은 전용 서브뷰, MV-over-MVVM 데이터 흐름, 안정적인 뷰 트리, 명시적 의존성에 대한 강력한 기본값을 적용합니다.