Repository navigation
install puts the official skills beside /sheep in every harness - #79
Merged
Merged
Conversation
spacesheep install now writes @spacesheep/design, @spacesheep/docs and @spacesheep/sheets as native skill folders wherever it puts /sheep (~/.claude/skills/design, ~/.codex/skills/design, ...), fetched with the same code as `skills get <name> -o <dir>` at the store's current version. The harness's own skill picker then routes "design a landing page" to Design without the agent having to follow sheep.md's library step first. - A folder is replaced or removed only when it holds install's .spacesheep-skill.json, so a person's own skill of the same name stays. - Each skill is fetched once, then copied into each harness and swapped in by rename; a re-run at the same version costs one card call per skill. - --dry-run, --skip (a harness, or a skill: --skip design), --no-skill, status and uninstall cover them. - Kept current like /sheep (compare versions, replace the copy), but by the CLI rather than the agent, so a ~25 s fetch never lands before the first canvas: each install run, and once a day at a harness start (mcp and mcp headers start a detached `skills refresh`) where install put them. Co-authored-by: Pointman <noreply@pointman.ai> Co-authored-by: Claude <noreply@anthropic.com>
… an atomic daily claim - A folder is written only when its marker names this skill (or, for a new install, nothing is there), checked when the work is chosen, again after the fetch, and once more on the folder moved aside before it's replaced: anything else goes back untouched. - Install, refresh and uninstall hold one lock per machine (official-skills.lock): install and uninstall wait for it, a refresh that finds it held does nothing, so a refresh can't put back a folder an uninstall took out. A lock whose process is gone is taken over. - The daily refresh is claimed by creating a claim file named for the stamp it read (wx), so of harnesses starting together exactly one starts it. The child's error event is handled, so a failed spawn can't end the harness's process. - --dry-run reads the server's table without caching it. Co-authored-by: Pointman <noreply@pointman.ai> Co-authored-by: Claude <noreply@anthropic.com>
…sh lock is held The lock was created empty (wx) and its record written after, so a contender could read it empty, judge it stale and remove it while its owner went on. The record is now written to a file of the process's own and hard-linked into place. A lock that can't be read counts as held until it is 15 minutes old, and a stale lock is moved aside and checked before removal, so a contender's fresh lock isn't the one taken out. Co-authored-by: Pointman <noreply@pointman.ai> Co-authored-by: Claude <noreply@anthropic.com>
…th the file to delete A lock is no longer removed for being old or for its owner being gone: a 15-minute holder can be alive, and removing a stale lock races other contenders. Instead, a lock whose owner isn't running is reported at once (not waited on). install and uninstall say who holds it and which file to delete, `mcp status` names it (official_skills_lock in --json), and a refresh that skips writes official-skills-refresh.log, so a crashed install can't leave the daily refresh skipping unseen. Co-authored-by: Pointman <noreply@pointman.ai> Co-authored-by: Claude <noreply@anthropic.com>
…n is held, not spun on readLock took any read error for a missing lock, so withLock retried the link at once, forever, and status reported nothing. Only ENOENT means no lock now; anything else is the unreadable-lock case, reported with the file to delete. Co-authored-by: Pointman <noreply@pointman.ai> Co-authored-by: Claude <noreply@anthropic.com>
jamescalam
marked this pull request as ready for review
November 30, 2026 01:33
PR SecurityPR Security did not run: your free credit is used. A workspace owner or admin can add a card in Usage & billing, then push again. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
spacesheep installnow also puts the official skills (@spacesheep/design,@spacesheep/docs,@spacesheep/sheets) beside/sheepin each harness, as native skill folders:~/.claude/skills/design,~/.codex/skills/design,~/.gemini/skills/design, and so on. The harness's own skill picker then sends "design a landing page" to Design. Until now the agent had to follow sheep.md's "a skill from the library comes first" step, and Codex skipped it.What changed
lib/official.js(new). For each skill it makes onecardcall to learn the current version, then one fetch throughdoors.takeFolder, the same code asskills get <name> -o <dir>, pinned to that version. The fetched folder is copied into each harness's skills folder and swapped in by rename, so no harness reads half a folder. Next toSKILL.mdit writes one file of its own,.spacesheep-skill.json(skill, version label, number, hash). The other files match what the store sends, byte for byte.official-skills.lock. Install and uninstall wait up to 2 minutes for it. A refresh that finds it held does nothing, so a refresh can't put back a folder an uninstall took out. A lock whose process has gone is taken over.skillTargetsnow gives each target askillsDir. A Claude home whose/sheepcomes from the plugin or fromcommands/sheep.mdstill gets<home>/skills/<name>.--dry-runreports added, updated or unchanged and writes nothing.--skiptakes a harness as before, or a skill name (--skip design).--no-skillleaves out all of them along with/sheep.mcp statusandmcp uninstallinclude them, and--jsongainsofficial_skills./sheepchecks its version when it starts and replaces itself. These skills compare the same way but are refreshed by the CLI, outside any turn, because a folder fetch takes about 25 s. Doing it in the turn would put that wait before the first canvas, which is the delay this change removes. Refreshes happen:installrun;mcp(the bridge) andmcp headers(Claude Code's helper) start a detachedspacesheep skills refresh, which only updates folders install put there. It runs only where install left its stamp (official-skills-check.json), never in CI, and not withSPACESHEEP_NO_UPDATE_CHECKorSPACESHEEP_NO_SKILL_REFRESHset. Each stamp value can be claimed once, by creating a claim file named after it (wx), so harnesses that start together start only one refresh. The child'serrorevent is handled, so a failed spawn can't take down the harness's process.skills refreshis a local command, likeskills lint. The server's table has no verb by that name.Tested
test/official.test.js(new, 11 tests; the 5 race and lock tests fail on fe174e9):--dry-runwrites nothing;--skip design, and the gate and once-a-day timing of the background refresh;error;--dry-runwriting nothing to the config folder.npm test: 406 tests, 403 pass. The 2 failures (start nudge…in talk.test.js,the launchd agent and systemd unit stay down…in machine.test.js) fail the same way onmainon this machine. They depend on its PATH and local state. The repo has no lint script, sonode --checkwas run on every file.install --dry-runlisted 3 skills × 3 harnesses;installwrote them (65 s with the fetches in sequence; they now run in parallel);skills get -oapart from the marker.--dry-runin a clean config folder still leaves the doors-table cache. The CLI's command dispatch (door()inbin/spacesheep.js) writes it for every command before the command runs, with or without--no-skill, and this PR doesn't change that.CODEX_HOMEin that HOME and the prompt "Design a landing page for Tidewell, three directions on spacesheep. Don't ask." It read~/.codex/skills/design/SKILL.mdfirst, with noinstalls listand nolive_link.fold.js startran at 10.4 s and the empty canvas was live at 20.6 s.Look closely at
mcp headersis acceptable. Claude Code runs that helper on every connect. The cost is one stat and one small JSON read, and the spawn happens only where install left its stamp.designandspacesheep:design. Installs where the plugin is on may needchosenSkillsto skip them then.