Skip to content

feat(repo-fleet-hygiene): sync verb — move every canonical repo to its default branch, ff-pull, park divergent work in a worktree #3992

Description

@kyle-sexton

Problem

Nothing in the marketplace moves a fleet of canonical checkouts to their default branch and fast-forwards them without risking work. repo-fleet-hygiene:audit is read-only by contract, apply only deletes merged branches and worktrees, and repo-hygiene:clean tree-batch is a destructive reset.

Proposal

A new repo-fleet-hygiene:sync skill:

  • switches each canonical checkout to the remote's current default branch (git ls-remote --symref origin HEAD) and pull --ff-onlys it;
  • parks divergent work (non-default branch with uncommitted changes, or dirty tree on the default branch) into a linked worktree via source-control's worktree-create.sh, which gains an existing-branch mode;
  • infers scope from a six-rung ladder on bare invocation (explicit args, fleet conf, conversation-named paths, ghq roots if ghq is present, cwd context, else a transparent exit 3), via a shared resolver that audit also adopts as its no-scope fallback;
  • bare invocation is a dry-run plan; mutation only behind --apply after one confirmation gate; non-fast-forward, dubious ownership, and partial stash apply are skip-and-report.

Brief and acceptance criteria: docs/topics/fleet-sync/PLAN.md on the task branch.

Out of scope (follow-ups)

  • Zero-argument scope inference for repo-hygiene:clean tree-batch (separate plugin, destructive verb).
  • Adding sync-related findings to audit-fleet.sh.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumReal value, no hard deadline; normal backlog flow.work-class: structuralRefactors, migrations, contract changes; cross-cutting and hard to reverse.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions