Fetch GitHub Issue with AI Analysis

VerifiedSafe

Retrieve complete GitHub issue details including AI-generated analysis comment for use in architecture planning.

Sby Skills Guide Bot
DevelopmentIntermediate
7/28/2026
Claude CodeCursorCodex
#github-issues#gh-cli#workflow-automation#issue-analysis#bash

Recommended for

Automated summary

Fetches a GitHub issue's metadata and, when available, the github-actions bot's AI Issue Analysis comment, then returns them as structured JSON for workflow planning.

Strengths

  • Validates the issue number before calling gh, avoiding malformed requests.
  • Detects the ai-analyzed label and filters comments to the github-actions[bot] author.
  • Provides JSON output and optional extraction of named analysis sections for downstream planning.
  • Includes both basic issue fields and AI analysis in one pass.

Limitations

  • Assumes an authenticated gh CLI plus jq and sed, and is tailored to the WescoBar conductor workflow.
  • Section parsing depends on exact Markdown headings and can truncate or miss content when the AI comment format changes.
  • Only looks for one bot-authored comment containing 'AI Issue Analysis'; it does not handle pagination or other bot names.
When to use it

Use when starting or resuming a conductor workflow phase that needs issue context plus the AI-generated analysis comment.

When not to use it

Do not use for issues that lack the ai-analyzed label or when you need general GitHub issue search/reporting rather than a single issue fetch.

Security analysis

Safe
Quality score88/100

The skill uses standard GitHub CLI (gh) and text processing tools (jq, sed, grep) to fetch and parse issue data and comments. All operations are read-only and non-destructive. No destructive commands, no exfiltration of secrets, no obfuscated payloads, and no network calls beyond the official GitHub API via gh. The bash commands are straightforward and legitimate for the stated purpose.

No concerns found

How this analysis is made

Examples

Fetch analyzed issue for planning
Fetch GitHub issue #137 for this repo, including the AI Issue Analysis comment from github-actions[bot], and return the structured JSON for conductor Phase 1.
Resume workflow from issue
Resume the conductor workflow using issue #204: fetch its labels, body, and any AI analysis sections, then summarize the architectural alignment and files affected.
Check AI analysis presence
Check whether issue #88 has the ai-analyzed label and, if present, extract the AI analysis testing strategy and implementation suggestions.

name: fetch-github-issue-analysis description: Fetch GitHub issue details with AI analysis comment from github-actions bot, extracting structured data for architecture planning in WescoBar workflows

Fetch GitHub Issue Analysis

Purpose

Retrieve complete GitHub issue information including title, body, labels, and AI-generated analysis comment (if present) for use in conductor workflow Phase 1.

When to Use

  • Conductor workflow Phase 1 (Issue Discovery and Planning)
  • Workflow resumption with existing issue number
  • Issue selection and validation
  • Architecture planning with AI insights

Instructions

Step 1: Fetch Basic Issue Data

# Safe parameter handling with validation
ISSUE_NUMBER=${1:-""}

# Validate required parameter
if [ -z "$ISSUE_NUMBER" ]; then
  echo "❌ Error: Issue number required"
  echo "Usage: fetch-github-issue-analysis <issue_number>"
  exit 1
fi

# Get issue details
ISSUE_DATA=$(gh issue view "$ISSUE_NUMBER" --json title,body,labels,number,state)

# Extract fields
ISSUE_TITLE=$(echo "$ISSUE_DATA" | jq -r '.title')
ISSUE_BODY=$(echo "$ISSUE_DATA" | jq -r '.body')
ISSUE_STATE=$(echo "$ISSUE_DATA" | jq -r '.state')
LABELS=$(echo "$ISSUE_DATA" | jq -r '[.labels[].name] | join(",")')

Step 2: Check for AI Analysis Label

# Check if issue has ai-analyzed label
if echo "$LABELS" | grep -q "ai-analyzed"; then
  HAS_AI_ANALYSIS=true
else
  HAS_AI_ANALYSIS=false
fi

Step 3: Fetch AI Analysis Comment (if exists)

if [ "$HAS_AI_ANALYSIS" = true ]; then
  # Get repository name with owner
  REPO_NAME=$(gh repo view --json nameWithOwner --jq .nameWithOwner)

  # Fetch AI analysis comment from github-actions bot
  AI_ANALYSIS=$(gh api "repos/$REPO_NAME/issues/$ISSUE_NUMBER/comments" \
    --jq '.[] | select(.user.login == "github-actions[bot]" and (.body | contains("AI Issue Analysis"))) | .body')

  if [ -n "$AI_ANALYSIS" ]; then
    AI_ANALYSIS_FOUND=true
  else
    AI_ANALYSIS_FOUND=false
  fi
else
  AI_ANALYSIS=""
  AI_ANALYSIS_FOUND=false
fi

Step 4: Return Structured Output

Output as JSON for easy parsing by conductor:

{
  "issue": {
    "number": 137,
    "title": "Add user dark mode preference toggle",
    "body": "User wants to...",
    "state": "open",
    "labels": ["feature", "frontend", "ai-analyzed"]
  },
  "aiAnalysis": {
    "found": true,
    "content": "# AI Issue Analysis\n\n## Architectural Alignment...",
    "sections": {
      "architecturalAlignment": "...",
      "technicalFeasibility": "...",
      "implementationSuggestions": "...",
      "filesAffected": [...],
      "testingStrategy": "..."
    }
  }
}

Step 5: Parse AI Analysis Sections (Optional)

If AI analysis found, extract key sections:

# Extract Architectural Alignment section
ARCH_ALIGNMENT=$(echo "$AI_ANALYSIS" | sed -n '/## Architectural Alignment/,/## /p' | sed '$d')

# Extract Technical Feasibility section
TECH_FEASIBILITY=$(echo "$AI_ANALYSIS" | sed -n '/## Technical Feasibility/,/## /p' | sed '$d')

# Extract Implementation Suggestions section
IMPL_SUGGESTIONS=$(echo "$AI_ANALYSIS" | sed -n '/## Implementation Suggestions/,/## /p' | sed '$d')

# Extract Files/Components section
FILES_AFFECTED=$(echo "$AI_ANALYSIS" | sed -n '/## Files/,/## /p' | sed '$d')

# Extract Testing Strategy section
TESTING_STRATEGY=$(echo "$AI_ANALYSIS" | sed -n '/## Testing Strategy/,/## /p' | sed '$d')

Output Format

Success Case

{
  "status": "success",
  "issue": {
    "number": 137,
    "title": "Add user dark mode preference toggle",
    "state": "open",
    "labels": ["feature", "frontend", "ai-analyzed"]
  },
  "aiAnalysis": {
    "found": true,
    "architecturalAlignment": "Aligns with component-based architecture...",
    "technicalFeasibility": "High - uses existing React patterns...",
    "implementationSuggestions": "1. Add darkMode to state\n2. Create toggle component...",
    "filesAffected": ["src/components/Settings.tsx", "src/context/WorldContext.tsx"],
    "testingStrategy": "Unit tests for toggle, integration tests for persistence"
  }
}

No AI Analysis Case

{
  "status": "success",
  "issue": {
    "number": 123,
    "title": "Fix character portrait loading",
    "state": "open",
    "labels": ["bug", "frontend"]
  },
  "aiAnalysis": {
    "found": false
  }
}

Integration with Conductor

Used in conductor Phase 1, Step 1:

**Step 1: Issue Selection**

If issue number provided by user:

Use `fetch-github-issue-analysis` skill:
- Input: issue_number
- Output: issue details + AI analysis (if available)

If AI analysis found:
  ✅ Use AI insights for architecture planning
  📋 Extract: architectural alignment, implementation suggestions, testing strategy
  → Skip orchestrator selection, proceed to architecture review

If no AI analysis:
  → Delegate to orchestrator for issue selection logic

Error Handling

Issue Not Found

{
  "status": "error",
  "error": "Issue #999 not found",
  "code": "NOT_FOUND"
}

Issue Closed

{
  "status": "warning",
  "issue": {...},
  "warning": "Issue is closed - confirm before proceeding"
}

Rate Limit

{
  "status": "error",
  "error": "GitHub API rate limit exceeded",
  "code": "RATE_LIMIT",
  "retryAfter": 3600
}

Related Skills

  • parse-ai-analysis - Deep parsing of AI analysis sections
  • select-optimal-issue - Backlog selection when no issue specified
  • create-tracking-issue - Create new issues

Examples

Example 1: Issue with AI Analysis

# Input
fetch-github-issue-analysis 137

# Output
{
  "status": "success",
  "issue": {
    "number": 137,
    "title": "Add user dark mode preference toggle"
  },
  "aiAnalysis": {
    "found": true,
    "architecturalAlignment": "Aligns with React Context patterns..."
  }
}

Example 2: Issue without AI Analysis

# Input
fetch-github-issue-analysis 123

# Output
{
  "status": "success",
  "issue": {
    "number": 123,
    "title": "Fix character portrait loading"
  },
  "aiAnalysis": {
    "found": false
  }
}

Best Practices

  1. Always check issue state - Warn if closed
  2. Cache AI analysis - Avoid repeated API calls
  3. Handle rate limits - Implement exponential backoff
  4. Validate JSON output - Ensure well-formed response
  5. Extract sections carefully - AI analysis format may vary

Notes

  • AI analysis format is defined by github-actions bot
  • Comment must contain "AI Issue Analysis" heading
  • Sections may vary based on issue type
  • Always validate AI analysis exists before parsing sections

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/fetch-github-issue-with-ai-analysis-ms47vpx5/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/fetch-github-issue-with-ai-analysis-ms47vpx5' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/fetch-github-issue-with-ai-analysis-ms47vpx5/download' --output '.skill-downloads/fetch-github-issue-with-ai-analysis-ms47vpx5/SKILL.md.part' && mv '.skill-downloads/fetch-github-issue-with-ai-analysis-ms47vpx5/SKILL.md.part' '.skill-downloads/fetch-github-issue-with-ai-analysis-ms47vpx5/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/fetch-github-issue-with-ai-analysis-ms47vpx5/SKILL.md' && test -s '.skill-downloads/fetch-github-issue-with-ai-analysis-ms47vpx5/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/fetch-github-issue-analysis' && cp -R '.skill-downloads/fetch-github-issue-with-ai-analysis-ms47vpx5' '.claude/skills/fetch-github-issue-analysis'

Cursor
test -f '.skill-downloads/fetch-github-issue-with-ai-analysis-ms47vpx5/SKILL.md' && test -s '.skill-downloads/fetch-github-issue-with-ai-analysis-ms47vpx5/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/fetch-github-issue-analysis' && cp -R '.skill-downloads/fetch-github-issue-with-ai-analysis-ms47vpx5' '.cursor/skills/fetch-github-issue-analysis'

Codex
test -f '.skill-downloads/fetch-github-issue-with-ai-analysis-ms47vpx5/SKILL.md' && test -s '.skill-downloads/fetch-github-issue-with-ai-analysis-ms47vpx5/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/fetch-github-issue-analysis' && cp -R '.skill-downloads/fetch-github-issue-with-ai-analysis-ms47vpx5' '.agents/skills/fetch-github-issue-analysis'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/fetch-github-issue-with-ai-analysis-ms47vpx5'

openskills read 'fetch-github-issue-with-ai-analysis-ms47vpx5'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/fetch-github-issue-with-ai-analysis-ms47vpx5/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills