From software-engineering
Detects GitHub or GitLab hosting from git remote URLs and extracts owner, repo, project_path for platform-aware command routing in git repos.
How this skill is triggered — by the user, by Claude, or both
Slash command
/software-engineering:detect-repo-hostThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Detect the repository hosting service from git remote configuration and extract structured metadata for platform-aware command routing.
Detect the repository hosting service from git remote configuration and extract structured metadata for platform-aware command routing.
Many commands need to determine whether the current repository is hosted on GitHub or GitLab to route MCP calls correctly. This skill centralizes that detection logic so commands can invoke it via the Skill tool instead of duplicating git remote -v parsing.
owner/repo or project_pathgit remote -v
Parse the output to find the origin remote (or the first available remote if origin is not set).
Support both SSH and HTTPS URL formats:
SSH formats:
[email protected]:owner/repo.git
[email protected]:group/subgroup/project.git
[email protected]:group/project.git
HTTPS formats:
https://github.com/owner/repo.git
https://gitlab.com/group/subgroup/project.git
https://gitlab.self-hosted.example.com/group/project.git
Parsing rules:
.git suffix if present| Hostname Pattern | Platform |
|---|---|
github.com | GitHub |
gitlab.com | GitLab |
| Other hostnames | Assume GitLab (self-hosted instances are common) |
For GitHub (github.com):
owner: First path segment (user or organization)repo: Second path segment (repository name)project_path: owner/repoFor GitLab (gitlab.com or self-hosted):
project_path: Full path after hostname (supports nested groups, e.g., group/subgroup/project)owner: First path segment (top-level group)repo: Last path segment (project name)Return the following structured information:
| Field | Description | Example (GitHub) | Example (GitLab) |
|---|---|---|---|
platform | Hosting service | github | gitlab |
owner | User/org/group | sgaunet | myorg |
repo | Repository name | claude-plugins | myproject |
project_path | Full path | sgaunet/claude-plugins | myorg/team/myproject |
remote_url | Raw remote URL | [email protected]:sgaunet/claude-plugins.git | https://gitlab.com/myorg/team/myproject.git |
| Condition | Action |
|---|---|
| Not a git repository | Abort: "Not a git repository. Initialize with git init first." |
| No remotes configured | Abort: "No git remotes found. Add a remote with git remote add origin <url>." |
No origin remote | Fall back to first available remote, warn user |
| URL format unrecognized | Abort: "Could not parse remote URL: <url>. Expected GitHub or GitLab format." |
$ git remote -v
origin [email protected]:sgaunet/claude-plugins.git (fetch)
→ platform: github
→ owner: sgaunet
→ repo: claude-plugins
→ project_path: sgaunet/claude-plugins
→ remote_url: [email protected]:sgaunet/claude-plugins.git
$ git remote -v
origin https://gitlab.com/myorg/backend/api-service.git (fetch)
→ platform: gitlab
→ owner: myorg
→ repo: api-service
→ project_path: myorg/backend/api-service
→ remote_url: https://gitlab.com/myorg/backend/api-service.git
$ git remote -v
origin [email protected]:devteam/infra.git (fetch)
→ platform: gitlab
→ owner: devteam
→ repo: infra
→ project_path: devteam/infra
→ remote_url: [email protected]:devteam/infra.git
npx claudepluginhub sgaunet/claude-plugins --plugin software-engineeringDetects GitHub repo owner and name from git remotes. Parses HTTPS/SSH URLs including Enterprise. Extracts owner/repo format for GitHub CLI, API calls, multi-repo workflows.
Detects Git platform (GitHub, GitLab, Bitbucket) and maps equivalent CLI commands (gh, glab) for issues, PRs/MRs, comments. Auto-injects detection into session context for cross-platform workflows.
Executes GitHub operations via the gh CLI for inspecting repos, files, issues, PRs, releases, Actions, and cloning for deep analysis. Activates on github.com URLs or repo paths.