git-platform
Skill9 starsChanged 4 months agoMITView on GitHub
Detect the git hosting platform (GitHub, GitLab, Bitbucket, …) before running any hosting CLI — creating PRs, viewing issues, commenting on PRs. Never assume GitHub.
- Installs packages
- Commits and pushes
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Before running any git hosting CLI command (creating PRs, viewing issues, commenting on PRs, etc.), detect the platform first.
- Distinctive: line 15
Run this detection sequence and use the FIRST match:
- Distinctive: line 50
If the CLI is not installed, inform the user and provide the install command:
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: Git Platform Detection
When to Use
Before running any git hosting CLI command (creating PRs, viewing issues, commenting on PRs, etc.), detect the platform first. Never assume GitHub.
Detection
Run this detection sequence and use the FIRST match:
Step 1: Check remote URL
git remote get-url origin 2>/dev/null| Remote URL contains | Platform | CLI | MR/PR term |
github.com | GitHub | gh | Pull Request (PR) |
gitlab.com or gitlab | GitLab | glab | Merge Request (MR) |
bitbucket.org | Bitbucket | bb or API | Pull Request (PR) |
dev.azure.com or visualstudio.com | Azure DevOps | az repos | Pull Request (PR) |
codecommit | AWS CodeCommit | aws codecommit | Pull Request (PR) |
For self-hosted instances (e.g., gitlab.company.com), check for platform indicators:
.gitlab-ci.ymlexists → GitLab.github/directory exists → GitHubbitbucket-pipelines.ymlexists → Bitbucketazure-pipelines.ymlexists → Azure DevOps
Step 2: Verify CLI is installed
# GitHub
command -v gh &>/dev/null && gh auth status &>/dev/null
# GitLab
command -v glab &>/dev/null && glab auth status &>/dev/null
# Azure DevOps
command -v az &>/dev/null && az devops configure --list &>/dev/nullIf the CLI is not installed, inform the user and provide the install command:
- GitHub:
brew install gh/sudo apt install gh - GitLab:
brew install glab/sudo apt install glab - Azure DevOps:
az extension add --name azure-devops
Step 3: If detection fails
Use AskUserQuestion with options:
- "GitHub (gh)"
- "GitLab (glab)"
- "Azure DevOps (az repos)"
- "Other (I'll provide the commands)"
Command Reference
Create PR/MR
| Platform | Command |
| GitHub | gh pr create --title "..." --body "..." |
| GitLab | glab mr create --title "..." --description "..." |
| Azure DevOps | az repos pr create --title "..." --description "..." |
View PR/MR
| Platform | Command |
| GitHub | gh pr view [N] --json title,body,state,comments |
| GitLab | glab mr view [N] |
| Azure DevOps | az repos pr show --id [N] |
Comment on PR/MR
| Platform | Command |
| GitHub | gh pr comment [N] --body "..." |
| GitLab | glab mr note [N] --message "..." |
| Azure DevOps | az repos pr set-vote --id [N] (or API for comments) |
Get PR/MR diff
| Platform | Command |
| GitHub | gh pr diff [N] |
| GitLab | glab mr diff [N] |
| Azure DevOps | az repos pr diff --id [N] |
View issue
| Platform | Command |
| GitHub | gh issue view [N] --json title,body,comments |
| GitLab | glab issue view [N] |
| Azure DevOps | az boards work-item show --id [N] |
Review PR/MR
| Platform | Command |
| GitHub | gh pr review [N] --comment --body "..." |
| GitLab | glab mr approve [N] / glab mr note [N] |
| Azure DevOps | az repos pr set-vote --id [N] --vote approve |
List PRs/MRs
| Platform | Command |
| GitHub | gh pr list |
| GitLab | glab mr list |
| Azure DevOps | az repos pr list |
In this repository7 other files it gives its agents.
- templates/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- add-cli-subcommandSkill
- add-new-commandSkill
- batch-operationsSkill
- bug-reproductionSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

