Managing Repository Labels
Analyze repository context and establish or refresh a semantic label system tailored to the project's domain and needs.
What you should do
When invoked, help the user create or refresh their repository's label system by:
Understanding the request - Determine what's needed:
- Initial setup for new repository
- Periodic refresh (6-12 month cycle)
- Standardization across organization
- Migration from legacy labels
Analyzing the repository - Gather context:
- Technology stack and project type
- Existing issue patterns
- Current label usage and gaps
- Team terminology
Designing the label system - Create semantic labels:
- Core categories (bug, enhancement, question)
- Domain-specific labels (api, frontend, pipeline, etc.)
- Apply semantic color philosophy
- Ensure no redundancy or overlap
Implementing changes - Execute carefully:
- Create new labels with proper colors
- Migrate issues from old to new labels
- Delete obsolete labels (after verification)
- Audit and label unlabeled issues
Documenting the system - Create .github/LABELS.md:
- Label categories and descriptions
- Usage guidelines
- Migration history
When to use this skill
Trigger phrases:
- "Set up labels"
- "Organize our labels"
- "Label system is a mess"
- "Standardize labels"
- "Clean up labels"
- "Refresh label system"
Proactive detection:
- Many unlabeled issues detected
- Duplicate labels observed (e.g.,
docs and documentation)
- Inconsistent label usage
- Project scope has expanded
- Team mentions label confusion
Scheduled maintenance:
- Every 6-12 months for active repositories
- When merging multiple repositories
- After significant project evolution
Analysis process
1. Analyze repository context
# Get repository information
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)
REPO_DESCRIPTION=$(gh repo view --json description -q .description)
# List existing labels
gh label list --json name,description,color --limit 100
# Analyze recent issues for patterns
gh issue list --limit 50 --json title,body,labels --state all
Look for:
- Technology stack (languages, frameworks)
- Issue patterns (security, performance, bugs, features)
- Team terminology (what words do they use?)
- Missing label coverage (unlabeled issues)
2. Determine label categories
Core categories (most repositories need):
- Nature: bug, enhancement, question
- Domain-specific: Labels specific to project type (api, frontend, backend)
- Quality: testing, refactor, docs
- Infrastructure: ci, dependencies, config
- Impact: security, performance, accessibility
Important: Do NOT create labels for status (todo/done), priority (high/low), value (essential/nice-to-have), or effort (heavy/light). These should be managed as custom fields in GitHub Projects V2, not labels.
Repository-specific examples:
- API project: endpoint, schema, authentication
- Data project: pipeline, validation, data-quality
- UI project: ux, accessibility, design-system
- Library: breaking-change, deprecation, api
Color assignment
Use semantic color philosophy to communicate meaning visually. See LABEL-COLORS.md for complete reference.
Quick reference
| Category |
Hex Code |
Use Case |
| Critical (Red) |
FF3B30 |
bug, breaking-change |
| High Priority (Orange) |
FF9500 |
security, performance |
| Success (Green) |
34C759 |
testing, quality |
| Enhancement (Light Green) |
30D158 |
enhancement, feature-request |
| Refinement (Purple) |
AF52DE |
refactor, cleanup |
| Infrastructure (Cyan) |
00C7BE |
ci, deployment |
| Technical (Blue) |
007AFF |
dependencies, architecture |
| Routine (Gray) |
8E8E93 |
docs, config |
Color selection rules
- Darker shades = higher urgency within same color family
- Never use pure red (
FF0000) - too alarming
- Limit to 2-3 shades per color family - avoid confusion
- Test accessibility - ensure WCAG AA contrast
- Match GitHub defaults -
bug uses FF3B30
Implementation workflow
Step 1: Create or update labels
# Create new labels
gh label create "bug" --description "Something isn't working" --color "FF3B30"
# Update existing labels
gh label edit "bug" --description "Something isn't working" --color "FF3B30"
Step 2: Migrate issues
Before deleting obsolete labels, migrate issues:
# List issues with old label
OLD_LABEL="old-label-name"
NEW_LABEL="new-label-name"
ISSUES=$(gh issue list --label "$OLD_LABEL" --json number --jq '.[].number')
# Migrate each issue
for issue in $ISSUES; do
echo "Migrating issue #$issue from $OLD_LABEL to $NEW_LABEL"
gh issue edit $issue --remove-label "$OLD_LABEL" --add-label "$NEW_LABEL"
done
Migration strategies:
- Direct replacement: Old label → New label (1:1)
- Split: One old → Multiple new (e.g.,
feature → enhancement + domain)
- Consolidate: Multiple old → One new (e.g.,
high-priority + critical → security)
- Drop: Remove obsolete labels
Step 3: Clean up obsolete labels
After migration, delete old labels:
# Verify label has no remaining issues
REMAINING=$(gh issue list --label "old-label" --json number --jq 'length')
if [ "$REMAINING" -eq 0 ]; then
gh label delete "old-label"
echo "Deleted obsolete label: old-label"
else
echo "Warning: $REMAINING issues still use old-label"
fi
Common labels to clean up:
- Status labels:
todo, in-progress, done, backlog (use Status custom field)
- Priority labels:
high-priority, low-priority, p0, p1 (use Value/Effort custom fields)
- Value labels:
essential, nice-to-have (use Value custom field)
- Effort labels:
heavy, light, quick-win (use Effort custom field)
- Duplicate labels (e.g.,
documentation and docs)
- Vague labels (e.g.,
needs-work, help-wanted)
- Legacy project-specific labels
Step 4: Audit unlabeled issues
# Find unlabeled issues
gh issue list --label "" --limit 100 --json number,title
# Review and apply appropriate labels
for issue in $(gh issue list --label "" --json number --jq '.[].number' | head -20); do
gh issue view $issue
# gh issue edit $issue --add-label "appropriate-label"
done
Step 5: Document the system
Create or update .github/LABELS.md:
# Repository Labels
## Label Categories
### Critical Issues (Red-Orange)
- `bug` - Something isn't working
- `security` - Security-related issues
- `performance` - Performance improvements
### Quality (Green)
- `testing` - Test suite improvements
- `docs` - Documentation updates
### Infrastructure (Blue-Cyan)
- `ci` - Continuous integration
- `dependencies` - Dependency updates
## When to Use
**bug**: Broken functionality, errors, or unexpected behavior
**security**: Any security vulnerability or concern
**testing**: Test suite or testing infrastructure changes
**docs**: Documentation improvements
## Multiple Labels
Issues can have multiple labels:
- `bug` + `security`: Security vulnerability
- `enhancement` + `performance`: Performance-improving feature
## Migration History
### YYYY-MM-DD: Label system refresh
- **Reason**: [Initial setup | Periodic refresh | Project scope expansion]
- **Changes made**:
- Migrated `feature` → `enhancement`
- Consolidated `high-priority`, `urgent` → `security`
- Deleted obsolete labels: `wontfix`, `invalid`
- Added domain labels: `api`, `frontend`, `backend`
- **Issues affected**: XX issues migrated
**Maintenance schedule:**
- Review label system every 6-12 months
- Document each refresh with date and reason
- Update this file when label changes are made
Quality gates
Before completing, verify:
Expected outcomes
- Consistent label system aligned to repository needs
- Semantic colors that communicate priority/type visually
- Clear documentation for contributors
- Existing issues properly categorized
- Foundation for better issue triage and project management
- Maintenance schedule established
Repository type examples
API/Backend project
api, endpoint, database, authentication
bug, security, performance
testing, docs, ci
Frontend project
ui, ux, accessibility, design-system
bug, browser-compat, performance
testing, docs, dependencies
Data/Pipeline project
pipeline, validation, data-quality
bug, performance, config
testing, docs, dependencies
Library/Framework
api, breaking-change, deprecation
bug, enhancement, docs
examples, testing, dependencies
Integration with other skills
Works with:
gh-project-setup - Use during initial project setup
git-issue-create - References label system for new issues
gh-project-manage - Complements project field management
Triggers from:
- Repository onboarding workflows
- Project setup automation
- Issue creation detecting missing labels
- Team requesting better organization
1---2name: managing-repository-labels3description: Reviews existing repository issues, code structure, and domain to create or refresh a semantic label system with appropriate colors aligned to the repository's specific context and needs. Use for initial setup or periodic maintenance (every 6-12 months) when users mention "labels", "label organization", "repository cleanup", "label system", or when detecting labeling inconsistencies.4---5
6# Managing Repository Labels
7
8Analyze repository context and establish or refresh a semantic label system tailored to the project's domain and needs.
9
10## What you should do
11
12When invoked, help the user create or refresh their repository's label system by:
13
141. **Understanding the request** - Determine what's needed:
15 - Initial setup for new repository
16 - Periodic refresh (6-12 month cycle)
17 - Standardization across organization
18 - Migration from legacy labels
19
202. **Analyzing the repository** - Gather context:
21 - Technology stack and project type
22 - Existing issue patterns
23 - Current label usage and gaps
24 - Team terminology
25
263. **Designing the label system** - Create semantic labels:
27 - Core categories (bug, enhancement, question)
28 - Domain-specific labels (api, frontend, pipeline, etc.)
29 - Apply semantic color philosophy
30 - Ensure no redundancy or overlap
31
324. **Implementing changes** - Execute carefully:
33 - Create new labels with proper colors
34 - Migrate issues from old to new labels
35 - Delete obsolete labels (after verification)
36 - Audit and label unlabeled issues
37
385. **Documenting the system** - Create `.github/LABELS.md`:
39 - Label categories and descriptions
40 - Usage guidelines
41 - Migration history
42
43## When to use this skill
44
45**Trigger phrases:**
46- "Set up labels"
47- "Organize our labels"
48- "Label system is a mess"
49- "Standardize labels"
50- "Clean up labels"
51- "Refresh label system"
52
53**Proactive detection:**
54- Many unlabeled issues detected
55- Duplicate labels observed (e.g., `docs` and `documentation`)
56- Inconsistent label usage
57- Project scope has expanded
58- Team mentions label confusion
59
60**Scheduled maintenance:**
61- Every 6-12 months for active repositories
62- When merging multiple repositories
63- After significant project evolution
64
65## Analysis process
66
67### 1. Analyze repository context
68
69```bash
70# Get repository information
71REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)
72REPO_DESCRIPTION=$(gh repo view --json description -q .description)
73
74# List existing labels
75gh label list --json name,description,color --limit 100
76
77# Analyze recent issues for patterns
78gh issue list --limit 50 --json title,body,labels --state all
79```
80
81**Look for:**
82- Technology stack (languages, frameworks)
83- Issue patterns (security, performance, bugs, features)
84- Team terminology (what words do they use?)
85- Missing label coverage (unlabeled issues)
86
87### 2. Determine label categories
88
89**Core categories** (most repositories need):
90- **Nature**: bug, enhancement, question
91- **Domain-specific**: Labels specific to project type (api, frontend, backend)
92- **Quality**: testing, refactor, docs
93- **Infrastructure**: ci, dependencies, config
94- **Impact**: security, performance, accessibility
95
96> **Important**: Do NOT create labels for status (todo/done), priority (high/low), value (essential/nice-to-have), or effort (heavy/light). These should be managed as custom fields in GitHub Projects V2, not labels.
97
98**Repository-specific examples:**
99- **API project**: endpoint, schema, authentication
100- **Data project**: pipeline, validation, data-quality
101- **UI project**: ux, accessibility, design-system
102- **Library**: breaking-change, deprecation, api
103
104## Color assignment
105
106Use semantic color philosophy to communicate meaning visually. See [LABEL-COLORS.md](LABEL-COLORS.md) for complete reference.
107
108### Quick reference
109
110| Category | Hex Code | Use Case |
111|----------|----------|----------|
112| Critical (Red) | `FF3B30` | bug, breaking-change |
113| High Priority (Orange) | `FF9500` | security, performance |
114| Success (Green) | `34C759` | testing, quality |
115| Enhancement (Light Green) | `30D158` | enhancement, feature-request |
116| Refinement (Purple) | `AF52DE` | refactor, cleanup |
117| Infrastructure (Cyan) | `00C7BE` | ci, deployment |
118| Technical (Blue) | `007AFF` | dependencies, architecture |
119| Routine (Gray) | `8E8E93` | docs, config |
120
121### Color selection rules
122
1231. **Darker shades = higher urgency** within same color family
1242. **Never use pure red (`FF0000`)** - too alarming
1253. **Limit to 2-3 shades per color family** - avoid confusion
1264. **Test accessibility** - ensure WCAG AA contrast
1275. **Match GitHub defaults** - `bug` uses `FF3B30`
128
129## Implementation workflow
130
131### Step 1: Create or update labels
132
133```bash
134# Create new labels
135gh label create "bug" --description "Something isn't working" --color "FF3B30"
136
137# Update existing labels
138gh label edit "bug" --description "Something isn't working" --color "FF3B30"
139```
140
141### Step 2: Migrate issues
142
143Before deleting obsolete labels, migrate issues:
144
145```bash
146# List issues with old label
147OLD_LABEL="old-label-name"
148NEW_LABEL="new-label-name"
149
150ISSUES=$(gh issue list --label "$OLD_LABEL" --json number --jq '.[].number')
151
152# Migrate each issue
153for issue in $ISSUES; do
154 echo "Migrating issue #$issue from $OLD_LABEL to $NEW_LABEL"
155 gh issue edit $issue --remove-label "$OLD_LABEL" --add-label "$NEW_LABEL"
156done
157```
158
159**Migration strategies:**
160- **Direct replacement**: Old label → New label (1:1)
161- **Split**: One old → Multiple new (e.g., `feature` → `enhancement` + domain)
162- **Consolidate**: Multiple old → One new (e.g., `high-priority` + `critical` → `security`)
163- **Drop**: Remove obsolete labels
164
165### Step 3: Clean up obsolete labels
166
167After migration, delete old labels:
168
169```bash
170# Verify label has no remaining issues
171REMAINING=$(gh issue list --label "old-label" --json number --jq 'length')
172
173if [ "$REMAINING" -eq 0 ]; then
174 gh label delete "old-label"
175 echo "Deleted obsolete label: old-label"
176else
177 echo "Warning: $REMAINING issues still use old-label"
178fi
179```
180
181**Common labels to clean up:**
182- **Status labels**: `todo`, `in-progress`, `done`, `backlog` (use Status custom field)
183- **Priority labels**: `high-priority`, `low-priority`, `p0`, `p1` (use Value/Effort custom fields)
184- **Value labels**: `essential`, `nice-to-have` (use Value custom field)
185- **Effort labels**: `heavy`, `light`, `quick-win` (use Effort custom field)
186- Duplicate labels (e.g., `documentation` and `docs`)
187- Vague labels (e.g., `needs-work`, `help-wanted`)
188- Legacy project-specific labels
189
190### Step 4: Audit unlabeled issues
191
192```bash
193# Find unlabeled issues
194gh issue list --label "" --limit 100 --json number,title
195
196# Review and apply appropriate labels
197for issue in $(gh issue list --label "" --json number --jq '.[].number' | head -20); do
198 gh issue view $issue
199 # gh issue edit $issue --add-label "appropriate-label"
200done
201```
202
203### Step 5: Document the system
204
205Create or update `.github/LABELS.md`:
206
207```markdown
208# Repository Labels
209
210## Label Categories
211
212### Critical Issues (Red-Orange)
213- `bug` - Something isn't working
214- `security` - Security-related issues
215- `performance` - Performance improvements
216
217### Quality (Green)
218- `testing` - Test suite improvements
219- `docs` - Documentation updates
220
221### Infrastructure (Blue-Cyan)
222- `ci` - Continuous integration
223- `dependencies` - Dependency updates
224
225## When to Use
226
227**bug**: Broken functionality, errors, or unexpected behavior
228**security**: Any security vulnerability or concern
229**testing**: Test suite or testing infrastructure changes
230**docs**: Documentation improvements
231
232## Multiple Labels
233
234Issues can have multiple labels:
235- `bug` + `security`: Security vulnerability
236- `enhancement` + `performance`: Performance-improving feature
237
238## Migration History
239
240### YYYY-MM-DD: Label system refresh
241- **Reason**: [Initial setup | Periodic refresh | Project scope expansion]
242- **Changes made**:
243 - Migrated `feature` → `enhancement`
244 - Consolidated `high-priority`, `urgent` → `security`
245 - Deleted obsolete labels: `wontfix`, `invalid`
246 - Added domain labels: `api`, `frontend`, `backend`
247- **Issues affected**: XX issues migrated
248
249**Maintenance schedule:**
250- Review label system every 6-12 months
251- Document each refresh with date and reason
252- Update this file when label changes are made
253```
254
255## Quality gates
256
257Before completing, verify:
258
259- [ ] Labels cover all common issue types in repository
260- [ ] Colors follow semantic color philosophy
261- [ ] Descriptions are clear and actionable
262- [ ] No redundant or overlapping labels
263- [ ] All issues migrated from old to new labels
264- [ ] Obsolete labels verified empty and deleted
265- [ ] Documentation created in `.github/LABELS.md` with migration history
266- [ ] Unlabeled issues reviewed and labeled appropriately
267
268## Expected outcomes
269
270- Consistent label system aligned to repository needs
271- Semantic colors that communicate priority/type visually
272- Clear documentation for contributors
273- Existing issues properly categorized
274- Foundation for better issue triage and project management
275- Maintenance schedule established
276
277## Repository type examples
278
279### API/Backend project
280
281- `api`, `endpoint`, `database`, `authentication`
282- `bug`, `security`, `performance`
283- `testing`, `docs`, `ci`
284
285### Frontend project
286
287- `ui`, `ux`, `accessibility`, `design-system`
288- `bug`, `browser-compat`, `performance`
289- `testing`, `docs`, `dependencies`
290
291### Data/Pipeline project
292
293- `pipeline`, `validation`, `data-quality`
294- `bug`, `performance`, `config`
295- `testing`, `docs`, `dependencies`
296
297### Library/Framework
298
299- `api`, `breaking-change`, `deprecation`
300- `bug`, `enhancement`, `docs`
301- `examples`, `testing`, `dependencies`
302
303## Integration with other skills
304
305**Works with:**
306- **`gh-project-setup`** - Use during initial project setup
307- **`git-issue-create`** - References label system for new issues
308- **`gh-project-manage`** - Complements project field management
309
310**Triggers from:**
311- Repository onboarding workflows
312- Project setup automation
313- Issue creation detecting missing labels
314- Team requesting better organization