Skip to content

feat(bin): rsync engineer skills to remote secondmate launches - #5

Merged
alandomio merged 2 commits into
mainfrom
fm/fm-skill-sync
Sep 1, 2026
Merged

alandomio merged 2 commits into
mainfrom
fm/fm-skill-sync

Conversation

@alandomio

@alandomio alandomio commented Sep 1, 2026 •

Copy link
Copy Markdown
Owner

Captain-directed (2026-08-31): "re-sync skills on every secondmate launch, using rsync."

At every remote secondmate launch, rsync the engineer's ~/.claude/skills/ into that route's remote login home, so a remote crewmate always sees the captain's current skill set instead of drifting from a one-off manual copy.

Why it matters: the manual copy that prompted this pushed 31 skills / 104 files by hand to agent-host-staging-adomio the same evening session-handoff got renamed - exactly the kind of edit a one-off copy never propagates. Without this, every remote secondmate silently runs against a stale skill set until someone remembers to re-copy.

This is additive and isolated: local secondmate routes, firstmate's bootstrap convergence sweep, and the existing FM_INHERITABLE_CONFIG allowlist contract are all untouched (see Out of scope). A failure here warns and never blocks a secondmate launch.

Change
File Change
bin/fm-remote-skill-sync.sh new: rsyncs ~/.claude/skills/ to a remote route's .claude/skills/
bin/fm-spawn.sh +10/-2: calls the new script from spawn_remote_secondmate, warn-only
docs/configuration.md new "Remote secondmate skill sync (config/skill-sync-exclude)" section
docs/examples/skill-sync-exclude new: copyable default exclusion list
docs/remote-secondmates.md one-line pointer in the existing launch-sequence paragraph
.agents/skills/secondmate-provisioning/SKILL.md one-line pointer beside the inherited-material propagation contract
AGENTS.md, docs/documentation-audiences.json pipeline document step: layout-inventory entry for the new config item + audience classification for its example file
tests/fm-remote-skill-sync.test.sh new: unit coverage of the script's own interface (fake rsync)
tests/fm-remote-secondmate-skill-sync.test.sh new: e2e coverage of the launch integration point
tests/fm-remote-secondmate-{trace-context,parent-binding,lifecycle-e2e}.test.sh +5 lines each: point skill-sync at a nonexistent source so these unrelated suites stay hermetic

Behavior:

  • bin/fm-remote-skill-sync.sh <secondmate-id> - guards on the registry's remote=1 field (a local route is a complete no-op, never shells out); destination is the plain relative path <host>:.claude/skills/, which an ssh-invoked rsync resolves against the remote login shell's own $HOME (no new remote-home registry field needed); never passes --delete (a host may legitimately hold skills the laptop does not - no-mistakes, installed there by its own installer, is the concrete example); exclusions come from gitignored config/skill-sync-exclude (one --exclude pattern per non-comment line, mirroring config/wedge-alarm's shape), which fully replaces, not merges with, a documented built-in default (notebooklm/, notebooklm-to-skill/, notebooklm-to-skill-workspace/, skill-creator/, no-mistakes/, __pycache__, .venv, node_modules).
  • Verification doesn't trust rsync's exit status alone: it requires rsync's own --stats output to contain two version-portable lines (Number of files: N and Total (bytes )?sent: N), so a confirmed zero-file resync (still a full stats block) is told apart from a flag-rejection usage banner that also exits 0 with no stats block at all.
  • A failure (missing rsync, unreachable host, unrecognized output) warns via the existing SECONDMATE_SYNC: secondmate <id>: skipped: skill sync failed on <host>: ... convention and never blocks the launch.
Validation
  • bash tests/fm-remote-skill-sync.test.sh - 6/6: local route never invokes rsync; default exclusions applied and --delete never passed; a present config/skill-sync-exclude fully overrides the default; an absent rsync and a failing rsync each fail distinctly; a confirmed no-op transfer is told apart from a rejected-flag usage banner that also exits 0.
  • bash tests/fm-remote-secondmate-skill-sync.test.sh - 2/2, against the repo's real SSH/Herdr remote-secondmate fixture: a failing skill sync warns via SECONDMATE_SYNC: but the real bin/fm-spawn.sh --secondmate launch chain still succeeds; a healthy sync targets the route's own registered SSH alias with no warning.
  • Re-ran the three touched pre-existing e2e suites after the hermeticity change - fm-remote-secondmate-trace-context.test.sh (6/6), fm-remote-secondmate-parent-binding.test.sh (5/5), and the full fm-remote-secondmate-lifecycle-e2e.test.sh (all pass, ~7.5 min) - to confirm the override didn't affect anything they assert.
  • bin/fm-lint.sh (pinned ShellCheck 0.11.0 + actionlint 1.7.12): clean.
  • Manual, against the actual installed openrsync (macOS system rsync, protocol 29): confirmed --stats output matches the script's parsing exactly, and confirmed --info=stats1 (the flag the captain's original manual run used) is rejected outright by this rsync - corroborating the flag-portability rationale in the script's own header.
  • The no-mistakes pipeline's own review pass flagged one informational nuance worth noting for anyone reading the script's header comment: in this sandbox, an unsupported rsync flag was observed to exit 1 immediately (caught by the plain exit-code check) rather than exit 0 with a usage banner. The --stats-block verification is deliberately kept anyway as defense in depth - it's what the captain's own manual run actually hit - and it costs nothing when the exit-code path already catches a real failure.
Out of scope

Deliberately excluded per the captain's own scoping:

  • Bootstrap convergence - bin/fm-bootstrap.sh's deferred sweep is untouched; this only runs at launch. Skills load only at session start, so a mid-session sync would have no live effect anyway.
  • Local secondmate routes - a local route already reads this same ~/.claude/skills/ directory; it stays a guarded no-op, never a code path change.
  • The FM_INHERITABLE_CONFIG allowlist contract - bin/fm-config-inherit-lib.sh's hashing, generation records, divergence quarantine, and read-only modes are untouched. Skills are a directory tree outside FM_HOME; this is a separate, adjacent step at the same launch convergence point, not an extension of that allowlist.

Pipeline

Updates from git push no-mistakes

🤖 Generated with Claude Code

Alan Domio added 2 commits September 1, 2026 01:18
At every remote secondmate launch, rsync ~/.claude/skills/ into the route's
remote login home, so a remote crewmate always sees the captain's current
skill set instead of drifting from a one-off manual copy. Adjacent to, not
an extension of, the FM_INHERITABLE_CONFIG allowlist: skills are a directory
tree outside FM_HOME. Remote-route only, never --delete, exclusions come
from gitignored config/skill-sync-exclude with a documented default, and a
failure warns via the existing SECONDMATE_SYNC convention without blocking
launch.
@alandomio
alandomio merged commit 9850f4e into main Sep 1, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant