Claude Skills Guide

Claude Code GitHub Discussions Summarizer Workflow

GitHub Discussions have become the go-to place for open-source communities to ask questions, share ideas, and collaborate. But with active communities, discussions can quickly accumulate into hundreds of threads. Manually reading through all of them wastes valuable developer time. This guide shows you how to build an automated summarization workflow using Claude Code to efficiently digest GitHub Discussions and extract key insights.

Why Automate Discussion Summaries?

Every active repository faces the same challenge: valuable information gets buried in long discussion threads. Community members ask similar questions repeatedly. Contributors miss important decisions buried in comments. Maintainers spend hours catching up on conversations they couldn’t attend in real time.

An automated summarizer solves these problems by:

Prerequisites

Before building your summarizer workflow, ensure you have:

Core Architecture

The workflow consists of three main components:

  1. Discussion Fetcher: Retrieves discussions from a GitHub repository using the GitHub API
  2. Content Processor: Extracts relevant information from each discussion
  3. Summary Generator: Uses Claude Code to generate concise, actionable summaries

Setting Up the Environment

Create a new directory for your workflow and set up the necessary configuration:

mkdir -p ~/github-discussion-summarizer
cd ~/github-discussion-summarizer

Create a configuration file to store your settings:

# config.env
export GITHUB_TOKEN="your_github_personal_access_token"
export REPO_OWNER="your-username"
export REPO_NAME="your-repo"
export OUTPUT_DIR="./summaries"

Fetching GitHub Discussions

The first step is retrieving discussions from your target repository. Here’s a shell script that fetches open discussions:

#!/bin/bash
# fetch_discussions.sh

source config.env

# Fetch open discussions with GraphQL API
GRAPHQL_QUERY='{
  repository(owner: "'"$REPO_OWNER"'", name: "'"$REPO_NAME"'") {
    discussions(first: 20, states: OPEN, orderBy: {field: UPDATED_AT, direction: DESC}) {
      nodes {
        title
        number
        author { login }
        createdAt
        updatedAt
        comments(first: 10) {
          nodes {
            author { login }
            body
            createdAt
          }
        }
      }
    }
  }
}'

curl -s -X POST \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"query\": \"$GRAPHQL_QUERY\"}" \
  https://api.github.com/graphql > "$OUTPUT_DIR/discussions_raw.json"

This script uses GitHub’s GraphQL API to fetch the 20 most recently updated open discussions along with their comments.

Processing Discussion Data

Once you have the raw discussion data, you need to format it for Claude Code. Create a script to extract and structure the content:

#!/bin/bash
# process_discussions.sh

OUTPUT_DIR="./summaries"

# Extract individual discussions to JSON files
jq -r '.data.repository.discussions.nodes[] | @base64' "$OUTPUT_DIR/discussions_raw.json" | while read -r encoded; do
  discussion=$(echo "$encoded" | base64 --decode)
  number=$(echo "$discussion" | jq -r '.number')
  title=$(echo "$discussion" | jq -r '.title')
  
  # Create formatted input for Claude
  {
    echo "Discussion #$number: $title"
    echo "Author: $(echo "$discussion" | jq -r '.author.login')"
    echo "Created: $(echo "$discussion" | jq -r '.createdAt')"
    echo ""
    echo "Comments:"
    echo "$discussion" | jq -r '.comments.nodes[] | "--- \nAuthor: \(.author.login)\n\(.body)\n"'
  } > "$OUTPUT_DIR/input_$number.txt"
  
  echo "Processed discussion #$number: $title"
done

Building the Summary Prompt

The key to getting useful summaries is crafting an effective prompt. Here’s a prompt template optimized for GitHub Discussions:

# summary_prompt.txt
You are an expert technical writer helping a development team stay informed about community discussions.

Analyze the following GitHub Discussion and provide a structured summary:

## Discussion Title
[TITLE]

## Author
[AUTHOR]

## Key Points and Answers
- Summarize the main question or topic (2-3 sentences)
- List any definitive answers or solutions provided
- Note any unresolved questions

## Action Items
- Any tasks or decisions that need follow-up
- Bugs or feature requests mentioned
- Questions requiring expertise from maintainers

## Summary for Team
Write a 3-4 sentence summary that a developer could read to understand the discussion without reading all comments.

---

Now analyze this discussion:

Generating Summaries with Claude Code

Now create the main automation script that processes each discussion through Claude Code:

#!/bin/bash
# generate_summaries.sh

source config.env
OUTPUT_DIR="./summaries"
PROMPT_TEMPLATE="./summary_prompt.txt"

# Ensure output directory exists
mkdir -p "$OUTPUT_DIR/summaries"

for input_file in "$OUTPUT_DIR"/input_*.txt; do
  filename=$(basename "$input_file")
  discussion_num=$(echo "$filename" | sed 's/input_//;s/.txt//')
  
  echo "Generating summary for discussion #$discussion_num..."
  
  # Combine prompt template with discussion content
  cat "$PROMPT_TEMPLATE" "$input_file" > "$OUTPUT_DIR/temp_prompt.txt"
  
  # Run Claude Code to generate summary
  claude Code --print < "$OUTPUT_DIR/temp_prompt.txt" > "$OUTPUT_DIR/summaries/summary_$discussion_num.md"
  
  echo "✓ Summary generated for discussion #$discussion_num"
  
  # Clean up temp file
  rm "$OUTPUT_DIR/temp_prompt.txt"
done

echo "All summaries generated!"

Advanced Features

Once you have the basic workflow running, consider adding these enhancements:

Scheduled Automation

Use cron to run your summarizer daily:

# Add to crontab
0 9 * * * cd ~/github-discussion-summarizer && ./generate_summaries.sh

Category Filtering

Modify the GraphQL query to focus on specific discussion categories:

discussions(first: 20, first: 10, category: {slug: "q-and-a"}) {

Notification Integration

Send summaries to Slack or Discord using webhooks:

# slack_notification.sh
WEBHOOK_URL="your_slack_webhook"
SUMMARY_FILE="$1"

curl -s -X POST "$WEBHOOK_URL" \
  -H 'Content-Type: application/json' \
  -d "{\"text\": \"New Discussion Summary available: $(cat $SUMMARY_FILE)\"}"

Best Practices

When implementing this workflow in production, keep these tips in mind:

Conclusion

Automating GitHub Discussion summaries with Claude Code transforms how your team consumes community feedback. Instead of spending hours scanning through threads, developers can quickly review concise summaries and focus on high-value work. The workflow is flexible—start with the basic version and extend it as your needs evolve.

Start building your summarizer today, and you’ll wonder how you ever managed without it.

Built by theluckystrike — More at zovo.one