/hvantk:hpc-sync <branches to sync, e.g. main dev> [--remote <cluster remote name>]from hvantk
Syncs branches between a GitHub remote and a cluster clone, preserving cluster-side commits. Use after landing shared branches or before building container images from the cluster clone.
Ships in hvantk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Read the hvantk:workflow-conventions skill (skills/workflow-conventions/SKILL.md)
first; this skill assumes its site-profile rule, its section contract and its
measurement contract.
Two remotes hold the same repository: the GitHub remote, where pull requests and CI
live, and a bare repository on the cluster, which the cluster's working clone pulls
from. Local branches track GitHub, so a bare git push never touches the cluster and
the cluster clone goes stale without any error. The outcome of this skill is that the
named branches on the cluster remote point at exactly the commits they point at on
GitHub, every commit that existed only on the cluster is still reachable, and the
cluster's working clone is fast-forwarded to the same commit, with the proof printed.
Use it after anything lands on a shared branch, before building a container image from the cluster clone, and whenever a job's log names a commit that is not the one you reviewed. Not this skill: resolving merge conflicts (that is a human decision), and pushing to GitHub itself (that is the ordinary PR workflow).
Where each step runs: steps 1 to 4 and 6 of the procedure run in the clone you push
from (a laptop, usually), and need only the cluster remote's name; preflight step 1,
procedure step 5 and verification step 2 run on the cluster, with the cluster's site
profile. A laptop has no site profile of its own, so the steps that run there never
source one: the user gives you the cluster remote's name and it replaces
<cluster-remote> literally in every command below.
source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/_site/check-site-profile.sh";
stop and ask for any missing value. Every later command that reads a profile value
starts with the same source "$HVANTK_SITE_PROFILE" &&.git -C "$HVANTK_REPO" rev-parse HEAD, on the cluster) and the image digest
(sha256sum "$(readlink -f "$HVANTK_SIF")"), as every workflow records them.git remote -v in the clone you are pushing from. The cluster remote's
name is a site value (HVANTK_CLUSTER_REMOTE in the cluster's profile when set); if
the user has not given it and the listing does not make it obvious, ask. Never guess which remote is the
cluster.git fetch origin && git fetch <cluster-remote>.
Everything below compares remote-tracking refs, never local branches.git rev-parse origin/<branch>) and every ref the cluster remote holds
(git ls-remote <cluster-remote>): the first is the target, the second is what
must survive.for b in <branches>; do
printf '%-6s origin=%s cluster=%s\n' "$b" \
"$(git rev-parse --short "origin/$b")" "$(git rev-parse --short "<cluster-remote>/$b" 2>/dev/null || echo none)"
done
git merge-base --is-ancestor <cluster-remote>/<branch> origin/<branch> && echo fast-forward.
If it is not, the cluster has commits GitHub does not have. Stop: list them with
git log --oneline origin/<branch>..<cluster-remote>/<branch>, show them to
the user, and let them decide whether those commits go to GitHub first (a branch and
a PR) or are discarded. Never force-push to resolve it.for b in <branches>; do git push <cluster-remote> "origin/$b:refs/heads/$b"; done
git push <cluster-remote> <branches> pushes your local branches, which can be
weeks behind while git reports success, because sending an already-present commit
is a legitimate no-op. The explicit form is right whether or not your local
branches are current.$HVANTK_REPO) from the bare remote
it tracks; --ff-only makes a clone with local changes fail loudly instead of
merging silently:
source "$HVANTK_SITE_PROFILE" && git -C "$HVANTK_REPO" fetch --all --prune && git -C "$HVANTK_REPO" merge --ff-only "@{upstream}" && git -C "$HVANTK_REPO" log --oneline -1
git push <cluster-remote> refs/tags/<tag>.
A release that is tagged on GitHub but not on the cluster builds an image whose
provenance names a tag the cluster cannot resolve.poetry.lock. After a sync that changed the lock
file, the image must be rebuilt before the next job, or the job runs new code on
old dependencies. Check with git diff --stat <old>..<new> -- poetry.lock.git push <cluster> main dev succeeded but the cluster did not move. Cause: it pushed
stale local branches; the commits were already there, so git said nothing. Fix:
explicit refspecs from origin/<branch> (step 3), then the ref diff (step 4).git status before
trusting it.merge --ff-only refuses. Cause: the clone has local commits, or edits to files the
update touches (other uncommitted edits are carried along silently; verification
step 2 catches them). Fix: show them to the user; commit them to a branch and push
that branch to GitHub, or discard them deliberately with git reset --hard @{upstream}
only after the user says so.md5sum poetry.lock in the synced clone.--force.git fetch over SSH hangs or asks for a passphrase. Cause: the key agent is empty or
the control socket is stale. Fix: load the key into the agent and retry; a sync that
waits on a prompt in a background job never finishes.origin meanings. Cause: in the laptop clone origin
is GitHub, in the cluster clone origin is the bare cluster repository. Fix: always
say which clone a command runs in, and read git remote -v first.git -C "$HVANTK_REPO" rev-parse HEAD on the cluster equals that hash for the branch
the clone tracks, and git -C "$HVANTK_REPO" status --porcelain is empty.git ls-remote <cluster-remote> lists it with the hash recorded in preflight
step 5; and GitHub holds no ref it did not hold before.references/ref-report.md shows the one-screen report to paste into the run notes,
with the commit each branch is at, the fast-forward verdict, and the clone's state.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub bigbio/hvantk --plugin hvantk13 skills in this plugin
/ancestry-inferenceUse when samples of a cohort must be assigned a continental ancestry with hvantk: building a labelled reference MatrixTable from 1000 Genomes, running the PCA and random-forest pipeline as a Slurm job, and reading the predictions and their confidence. Also when the pipeline refuses for too few shared variants, mixed genome builds or a missing label column, or when many samples come back unassigned./callset-subset-exportUse when a sample subset of a joint callset must be delivered as a verified VCF: subsetting the lossless VDS by sample list, densifying and exporting with hvantk, verifying header samples and record counts, writing checksums and a manifest, per contig for large callsets. Also when sample names in a list do not match the callset, when per-contig VCFs refuse to concatenate, or when a delivery must go to a read-only share./