Skip to content

Instantly share code, notes, and snippets.

@sdmcraft
Last active February 10, 2026 09:35
Show Gist options
  • Select an option

  • Save sdmcraft/f3af3140bde3156b30b71f1cf2ea9ef9 to your computer and use it in GitHub Desktop.

Select an option

Save sdmcraft/f3af3140bde3156b30b71f1cf2ea9ef9 to your computer and use it in GitHub Desktop.
Code News Skill for Claude Code
name description argument-hint disable-model-invocation
code-news
Generate an executive newsletter summarizing recent code changes across one or more git repositories
[repo-url-1] [repo-url-2] ... [hours=72]
true

Generate an executive newsletter summarizing recent code changes in markdown format.

Usage

/code-news <repo-url>                                    # Single repo, last 72 hours
/code-news <repo-url> 48                                 # Single repo, last 48 hours
/code-news <repo-url-1> <repo-url-2>                     # Multiple repos, last 72 hours
/code-news <repo-url-1> <repo-url-2> 48                  # Multiple repos, last 48 hours

At least one repository URL must be provided.

Instructions

  1. Parse Arguments

    • At least one repository URL must be provided
    • Arguments can be repository URLs (HTTP/HTTPS/SSH) or a number (hours)
    • If last argument is a number, use that as hours; otherwise default to 72 hours
    • URL formats supported:
      • HTTPS: https://github.com/org/repo, https://gitlab.com/org/repo
      • SSH: git@github.com:org/repo.git, git@gitlab.com:org/repo.git
    • Examples:
      • /code-news https://github.com/org/repo → repo, 72h
      • /code-news https://github.com/org/repo 24 → repo, 24h
      • /code-news https://github.com/org/repo1 https://github.com/org/repo2 → both repos, 72h
      • /code-news git@github.com:org/repo.git 48 → repo, 48h
    • If no repository URLs provided, show error message and exit
  2. Clone and Gather Commits from Each Repository

    • For each repository URL:
      • Create a temporary directory: temp_dir=$(mktemp -d)
      • Clone the repository: git clone --depth 100 <url> "$temp_dir/repo" 2>&1
      • Change to the cloned directory: cd "$temp_dir/repo"
      • Get the repository name from the URL (e.g., "awesome-project" from "https://github.com/org/awesome-project")
      • Use git log --since="[hours] hours ago" --pretty=format:"%H|%an|%ar|%s" --no-merges to get commits
      • The remote URL is already known (the input URL), use it for commit links
      • After processing, clean up: cd - && rm -rf "$temp_dir"
    • If clone fails, skip that repo with a warning message and continue with others
    • Use --depth 100 to clone only recent commits for faster performance
  3. Analyze Code Changes

    • For each significant commit, use git show <commit-hash> --stat first to see files changed
    • For key commits, use git show <commit-hash> to see actual changes
    • Identify the type of change:
      • 🚨 Critical fixes (production issues, hotfixes, security fixes)
      • ✨ New features (customer-facing functionality)
      • 🔧 Bug fixes (non-critical)
      • ⚡ Performance improvements
      • 📦 Dependencies or configuration
      • 🧹 Refactoring or code quality
    • Understand the business impact, not just technical details
  4. Generate the Newsletter in Markdown

    For Single Repository:

    # [Repository Name] - Code Activity Report
    
    **Period:** [Start Date] - [End Date] ([N] hours)
    **Total Commits:** [N]
    **Contributors:** [List unique authors]
    
    ---
    
    ## Key Changes
    
    ### 🚨 Critical Fix: [Brief Title]
    
    **Impact:** [High-level business impact in 1 sentence]
    
    **What Happened:**
    [2-3 sentences explaining the issue and resolution]
    
    **Customer Benefit:**
    - [Bullet point 1]
    - [Bullet point 2]
    
    **Status:** [Deployed/In Progress/Merged]
    
    🔗 [View commit abc123](https://github.com/org/repo/commit/abc123)
    
    ---
    
    [Repeat for each significant change]
    
    ## Operational Metrics
    
    - **Response Time:** [Time from issue to fix if applicable]
    - **Deployment:** [Zero downtime / scheduled maintenance / etc]
    - **Code Quality:** [Tests added, coverage maintained, etc]
    
    ## Looking Ahead
    
    [Brief forward-looking statement about ongoing work or monitoring]

    For Multiple Repositories:

    # Code Activity Report - Multi-Repository Update
    
    **Period:** [Start Date] - [End Date] ([N] hours)
    **Repositories:** [N]
    
    ---
    
    ## Summary
    
    | Repository | Commits | Contributors | Key Changes |
    |------------|---------|--------------|-------------|
    | [repo1]    | N       | X, Y         | Critical fix, feature |
    | [repo2]    | N       | Z            | Performance improvement |
    
    ---
    
    ## [Repository 1 Name]
    
    ### 🚨 Critical Fix: [Title]
    
    **Impact:** [Impact]
    
    **Details:** [Details]
    
    🔗 [View commit abc123](https://github.com/org/repo1/commit/abc123)
    
    ---
    
    ## [Repository 2 Name]
    
    ### ⚡ Performance: [Title]
    
    **Impact:** [Impact]
    
    **Details:** [Details]
    
    🔗 [View commit def456](https://github.com/org/repo2/commit/def456)
    
    ---
    
    ## Overall Operational Metrics
    
    [Combined metrics across all repos]
  5. Commit Link Generation

    • Parse the git remote URL to determine the hosting platform:
      • GitHub: https://github.com/org/repo/commit/hash
      • GitLab: https://gitlab.com/org/repo/-/commit/hash
      • Bitbucket: https://bitbucket.org/org/repo/commits/hash
    • Handle both SSH and HTTPS remote URLs
    • If remote URL is SSH format (git@...), convert to HTTPS
    • For other git hosting platforms, use the pattern: https://<host>/org/repo/commit/hash
  6. Guidelines for Executive Communication

    • Focus on IMPACT over implementation
    • Avoid technical jargon (no class names, function signatures, stack traces)
    • Use business language:
      • ✅ "Improved checkout reliability for customers"
      • ❌ "Fixed NullPointerException in payment_processor.py line 234"
    • Emphasize customer benefits and operational excellence
    • Keep descriptions concise - executives scan content
    • Use emojis for visual hierarchy:
      • 🚨 Critical/urgent issues
      • ✨ New features
      • ⚡ Performance improvements
      • 🔧 Bug fixes
      • 📦 Dependencies/config
      • 🧹 Refactoring
      • ✅ Completed/deployed
      • 📊 Metrics
  7. Categorization and Prioritization

    • Group commits by impact and type
    • Priority order:
      1. 🚨 Production fixes and hotfixes (highest priority)
      2. ✨ Customer-facing features
      3. ⚡ Performance improvements
      4. 🔧 Bug fixes
      5. 📦 Dependencies and configuration
      6. 🧹 Internal refactoring (mention briefly or group)
    • If many small commits, group similar changes together
    • For minor updates (typos, formatting, small tweaks), create a "Minor Updates" section
  8. Error Handling

    • If a repository clone fails (invalid URL, authentication required, network error), show a warning and continue with other repos
    • If no commits found in time period for a repository, state that clearly in the report
    • If git commands fail after cloning, show helpful error messages
    • Always clean up temporary directories, even if errors occur
    • If all repository clones fail, show an error message with details
  9. Output Format

    • Output the complete markdown newsletter
    • Include a summary if multiple repositories
    • Provide clear section headers for each repository
    • End with actionable information (who to contact, what's next)

Example Invocations

# Single repo, last 72 hours
/code-news https://github.com/facebook/react

# Single repo, last 48 hours
/code-news https://github.com/microsoft/vscode 48

# Multiple repos, last 72 hours
/code-news https://github.com/org/frontend https://github.com/org/backend https://github.com/org/api

# Multiple repos with custom timeframe (24 hours)
/code-news git@github.com:org/repo1.git git@github.com:org/repo2.git 24

# Using GitLab repos
/code-news https://gitlab.com/org/project1 https://gitlab.com/org/project2 48

Template Structure

Use this as your base template and adapt based on the content:

# [Project/Service Name] - Code Activity Report

**Period:** [Date Range]
**Total Commits:** [N]
**Contributors:** [Names]

---

## Key Changes

### 🚨 [Change Title]

**Impact:** [One sentence about business/customer impact]

**What Changed:** [2-3 sentences with context]

**Benefits:**
- [Benefit 1]
- [Benefit 2]

**Status:** [Deployed/In Review/Testing]

🔗 [View commit](link)

---

## Operational Excellence

- **Quality:** [Code quality metrics, test coverage]
- **Speed:** [Development velocity, time to deploy]
- **Reliability:** [Uptime, incident response]

## What's Next

[Forward-looking statement]

---

**Questions?** Contact [team name]

Notes

  • Always maintain a professional, executive-appropriate tone
  • Focus on "why it matters" not "how it works"
  • If there are breaking changes, highlight them prominently
  • Include deployment status when relevant
  • For multiple repos, provide a consolidated view at the top
  • The newsletter should be ready to share with leadership
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment