Repository navigation
feat(swe-router): install the skill with one command - #175
Merged
Merged
Conversation
Installing the skill meant a five-line shell loop that fetched each file from raw.githubusercontent.com one at a time, because a raw-file URL can only serve one file. The loop also left no room for the things an install needs: choosing a target directory, pinning a version, or failing cleanly when a download breaks part-way. Add vend/swe-router/install.sh so the install is one command: curl -sL .../vend/swe-router/install.sh | bash The script stages every file in a temp directory and moves them into place only once all five arrive, so a failed download leaves an existing install untouched instead of half-replaced. It fails closed on an HTTP error, an empty file, or malformed JSON, naming the fix in each message. --dir installs user-wide, --ref pins a tag or commit, and --force replaces an allowed-models.txt that has already been edited; each option also reads from an environment variable so the piped form stays configurable. Re-running upgrades the skill and keeps an edited allowed-models.txt. Overwriting it would silently replace an organisation's model policy, and that file is the one thing an installer must not touch on an upgrade. The transfer is pinned to HTTPS with --proto and --proto-redir. Without them, -L would let a redirect walk a code download down to cleartext. The files are not checksummed because they are the release itself, with no separate artifact to check against; --ref <commit-sha> is the control that actually helps, and the script header and README both say so. The vend directory test asserted an exact file list, so extend it to cover install.sh and add a test that the installer's own file list matches what the directory holds and never installs itself. A file added to vend/ but missing from SKILL_FILES would otherwise read as part of the skill and never actually be installed.
The root README showed the default install then said to 'add -s -- --dir ~/.claude/skills' for a user-wide one, without saying where in the command that goes. It also never said where the default install lands, so a reader could not tell what running it would do. Spell out both commands, name the target directory, and say that re-running upgrades in place and keeps an edited allowed-models.txt.
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.
What this changes
Installing
swe-routertook a five-line shell loop, because a raw-file URL serves one file at a time and the skill is five files. This addsvend/swe-router/install.sh, so the install is one command:curl -sL https://raw.githubusercontent.com/aarora79/agentic-coding-harness-benchmarks/main/vend/swe-router/install.sh | bashThe loop also left no room for what an install actually needs: choosing a target directory, pinning a version, or failing cleanly when a download breaks part-way. All three now have flags.
--dir~/.claude/skillsfor every repository at once--refmain--forceallowed-models.txtthat has already been edited--repoEach also reads from an environment variable (
SWE_ROUTER_DIR,SWE_ROUTER_REF, ...), so the piped form stays configurable without-s --.Behavior worth calling out
An upgrade keeps your
allowed-models.txt. Re-running the installer refreshes the skill and leaves that one file alone, because overwriting it would silently replace an organisation's model policy.--forceopts into replacing it.It fails closed. Every file is staged in a temp directory and moved into place only once all five arrive, so a broken download leaves an existing install untouched rather than half-replaced. An HTTP error, an empty file, or malformed JSON each stop the install with a message naming the fix.
Supply chain
The transfer is pinned to HTTPS with
--proto '=https' --proto-redir '=https'. Without them-Lwould let a redirect walk a code download down to cleartext.The files are not checksummed, and deliberately so: they are the release itself, with no separate artifact to check them against, and a checksum committed in the same repo and served from the same host adds no attacker resistance.
--ref <commit-sha>is the control that helps, installing a fixed revision a reader can review on GitHub first. The script header and the README both say this.Tests
test_vend_dir_holds_exactly_the_portable_filesasserted an exact file list, so it now coversinstall.sh, with a comment explaining that the installer is not part of the skill.Added
test_installer_installs_exactly_the_skill_files, which readsSKILL_FILESback out of the script and checks it against the directory, and asserts the installer never installs itself. A file added tovend/but missing from that list would otherwise be documented as part of the skill and never actually installed.Verification
pre-commitclean on all four changed files;banditadds no new findings.--dir, piped form with arguments, environment-variable form, upgrade preserving an edited policy file,--forcereplacing it,--refpinned to commit2a323c8, a bad ref failing without creating a directory, a bad ref leaving an existing install intact, and the argument errors returning exit 2.route.py --tier medium --floor 70returns a recommendation.Docs
Both install sections now show the one-liner:
vend/swe-router/README.mdand the rootREADME.mdstep 2. The vend README keeps a download-and-read-first path for anyone who would rather not pipe a script into a shell.