본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)70k · #3145

gh-stack

하는 일

이 스킬은 GitHub CLI용 gh stack 확장으로 쌓인 풀 리퀘스트를 관리합니다. 큰 변경을 순서가 있는 작은 조각으로 검토받고 싶은 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓큰 변경을 작은 풀 리퀘스트로 나누어야 할 때.
  • ✓스택형 브랜치, 종속 풀 리퀘스트, gh stack을 언급할 때.
  • ✓스택을 업데이트, 리베이스, 동기화하거나 병합해야 할 때.

스킬 링크

https://github.com/remotion-dev/remotion/blob/main/.agents/skills/gh-stack/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/remotion-dev/remotion/blob/main/.agents/skills/gh-stack/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 기능이 너무 큽니다. 검토자가 하나씩 읽을 수 있도록 작은 풀 리퀘스트 스택으로 나누어 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 기반부터 최상위까지 층의 순서를 계획하고, 연결된 브랜치를 만든 뒤 gh stack 명령으로 관리합니다. 명령이 입력을 기다리며 멈추지 않도록 플래그를 명시적으로 전달합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

gh-stack

gh stack is a GitHub CLI extension for stacked branches and pull requests. A stack is an ordered chain of branches rooted on a trunk, where each branch has one PR based on the branch below it, so a reviewer sees only that layer's diff.

gh stack prints a stack trunk-first, left to right:

(main) <- auth <- api <- frontend

Left is the bottom, right is the top. auth is based on main and merges first; frontend merges last. up moves toward the top, away from trunk; down moves toward it. Foundational work belongs at the bottom, code that depends on it above. For how to choose the layers, read references/stack-design.md.

Setup

gh extension install github/gh-stack
git config rerere.enabled true         # remember conflict resolutions
git config remote.pushDefault origin   # required if the repo has more than one remote

Non-interactive use

gh stack branches on whether stdout is a TTY. Piped, most commands error cleanly or print static text; under a PTY the same commands open a prompt or a full-screen TUI and block forever. Agent harnesses differ, so always pass the flags below instead of relying on that detection.

Multiple remotes: never run push, submit, sync, rebase, or link without --remote <name> unless remote.pushDefault is configured. checkout and trunk have no --remote flag and require the config.

Always run Never run bare Why
gh stack view --json gh stack view opens a TUI under a PTY
gh stack submit --auto gh stack submit prompts for a title per new PR
gh stack merge <target> --yes --squash gh pr merge gh pr merge cannot merge a stack
gh stack init <branch>... gh stack init prompts for branch names
gh stack add <branch> gh stack add prompts for a name, and fails even when piped
gh stack checkout <target> gh stack checkout opens a selection menu
gh stack up / down / top / bottom gh stack switch switch is menu-only
— gh stack modify TUI-only, no non-interactive path
  • view --short is safe in both modes, but it is formatted for humans. Use --json to parse.
  • checkout <pr> when a different local stack already covers those branches cannot be forced. Run gh stack unstack --local first (this keeps the stack on GitHub), then retry.

Branch placement

  • Starting multi-part work: create the stack before writing files. Do not implement every concern on trunk and split it later. Put one dependent concern in each layer, bottom to top.
  • Editing an existing stack: check out the layer that owns the change before editing. Never commit a lower layer's concern on the current top branch. Run gh stack view --json; if ownership is unclear, inspect git log --all -- <path>. Then check out the owner, edit, commit, rebase upstack, and return to top.
gh stack down                   # or: gh stack checkout api
git add ... && git commit -m "Add get-user endpoint"
gh stack rebase --upstack       # replay every branch above onto the change
gh stack top                    # return to where you were
gh stack push

Core loop

gh stack init auth              # create the stack and check out its branch
git add ... && git commit -m "Add auth middleware"
gh stack add api                # next layer, branched from the current one
git add ... && git commit -m "Add API routes"
gh stack submit --auto          # push every branch and open draft PRs
gh stack view --json            # confirm

Add --open to submit to create PRs ready for review instead of drafts. Branch names are verbatim — gh stack add refactor/foo creates refactor/foo.

Staying in sync

gh stack sync                   # fetch, reconcile with GitHub, rebase, push, refresh PR state
gh stack sync --prune           # also delete local branches for merged PRs

Pruning never happens without --prune when non-interact

자주 묻는 질문

층은 어떤 순서로 쌓나요?

기반 작업을 아래에 두고 그에 의존하는 코드를 위에 둡니다. 그래서 아래 풀 리퀘스트가 먼저 병합됩니다.

스킬은 왜 명시적 플래그를 쓰나요?

스킬에 따르면 이 도구는 대화형 터미널에서 다르게 작동하며, 그렇지 않으면 영원히 멈출 수 있습니다.

어떤 설정이 필요한가요?

gh stack 확장을 설치하고, 충돌 해결을 기억하도록 rerere를 켜야 합니다.

상세 정보

작성자의 원본 설명

Manages stacked PRs and splits multi-part work into reviewable branches with gh-stack. Use for stack creation, viewing, edits, push, submit, sync, rebase, merge, or checkout; when asked to split or isolate work for review; whenever a user mentions a stack, branch layers, dependent PRs, or gh stack; or when a stack is checked out.

repo: remotion-dev/remotion

인기도

GitHub 스타
70k
순위
#3145
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬