Skip to content

fix(skills): auto-detect GitHub URL in skills add command#257

Merged
christso merged 3 commits intomainfrom
fix/256-skills-add-github-url
Mar 15, 2026
Merged

fix(skills): auto-detect GitHub URL in skills add command#257
christso merged 3 commits intomainfrom
fix/256-skills-add-github-url

Conversation

@christso
Copy link
Contributor

@christso christso commented Mar 15, 2026

Summary

  • Auto-detect when a GitHub URL is passed as the positional skill argument in allagents skills add
  • Extract the skill name from the URL (last path segment for URLs with subpath, SKILL.md frontmatter name or repo name for bare repo URLs)
  • Treat the URL as the --from plugin source automatically

Closes #256

Changes

  • Added resolveSkillFromUrl() helper — pure URL parsing that returns { skill, from, parsed } or null
  • Added resolveSkillNameFromRepo() helper — async, fetches repo and reads SKILL.md frontmatter for skill name
  • Wired both into the addCmd handler, before findSkillByName()
  • Added error for conflicting --from flag when URL is auto-detected
  • 9 unit tests covering URL parsing and frontmatter resolution

E2E Test

tmpdir=$(mktemp -d)
cd "$tmpdir"
mkdir -p .allagents
printf 'repositories: []\nplugins: []\nclients: [claude]\n' > .allagents/workspace.yaml
npx allagents skills add https://github.com/anthropics/skills/tree/main/skills/skill-creator

Result:

Skill 'skill-creator' not found. Installing plugin: https://github.com/anthropics/skills/tree/main/skills/skill-creator...
Running initial sync...

Skill 'skill-creator' is already enabled.

Clean up: rm -rf "$tmpdir"

Test plan

  • Unit tests pass (9 new tests, 973 total)
  • Lint, typecheck, test hooks pass
  • E2E: skills add <github-url-with-subpath> installs and enables skill
  • E2E: skills add <bare-repo-url> reads name from SKILL.md frontmatter (frontmatter-test-skill extracted from root SKILL.md, not repo name)
  • E2E: skills add <url> --from <source> shows conflict error

@cloudflare-workers-and-pages
Copy link

Deploying allagents with  Cloudflare Pages  Cloudflare Pages

Latest commit: a387348
Status: ✅  Deploy successful!
Preview URL: https://e42421a9.allagents.pages.dev
Branch Preview URL: https://fix-256-skills-add-github-ur.allagents.pages.dev

View logs

@christso christso merged commit cf0a2c7 into main Mar 15, 2026
1 check passed
@christso christso deleted the fix/256-skills-add-github-url branch March 15, 2026 22:35
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.

bug: cannot install skills individually

1 participant