Gh work report

From rysweet/amplihack · View interactive version

Gh work report is an AI agent skill from the GitHub repository rysweet/amplihack. Generates comprehensive GitHub activity reports across all authenticated accounts. Gathers repos, PRs, features, and themes for configurable time periods (1/5/7/30/90 days). Produces shareable markdown with tables, mermaid charts, and executive summaries. Can create a private repo with GitHub Action

How to use this skill

Skill file

GitHub Work Report Skill

Generates rich GitHub activity reports across all authenticated gh accounts.

Invocation

The user triggers this skill with phrases like:

Parse the time period

Extract the number of days from the user's message. Valid values: 1, 5, 7, 30, 90. Default to 7 if not specified or if an invalid value is given.

Workflow

Follow these steps in order. Check off each step as you complete it.

Step 1: Detect accounts

gh auth status 2>&1

Parse the output to identify all authenticated accounts (e.g., rysweet on github.com, rysweet_microsoft on github.com). Store the list of account values and note which is currently active.

Step 2: Gather data per account

For each account, switch to it and collect data:

gh auth switch --user <ACCOUNT>

Then gather:

2a. Repositories with recent activity
# Get repos the user pushed to in the time window
gh api graphql --paginate -f query='
query($cursor: String) {
  viewer {
    repositories(first: 100, after: $cursor, orderBy: {field: PUSHED_AT, direction: DESC}) {
      pageInfo { hasNextPage endCursor }
      nodes {
        nameWithOwner
        url
        description
        pushedAt
        homepageUrl
        isPrivate
      }
    }
  }
}'

Filter to repos with pushedAt within the time window.

2b. Pull requests
gh search prs --author=@me --created=">YYYY-MM-DD" --limit 200 --json number,title,repository,state,createdAt,url,mergedAt

Also gather PRs merged (not just created) in the window:

gh search prs --author=@me --merged=">YYYY-MM-DD" --limit 200 --json number,title,repository,state,createdAt,url,mergedAt

Deduplicate by URL.

2c. Issues
gh search issues --author=@me --created=">YYYY-MM-DD" --limit 100 --json number,title,repository,state,createdAt,url
2d. Releases
# For each active repo, check for releases
gh api repos/{owner}/{repo}/releases --jq '.[].tag_name' | head -5

Step 3: Combine and deduplicate

Merge data from all accounts. Deduplicate repos by nameWithOwner and PRs by URL. Tag each item with the account that produced it.

Step 4: Analyze and synthesize

This is where you add value beyond raw data:

  1. Identify themes: Group repos/PRs by topic (e.g., "infrastructure", "security", "new features"). Use repo descriptions, PR titles, and any patterns you observe.
  2. Highlight big wins: PRs with significant impact — large features merged, important bug fixes, new repos created.
  3. Extract usage examples: For notable features, write a short "here's how to use this" snippet based on PR titles, descriptions, and repo READMEs.
  4. Spot new work: Repos with first-ever commits in the time window.

Step 5: Generate the report

Use the template structure from reference.md. The report must include:

Save the report as a markdown file named gh-work-report-YYYY-MM-DD-to-YYYY-MM-DD.md.

Step 6: Restore original account

Switch back to the account that was active before the report started:

gh auth switch --user <ORIGINAL_ACCOUNT>

Step 7: Offer automation infrastructure

After generating the report, ask the user:

Would you like me to create a private GitHub repo with automated weekly/monthly reports and a GitHub Pages site to browse them?

If yes, follow the infrastructure setup in reference.md § Infrastructure Setup.

Key Rules

Authentication & Automation

Reference Files

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.