Classifies and applies labels to GitHub issues by matching content against repository instructions.

Install

mkdir -p .claude/skills/label-issue && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15237" && unzip -o skill.zip -d .claude/skills/label-issue && rm skill.zip

Installs to .claude/skills/label-issue

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Classify and label GitHub issues based on repository-specific labeling instructions. Use when (1) auto-labeling new issues, (2) classifying issue types (bug, feature, etc.), (3) adding priority or area labels, (4) applying consistent labeling rules. Triggers on requests like "label issue", "classify issue", "what labels should this issue have", "add labels to issue".
369 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Fetch labeling instructions from `.github/label-instructions.md`
  • Fetch GitHub issue details (title, body, existing labels)
  • Analyze issue content against labeling rules
  • Determine appropriate labels based on keyword matching and issue type
  • Apply labels to GitHub issues via Python script and GitHub API
  • Report applied labels with reasoning and existing labels

How it works

The skill fetches labeling instructions and issue details, analyzes the issue content against predefined rules, determines suitable labels, and applies them using a Python script that interacts with the GitHub API.

Inputs & outputs

You give it
GitHub issue URL or issue number with repository (owner/repo)
You get back
Applied labels to the GitHub issue and a report detailing the changes

When to use label-issue

  • Auto-label new issues
  • Classify issue types
  • Apply priority labels
  • Maintain consistent issue categorization

About this skill

Label Issue Skill

Automatically classify and label GitHub issues based on repository-specific labeling instructions.

Overview

This skill analyzes GitHub issue content (title, body, comments) and applies appropriate labels based on labeling rules defined in the target repository's .github/label-instructions.md file.

Workflow

  1. Input: Receive issue URL or issue number with repository (owner/repo)
  2. Fetch labeling instructions: Read .github/label-instructions.md from the repository
  3. Fetch issue: Get issue details (title, body, existing labels)
  4. Analyze issue: Match issue content against labeling rules
  5. Determine labels: Select appropriate labels based on:
    • Keyword matching
    • Issue type detection (bug, feature, question, etc.)
    • Priority assessment
    • Area/component identification
  6. Apply labels: Use Python script to add labels via GitHub API
  7. Report: Confirm labels applied with reasoning

Reading Labeling Instructions

Fetch .github/label-instructions.md from the target repository using GitHub MCP tools. The file should define:

  • Available labels: List of valid labels with descriptions
  • Labeling rules: Criteria for when to apply each label
  • Keywords mapping: Keywords that trigger specific labels

For template format, see references/label_instructions_template.md.

If .github/label-instructions.md is not found:

  1. Fetch the list of labels defined in the target repository using github/list_labels
  2. Create a brief summary of available labels based on their names and descriptions
  3. Use the summary to determine which labels best match the issue content

Issue Analysis

Analyze issue content to determine appropriate labels by:

  1. Type Detection: Match issue keywords against label names/descriptions
  2. Priority Assessment: Identify severity indicators in the issue
  3. Area Detection: Match issue content against area-specific labels

Applying Labels

Run the bundled Python script to add labels:

# Install dependency
pip install requests

# Add labels to an issue
python scripts/label_issue.py <owner> <repo> <issue_number> <labels>

# Example: add bug and priority:high labels
python scripts/label_issue.py microsoft vscode 123 "bug,priority:high"

# Example: add multiple area labels
python scripts/label_issue.py microsoft vscode 123 "bug,area:ui,area:api"

The script scripts/label_issue.py handles the GitHub API call.

Example Commands

Output

Report the labeling decision with:

  • Labels applied: List of labels added
  • Reasoning: Why each label was chosen
    • Type: "Detected as bug (keywords: 'not working', 'error')"
    • Priority: "High priority (affects core functionality)"
    • Area: "Matched 'ui' area (keywords: button, dialog)"
  • Existing labels: Labels already on the issue (not modified)

Example Output

✅ Labels added to issue #123: bug, priority:high, area:ui

**Reasoning:**
- **bug**: Issue describes broken functionality ("button not working")
- **priority:high**: Core feature affected, no workaround mentioned
- **area:ui**: UI-related keywords detected (button, click, display)

**Existing labels:** needs-triage (unchanged)

Configuration

The skill requires:

  1. GITHUB_ACCESS_TOKEN or GITHUB_PAT environment variable with repo scope
  2. label-instructions.md in target repository (optional but recommended)

Fallback Behavior

If labeling instructions are not found:

  1. Use default type detection rules
  2. Skip priority and area labels
  3. Report that default rules were used

When not to use it

  • When not classifying or labeling GitHub issues
  • When repository-specific labeling instructions are not available or desired

Prerequisites

GITHUB_ACCESS_TOKEN or GITHUB_PAT environment variable with `repo` scopePython requests library

Limitations

  • Requires `GITHUB_ACCESS_TOKEN` or `GITHUB_PAT` with `repo` scope
  • Relies on `.github/label-instructions.md` for specific rules, otherwise uses default type detection
  • The Python script `scripts/label_issue.py` is used for applying labels

How it compares

It automates GitHub issue labeling based on repository-specific instructions and content analysis, providing consistent categorization unlike manual labeling.

Compared to similar skills

label-issue side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
label-issue (this skill)06moReviewIntermediate
triage-issue16moReviewIntermediate
proof-of-work16moNo flagsIntermediate
github-triage03moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

Search skills

Search the agent skills registry