Skip to content

Add git:<url> as a third install source#1

Open
tianyilt wants to merge 2 commits into
KnowledgeXLab:mainfrom
tianyilt:feat/git-url-install-source
Open

Add git:<url> as a third install source#1
tianyilt wants to merge 2 commits into
KnowledgeXLab:mainfrom
tianyilt:feat/git-url-install-source

Conversation

@tianyilt
Copy link
Copy Markdown

Summary

Adds git:<url> as a third install source for /skill-git:install, alongside the existing skillhub: and clawhub: registries. Lets users install skills from any git URL — including private repos on GitHub/GitLab/self-hosted, beyond what the two public registries cover.

Motivation

/skill-git:install currently only accepts SkillHub or ClawHub identifiers. Both registries serve public skills. Users who:

  • maintain skills in private GitHub/GitLab repos (org-internal tools, in-progress work, sensitive content)
  • self-host git on company infrastructure
  • want to install a fork of a public skill from their own URL

…have no first-class path. The vim-plug / npm / pip ecosystem has long settled on "any git URL" as the universal source — this PR brings the same convenience to skill-git, completing the pattern alongside the curated public registries.

Design

/skill-git:install git:<owner>/<repo>[@<install_name>]      # GitHub shorthand
/skill-git:install git:<full-url>[@<install_name>]          # any host / scheme
  • <owner>/<repo> shorthand expands to https://github.com/<owner>/<repo>.git. HTTPS works for public repos with no setup, and for private repos when the user has run gh auth login (gh registers a git credential helper). Users who prefer SSH can pass the full URL: git:git@github.com:owner/repo.git.
  • Full URLs are passed to git clone as-is (https://, http://, git@host:, ssh://).
  • Optional trailing @<install_name> overrides the auto-derived name (basename of the repo with .git stripped). Useful when the repo is named skill-foo but the user wants to install it as foo.
  • Cloned .git and tags are preserved (not stripped). sg-init.sh already handles 4 cases — including "repo with existing v* tags" (Case D, skip) and "repo with commits but no tags" (Case C, tag v1.0.0 on the first commit) — so the existing init step composes cleanly with cloned content.
  • Origin remote is left intact, so git pull origin works for upstream updates afterward.

Implementation

File Change
commands/install.md Frontmatter description/argument-hint updated. Step 0 adds git:<spec> parsing + install_name derivation. Step 3 adds new sub-section 3c. Git URL; existing "Validate" renumbered to 3d. Preview Source line includes Git — <url>.
scripts/sg-install-git.sh New helper. Normalizes shorthand to HTTPS, refuses non-empty install paths, runs git clone, validates SKILL.md presence at repo root.

Total diff: +88 / -6 lines, 1 new file.

Tests

Manual reproduction (scripts/sg-install-git.sh directly, since the repo has no test harness):

  1. Full file:// URL — clones, preserves .git and v* tags ✓
  2. Refuses non-empty target — exits with clear error ✓
  3. Missing SKILL.md — exits with clear error pointing to root ✓
  4. Shorthand expansiontianyilt/skill-paper-writehttps://github.com/tianyilt/skill-paper-write.git
  5. End-to-end against a real private GitHub repo (HTTPS via gh credential helper) — clone succeeds, SKILL.md present, v1.0.0 tag pulled, origin set ✓

Backward compatibility

SkillHub and ClawHub paths are completely untouched. Existing identifiers (skillhub:owner/repo@skill, clawhub:slug) continue to dispatch to Steps 3a / 3b unchanged.

Out of scope (potential follow-ups)

  • /skill-git:search git:<query> — searching arbitrary git hosts is non-trivial and not symmetric with the curated registries; left for a separate discussion.
  • A --branch / --ref flag for installing a specific branch or tag — easy to add later if there's demand.
  • HTTP basic-auth handling beyond what the user's git credential helper provides — out of scope for this change.

tianyilt and others added 2 commits May 11, 2026 00:25
/skill-git:install now accepts git:<owner>/<repo> shorthand or git:<full-url>
in addition to skillhub: and clawhub: identifiers. An optional @<install_name>
suffix overrides the auto-derived name. Cloned .git is preserved so sg-init.sh
re-tags idempotently and `git pull` works for upstream updates later.

This unlocks installing skills from private repos (GitHub, GitLab, self-hosted)
and any git host beyond the two public registries.

- commands/install.md: parse git:<spec>, add Step 3c "Git URL"
- scripts/sg-install-git.sh: new helper, normalizes shorthand to git@github.com,
  refuses non-empty targets, validates SKILL.md presence

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
HTTPS works for public repos with no setup and for private repos when
the user has run `gh auth login` (gh registers a credential helper).
Requiring SSH out of the box would block users who haven't uploaded
an SSH public key to GitHub. SSH remains available via the full URL form
(git:git@github.com:owner/repo.git).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@tianyilt
Copy link
Copy Markdown
Author

思路就是类比npm pip install这样 支持对着github装库 因为有些skill还在开发或者私仓阶段 就和yml里面git+一样

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