GitHub Weekly Report
Generate comprehensive weekly activity reports for GitHub organizations. Produces clean Markdown perfect for GitHub issues or documentation.
The report is produced in two phases:
- Phase 1 — Data collection (
report.py): fetches PRs, issues, CI runs, and active epics via the gh CLI and renders the mechanical sections.
- Phase 2 — AI synthesis (you, the agent): reads the generated report and structured JSON, then writes the Cross-Repo Highlights, Active Epics, and Action Items sections using your own reasoning.
Prerequisites
- Python 3.8+
- GitHub CLI (
gh) — authenticated with access to the target org
- Token scope:
read:project is optional — it only enriches the epic Status column from the Projects v2 board. Active-epic detection is sub-issue-based and works without it.
Quick Start
# Report on current week (last 7 days) — also emit JSON for AI synthesis
python3 {baseDir}/scripts/report.py --org <org> --output report.md --json-output report-data.json
# Report on specific date range
python3 {baseDir}/scripts/report.py --org <org> --since 2026-03-23 --until 2026-03-30 --output report.md --json-output report-data.json
# Report on an explicit repo set (owner-qualified); skips org-wide discovery
python3 {baseDir}/scripts/report.py --org <org> --repos <org>/repo-a <org>/repo-b --output report.md --json-output report-data.json
# Run epic tracker standalone (for debugging)
python3 {baseDir}/scripts/epic-tracker.py --org <org> --since 2026-03-23 --until 2026-03-30
# Post report to a GitHub issue
gh issue create -R <org>/<repo> --title "Weekly Report $(date +%Y-%m-%d)" --body-file report.md
When --repos is omitted, the report discovers all repos in the org (the unchanged default). Automation deployments pass the curated core-repo allowlist via the weekly-report.sh wrapper, which resolves the list and calls report.py --repos for you.
What the Report Includes
- Org-Wide Summary — table with merged PRs, open PRs, open issues, new issues, CI pass rate, and status per repo
- Active Epics — table of in-progress epics with leads, Key Results, and this-week activity
- Cross-Repo Highlights — AI-synthesized narrative (see Phase 2 below)
- Per-Repo Deep Dives — top contributors, merged PR table, open PRs by status (Ready to Merge / Changes Requested / Needs Review / Draft) with Notes flags, CI Health section, new issues
- Action Items — AI-synthesized prioritized table (see Phase 2 below)
Phase 2: AI Synthesis
After running report.py, read both the generated report.md and report-data.json. Use them to write three sections that require reasoning across the whole dataset.
Active Epics
The script generates a baseline Active Epics table from epic-tracker.py output. Review it and enhance:
Rules:
- Scan for the
epic label across all repos in the org
- Detection is sub-issue-based (the primary signal): an epic is active if it has open sub-issues (backlog / in-progress) OR a sub-issue closed within the reporting window. This does not depend on the project board and needs no
read:project scope. A merged-PR cross-reference in the window also counts.
- Board Status (Projects v2), when available, is display-only enrichment — it fills the status label but never gates inclusion. Teams often park active epics in an "Epics" column rather than "In Progress", so board status alone misses them.
- Lead = first assignee on the epic issue
- Epic reference = full
org/repo#N with link to the source repo
- Key Result = extracted from epic body (
## Key Results section) or inferred from title/labels
- "This Week" = brief summary of sub-issues closed / open, plus any PRs merged referencing this epic
- Cap the list (configurable via
--max-epics, default 10); sort by recent activity (sub-issues closed this week, then open count) descending to keep the section a focused planning input
- If the script produced a fallback-mode table (no Projects v2 access), the status column is derived from sub-issue state — keep the section
Cross-Repo Highlights
Replace the scaffold in ## Cross-Repo Highlights with a rich narrative. Write bullet points covering all of the following that are relevant:
Multi-repo contributors
- For each person who merged PRs in more than one repo, describe what they worked on — not just a count. Name the repos and the themes.
- Call out the dominant contributor in the most active repo by name with a one-line summary of their impact.
Org-wide CI narrative
- State the overall org CI pass rate (compute as total passed / total runs across all repos).
- Call out which repos drag the average down and name the specific failing workflow(s).
- Highlight repos at 100% by name.
Security concerns
- List any open PRs flagged SECURITY that have been open >7 days without review. Link to the PR. Note the age.
Dependabot accumulation
- If the total open dependabot PRs across the org is significant (>10), call it out with a per-repo breakdown.
Shared patterns / themes
- Identify recurring themes across repos this week.
Action Items
Append a ## Action Items section at the end of the report. Produce a prioritized table of concrete actions.
Priority criteria:
| Priority |
Criteria |
| P0 |
Security PRs unreviewed >7 days; CI broken on main for multiple consecutive days; active data/credential leak |
| P1 |
APPROVED PRs not yet merged; critical/regression bugs with no assignee; operator bugs causing pod restart loops |
| P2 |
PRs with CHANGES_REQUESTED where author has not responded >5 days; dependabot batch reviews; stale draft PRs blocking others |
| P3 |
Stale issues >30 days; ancient PRs >90 days with no review; quiet-repo triage; documentation gaps |
Table format:
| # | Action | Repo | Owner | Priority |
|---|--------|------|-------|----------|
| 1 | Review and merge security fix #188 | agent-examples | @pdettori | P0 |
Rules for Action Items:
- Include only actionable items — skip things already in progress with healthy momentum
- Assign a named owner where obvious
- Limit to 15 items max, highest-priority first
- Reference GitHub issue/PR numbers with links
Automation
The cron job runs weekly on Mondays at 05:01 UTC. The agent:
- Runs
report.py with --json-output
- Reads the structured JSON and markdown
- Enhances the Active Epics, Cross-Repo Highlights, and Action Items sections
- Closes previous weekly report issues
- Posts the final report as a new GitHub issue
See Also
1---2name: github-weekly-report3description: Generate comprehensive weekly activity reports for GitHub organizations showing merged PRs, open PR review status, new issues, CI health, active epics, and multi-repo contributor highlights with AI-synthesized Cross-Repo Highlights and Action Items. Use when the user wants a weekly summary, org activity report, "what happened this week" recap, or a GitHub org status update for a specific date range.4---56# GitHub Weekly Report78Generate comprehensive weekly activity reports for GitHub organizations. Produces clean Markdown perfect for GitHub issues or documentation.910The report is produced in **two phases**:111. **Phase 1 — Data collection** (`report.py`): fetches PRs, issues, CI runs, and active epics via the `gh` CLI and renders the mechanical sections.122. **Phase 2 — AI synthesis** (you, the agent): reads the generated report and structured JSON, then writes the **Cross-Repo Highlights**, **Active Epics**, and **Action Items** sections using your own reasoning.1314## Prerequisites1516- **Python 3.8+**17- **GitHub CLI (`gh`)** — authenticated with access to the target org18- **Token scope**: `read:project` is optional — it only enriches the epic Status column from the Projects v2 board. Active-epic detection is sub-issue-based and works without it.1920## Quick Start2122```bash23# Report on current week (last 7 days) — also emit JSON for AI synthesis24python3 {baseDir}/scripts/report.py --org <org> --output report.md --json-output report-data.json2526# Report on specific date range27python3 {baseDir}/scripts/report.py --org <org> --since 2026-03-23 --until 2026-03-30 --output report.md --json-output report-data.json2829# Report on an explicit repo set (owner-qualified); skips org-wide discovery30python3 {baseDir}/scripts/report.py --org <org> --repos <org>/repo-a <org>/repo-b --output report.md --json-output report-data.json3132# Run epic tracker standalone (for debugging)33python3 {baseDir}/scripts/epic-tracker.py --org <org> --since 2026-03-23 --until 2026-03-303435# Post report to a GitHub issue36gh issue create -R <org>/<repo> --title "Weekly Report $(date +%Y-%m-%d)" --body-file report.md37```3839When `--repos` is omitted, the report discovers all repos in the org (the unchanged default). Automation deployments pass the curated core-repo allowlist via the `weekly-report.sh` wrapper, which resolves the list and calls `report.py --repos` for you.4041## What the Report Includes42431. **Org-Wide Summary** — table with merged PRs, open PRs, open issues, new issues, CI pass rate, and status per repo442. **Active Epics** — table of in-progress epics with leads, Key Results, and this-week activity453. **Cross-Repo Highlights** — AI-synthesized narrative (see Phase 2 below)464. **Per-Repo Deep Dives** — top contributors, merged PR table, open PRs by status (Ready to Merge / Changes Requested / Needs Review / Draft) with Notes flags, CI Health section, new issues475. **Action Items** — AI-synthesized prioritized table (see Phase 2 below)4849---5051## Phase 2: AI Synthesis5253After running `report.py`, read both the generated `report.md` and `report-data.json`. Use them to write three sections that require reasoning across the whole dataset.5455### Active Epics5657The script generates a baseline Active Epics table from `epic-tracker.py` output. Review it and enhance:5859| Epic | Lead | Key Result | This Week |60|------|------|------------|-----------|61| [kagenti/kagenti#1789](https://github.com/kagenti/kagenti/issues/1789) OPA Authorization | @davidhadas | KR2: Zero-trust agent auth | 3 sub-issues closed, 4 open |62| [kagenti/kagenti-extensions#501](https://github.com/kagenti/kagenti-extensions/issues/501) Session Mgmt | @sahilsuneja1 | KR1: Stateful agent infra | 2 open, 1 PR merged |6364Rules:65- Scan for the `epic` label across all repos in the org66- **Detection is sub-issue-based** (the primary signal): an epic is active if it has open sub-issues (backlog / in-progress) OR a sub-issue closed within the reporting window. This does not depend on the project board and needs no `read:project` scope. A merged-PR cross-reference in the window also counts.67- Board Status (Projects v2), when available, is **display-only enrichment** — it fills the status label but never gates inclusion. Teams often park active epics in an "Epics" column rather than "In Progress", so board status alone misses them.68- Lead = first assignee on the epic issue69- Epic reference = full `org/repo#N` with link to the source repo70- Key Result = extracted from epic body (`## Key Results` section) or inferred from title/labels71- "This Week" = brief summary of sub-issues closed / open, plus any PRs merged referencing this epic72- Cap the list (configurable via `--max-epics`, default 10); sort by recent activity (sub-issues closed this week, then open count) descending to keep the section a focused planning input73- If the script produced a fallback-mode table (no Projects v2 access), the status column is derived from sub-issue state — keep the section7475### Cross-Repo Highlights7677Replace the scaffold in `## Cross-Repo Highlights` with a rich narrative. Write bullet points covering **all** of the following that are relevant:7879**Multi-repo contributors**80- For each person who merged PRs in more than one repo, describe *what* they worked on — not just a count. Name the repos and the themes.81- Call out the dominant contributor in the most active repo by name with a one-line summary of their impact.8283**Org-wide CI narrative**84- State the overall org CI pass rate (compute as total passed / total runs across all repos).85- Call out which repos drag the average down and name the specific failing workflow(s).86- Highlight repos at 100% by name.8788**Security concerns**89- List any open PRs flagged SECURITY that have been open >7 days without review. Link to the PR. Note the age.9091**Dependabot accumulation**92- If the total open dependabot PRs across the org is significant (>10), call it out with a per-repo breakdown.9394**Shared patterns / themes**95- Identify recurring themes across repos this week.9697### Action Items9899Append a `## Action Items` section at the end of the report. Produce a prioritized table of concrete actions.100101**Priority criteria:**102103| Priority | Criteria |104|----------|----------|105| **P0** | Security PRs unreviewed >7 days; CI broken on main for multiple consecutive days; active data/credential leak |106| **P1** | APPROVED PRs not yet merged; critical/regression bugs with no assignee; operator bugs causing pod restart loops |107| **P2** | PRs with CHANGES_REQUESTED where author has not responded >5 days; dependabot batch reviews; stale draft PRs blocking others |108| **P3** | Stale issues >30 days; ancient PRs >90 days with no review; quiet-repo triage; documentation gaps |109110**Table format:**111112```markdown113| # | Action | Repo | Owner | Priority |114|---|--------|------|-------|----------|115| 1 | Review and merge security fix #188 | agent-examples | @pdettori | P0 |116```117118**Rules for Action Items:**119- Include only actionable items — skip things already in progress with healthy momentum120- Assign a named owner where obvious121- Limit to 15 items max, highest-priority first122- Reference GitHub issue/PR numbers with links123124---125126## Automation127128The cron job runs weekly on Mondays at 05:01 UTC. The agent:1291. Runs `report.py` with `--json-output`1302. Reads the structured JSON and markdown1313. Enhances the Active Epics, Cross-Repo Highlights, and Action Items sections1324. Closes previous weekly report issues1335. Posts the final report as a new GitHub issue134135## See Also136137- GitHub CLI docs: https://cli.github.com/manual/138- Example report: https://github.com/kagenti/kagenti/issues/1110