feat: Add support for parsing full GitHub URLs#192
Open
hoducha wants to merge 4 commits intocomputerlovetech:mainfrom
Open
feat: Add support for parsing full GitHub URLs#192hoducha wants to merge 4 commits intocomputerlovetech:mainfrom
hoducha wants to merge 4 commits intocomputerlovetech:mainfrom
Conversation
kasperjunge
reviewed
Mar 30, 2026
Collaborator
kasperjunge
left a comment
There was a problem hiding this comment.
Review feedback: slash-in-branch-name edge case
After deeper analysis, the skill_path[-1] approach is actually correct for the real-world use case — users copy a URL pointing to a skill directory, so the last segment is always the skill name, regardless of slashes in the branch.
Suggestion: Add a comment in _try_parse_github_url documenting this known limitation:
if len(path_parts) >= 4 and path_parts[2] in ("tree", "blob"):
# Note: we can't reliably separate the branch name from the skill
# path when branches contain slashes (e.g. feature/foo). Since skill
# discovery is name-based (recursive SKILL.md search), we only need
# the last segment as the skill name — which skill_path[-1] gives us
# correctly even with slashed branches.
skill_path = path_parts[4:]Also consider adding a test that documents this works:
def test_url_with_slashed_branch(self):
"""Slashed branch names still extract the correct skill name."""
h = parse_handle("https://github.com/user/repo/tree/feature/login/skills/sample")
assert h.name == "sample"
assert h.repo == "repo"Otherwise the implementation looks good — the "://" fast-path skip and the overall integration approach are clean. 👍
🤖 Generated with Claude Code
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.
Problem
Running agr add with a full GitHub URL fails:
Users often copy and paste URLs directly from the GitHub web interface. Additionally, some shared skills are located outside of the repository's root directory. However, the
parse_handlefunction only accepts the shortened URL format in the form ofuser/repo/skill.Solution
Detects GitHub URLs and normalizes them to the standard handle format before the existing parsing logic runs.
Supported URL patterns:
A fast-path check ("://" not in ref) skips
urlparseentirely for normal handles.