feat(skills): support loading skills from URLs#2091
feat(skills): support loading skills from URLs#2091mkmeral merged 9 commits intostrands-agents:mainfrom
Conversation
Add support for remote Git repository URLs as skill sources in AgentSkills, enabling teams to share and reference skills directly from GitHub without manual cloning. Closes strands-agents#2090 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Parse GitHub web URLs like /tree/<ref>/path to extract the clone URL, branch, and subdirectory path. This enables loading skills from subdirectories within mono-repos. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
01a4fc3 to
83966f6
Compare
|
/strands review |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Issue: This PR introduces new public API surface ( Key questions an API reviewer should evaluate:
|
|
Issue: The Suggestion: Add |
Review SummaryAssessment: Request Changes This is a well-structured feature that fills a real user need. The design decisions (subprocess git, shallow clone, hash-based caching) are sound and well-documented in the PR description. The test coverage is thorough with 32 new tests. Review Categories
The core implementation is solid — addressing the security and reliability items above would make this ready to merge. |
- Security: remove http:// support (MITM risk), only allow https/ssh/git@ - Reliability: atomic clone via tempdir + rename to prevent race conditions - Reliability: evaluate cache dir lazily (not at import time) for containers - Usability: respect XDG_CACHE_HOME for cache directory - Usability: add force_refresh parameter to re-clone stale unpinned refs - Docs: add ValueError to Skill.from_url() Raises section - Docs: add _url_loader.py to AGENTS.md directory tree - Tests: add coverage for XDG_CACHE_HOME, force_refresh, race condition, http:// rejection (184 tests total) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Per maintainer feedback:
- Remove _url_loader.py — inline fetch logic directly into Skill.from_url()
- Move imports to top of module (not inside methods)
- Use source.startswith("https://") directly in _resolve_skills()
- Remove AGENTS.md entry for deleted file
The entire URL loading feature is now ~15 lines in skill.py with no
separate module.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix stale "auto-resolved to raw content" in AgentSkills docstring - Add test for non-SKILL.md content (HTML page → ValueError) - Add from_url() example to Skill class docstring Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Review SummaryAssessment: Comment The implementation is now clean and minimal — Remaining Items
The doc PR (strands-agents/docs#756) is linked. Nice work iterating on the design to reach this simple, focused solution. 👍 |
… test - Mention HTTPS URL support in set_available_skills docstring - Add test for duplicate skill names from URL sources (Codecov gap) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Review SummaryAssessment: Approve All 14 prior review threads have been addressed. The implementation has been iteratively refined from ~900 lines (git clone + cache) → ~450 lines (HTTPS + GitHub resolution) → 242 lines (pure HTTPS fetch, no new files). I've replied to each stale thread to mark it resolved. The final implementation is clean and focused: |
Summary
Closes #2090
AgentSkillsandSkill.from_url()https://,git@, andssh://URLs with optional@refsuffix for branch/tag pinning (e.g.,https://github.com/org/skill@v1.0.0)--depth 1) and cached locally at~/.cache/strands/skills/(configurable viacache_dirparameter)Usage
Changes
_url_loader.py(new)skill.pySkill.from_url()classmethodagent_skills.py_resolve_skills()to detect URL strings; addedcache_dirparametertest_url_loader.py(new)test_skill.pySkill.from_url()test_agent_skills.pyAgentSkillsDesign decisions
gitwhich is universally available. Handles auth naturally (SSH keys, credential helpers, tokens).--depth 1minimizes bandwidth and disk for skill repos.sha256(url + ref)[:16]as cache directory name. Repeated loads are instant.subprocess,hashlib,shutil).Test plan
@hookdecorator typing)aws-data-agent-skill)obra/superpowers/brainstorming)