Generate an AI-synthesised summary of your GitHub activity (issues, PRs, commits) for a specified organisation and time period. Creates a natural language narrative with inline URL references...
Generate a comprehensive, AI-written summary of your GitHub activity including issues, pull requests (authored and reviewed), and commits.
When the user wants a GitHub activity summary:
Check which data sources are available:
Check GitHub MCP Server:
Look for MCP tools: search_issues, search_pull_requests, list_issues, issue_read, pull_request_read, list_commits
Check gh CLI:
gh auth status
Decision logic:
Both available: Use AskUserQuestion to let the user choose:
Only MCP available: Use MCP automatically, inform user
Only gh CLI available: Use gh CLI automatically, inform user
Neither available: Stop and guide user to either:
gh auth login to authenticate the CLIUsing MCP:
search_orgs or equivalent org listing tool
Using gh CLI:
gh api user/orgs --jq '.[].login'
Also get the authenticated username:
gh api user --jq '.login'
Use AskUserQuestion to prompt the user to select an organisation.
Build options from the fetched organisations list, plus:
Example question: "Which organisation would you like to summarise activity for?"
Use AskUserQuestion to prompt for the time range.
Options:
If "Custom range" is selected, ask follow-up questions for:
Convert all dates to ISO 8601 format (YYYY-MM-DD) for API queries.
Fetch lists of issues, PRs, and commits for the selected organisation and time period.
Using MCP Server (preferred - use search tools for accurate filtering):
# IMPORTANT: Use search tools, not list tools, for accurate author + date filtering
# Issues created by user in date range
search_issues(q: "author:<username> org:<org> created:<start>..<end>")
# Issues where user is involved (assigned, commented, mentioned) but didn't create
search_issues(q: "involves:<username> org:<org> updated:<start>..<end>")
# PRs authored by user in date range
search_pull_requests(q: "author:<username> org:<org> created:<start>..<end>")
# PRs reviewed by user in date range
search_pull_requests(q: "reviewed-by:<username> org:<org> updated:<start>..<end>")
# Commits by user
search_commits(q: "author:<username> org:<org> author-date:<start>..<end>")
Important: Merge results from author: and involves: queries, deduplicating by issue number.
MCP Fallback (if search tools unavailable):
If only list_issues/list_pull_requests are available:
since which filters by update time, not creation time# Less accurate - requires post-filtering
list_issues(owner: <org>, repo: <repo>, state: "all", since: <ISO-date>)
# Then filter: keep only items where creator == <username> AND created_at >= <start>
list_pull_requests(owner: <org>, repo: <repo>, state: "all")
# Then filter: keep only items where user.login == <username> AND created_at in range
Using gh CLI:
# Issues created by user
gh search issues --author @me --owner <org> --created "<start>..<end>" --json title,url,number,repository --limit 100
# Issues where user is involved (assigned, commented, mentioned) but didn't create
# This catches issues like tracking issues created by others that you work on
gh search issues --involves @me --owner <org> --updated "<start>..<end>" --json title,url,number,repository --limit 100
# PRs authored by user
gh search prs --author @me --owner <org> --created "<start>..<end>" --json title,url,number,repository,state --limit 100
# PRs reviewed by user
gh search prs --reviewed-by @me --owner <org> --updated "<start>..<end>" --json title,url,number,repository,state --limit 100
# Commits by user
gh search commits --author @me --owner <org> --author-date "<start>..<end>" --json sha,repository,commit --limit 100
Important: Merge results from --author and --involves queries, deduplicating by issue number. The --involves flag catches issues where you're assigned, commented, or mentioned but didn't create.
Note: If "All organisations" was selected, omit the --owner/org: filter from commands.
For each issue and PR discovered, fetch rich context to enable meaningful summarisation.
For Issues (using gh CLI):
# Full issue details
gh api repos/<owner>/<repo>/issues/<number>
# Comments on the issue
gh api repos/<owner>/<repo>/issues/<number>/comments
# Timeline (shows linked PRs, cross-references, sub-issues)
gh api repos/<owner>/<repo>/issues/<number>/timeline
For PRs Authored (using gh CLI):
# Full PR details
gh api repos/<owner>/<repo>/pulls/<number>
# Review comments
gh api repos/<owner>/<repo>/pulls/<number>/reviews
# Inline comments
gh api repos/<owner>/<repo>/pulls/<number>/comments
# Files changed (summary)
gh api repos/<owner>/<repo>/pulls/<number>/files --jq 'length'
For PRs Reviewed (using gh CLI):
# Your review on this PR
gh api repos/<owner>/<repo>/pulls/<number>/reviews --jq '[.[] | select(.user.login == "<username>")]'
For Commits:
# Check if commit is associated with a PR
gh api repos/<owner>/<repo>/commits/<sha>/pulls
Using MCP Server:
issue_read(owner, repo, issue_number) # Returns body, comments, sub-issues, labels, linked PRs
pull_request_read(owner, repo, pr_number) # Returns body, review comments, files, status
Using all the collected data, write a natural language summary document.
Determine Output Location:
Inbox/ folder in the current working directory or parent directoriesGitHub/, Personal/, Work/), use the most appropriate pillar's InboxFilename: YYYY-MM-DD GitHub Summary.md (using today's date)
Writing Guidelines:
CRITICAL: Write narrative prose, NOT tables or bullet lists.
The output must be natural language paragraphs that tell a story. This is a summary for humans to read, not a data dump.
DO NOT:
DO:
EXAMPLE - BAD (DO NOT DO THIS):
## Pull Requests
### Authored
**acme-corp/api-gateway (4 PRs merged)**
- Fix: Token refresh logic — Fixed token expiry handling...
- Feature: Add rate limiting configuration...
**acme-corp/web-app (2 PRs merged)**
- Update: Migrate to new auth provider...
EXAMPLE - GOOD (DO THIS INSTEAD):
## Pull Requests
### Authored
I focused heavily on the API gateway this week. The most significant fix addressed [token refresh logic](url), which was causing intermittent authentication failures when tokens expired mid-request. This required understanding how the OAuth flow handles edge cases around clock skew. I also submitted [rate limiting configuration improvements](url) to give operators more control over throttling behaviour.
On the web application, I completed the [auth provider migration](url) that had been planned since Q3. The new provider offers better SSO support and simplified our session management code.
Voice: Write in first person ("I worked on...", "I submitted...")
Structure:
TLDR Section:
URLs: Reference URLs inline within sentences, not as separate items
Context: Explain the significance and context in prose
Grouping: Group by theme or project when natural, maintain chronological order within groups
Metadata: Include at the top:
Tags: End with relevant tags (e.g., #context/github #type/note)
Template Structure:
# GitHub Summary
**Period:** <start-date> to <end-date>
**Organisation:** <org-name or "All">
---
## TLDR
- Fixed critical bug in URL transformation affecting readme rendering
- Merged 4 PRs improving API stability and documentation
- Reviewed 2 PRs for new feature implementations
---
## Overview
This week centred on stability improvements and documentation clarity. The main focus was resolving URL handling issues in the registry service that had been causing broken links in rendered readmes. I also contributed to the ongoing API modernisation effort and provided review feedback on upcoming features.
## Issues
I opened [#234: Blob URLs incorrectly generated for relative paths](url) after noticing broken images in several MCP server readmes. Investigation revealed the transformation logic assumed absolute URLs, but many repositories use relative paths for their assets. This led directly to the fix in PR #312.
## Pull Requests
### Authored
The URL transformation fix required careful handling of edge cases. In [#312: Fix blob URL generation](url), I updated the path resolution to detect relative URLs and prepend the repository's raw content base. The review feedback highlighted a missed edge case with nested directories, which I addressed in a follow-up commit.
I also submitted [#318: Update API deprecation notices](url) to clarify migration paths for external consumers. This involved updating both code comments and the public documentation.
### Reviewed
I reviewed [#320: Add rate limiting middleware](url), suggesting improvements to the backoff algorithm. The original implementation used fixed delays, but I recommended exponential backoff to better handle burst traffic.
## Commits
A few documentation fixes went directly to main without PRs: typo corrections in the contributing guide and updated contact information in the security policy.
---
#context/github #type/note
After saving the file, tell the user:
If the user has no organisation memberships:
If all queries return empty results:
If you encounter rate limit errors (HTTP 403):
If results exceed 100 items:
If individual item fetches fail:
If gh CLI is not authenticated:
gh auth loginUser: "Summarise my GitHub activity for the last two weeks"
Steps:
["github", "microsoft"]GitHub/Inbox/2026-01-09 GitHub Summary.md--author @me and @me syntax automatically uses the authenticated GitHub user