Get the FREE Ultimate OpenClaw Setup Guide →

gitlab-label

npx machina-cli add skill grandcamel/GitLab-Assistant-Skills/gitlab-label --openclaw
Files (1)
SKILL.md
5.1 KB

Label Skill

Label management operations for GitLab using the glab CLI.

Quick Reference

OperationCommandRisk
List labelsglab label list-
Create labelglab label create <name>⚠️

Risk Legend: - Safe | ⚠️ Caution | ⚠️⚠️ Warning | ⚠️⚠️⚠️ Danger

When to Use This Skill

ALWAYS use when:

  • User wants to manage project labels
  • User mentions "label", "tag" (for categorization), "category"
  • User wants to organize issues or MRs

NEVER use when:

  • User wants to apply labels to issues/MRs (use gitlab-issue or gitlab-mr)
  • User wants to manage git tags (use git commands or gitlab-release)

Available Commands

List Labels

glab label list [options]

Options:

FlagDescription
-P, --per-page=<n>Results per page
--allGet all labels

Examples:

# List all project labels
glab label list

# List with more results
glab label list --per-page=100

Create Label

glab label create <name> [options]

Options:

FlagDescription
-c, --color=<color>Label color (hex format, e.g., #ff0000)
-d, --description=<desc>Label description

Examples:

# Create label with default color
glab label create "needs-review"

# Create label with color
glab label create "bug" -c "#ff0000"

# Create label with color and description
glab label create "priority::high" \
  -c "#dc3545" \
  -d "High priority items requiring immediate attention"

# Create scoped label
glab label create "status::in-progress" \
  -c "#ffc107" \
  -d "Work in progress"

Common Label Patterns

Priority Labels

glab label create "priority::critical" -c "#dc3545" -d "Must fix immediately"
glab label create "priority::high" -c "#fd7e14" -d "Fix in current sprint"
glab label create "priority::medium" -c "#ffc107" -d "Fix soon"
glab label create "priority::low" -c "#28a745" -d "Nice to have"

Type Labels

glab label create "type::bug" -c "#d73a4a" -d "Something isn't working"
glab label create "type::feature" -c "#0366d6" -d "New feature request"
glab label create "type::docs" -c "#0075ca" -d "Documentation"
glab label create "type::refactor" -c "#6f42c1" -d "Code refactoring"

Status Labels

glab label create "status::backlog" -c "#6c757d" -d "In backlog"
glab label create "status::ready" -c "#17a2b8" -d "Ready to start"
glab label create "status::in-progress" -c "#ffc107" -d "Work in progress"
glab label create "status::review" -c "#007bff" -d "In review"
glab label create "status::done" -c "#28a745" -d "Completed"

Workflow Labels

glab label create "needs-review" -c "#d876e3" -d "Needs code review"
glab label create "needs-design" -c "#fbca04" -d "Needs design input"
glab label create "blocked" -c "#b60205" -d "Blocked by external dependency"
glab label create "help-wanted" -c "#008672" -d "Looking for contributors"

GitLab Scoped Labels

GitLab supports scoped labels using the :: separator:

priority::high
status::in-progress
type::bug

Only one label per scope can be applied to an issue/MR, making them mutually exclusive.

Common Workflows

Workflow 1: Set Up New Project Labels

# Create priority labels
glab label create "priority::critical" -c "#dc3545"
glab label create "priority::high" -c "#fd7e14"
glab label create "priority::medium" -c "#ffc107"
glab label create "priority::low" -c "#28a745"

# Create type labels
glab label create "type::bug" -c "#d73a4a"
glab label create "type::feature" -c "#0366d6"
glab label create "type::docs" -c "#0075ca"

Workflow 2: Apply Labels to Issues

# List available labels
glab label list

# Create issue with labels
glab issue create -t "Fix login bug" -l "type::bug,priority::high"

# Update issue labels
glab issue update 42 -l "status::in-progress"

Color Reference

Common colors for labels:

ColorHexUse For
Red#dc3545Bugs, critical, blocked
Orange#fd7e14High priority, warning
Yellow#ffc107Medium priority, in-progress
Green#28a745Done, low priority, good first issue
Blue#007bffFeatures, info, review
Purple#6f42c1Refactor, enhancement
Gray#6c757dBacklog, wontfix

Troubleshooting

IssueCauseSolution
Authentication failedInvalid/expired tokenRun glab auth login
Label already existsDuplicate nameUse different name or update existing
Invalid colorWrong formatUse hex format: #RRGGBB
Permission deniedNot maintainerNeed maintainer+ role

Related Documentation

Source

git clone https://github.com/grandcamel/GitLab-Assistant-Skills/blob/main/skills/gitlab-label/SKILL.mdView on GitHub

Overview

Manages GitLab project labels via the glab CLI. It covers listing labels, creating new ones with color and descriptions, and building scoped labels (e.g., priority::high, status::in-progress) to organize issues and merge requests. This skill helps enforce labeling conventions and streamline project workflows.

How This Skill Works

It leverages glab label list to read labels and glab label create to add or update labels, using -c for color and -d for description. Scoped labels use the :: separator and are mutually exclusive within a single scope, enabling consistent filtering and reporting.

When to Use It

  • You want to list all project labels to audit what's defined.
  • You want to create new labels with a specific color and description.
  • You want to organize labels using patterns like type::, status::, or priority::.
  • You want to adjust colors or descriptions to align with project conventions.
  • You want to understand how scoped labels affect labeling of issues/MRs.

Quick Start

  1. Step 1: List current labels with glab label list.
  2. Step 2: Create a new label with color and optional description, e.g. glab label create "needs-review" -c "#d876e3" -d "Needs code review".
  3. Step 3: Confirm the new label by listing labels again (glab label list or glab label list --all).

Best Practices

  • Audit existing labels with glab label list before creating new ones.
  • Use consistent naming for scoped labels (e.g., type::bug, status::in-progress).
  • Choose distinct, accessible hex colors and document their meaning.
  • Write concise, useful descriptions for each label.
  • Test label creation and review labeling workflows on a sample issue/MR.

Example Use Cases

  • glab label create "priority::critical" -c "#dc3545" -d "Must fix immediately"
  • glab label create "type::bug" -c "#d73a4a" -d "Something isn't working"
  • glab label create "status::in-progress" -c "#ffc107" -d "Work in progress"
  • glab label create "needs-review" -c "#d876e3" -d "Needs code review"
  • glab label create "blocked" -c "#b60205" -d "Blocked by external dependency"

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers