Repository navigation
Commit 4285688
committed
Sync only the skills this CLI owns to basecamp/skills
basecamp/skills is shared by several CLIs, and every one of them ran the
same sync script against one shared .managed-skills: publish skills/*,
then delete every name in that file that the publisher's own tree lacks.
So hey-cli's v0.1.1 release deleted skills/basecamp and
skills/basecamp-doctor (basecamp/skills@08ef7ea), and basecamp-cli's
v0.10.0 and v0.11.0 deleted skills/hey (728a916, 42716d7). Today the
distribution repo holds only whichever CLI released last
(basecamp/skills#5).
Each publisher now owns a manifest of its own, .managed-skills.<source>,
and reads only that file to decide what to remove. A skills/<name> goes
only when this source's manifest lists it, this release no longer ships
it, and no other source's manifest claims it — a name two manifests
list is a collision to settle upstream, so it is warned about and left,
and a name another source's manifest holds is refused for publishing.
A target with no manifest for this source yet removes nothing; the old
"no manifest, so everything under skills/ is ours" fallback is gone,
since it is exactly what deleted the sibling's skills.
The legacy .managed-skills stays, rewritten on every run as a
comment-only tombstone. The pre-fix script skips every line it cannot
parse as a skill name, so a sibling still running it deletes nothing;
had the file been removed, that script's fallback would have claimed
every skills/* directory. That is what makes the rollout order across
CLIs irrelevant.
A push rejected because a sibling published first ("fetch first" on a
depth-1 clone, or non-fast-forward) drops the stale commit and applies
the sync again from the remote's new tip, collision guard included. The
token reaches git through a private GIT_CONFIG_GLOBAL insteadOf rewrite
rather than the clone URL, and the checkout must be clean before the
sync sweeps it into a commit.
SYNC_SOURCE overrides the source name (the bot identity and commit
message derive from it) so a test can play the other CLI, and
SKILLS_TARGET points the script at an existing checkout instead of
cloning; with DRY_RUN=local it applies and commits but skips the push.
scripts/test-sync-skills.sh (make test-sync-skills, in bin/ci) builds a
target reproducing basecamp/skills as the history above left it and runs
the script interleaved as both CLIs, through a rejected push included.
The script is the shared CLI seed's, byte-identical apart from the
CLI_NAME default. It also gains SKILLS_SOURCE, as hey-cli's already had,
and the manual recovery workflow adopts hey-cli's two-checkout pattern:
sync logic from the dispatching ref, content from the release tag.1 parent d120b3a commit 4285688
6 files changed
Lines changed: 655 additions & 139 deletions
File tree
- .github/workflows
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
55 | | - | |
56 | | - | |
| 57 | + | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
66 | | - | |
67 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
68 | 73 | | |
69 | 74 | | |
70 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
71 | 86 | | |
72 | 87 | | |
73 | 88 | | |
| |||
83 | 98 | | |
84 | 99 | | |
85 | 100 | | |
86 | | - | |
87 | | - | |
88 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
89 | 104 | | |
90 | 105 | | |
91 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
92 | 109 | | |
93 | 110 | | |
94 | 111 | | |
| |||
100 | 117 | | |
101 | 118 | | |
102 | 119 | | |
| 120 | + | |
103 | 121 | | |
104 | 122 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
184 | 187 | | |
185 | 188 | | |
186 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
386 | | - | |
| 386 | + | |
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
| |||
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
567 | 572 | | |
568 | 573 | | |
569 | 574 | | |
| |||
647 | 652 | | |
648 | 653 | | |
649 | 654 | | |
| 655 | + | |
650 | 656 | | |
651 | 657 | | |
652 | 658 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
73 | 95 | | |
74 | 96 | | |
75 | 97 | | |
| |||
0 commit comments