Skip to content

feat(swe-router): install the skill with one command - #175

Merged
aarora79 merged 2 commits into
mainfrom
feat/swe-router-install-script
Sep 8, 2026
Merged

aarora79 merged 2 commits into
mainfrom
feat/swe-router-install-script

Conversation

@aarora79

@aarora79 aarora79 commented Sep 8, 2026

Copy link
Copy Markdown
Owner

What this changes

Installing swe-router took a five-line shell loop, because a raw-file URL serves one file at a time and the skill is five files. This adds vend/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 | bash

The 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.

Flag
--dir where to install; ~/.claude/skills for every repository at once
--ref pin a tag or commit instead of tracking main
--force replace an allowed-models.txt that has already been edited
--repo install from a fork

Each 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. --force opts 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 -L would 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_files asserted an exact file list, so it now covers install.sh, with a comment explaining that the installer is not part of the skill.

Added test_installer_installs_exactly_the_skill_files, which reads SKILL_FILES back out of the script and checks it against the directory, and asserts the installer never installs itself. A file added to vend/ but missing from that list would otherwise be documented as part of the skill and never actually installed.

Verification

  • 425 tests pass, run three times to rule out flakiness.
  • pre-commit clean on all four changed files; bandit adds no new findings.
  • The installer was exercised against the live URLs: fresh install, user-wide --dir, piped form with arguments, environment-variable form, upgrade preserving an edited policy file, --force replacing it, --ref pinned to commit 2a323c8, a bad ref failing without creating a directory, a bad ref leaving an existing install intact, and the argument errors returning exit 2.
  • The installed skill runs: route.py --tier medium --floor 70 returns a recommendation.

Docs

Both install sections now show the one-liner: vend/swe-router/README.md and the root README.md step 2. The vend README keeps a download-and-read-first path for anyone who would rather not pipe a script into a shell.

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.
@aarora79
aarora79 merged commit c4c715a into main Sep 8, 2026
5 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