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

workspace-sync

Deterministic synchronization of trunk, PR evaluation worktrees, and drift reporting in Deliberate Lab's bare repository workspace.

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

PAIR-code/deliberate-lab스타 97(GitHub 97 + cccskills 0)
연동 도구GitHub

실행 점수 미검증

설치 방법 보기

포함된 파일(2)

  • SKILL.md3.6 KB
  • scripts/workspace-sync.sh12.2 KB

SKILL.md(원문)

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

Workspace Sync

Synchronize all branches and worktrees in Deliberate Lab's bare repository layout against upstream and origin.

This skill replaces manual, multi-step git operations with a single deterministic automation script that fast-forwards trunk, mirrors PR evaluation worktrees, identifies merged/closed PRs for cleanup, and reports feature branch drift.

When to use

Invoke this skill when asked to:

  • "Sync workspace"
  • "Update all PR worktrees"
  • "Pull latest changes"
  • "Catch up with upstream"
  • "Check branch drift"
  • "Sync my fork"

Procedure

1. Run the Synchronization Script

From any worktree directory or the parent repository container:

./.agents/skills/workspace-sync/scripts/workspace-sync.sh

To preview changes without altering any git refs or worktree checkouts:

./.agents/skills/workspace-sync/scripts/workspace-sync.sh --dry-run

To only sync trunk and feature branch status without touching PR worktrees:

./.agents/skills/workspace-sync/scripts/workspace-sync.sh --skip-pr-mirror

The script visibly echoes the underlying git commands by default (prefixed with [dry-run] during dry-run mode) and formats all worktree targets with actionable relative paths. If the sync report exceeds 7 KB, it automatically saves to a temporary file via mktemp and provides the path for lossless inspection via view_file (ADR 0003).

2. Understanding the Execution Phases

The script executes four deterministic stages:

  1. Remote Pruning: Runs git fetch --all --prune to refresh all remotes and clean up deleted remote-tracking refs.
  2. Trunk Synchronization (main):
    • Ensures main/ is clean before touching it.
    • Fast-forwards main to upstream/main (git merge --ff-only upstream/main).
    • Pushes main to origin/main to keep your personal fork in sync.
  3. PR Worktree Mirroring (pr-<number>):
    • Finds all sibling worktrees matching pr-[0-9]*.
    • Safety First: Any worktree with uncommitted changes (git status --porcelain) is skipped to prevent data loss.
    • Lifecycle Awareness & Automated Cleanup: Queries GitHub CLI (gh pr view) to see if the PR is MERGED or CLOSED. If so and the worktree is clean, automatically removes the worktree (git worktree remove) and deletes the local branch (git branch -D), keeping the workspace free of zombie checkouts.
    • Exact Mirroring: For open PRs, fetches upstream pull/<number>/head and resets the local branch to FETCH_HEAD.
    • Dependency Notice: If package.json or package-lock.json changed during the update, reminds you to run npm ci in that worktree.
  4. Feature Branch Drift Awareness:
    • Inspects active development branches (e.g. <issue>-<slug>).
    • Reports commit counts ahead and behind main.
    • If a feature branch is behind, suggests running git rebase main inside that worktree when the author is ready.

Safety Rules

  • Never rebase or merge PR evaluation worktrees: External PRs must remain exact mirrors of their upstream head.
  • Never clobber dirty worktrees: Any worktree with unstaged or uncommitted changes is protected and skipped.
  • Do not auto-rebase active feature branches: Feature branches may be in the middle of active development or testing. The script only reports divergence; rebasing is left to the developer or agent at an intentional time.

리뷰

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

댓글

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

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

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

0 / 1,000자

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

같은 저장소의 스킬

eval-pr

무료

Set up a git worktree to run and evaluate an upstream Pull Request locally in a flat worktree bare clone repository layout.

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

PAIR-code/deliberate-lab972026년 10월 25일 업데이트

gh

무료

Run GitHub CLI commands and inspect GitHub Issues and Pull Requests cleanly without PTY Glamour terminal truncation or comment-stripping traps.

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

PAIR-code/deliberate-lab972026년 10월 25일 업데이트

Evaluate Pull Requests for participant or experimenter UX changes, determine runtime behavioral impact, audit and synthesize Deliberate Lab's 7-part manual experiment test plans, and interactively co-author verification steps.

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

PAIR-code/deliberate-lab972026년 10월 25일 업데이트

Reflect on pairing sessions from the AI perspective using the FAR framework (Friction, Ambiguity, Repetition), present observations conversationally, and anchor generalizable improvements as GitHub issues or comments.

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

PAIR-code/deliberate-lab972026년 10월 25일 업데이트

Inspect the local Deliberate Lab workspace environment, Node.js version, bare repository worktrees, remotes, git status, and toolchain readiness.

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

PAIR-code/deliberate-lab972026년 10월 25일 업데이트

PAIR-code의 스킬 모두 보기

이 스킬의 문제 신고