git-branch
Manage, scan, and prune branches across multiple local Git repositories using git-branch-dashboard
Best use case
git-branch is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Manage, scan, and prune branches across multiple local Git repositories using git-branch-dashboard
Teams using git-branch should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/git-branch/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How git-branch Compares
| Feature / Agent | git-branch | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Manage, scan, and prune branches across multiple local Git repositories using git-branch-dashboard
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# git-branch skill
## When to use
Use this skill when the user needs to:
- Track branch age and staleness across one or more Git repositories
- View open PR/MR status overlaid on branch data
- Delete stale branches safely with a two-step confirmation
- Run scheduled or manual repository scans
- Configure staleness thresholds and API tokens
## Prerequisites
- Node.js 20+
- pnpm
- Git 2.20+ in PATH
- Optional: GitHub personal access token (scope: `read:repo`) for PR status
- Optional: GitLab personal access token (scope: `read_api`) for MR status
## Installation
```
npm install -g git-branch-dashboard
```
Or run from source:
```
git clone https://github.com/your-org/git-branch-dashboard
cd git-branch-dashboard
pnpm install
pnpm build
pnpm link --global
```
## Quick Start
```
# Start the dashboard server (opens http://127.0.0.1:7654)
git-branch-dash start
# Add a local repository
git-branch-dash repo add /path/to/my-repo
# Set GitHub token for PR status
git-branch-dash config set github-token ghp_...
# Trigger a manual scan
git-branch-dash scan
```
## Usage Patterns
### Tracking a monorepo workspace
Add each sub-package as a separate repository path if they are independent Git clones. If they share a single `.git` directory, add the root once.
```
git-branch-dash repo add /workspace/packages/api
git-branch-dash repo add /workspace/packages/web
git-branch-dash repo add /workspace/packages/shared
```
### Pruning stale branches across all repos
The `prune` command deletes local branches classified as stale or very stale. It never touches remote branches.
```
# Dry run first to preview what would be deleted
git-branch-dash prune --dry-run
# Prune a specific repo
git-branch-dash prune --repo my-app
# Prune all repos (prompts for confirmation per repo)
git-branch-dash prune --all
```
### Scanning on a schedule
The dashboard server runs a background scanner on a configurable interval. The default is every 15 minutes. Change it in Settings or via environment variable:
```
GBDASH_SCAN_INTERVAL=5 git-branch-dash start
```
Set to `0` to disable automatic scanning.
### Reading branch data from the API
All branch data is available via the REST API at `http://127.0.0.1:7654/api/`:
```
# All stale branches
curl http://127.0.0.1:7654/api/branches/stale
# Branches for a specific repo
curl http://127.0.0.1:7654/api/repos/{id}/branches
```
## CLI Reference
| Command | Description |
|---|---|
| `git-branch-dash start` | Start the dashboard server |
| `git-branch-dash start --port 8080` | Start on a custom port |
| `git-branch-dash scan` | Scan all configured repositories immediately |
| `git-branch-dash scan --repo <name>` | Scan a single repository |
| `git-branch-dash prune` | Interactive stale branch pruning |
| `git-branch-dash prune --repo <name>` | Prune a specific repository |
| `git-branch-dash prune --dry-run` | Preview branches to be pruned |
| `git-branch-dash prune --all` | Prune all repos without prompting per-repo |
| `git-branch-dash repo add <path>` | Add a local Git repository |
| `git-branch-dash repo list` | List all tracked repositories |
| `git-branch-dash repo remove <name>` | Remove a tracked repository |
| `git-branch-dash config set <key> <value>` | Set a config value |
| `git-branch-dash config show` | Show current configuration |
| `git-branch-dash --help` | Show help |
| `git-branch-dash --version` | Show version |
## Environment Variables
| Variable | Description | Default |
|---|---|---|
| `GBDASH_PORT` | Dashboard port | `7654` |
| `GBDASH_HOST` | Bind address | `127.0.0.1` |
| `GBDASH_DATA_DIR` | SQLite and config directory | `~/.git-branch-dashboard` |
| `GBDASH_GITHUB_TOKEN` | GitHub token (overrides config file) | (from config) |
| `GBDASH_GITLAB_TOKEN` | GitLab token (overrides config file) | (from config) |
| `GBDASH_SCAN_INTERVAL` | Auto-scan interval in minutes | `15` |
| `GBDASH_STALE_DAYS` | Days until a branch is stale | `31` |
| `GBDASH_VERY_STALE_DAYS` | Days until a branch is very stale | `90` |
| `GBDASH_LOG_LEVEL` | Log level: debug, info, warn, error | `info` |
## Staleness Tiers
| Tier | Age | Color |
|---|---|---|
| Fresh | 0-7 days | Green |
| Aging | 8-30 days | Yellow |
| Stale | 31-90 days | Orange |
| Very stale | 90+ days | Red |
Thresholds are configurable per-instance via Settings or environment variables. The default branch (main/master) is never classified as stale regardless of last commit date.
## Troubleshooting
**"No repositories tracked"** - Add at least one repository with `git-branch-dash repo add <path>`. The path must be an absolute path to a local Git clone.
**PR badges not showing** - Configure a GitHub token: `git-branch-dash config set github-token ghp_...`. Verify the token has `read:repo` scope and the repository owner/slug are correct in the repository settings.
**Scan fails with "not a git repository"** - Verify the path passed to `repo add` contains a `.git` directory. Submodules must be added individually if they have separate remotes.
**Stale thresholds not updating** - After changing thresholds in Settings, trigger a manual scan with `git-branch-dash scan` so all branches are reclassified against the new values.
**Port 7654 already in use** - Start on a different port: `GBDASH_PORT=7655 git-branch-dash start` or set it in the config file.
**Database locked error** - Only one instance of git-branch-dash should run at a time. Stop any existing instance before starting a new one.Related Skills
Skill: Uptime Monitoring
## Overview
Skill: Status Page
## Overview
Skill: unit-conversion
## Overview
Skill: recipe-scaler
## Overview
reading-list
Operate the reading-list API to save, manage, tag, search, and export articles.
email-digest
Configure, test, and troubleshoot the reading-list daily email digest delivered via nodemailer.
websocket-realtime
Use the WebSocket connection in poll-builder to receive live vote updates. Use when you need to stream real-time poll results, monitor a poll for new votes, or build a live dashboard. Triggers include "live results", "real-time updates", "stream votes", "watch poll", or "WebSocket".
poll-builder
Self-hosted poll creation tool with real-time results. Use when you need to create a poll, check vote counts, close a poll, export results, or get the shareable link for a poll. Triggers include "create poll", "vote", "poll results", "survey", "collect votes", "share poll", or any task involving polling or voting.
Skill: personal-finance
## Overview
Skill: csv-import
## Overview
Skill: Syntax Highlighting
## Purpose
Skill: Pastebin Core
## Purpose