agentleFS
goca-segoca-se/dotcontext/.claude/skills/git-platform/SKILL.md

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
  1. Distinctive:

    Before running any git hosting CLI command (creating PRs, viewing issues, commenting on PRs, etc.), detect the platform first.

    line 11
  2. Distinctive:

    Run this detection sequence and use the FIRST match:

    line 15
  3. Distinctive:

    If the CLI is not installed, inform the user and provide the install command:

    line 50

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 containsPlatformCLIMR/PR term
github.comGitHubghPull Request (PR)
gitlab.com or gitlabGitLabglabMerge Request (MR)
bitbucket.orgBitbucketbb or APIPull Request (PR)
dev.azure.com or visualstudio.comAzure DevOpsaz reposPull Request (PR)
codecommitAWS CodeCommitaws codecommitPull Request (PR)

For self-hosted instances (e.g., gitlab.company.com), check for platform indicators:

  • .gitlab-ci.yml exists → GitLab
  • .github/ directory exists → GitHub
  • bitbucket-pipelines.yml exists → Bitbucket
  • azure-pipelines.yml exists → 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/null

If 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

PlatformCommand
GitHubgh pr create --title "..." --body "..."
GitLabglab mr create --title "..." --description "..."
Azure DevOpsaz repos pr create --title "..." --description "..."

View PR/MR

PlatformCommand
GitHubgh pr view [N] --json title,body,state,comments
GitLabglab mr view [N]
Azure DevOpsaz repos pr show --id [N]

Comment on PR/MR

PlatformCommand
GitHubgh pr comment [N] --body "..."
GitLabglab mr note [N] --message "..."
Azure DevOpsaz repos pr set-vote --id [N] (or API for comments)

Get PR/MR diff

PlatformCommand
GitHubgh pr diff [N]
GitLabglab mr diff [N]
Azure DevOpsaz repos pr diff --id [N]

View issue

PlatformCommand
GitHubgh issue view [N] --json title,body,comments
GitLabglab issue view [N]
Azure DevOpsaz boards work-item show --id [N]

Review PR/MR

PlatformCommand
GitHubgh pr review [N] --comment --body "..."
GitLabglab mr approve [N] / glab mr note [N]
Azure DevOpsaz repos pr set-vote --id [N] --vote approve

List PRs/MRs

PlatformCommand
GitHubgh pr list
GitLabglab mr list
Azure DevOpsaz repos pr list

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.