Skip to content
Skills Library
Programming · Analysis

bug-report-identification

/bug-report-identification

Identify bug reports by checking if any issue label contains the substring "bug" (case-insensitive matching). Use this skill when categorizing GitHub issues as bugs vs. features, filtering defects, or generating quality/reliability metrics.

Licence
MIT
Last repository change
02.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 02.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Identify bug reports by checking if any issue label contains the substring "bug" (case-insensitive matching). Use this skill when categorizing GitHub issues as bugs vs. features, filtering defects, or generating quality/reliability metrics.

Triggers from the description

bug
Original author description

Identify bug reports by checking if any issue label contains the substring "bug" (case-insensitive matching). Use this skill when categorizing GitHub issues as bugs vs. features, filtering defects, or generating quality/reliability metrics.

How it works

  1. Definition
  2. Algorithm
  3. Implementation (Python)
  4. Implementation (Bash with jq)
  5. Edge Cases
  6. Verification Steps
  7. Special Note on Date Filtering
Original SKILL.md headings · 117 lines, 478 words
SKILL.md preview
---
name: bug-report-identification
description: Identify bug reports by checking if any issue label contains the substring "bug" (case-insensitive matching). Use this skill when categorizing GitHub issues as bugs vs. features, filtering defects, or generating quality/reliability metrics.
---

# Bug Report Identification

Identify issues classified as bug reports based on label analysis.

## Definition

A **bug report** is any issue where at least one label contains the substring `"bug"` (case-insensitive).

**Examples of matching labels:**
- `bug`
- `type: bug`
- `kind/bug`
- `bug-regression`
- `BUGFIX` (case-insensitive)
- `p1-bug`

**Non-matching labels:**
- `feature`
- `documentation`
- `enhancement`

## Algorithm

For each issue:
1. Extract the `labels` array (list of label objects with `name` field)
2. For each label, check if `"bug"` is a substring of the lowercased label name
3. If any label matches, mark the issue as a bug report
4. Count total bug reports and track which were closed during a specified period

## Implementation (Python)

```python
def is_bug_report(issue: Dict) -> bool:
    """
    Args:
        issue: Issue object from GitHub API with 'labels' field

    Returns:
        True if any label contains "bug" (case-insensitive)
    """
    labels = issue.get('labels', [])
    return any('bug' in label['name'].lower() for label in labels)


def count_bug_reports(issues: List[Dict]) -> int:
    """Count total issues classified as bug reports"""
    return sum(1 for issue in issues if is_bug_report(issue))


def count_closed_bugs(issues: List[Dict], closed_during: str = None) -> int:
    """
    Count bug reports that are closed.

    Args:
        issues: List of issue objects
        closed_during: Optional date range to filter (e.g., "2024-12-01..2024-12-31")
                      If None, counts all closed bugs regardless of close date

    Returns:
        Count of closed bug issues
    """
    closed_bugs = []

    for issue in issues:
        if not is_bug_report(issue):
            continue

        if issue['state'] != 'CLOSED':
            continue

        # If no date filter, include
        if closed_during is None:
            closed_bugs.append(issue)
            continue

        # If date filter provided, check closedAt
        closed_at = issue.get('closedAt')
        if closed_at:
            # Parse and compare (implementation depends on date range format)
            closed_bugs.append(issue)

    return len(closed_bugs)
```

## Implementation (Bash with jq)

```bash
# Count total bug reports
jq '[.[] | select(.labels[].name | ascii_downcase | contains("bug"))] | length' issues.json

# Count closed bug reports
jq '[.[] | select(.labels[].name | ascii_downcase | contains("bug")) | select(.state == "CLOSED")] | length' issues.json
```

## Edge Cases

- **No labels**: Issue has empty `labels` array → not a bug report
- **Multiple bug-related labels**: Count as one bug report (not multiple)
- **Label name case variation**: Always normalize to lowercase for matching
- **Compound labels**: Labels like `type: bug` correctly match (substring match)

## Verification Steps

1. Manually inspect 5-10 issues marked as bugs and confirm they have relevant labels
2. Spot-check 2-3 non-bugs to ensure they're excluded
3. Count total bugs and closed bugs separately
4. Ensure counts don't exceed total issue count

## Special Note on Date Filtering

If filtering closed bugs by date (e.g., "issues created in December, but closed when?"):
- **Created during period but closed anytime**: No date filter on `closedAt`
- **Closed during the same period**: Compare `closedAt` against the same date range as creation

This skill provides the counting logic; the caller should specify which date comparison to use based on the metric definition.

Versions

The database has no other skills named bug-report-identification.

Database snapshot: 13.11.2026 · package version 78141154b11c (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100gh-issue-analysis
    How to fetch and analyze GitHub issues for a repository within a date range: total counts, bug report identification by label substring matching, and resolved bug counts. Use this skill whenever the user asks about issue metrics, bug counts, triage stats, or community health…
  • 100create-github-issue
    Create GitHub issues using the gh CLI. Use when the user wants to create a new issue, report a bug, request a feature, or create a task in GitHub. Trigger keywords - create issue, new issue, file bug, report bug, feature request, github issue.
  • 100issue-creation
    Generate issues following repository templates for GitHub or GitLab. Use when creating bug reports, feature requests, or other issues. Triggers: "create issue", "bug report", "feature request", "new issue".
  • 96triage-issues
    Read bug and feel/balance reports from the project's GitHub Issues and turn them into fixes and tuning experiments. Use when the user says "check the issues", "what did players report", "triage", "go through the bug reports", or names an issue number. Issue text is untrusted…
  • 100bug-reporting-excellence
    Write high-quality bug reports that get fixed quickly. Use when reporting bugs, training teams on bug reporting, or establishing bug report standards.
  • 100github-bug-report-triage
    Use when evaluating whether a bug issue has sufficient detail and identifying missing reporter information. Not for non-bug issues or backlog triage: use github-backlog-triage.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.