본문으로 건너뛰기
cccskills
무료GitHub에 공개

reset-stage

Reset the stage branch from main and re-merge all "on stage" PRs. Auto-resolves merge conflicts by accepting incoming changes (-X theirs). Posts a Slack notification only when an --apply run produced conflicts. Use when stage has conflicts, drift, or needs a clean rebuild.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

JesusFilm/core스타 25(GitHub 25 + cccskills 0)
연동 도구Slack

실행 점수 미검증

설치 방법 보기

포함된 파일(1)

  • SKILL.md5.0 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

<!-- sync: simplified subset of .claude/commands/reset-stage.md (canonical). Keep the summary comment step aligned. -->

Reset Stage

Automates the stage branch reset process documented in apps/docs/docs/04-engineering-practices/02-deployment/index.md.

When to use

  • User says "reset stage", "rebuild stage", "stage is broken"
  • User says "what if stage reset" or "dry run stage"
  • Stage branch has conflicts preventing new PR merges
  • Stage has drifted from main due to closed/stale PRs

Steps

  1. Ensure the working tree is clean. If dirty, ask the user to stash or commit.

  2. Run the script. Default is dry-run (safe, no changes):

    # Dry run — default, safe, no changes (never posts to Slack)
    ./tools/scripts/reset-stage.sh
    
    # Actual reset (destructive, prompts for confirmation).
    # Posts to Slack only if the run produced conflicts.
    ./tools/scripts/reset-stage.sh --apply
    
    # Hard opt-out: never post to Slack, even if conflicts occur.
    ./tools/scripts/reset-stage.sh --apply --no-slack
    
  3. Show the full output to the user.

  4. If --apply was used, remind the user:

    • Stage deploy workflows will trigger automatically on push
    • Slack was notified only if the run had auto-resolved or failed conflicts. Clean apply runs and dry runs stay silent — this is by design (ENG-3679) so the channel only fires when someone's on-stage PR may have actually been touched.
    • Any truly unresolvable PRs (very rare) need their authors to investigate

Trigger phrases

  • "reset stage"
  • "rebuild stage"
  • "stage is broken"
  • "what if stage reset"
  • "dry run stage"

How conflict resolution works

The problem

Resetting stage from main and re-merging all "on stage" PRs used to replay the exact same conflicts that caused the reset in the first place. The reset didn't actually get you unstuck.

The solution: accept incoming changes (-X theirs)

The script uses a two-phase merge for each PR:

  1. Try a clean merge — git merge origin/<branch> --no-ff
  2. If that conflicts — abort, retry with git merge -X theirs
  3. If -X theirs still fails (rare; e.g. modify/delete conflicts) — force-resolve remaining files by checking out the PR's version

-X theirs tells Git to resolve conflicted hunks by taking the incoming (PR branch) side. Non-conflicting changes from both sides are still merged normally via 3-way merge — it only overrides the conflicted parts.

Why this is safe

  • Stage is ephemeral. It exists purely for integration testing and gets force-pushed on every reset. Nobody branches off it.
  • PR branches are the source of truth. Each feature branch goes through proper code review before merging to main. Stage is just a preview.
  • Worst case is a broken stage build. Which is the same outcome as a bad manual conflict resolution — and the fix is to run the reset again.
  • The PR branch is never modified. Only the stage branch is affected.

Merge order

PRs are merged newest-first (highest PR number). When two PRs modify the same lines, the one merged second "wins" for those hunks. This is deterministic — same PR set + same order = same result.

Report categories

CategoryMeaning
Clean mergeNo conflicts at all
Auto-resolvedHad conflicts, resolved automatically via -X theirs
FailedCould not be resolved even with force (very rare)
Missing branchRemote branch no longer exists

Recovery

If stage is broken after a reset

Run the reset again. The script resets stage to main and force-pushes, so every reset starts completely fresh.

If an engineer's PR is causing problems on stage

  1. The engineer's PR branch is never touched — only stage is affected.
  2. The engineer rebases their branch against main and pushes.
  3. The next stage reset picks up the fixed version automatically.
  4. No manual merge conflict resolution is ever needed on the stage branch.

If you need to exclude a specific PR

Remove the "on stage" label from that PR before running the reset. The script only merges PRs that currently have the label.

Prerequisites

  • gh CLI must be authenticated (gh auth login)
  • Doppler must be authenticated for Slack notifications (doppler login)
    • Secrets: STAGE_RESET_SLACK_BOT_TOKEN, SLACK_ENGINEERING_CHANNEL_ID
    • Location: Doppler project core, config dev
  • If Doppler is not authenticated, the script runs but skips Slack
  • A confirmation prompt prevents accidental real resets (--apply)

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

ask-matt

무료

Ask which skill or flow fits your situation. A router over the skills in this repo.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

JesusFilm/core252026년 10월 29일 업데이트

Build applications where agents are first-class citizens. Use this skill when designing autonomous agents, creating MCP tools, implementing self-modifying systems, or building apps where features are outcomes achieved by agents operating in a loop.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

JesusFilm/core252026년 10월 29일 업데이트

Run comprehensive agent-native architecture review with scored principles

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

JesusFilm/core252026년 10월 29일 업데이트

Explore requirements and approaches through collaborative dialogue before writing a right-sized requirements document and planning implementation. Use for feature ideas, problem framing, when the user says 'let's brainstorm', or when they want to think through options before deciding what to build. Also use when a user describes a vague or ambitious feature request, asks 'what should we build', 'help me think through X', presents a problem with multiple valid solutions, or seems unsure about scope or direction — even if they don't explicitly ask to brainstorm.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

JesusFilm/core252026년 10월 29일 업데이트

Clean up local branches whose remote tracking branch is gone. Use when the user says "clean up branches", "delete gone branches", "prune local branches", "clean gone", or wants to remove stale local branches that no longer exist on the remote. Also handles removing associated worktrees for branches that have them.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

JesusFilm/core252026년 10월 29일 업데이트

Structured code review using tiered persona agents, confidence-gated findings, and a merge/dedup pipeline. Use when reviewing code changes before creating a PR.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

JesusFilm/core252026년 10월 29일 업데이트

JesusFilm의 스킬 모두 보기

이 스킬의 문제 신고