Przejdź do treści
Biblioteka skilli
Zarządzanie i produkt · Automatyzacja

merge-sync

/merge-sync

Uzgadnia tickety i backlog z rzeczywistością: zamyka tickety ze scalonymi PR, czyści scalone adresy URL i naprawia rozjazdy statusów, edytując tylko pliki ticketów.

Repozytorium
terminal ↗
Licencja
MIT
Ostatnia zmiana repozytorium
01.09.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 01.09.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Uzgadnia tickety i backlog z rzeczywistością: zamyka tickety ze scalonymi PR, czyści scalone adresy URL i naprawia rozjazdy statusów, edytując tylko pliki ticketów.

Oryginalny opis (EN)

Reconcile tickets/backlog with reality: close tickets whose PRs merged, scrub merged URLs, sweep status drift. Edits ticket files only, never merges. Use after merging a stack or whenever PRs have landed.

Jak działa

  1. Process
  2. When to run
  3. Hard rules
  4. Activity
Sekcje z nagłówków SKILL.md, w oryginale · 83 linii, 601 słów
Podgląd SKILL.md
---
name: merge-sync
description: "Reconcile tickets/backlog with reality: close tickets whose PRs merged, scrub merged URLs, sweep status drift. Edits ticket files only, never merges. Use after merging a stack or whenever PRs have landed."
---

# /merge-sync — Reconcile tickets with merged PRs

> **Where this lives.** Workflow state is kept in a per-project sidecar outside the repo, so a repo shared with collaborators never receives it. TerMinal exports `$TERMINAL_BACKLOG_DIR` into every session it spawns; in a shell it did not spawn, resolve it with `tm-state-dir backlog`.

The merge is human-only (global §8), so after the human merges, ticket state is
stale: tickets still say `in-progress` and still list the now-merged PR/MR in
`prs:`. This skill closes the loop. It **never merges** — it only reads PR/MR
state from the forge and updates the active ticket directory
(`$TERMINAL_BACKLOG_DIR/` in v2, `backlog/` in legacy v1).

## Process

### 1. Run the deterministic reconcile — `bin/merge-sync`

Steps 1–3 of the old manual flow (find tickets with linked PRs → ask the forge
what merged → scrub merged URLs + close fully-merged tickets) are **judgment-
free**, so a script does them in one forge call instead of N tickets × N `gh`
round-trips:

```bash
${CLAUDE_PLUGIN_ROOT}/bin/merge-sync            # dry-run: print the reconcile plan (read-only)
${CLAUDE_PLUGIN_ROOT}/bin/merge-sync --apply    # execute the closes + scrubs
```

It runs one `gh pr list --state merged` (or `glab mr list`, resolved via
`${CLAUDE_PLUGIN_ROOT}/bin/forge`), matches against every ticket's `prs:`, and: closes a ticket
only when its linked PR is *actually* merged (sets `status: closed` + `updated:`
today), scrubs merged URLs (handles all `prs:` formats), and scrubs
`closed`-but-still-linked drift. A single PR closing multiple tickets is handled
naturally — every ticket listing that URL reconciles. **Only** edits ticket files.

Review the dry-run plan first; run `--apply` when it looks right. For tickets
that landed via a scheduled/`/bg` MR merge, also call
`set_run_outcome({runId: $TERMINAL_RUN_ID, outcome: 'merged'})` (MCP).

### 4. Sweep for drift (periodic cleanup)

Beyond merge-driven closes, do a quick hygiene pass so the backlog matches
reality (CLAUDE.md [4.1] — this is the workflow's periodic ticket cleanup, and
the same sweep `/session-end` runs):

- **`in-progress` with no open PR** and no active session on it → move back to
  `open`, or to `stuck` (note why) / `icebox`. Don't leave it falsely in flight.
- **`stuck` with a cleared blocker** (resolved HITL, closed dependency, available
  credential/approval, or original blocker no longer reproduces) → move back to
  `open`, or `in-progress` if resuming it now. Don't leave it falsely blocked.
- **`closed` but still listing a `prs:` URL** → scrub the URL.
- **Long-stale `open`** (untouched, clearly out of scope) → surface it and
  suggest `icebox`/`future`; change it only with confirmation, since `open` may
  just mean "not started yet".

### 5. Report

List what changed: which tickets were closed, which PR URLs were scrubbed, any
status drift fixed, and any ticket left open because not all its PRs merged. Refresh the live snapshot
(`${CLAUDE_PLUGIN_ROOT}/bin/status > .status.md`) to reflect the closed tickets. Don't
auto-`/document` or file new tickets — this is pure reconciliation.

## When to run

- After merging a `/stacked-mr` batch in the morning (the common case — ~N PRs
  merged at once).
- At the top of `/session-start` (context-seeding can detect merged-but-open
  tickets and suggest running this).
- Anytime `gh pr list --state merged` shows recent merges not yet reflected in
  the backlog.

## Hard rules

1. **Never merge.** Read PR state only; `gh pr merge` is blocked by the hook.
2. **Only edit ticket files.** No code changes, no doc writes.
3. **Don't close a ticket whose PR isn't actually merged** — verify via `gh`,
   don't assume from the `prs:` link alone.

## Activity

For each ticket closed during reconciliation, emit a feed event:

```bash
${CLAUDE_PLUGIN_ROOT}/bin/activity ticket-closed "Ticket closed · #<id>" "PR !<iid> merged" --ticket <id> --pr <iid>
```

Wersje

W bazie nie ma innych skilli o nazwie merge-sync.

Migawka bazy z 13.11.2026 · wersja paczki ff11f0467402 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 2 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100jira-close-merged
    Oznacza tickety Jira jako Done, gdy ich commity zostały zmergowane do bieżącej gałęzi, i synchronizuje Jira ze zmergowanymi PR-ami po serii wydań.
  • 100bmad-github-story-sync
    Uzgadnia stan GitHub z plikami BMAD: wykrywa scalone pull requesty, oznacza historyjki jako zakończone w sprint-status.yaml, synchronizuje etykiety i sprząta worktree oraz gałęzie.
  • 100jira-tickets
    Czyta i aktualizuje tickety Jira przez zapisane połączenia Jira w Orca, traktując treść ticketów, komentarze i etykiety jako niezaufane dane zadania.
  • 100jira-ticket-creator
    Tworzy tickety Jira z notatek ze spotkań, historyjek użytkownika lub krótkich list, w tym zbiorczo zadania, historie i błędy do backlogu.
  • 90reconcile-build
    Prowadzi procedury zamknięcia dużej budowy: backlog, gotowość operacyjną, uzgodnienie specyfikacji i plan integracji.
  • 100task-reconcile
    Zamyka zadania taskwarrior, których powiązany issue lub PR na GitHubie został zamknięty albo scalony, na przykład po sprzątaniu po merge'ach.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.