Luigit
repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by admin

pi/agent/skillz/jj/jj-sync/SKILL.md

Raw
Rendered preview

name: jj-sync path: .jj disable-model-invocation: true description: "Synchronize a Jujutsu change stack by fetching, rebasing onto its target, testing, and optionally pushing when publication was requested. Use for pull, sync, rebase-and-push, or bookmark publication requests."

Jj Sync

Use Jujutsu when jj root succeeds. Preserve unrelated work, use jj-native commands, and never force-push.

Resolve context

  • Stop on unresolved conflicts.
  • Resolve the current bookmark and its tracked remote when available. With no tracking remote, use the sole configured remote; ask when ambiguous.
  • Distinguish the bookmark being published from the integration target.
  • Resolve an explicit integration target first. Otherwise use trunk() or the first existing remote bookmark among trunk, main, and master.

Procedure

  1. Record the current change, bookmark, remote, target, and stack.
  2. Fetch the resolved remote.
  3. Warn before rebasing a large stack.
  4. Rebase the current stack onto the fetched target with a jj-native rebase.
  5. On conflicts, stop and report status and the available resolution or abandonment choices.
  6. Run repository-required gates plus requested or obvious fast checks. Stop when a required check fails.
  7. Push only when the user or encompassing request authorized publication. Otherwise stop after local synchronization.
  8. Before publication, verify the fetched remote bookmark tip is an ancestor of the proposed tip. Stop rather than rewrite published history.
  9. Move the current bookmark to the resulting change when needed and push it to the resolved remote. If rejected, fetch, repeat the ancestry check, rebase, and test once more, then retry once.
  10. Report bookmark, target, remote, rebase result, checks, publication authorization, and any pushed change and commit IDs.
---
name: jj-sync
path: .jj
disable-model-invocation: true
description: "Synchronize a Jujutsu change stack by fetching, rebasing onto its target, testing, and optionally pushing when publication was requested. Use for pull, sync, rebase-and-push, or bookmark publication requests."
---

# Jj Sync

Use Jujutsu when `jj root` succeeds.
Preserve unrelated work, use jj-native commands, and never force-push.

## Resolve context

- Stop on unresolved conflicts.
- Resolve the current bookmark and its tracked remote when available.
  With no tracking remote, use the sole configured remote; ask when ambiguous.
- Distinguish the bookmark being published from the integration target.
- Resolve an explicit integration target first.
  Otherwise use `trunk()` or the first existing remote bookmark among `trunk`, `main`, and `master`.

## Procedure

1. Record the current change, bookmark, remote, target, and stack.
2. Fetch the resolved remote.
3. Warn before rebasing a large stack.
4. Rebase the current stack onto the fetched target with a jj-native rebase.
5. On conflicts, stop and report status and the available resolution or abandonment choices.
6. Run repository-required gates plus requested or obvious fast checks.
   Stop when a required check fails.
7. Push only when the user or encompassing request authorized publication.
   Otherwise stop after local synchronization.
8. Before publication, verify the fetched remote bookmark tip is an ancestor of the proposed tip.
   Stop rather than rewrite published history.
9. Move the current bookmark to the resulting change when needed and push it to the resolved remote.
   If rejected, fetch, repeat the ancestry check, rebase, and test once more, then retry once.
10. Report bookmark, target, remote, rebase result, checks, publication authorization, and any pushed change and commit IDs.