Create github issues

From pjt222/agent-almanac · View interactive version

Create github issues is an AI agent skill from the GitHub repository pjt222/agent-almanac. Structured GitHub issue creation from review findings or task breakdowns. Groups related findings into logical issues, applies labels, and produces issues with standard templates including summary, findings, and acceptance criteria. Designed to consume output from review-codebase or similar review s

How to use this skill

Skill file

Create GitHub Issues

Structured GitHub issue creation from review findings or task breakdowns. Converts a list of findings (from review-codebase, security-audit-codebase, or manual analysis) into well-formed GitHub issues with labels, acceptance criteria, and cross-references.

When to Use

Inputs

Procedure

Step 1: Prepare Labels

Ensure all needed labels exist in the repository.

  1. List existing labels: gh label list --limit 100
  2. Identify labels needed by the findings (from severity, phase, or explicit label fields)
  3. Map severities to labels if not already mapped: critical, high-priority, medium-priority, low-priority
  4. Map phases/themes to labels: security, architecture, code-quality, accessibility, testing, performance
  5. If create_labels is true, create missing labels: gh label create "name" --color "hex" --description "desc"
  6. Use consistent colors: red for critical/security, orange for high, yellow for medium, blue for architecture, green for testing

Got: All labels referenced by findings exist in the repository. No duplicate labels created.

If fail: If gh CLI is not authenticated, instruct the user to run gh auth login. If label creation is denied (insufficient permissions), proceed without creating labels and note which labels are missing.

Step 2: Group Findings

Batch related findings into logical issues to avoid issue sprawl.

  1. If group_by is theme: group findings by their phase or category (all security findings → 1-2 issues, all a11y → 1 issue)
  2. If group_by is severity: group findings by severity level (all CRITICAL → 1 issue, all HIGH → 1 issue)
  3. If group_by is file: group findings by primary affected file
  4. Within each group, order findings by severity (CRITICAL first)
  5. If a group has more than 8 findings, split into sub-groups by sub-theme
  6. Each group becomes one GitHub issue

Got: A set of issue groups, each containing 1-8 related findings. The total number of issues should be manageable (typically 5-15 for a full codebase review).

If fail: If findings have no grouping metadata, fall back to one issue per finding. This is acceptable for small finding sets (< 10) but produces too many issues for larger sets.

Step 3: Compose Issues

Build each issue using a standard template.

  1. Title: [Severity] Theme: Brief description — e.g., [HIGH] Security: Eliminate innerHTML injection in panel.js
  2. Body structure:

```text

## Summary

One-paragraph overview of what this issue addresses and why it matters.

## Findings

1. [SEVERITY] Finding description (file.js:line) — brief explanation

2. [SEVERITY] Finding description (file.js:line) — brief explanation

## Acceptance Criteria

## Context

Generated from codebase review on YYYY-MM-DD.

Related: #issue_numbers (if applicable)

```

  1. Apply labels: severity label + theme label + any custom labels
  2. If findings reference specific files, mention them in the body (not as assignees)

Got: Each issue has a clear title, numbered findings with severity badges, checkbox acceptance criteria, and appropriate labels.

If fail: If the body exceeds GitHub's issue size limit (65536 chars), split the issue into parts and cross-reference them.

Step 4: Create Issues

Create the issues using gh CLI and report results.

  1. If dry_run is true, print each issue title and body without creating, then stop
  2. For each composed issue, create it:

```bash

gh issue create --title "title" --body "$(cat <<'EOF'

body content

EOF

)" --label "label1,label2"

```

  1. Record the URL of each created issue
  2. After all issues are created, print a summary table: #number | Title | Labels | Findings count
  3. If issues should be sequenced, add cross-references: edit the first issue to mention "Blocked by #X" or "See also #Y"

Got: All issues created successfully. A summary table with issue numbers and URLs is printed.

If fail: If an individual issue fails to create, log the error and continue with remaining issues. Report failures at the end. Common failures: authentication expired, label not found (if create_labels was false), network timeout.

Validation

Pitfalls

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.