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

git-sync

Run the guarded repository sync ritual; commit-time hooks enforce the cheap gates and the pre-push hook runs gz check.

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

설치 방법 보기

포함된 파일(1)

  • SKILL.md5.9 KB

SKILL.md(원문)

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

SKILL.md

Git Sync

Run the guarded repository sync ritual with lint/test gates.

Trigger

  • User asks to "git sync" or "push with guards"
  • End-of-task reconciliation before handoff
  • Branch drift recovery after remote updates

Behavior

Use the gz git-sync command flow (dry-run first, then apply as requested).

Prerequisites

  • Repository is initialized with gz init
  • Current directory is a git worktree

Steps

  1. Preview planned actions: uv run gz git-sync
  2. Execute the standard ritual: uv run gz git-sync --apply
  3. Explicit redundant-gate invocation (edge cases only, e.g. verifying pre-commit config drift): uv run gz git-sync --apply --lint --test

Both dry-run and apply mode run git fetch --prune <remote> before reading ahead/behind, so divergence numbers always reflect current remote state — no separate pre-fetch needed (GHI #343). When the network is unreachable the dry-run reports the fetch failure as a warning and proceeds with cached refs; apply-mode treats it as a blocker.

The pre-commit hook runs the CHEAP gates on every commit — ruff, ty, xenon, interrogate, gitleaks, authorship. It does NOT run the unit suite: unittest is declared stages: [manual] in .pre-commit-config.yaml and fires only on demand (pre-commit run unittest --hook-stage manual). The tests a change touches reach a push through the separate gz-check-pre-push hook, which runs gz check --reuse-verified; the whole unit tier runs in CI (GHI #1191). --lint and --test re-run those gates at the gz level — redundant for the normal ritual and multi-minute pain. Defaults were flipped to False to match this reality (airlineops parity evolution).

Examples

Example 1

Input: "git sync"

Output: Runs uv run gz git-sync --apply (or dry-run first if safety confirmation is needed). Pre-commit hook handles lint/test automatically.

Append-only JSONL conflicts

The runtime appends to .gzkit/ledger.jsonl (and agent-insights.jsonl, corpus/*.jsonl) during every session, so two clones in flight conflict over disjoint tail additions. uv run gz git-sync --apply registers a git merge driver — uv run gz ledger merge-driver — that reconciles them as a timestamp-ordered union. Registration is idempotent and per-clone, because git reads a driver command from local config, which cannot be committed.

Never hand-edit .gzkit/ledger.jsonl to clear a conflict. That is the action AGENTS.md § Behavior Rules prohibits (the ledger is written only through gz commands), and the driver exists so you do not have to. If the driver exits 1, a side did more than add rows — an ancestor row was edited or removed, a row carries no sortable ts, or the ancestor was already out of ts order — and it left the conflict for you deliberately. An addition never lands there, wherever in the file it sits (GHI #1075). Resolve as a timestamp-ordered union; never append one side to the other, which is what git's built-in merge=union would do and why it is not used here (the ledger is strictly ts-ordered — gz validate --ledger).

Constraints

  • Never use force push in this routine.
  • Resolve blockers (divergence, lint/test failures) before retrying.
  • Use uv run invocation style for project commands.

Common Rationalizations

These thoughts mean STOP — you are about to push without the guards:

ThoughtReality
"Force push, it's just my branch"The constraint is explicit: never use force push in this routine. "Just my branch" still rewrites history and can desync local clones. Resolve divergence the long way.
"Lint is failing on something cosmetic — ship it"The lint/test gates exist because cosmetic failures often hide real ones. The whole point of the ritual is that you don't get to triage at sync time. Fix or revert.
"I'll skip --lint --test to be quick"The bare --apply exists for git-only operations. Skipping the quality gates on a code change is the failure mode the ritual was designed to prevent.
"Divergence with remote — just rebase and force"Investigate first. Divergence may mean another agent or another machine pushed work you don't have. Force-pushing destroys it.
"Dry-run looks fine, no need to actually run --apply"Dry-run shows the plan; apply executes it. Walking away after dry-run leaves the local tree out of sync, which the next session inherits.
"Pre-commit hook failed — --no-verify it"Hooks are part of the contract. Skipping them with --no-verify is the same anti-pattern as skipping --lint --test. Diagnose, don't bypass.
"I'll commit and sync separately"The ritual includes the sync step deliberately. Committing without syncing leaves the branch behind on the remote, which is exactly the divergence trap.

Red Flags

  • Force push appearing anywhere in the routine
  • --no-verify used on the commit
  • Lint or test failures bypassed instead of fixed
  • Divergence resolved by reset/force instead of investigation
  • Dry-run run without follow-through apply
  • Sync run on a tree with uncommitted control-surface drift

Two hooks are the mandatory gate: the commit-time cheap gates (ruff + ty + xenon + guards) and the pre-push gz check, which runs every validator and the tests the change touches. The whole unit suite runs in CI on every code push. Explicit --lint --test flags are redundant for the normal ritual (see Steps § 3). Omitting them is not a red flag — skipping either hook via --no-verify is.

Related Skills

  • lint
  • test
  • format

리뷰

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

댓글

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

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

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

0 / 1,000자

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

같은 저장소의 스킬

Use to mine ../airlineops for governance habits gzkit lacks; produces a parity scan report (gzkit leads, AirlineOps adopts).

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

tvproductions/gzkit92026년 10월 19일 업데이트

Use to file a GitHub issue when a finding needs its own work order or the operator asks; OBPI corrections stay in its change log.

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

tvproductions/gzkit92026년 10월 19일 업데이트

ghi-close

무료

Use to do the work a GHI describes, verify it and close the issue with evidence in one sweep.

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

tvproductions/gzkit92026년 10월 19일 업데이트

Use to triage the open GHI queue before planning or choosing what to pull; produces a ranked deliverable.

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

tvproductions/gzkit92026년 10월 19일 업데이트

git-sync

무료

Run the guarded repository sync ritual; the hooks your pre-commit config declares enforce the quality gates.

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

tvproductions/gzkit92026년 10월 19일 업데이트

Use for an ADR's Gate-5 audit; provides the audit templates and procedure.

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

tvproductions/gzkit92026년 10월 19일 업데이트

tvproductions의 스킬 모두 보기

이 스킬의 문제 신고