# Gh Default Branch

> Retrieve the default branch name of the current Git repository using GitHub CLI. Use when asked "What is the default branch?", "Get the default branch", "What is the main branch?", "Show me the base branch", "get repo default branch", or when git operations require the default branch name (creating PRs, comparing branches, checking out base branch). Returns branch names like main, master, or deve…

- **Type:** Skill
- **Install:** `agentstack add skill-puku0x-agent-skills-test-gh-default-branch`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [puku0x](https://agentstack.voostack.com/s/puku0x)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [puku0x](https://github.com/puku0x)
- **Source:** https://github.com/puku0x/agent-skills-test/tree/main/.github/skills/gh-default-branch

## Install

```sh
agentstack add skill-puku0x-agent-skills-test-gh-default-branch
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Get Default Branch

## Overview

This skill retrieves the default branch name of the current Git repository using the GitHub CLI command `gh repo view --json defaultBranchRef --jq .defaultBranchRef.name`.

## When to Use

Use this skill when:

- The user requests the default branch name of the repository.
- Performing git operations that require knowledge of the default branch (e.g., creating pull requests, comparing branches, checking out the base branch).

## Instructions

To get the default branch name, run the command:

```bash
gh repo view --json defaultBranchRef --jq .defaultBranchRef.name
```

The command will output the default branch name (e.g., `main`, `master`, `develop`).

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [puku0x](https://github.com/puku0x)
- **Source:** [puku0x/agent-skills-test](https://github.com/puku0x/agent-skills-test)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-puku0x-agent-skills-test-gh-default-branch
- Seller: https://agentstack.voostack.com/s/puku0x
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
