| name | git-platform |
| description | Detects git forge (GitHub/GitLab/Bitbucket) and maps CLI commands cross-platform. Use when writing skills that must run on any git hosting provider. |
| alwaysApply | false |
| category | infrastructure |
| tags | ["git","platform","github","gitlab","bitbucket","cross-platform","forge"] |
| dependencies | ["authentication-patterns"] |
| provides | {"infrastructure":["platform-detection","command-mapping","forge-abstraction"],"patterns":["cross-platform-git","cli-selection","terminology-mapping"]} |
| usage_patterns | ["platform-detection","command-translation","cross-platform-workflows"] |
| complexity | beginner |
| model_hint | fast |
| estimated_tokens | 400 |
| progressive_loading | true |
| modules | ["modules/command-mapping.md"] |
| role | library |
Table of Contents
Git Platform Detection & Command Mapping
Overview
Cross-platform abstraction for git forge operations. Detects whether the current project uses GitHub, GitLab, or Bitbucket, and provides equivalent CLI commands for each platform.
The SessionStart hook (detect-git-platform.sh) automatically injects the detected platform into session context. This skill provides the command reference for translating operations across platforms.
When To Use
- Before running
gh, glab, or forge API commands
- When a skill or command needs to create issues, PRs/MRs, or post comments
- When writing CI/CD configuration
- Any time forge-specific CLI commands appear in a workflow
When NOT To Use
- Local-only git operations (
git commit, git branch, etc.)
- Projects without a hosted git remote
Platform Detection
Detection is automatic via the SessionStart hook. The session context will contain:
git_platform: github|gitlab|bitbucket, cli: gh|glab, mr_term: pull request|merge request
If you need to re-detect manually:
git remote get-url origin 2>/dev/null
ls -d .github/ .gitlab-ci.yml bitbucket-pipelines.yml 2>/dev/null
command -v gh && echo "GitHub CLI available"
command -v glab && echo "GitLab CLI available"
Quick Command Reference