GitHub Labels
Reference for discovering and applying labels to GitHub PRs and issues.
When to Use This Skill
| Use this skill when... |
Use something else when... |
| Listing available labels in a repo |
Creating or managing milestones |
| Adding or removing labels on PRs/issues |
Managing GitHub Projects boards |
| Creating new labels with colors |
Bulk-editing many issues at once |
| Inheriting labels from issue to PR |
Setting PR reviewers or assignees |
Discovering Available Labels
# List all labels with details
gh label list --json name,description,color --limit 50
# Search for specific labels
gh label list --search "bug"
# Output as simple list
gh label list --json name -q '.[].name'
Adding Labels to PRs
# Single label
gh pr create --label "bug"
# Multiple labels (repeat flag)
gh pr create --label "bug" --label "priority:high"
# Comma-separated
gh pr create --label "bug,priority:high"
# Add to existing PR
gh pr edit 123 --add-label "ready-for-review"
Adding Labels to Issues
# Create with labels
gh issue create --label "bug,needs-triage"
# Add to existing issue
gh issue edit 123 --add-label "in-progress"
# Remove label
gh issue edit 123 --remove-label "needs-triage"
Common Label Categories
| Category |
Examples |
| Type |
bug, feature, enhancement, documentation, chore |
| Priority |
priority:critical, priority:high, priority:medium, priority:low |
| Status |
needs-triage, in-progress, blocked, ready-for-review |
| Area |
frontend, backend, infrastructure, testing, ci-cd |
Label Inheritance Pattern
When creating a PR from an issue:
- Read issue labels via
gh issue view N --json labels
- Apply same labels to PR:
gh pr create --label "label1,label2"
This maintains traceability and consistent categorization.
Agentic Optimizations
| Context |
Command |
| List all labels (machine-readable) |
gh label list --json name,description,color --limit 50 |
| Get label names only |
gh label list --json name -q '.[].name' |
| Add label to PR silently |
gh pr edit $PR --add-label "label" |
| Check current issue labels |
gh issue view $ISSUE --json labels -q '.labels[].name' |
| Inherit labels from issue to PR |
`gh issue view $ISSUE --json labels -q '[.labels[].name] |
1---
2created: 2025-12-16
3modified: 2026-08-15
4reviewed: 2026-04-01
5name: github-labels
6description: "GitHub labels via gh CLI — list, apply, create. Use when labeling a PR or issue, checking which labels a repo has, or creating a new label."
7user-invocable: false
8allowed-tools: Bash, Read, Grep, Glob
9---
10
11# GitHub Labels
12
13Reference for discovering and applying labels to GitHub PRs and issues.
14
15## When to Use This Skill
16
17| Use this skill when... | Use something else when... |
18|------------------------|---------------------------|
19| Listing available labels in a repo | Creating or managing milestones |
20| Adding or removing labels on PRs/issues | Managing GitHub Projects boards |
21| Creating new labels with colors | Bulk-editing many issues at once |
22| Inheriting labels from issue to PR | Setting PR reviewers or assignees |
23
24## Discovering Available Labels
25
26```bash
27# List all labels with details
28gh label list --json name,description,color --limit 50
29
30# Search for specific labels
31gh label list --search "bug"
32
33# Output as simple list
34gh label list --json name -q '.[].name'
35```
36
37## Adding Labels to PRs
38
39```bash
40# Single label
41gh pr create --label "bug"
42
43# Multiple labels (repeat flag)
44gh pr create --label "bug" --label "priority:high"
45
46# Comma-separated
47gh pr create --label "bug,priority:high"
48
49# Add to existing PR
50gh pr edit 123 --add-label "ready-for-review"
51```
52
53## Adding Labels to Issues
54
55```bash
56# Create with labels
57gh issue create --label "bug,needs-triage"
58
59# Add to existing issue
60gh issue edit 123 --add-label "in-progress"
61
62# Remove label
63gh issue edit 123 --remove-label "needs-triage"
64```
65
66## Common Label Categories
67
68| Category | Examples |
69|----------|----------|
70| Type | `bug`, `feature`, `enhancement`, `documentation`, `chore` |
71| Priority | `priority:critical`, `priority:high`, `priority:medium`, `priority:low` |
72| Status | `needs-triage`, `in-progress`, `blocked`, `ready-for-review` |
73| Area | `frontend`, `backend`, `infrastructure`, `testing`, `ci-cd` |
74
75## Label Inheritance Pattern
76
77When creating a PR from an issue:
781. Read issue labels via `gh issue view N --json labels`
792. Apply same labels to PR: `gh pr create --label "label1,label2"`
80
81This maintains traceability and consistent categorization.
82
83## Agentic Optimizations
84
85| Context | Command |
86|---------|---------|
87| List all labels (machine-readable) | `gh label list --json name,description,color --limit 50` |
88| Get label names only | `gh label list --json name -q '.[].name'` |
89| Add label to PR silently | `gh pr edit $PR --add-label "label"` |
90| Check current issue labels | `gh issue view $ISSUE --json labels -q '.labels[].name'` |
91| Inherit labels from issue to PR | `gh issue view $ISSUE --json labels -q '[.labels[].name] | join(",")' | xargs -I{} gh pr edit $PR --add-label {}` |