Skip to content

feat(skill): source-positional + nested skill discovery#413

Merged
christso merged 1 commit into
mainfrom
feat/skill-add-source-positional
May 25, 2026
Merged

feat(skill): source-positional + nested skill discovery#413
christso merged 1 commit into
mainfrom
feat/skill-add-source-positional

Conversation

@christso
Copy link
Copy Markdown
Contributor

@christso christso commented May 25, 2026

Summary

  • Display formatter — new formatPluginSource() helper shortens long source strings for workspace status and skill list output (e.g. https://github.com/owner/repo/blob/main/skills/fooowner/repo/skills/foo). Display-only; workspace.yaml keeps the original string.
  • Recursive skill discovery — walks skills/ for any SKILL.md, picking up nested layouts like skills/research/llm-wiki/SKILL.md. Each skill carries its qualified category/skill subpath; the allowlist matches either the bare leaf name or the qualified path. As a side effect, skill add --list no longer reports empty container directories as skills.
  • npx-skills positional shape — when the positional looks like a GitHub source AND a selector (--skill, --list, --all) is provided, the positional is treated as the source. Adds a --skill flag accepting a comma-separated list for multi-skill installs. Legacy skill add <skill> --from <source> and deep-URL forms keep working.
  • Sync support for nested skillstransform.copySkills() and collectPluginSkills() use the same recursive walk so sync copies and tracks nested skills correctly.

Builds on #412.

Before / after

Before

$ allagents skill add llm-wiki --from NousResearch/hermes-agent
Error: Skill 'llm-wiki' not found in plugin 'NousResearch/hermes-agent'.
Available skills: apple, autonomous-ai-agents, …, research, …   ← "research" is a container, not a skill

$ allagents skill add NousResearch/hermes-agent --skill llm-wiki
error: found 1 error
  skill add NousResearch/hermes-agent --skill llm-wiki
                                      ^ Unknown arguments

$ allagents workspace status
Project Plugins (1):
  ✓ https://github.com/NousResearch/hermes-agent/blob/main/skills/research/llm-wiki (cached)

After

$ allagents skill add llm-wiki --from NousResearch/hermes-agent
Installing skill 'llm-wiki' from NousResearch/hermes-agent...
✓ Enabled skill: llm-wiki (hermes-agent)

$ allagents skill add NousResearch/hermes-agent --skill llm-wiki
Installing skill 'llm-wiki' from NousResearch/hermes-agent...
✓ Enabled skill: llm-wiki (hermes-agent)

$ allagents skill add NousResearch/hermes-agent --skill llm-wiki,dogfood
Installing skill 'llm-wiki' from NousResearch/hermes-agent...
✓ Enabled skill: llm-wiki (hermes-agent)
Installing skill 'dogfood' from NousResearch/hermes-agent...
✓ Enabled skill: dogfood (hermes-agent)

$ allagents skill add NousResearch/hermes-agent --list
Available skills in NousResearch/hermes-agent:
  apple/apple-notes
  …
  research/llm-wiki
  …                                                  ← no fake "research" entry; nested skills shown as path/leaf

$ allagents workspace status
Project Plugins (1):
  ✓ NousResearch/hermes-agent/skills/research/llm-wiki (cached)

Test plan

  • bun test — 1306 passing, 0 failing (added unit coverage for formatPluginSource, recursive skill discovery, allowlist match by qualified subpath, and classifySkillAddPositional)
  • bun run typecheck — clean
  • bun run check — lint count down (119 → 111); pre-push hook passes
  • E2E — legacy nested install: skill add llm-wiki --from NousResearch/hermes-agent → enabled
  • E2E — npx-skills shape: skill add NousResearch/hermes-agent --skill llm-wiki → enabled
  • E2E — multi-skill: skill add NousResearch/hermes-agent --skill llm-wiki,dogfood → both enabled (verified plain text + JSON output)
  • E2E — --all with positional source: skill add NousResearch/hermes-agent --all → 89 skills enabled, nested skills included
  • E2E — --list: shows nested skills as research/llm-wiki; no bare container dirs; JSON output includes path field for nested
  • E2E — deep-URL legacy form: skill add https://github.com/NousResearch/hermes-agent/blob/main/skills/research/llm-wiki still resolves to skill llm-wiki
  • E2E — display label: workspace status shows NousResearch/hermes-agent/skills/research/llm-wiki; skill list shows qualified path for nested skills
  • E2E — files synced: skill content lands at .claude/skills/llm-wiki/SKILL.md after install
  • E2E — error UX: --skill without a source positional → clear error; positional source + --from → clear conflict error; skill add --help shows new --skill flag and examples

- Add formatPluginSource() helper that shortens GitHub URLs to OWNER/REPO,
  strips /blob/<default-branch>/, and preserves @<ref> for non-default refs.
  Used by `workspace status` and `skill list` output (display-only — the
  workspace.yaml source is preserved verbatim).
- Recursively walk skills/ to find every SKILL.md, including nested layouts
  like skills/research/llm-wiki/SKILL.md. Each discovered skill carries its
  qualified subpath alongside the bare leaf name; the allowlist now matches
  either form so users can disambiguate with `category/skill` if needed.
  As a side effect, `skill add --list` no longer reports container dirs
  that lack a SKILL.md as fake skills.
- Add npx-skills positional shape: when the positional argument to
  `skill add` looks like a GitHub source AND a selector (--skill, --list,
  --all) is provided, treat the positional as the source. Adds a --skill
  flag that accepts a comma-separated list for multi-skill installs.
  The legacy `--from`/deep-URL forms continue to work unchanged.
- Update transform.copySkills() and collectPluginSkills() to use the same
  recursive walk so sync correctly copies nested skills referenced by the
  allowlist.

Builds on #412.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying allagents with  Cloudflare Pages  Cloudflare Pages

Latest commit: b57ce9b
Status: ✅  Deploy successful!
Preview URL: https://e235b2fb.allagents.pages.dev
Branch Preview URL: https://feat-skill-add-source-positi.allagents.pages.dev

View logs

@christso christso merged commit ca084df into main May 25, 2026
1 check passed
@christso christso deleted the feat/skill-add-source-positional branch May 25, 2026 01:07
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