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