#12

feat: bundle and provision Trylle CLI skill

MergedxlabMembermerged intofrom

Summary

  • archive vendor/skills/skills/trylle-cli during the Rust build and embed the complete skill directory in the CLI binary
  • record the bundled skill frontmatter version and vendored submodule Git revision as build metadata
  • make try skill install an offline install of the bundled snapshot
  • make try skill update download the full trylle/skills ZIP and atomically replace the installed directory
  • report bundled and discovered installed skill versions from both try version and try about
  • auto-provision the bundled skill globally for try agent when no repo-local or global installation exists
  • add try agent --no-skill and try agent --latest-skill
  • initialize the skills submodule for release binary builds and crates.io publishing

Implementation details

  • installed versions are read from metadata.version in SKILL.md frontmatter
  • discovery checks repo-local paths before known shared and agent-specific global paths
  • ZIP extraction rejects unsafe paths and symlinks, enforces a 50 MiB download limit, validates the staged skill, and preserves the previous installation until replacement succeeds
  • explicit latest updates replace the first installation the selected agent would discover; when none exists, they install globally
  • try agent continues to rely on native filesystem skill discovery and does not inject skill text into prompts

Validation

  • cargo fmt --all -- --check
  • cargo test — 307 passed, 1 ignored
  • cargo package --allow-dirty — package and verification build succeeded
  • git diff --check

Notes

  • The configured archive URL is https://trylle.com/trylle/skills/archive/main.zip. A direct probe currently returns HTTP 404, so explicit latest updates will surface that response until the archive route is available.
  • Strict all-target Clippy on Rust 1.97 still reports existing lints in unrelated diff-rendering and VCS code; none of the reported findings are in the new skill implementation.

Activity

6
xlabMember4mo ago

❗️ Caution
Review the following alerts detected in dependencies.

According to your organization's policies, you must resolve all "Block" alerts before proceeding. It's recommended to resolve "Warn" alerts too.
Learn more about Socket for GitHub.

ActionSeverityAlert (click for details)
Warn
hyper-util@0.1.20 - Obfuscated code

Note: Obfuscated files are intentionally packed to hide their behavior. This could be a sign of malware

Source: Manifest File

ℹ️ Read more on: This package | This alert | What is known malware?

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code

Mark as acceptable risk: To ignore this alert only in this pull request, reply with:
@SocketSecurity ignore hyper-util@0.1.20
Or ignore all future alerts with:
@SocketSecurity ignore-all

Warn
zune-jpeg@0.5.15 - Obfuscated code

Note: Obfuscated files are intentionally packed to hide their behavior. This could be a sign of malware

Source: Manifest File

ℹ️ Read more on: This package | This alert | What is known malware?

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code

Mark as acceptable risk: To ignore this alert only in this pull request, reply with:
@SocketSecurity ignore zune-jpeg@0.5.15
Or ignore all future alerts with:
@SocketSecurity ignore-all

Warn
writeable@0.6.3 - Obfuscated code

Note: Obfuscated files are intentionally packed to hide their behavior. This could be a sign of malware

Source: Manifest File

ℹ️ Read more on: This package | This alert | What is known malware?

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code

Mark as acceptable risk: To ignore this alert only in this pull request, reply with:
@SocketSecurity ignore writeable@0.6.3
Or ignore all future alerts with:
@SocketSecurity ignore-all

Warn
tokio@1.53.1 - Obfuscated code

Note: Obfuscated files are intentionally packed to hide their behavior. This could be a sign of malware

Source: Manifest File

ℹ️ Read more on: This package | This alert | What is known malware?

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code

Mark as acceptable risk: To ignore this alert only in this pull request, reply with:
@SocketSecurity ignore tokio@1.53.1
Or ignore all future alerts with:
@SocketSecurity ignore-all

Warn
zerocopy@0.8.55 - Obfuscated code

Note: Obfuscated files are intentionally packed to hide their behavior. This could be a sign of malware

Source: Manifest File

ℹ️ Read more on: This package | This alert | What is known malware?

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code

Mark as acceptable risk: To ignore this alert only in this pull request, reply with:
@SocketSecurity ignore zerocopy@0.8.55
Or ignore all future alerts with:
@SocketSecurity ignore-all

View full report

trylle-bot4mo ago

What changed

  • build.rs now archives the vendored vendor/skills/skills/trylle-cli submodule into a tar embedded in the binary via include_bytes!, and records the skill's frontmatter version + submodule git revision as build-time env vars (build.rs, src/version.rs).
  • try skill install becomes a fully offline install of that bundled snapshot; try skill update now downloads the full trylle/skills repo ZIP (previously a single raw SKILL.md file) and extracts, validates, and atomically swaps in the whole skill directory (src/command/skill.rs).
  • Installed/bundled skill versions are now surfaced through try about and try version --json (src/trylle/mod.rs).
  • try agent no longer injects skill text into the prompt. It now auto-provisions the bundled skill globally when no repo-local/global installation is discovered, with new --no-skill / --latest-skill flags (src/main.rs, src/config/cli.rs).
  • .github/workflows/publish-packages.yaml adds submodules: recursive to the two build/publish jobs so vendor/skills is present when build.rs runs.

Risk areas

  1. Build now hard-requires the skill submodule. bundle_skill() in build.rs panics if vendor/skills/skills/trylle-cli/SKILL.md is missing. Previously the skill was fetched at runtime, so a plain cargo build/cargo test never needed the submodule. Only the two jobs in publish-packages.yaml got submodules: recursive; the only check that actually ran on this PR is "Socket Security" (per try pr status 12), so it's worth confirming there's a PR-triggered CI job that builds/tests with the submodule checked out — otherwise contributors and CI on plain master pushes could start hitting an unfamiliar build.rs panic.

  2. try agent skill provisioning is no longer configurable via saved config. The old call command::skill::ensure_installed(config.provider, config.skill_install) respected a persisted SkillInstall::None opt-out. The new ensure_for_agent(agent, latest) (src/command/skill.rs) always provisions when nothing is discovered, and the only way to skip it is passing --no-skill on that specific invocation. This looks intentional — it's covered by agent_autoprovisions_bundled_skill_globally_and_no_skill_disables_it — but it's a real behavior change for anyone who previously configured skill install as disabled: they'll now get a skill silently written to their global agent directory next time they run try agent without --no-skill. Worth calling out explicitly for users upgrading, since the README only documents the new flags, not that the old persisted opt-out no longer applies to this path.

  3. No cap on decompressed size for the "latest" archive. download_latest_archive/extract_latest_skill cap the compressed download at 50 MiB but write every extracted entry straight to disk with no limit on total decompressed bytes. The archive URL is overridable via TRYLLE_SKILL_ARCHIVE_URL/TRYLLE_SKILL_URL, so a compromised or redirected host could still serve a small, highly-compressed zip bomb. Low severity given the default source is Trylle's own repo archive, and the zip-slip/symlink handling elsewhere in the same function is already careful — but the decompressed-size guard is the one check missing from that defense.

Suggested follow-ups

  • Verify (or add) a PR-triggered CI job that runs cargo build/cargo test with submodules: recursive, since this PR's only automated check was Socket Security.
  • Document the try agent provisioning behavior change (no more persistent opt-out; --no-skill is per-invocation only) for users upgrading from the previous config-driven behavior.
  • Consider tracking bytes written during extract_latest_skill and aborting past a sane ceiling, mirroring the existing compressed-size guard.
  • Minor/non-blocking: SkillInstallation and InstalledSkill in src/command/skill.rs have identical shape (path, version) — could likely be unified.

Nice test coverage on the new install/update/auto-provision paths (tests/agent_skill_commands.rs, tests/about_cli.rs), and the zip extraction already guards against zip-slip and symlinks via enclosed_name()/normal_components()/unix-mode checks.

xlab merged commit a3f08b9 into master3mo ago

Branch feat/bundled-trylle-skill has been merged.

Checking branch