The leaderboard agent is a thin wrapper around this skill, fired by the weekly-leaderboard cron in kortix.yaml.

1. Merged PRs — counts per person (the leaderboard backbone)

Repos: {{target_repos}} (space-separated). Count merged PRs per author in each:
bash
since=$(date -u -d '7 days ago' +%Y-%m-%d 2>/dev/null || date -u -v-7d +%Y-%m-%d)
for repo in {{target_repos}}; do
  gh pr list --repo "$repo" --state merged --search "merged:>=$since" --limit 200 \
    --json number,title,author,mergedAt,labels
done | jq -s 'add | group_by(.author.login)
  | map({author: .[0].author.login, count: length, prs: map({number,title,mergedAt})})'
Exclusions. Drop PRs authored by app/dependabot, app/github-actions, any agent-*, and any login ending in [bot]. Count them on a separate line: "+ N bot/agent PRs (dependabot ×N, …)". Do NOT exclude a PR a human drove even if an agent helped write it — attribute to the human who opened/merged it.
Identity map (GitHub login → display name). Edit this for your team:
text
# githubLogin  ->  Display Name
# alice-gh     ->  Alice
# bob-eng      ->  Bob
When in doubt, use the PR author's display-name field.
Also pull commits pushed straight to the default branch (no PR):
bash
for repo in {{target_repos}}; do
  gh api "repos/$repo/commits?since=${since}T00:00:00Z&per_page=100" --paginate \
    --jq '.[] | {sha: .sha[0:8], author: .commit.author.name, msg: (.commit.message | split("\n")[0])}'
done

2. Prior week (deltas + streaks)

Read .kortix/memory/weekly-digests.md — the ### PR Leaderboard and ### Streaks of the most recent entry — for last week's per-person counts (compute +N / -N) and current streak counts.

3. Team discussion (context that makes numbers meaningful)

bash
slack channels --limit 1000
slack history --channel <main-channel-id> --limit 200
slack search --query "shipped after:$since"
Capture launches, decisions, blockers, direction changes, shout-outs. Link the most useful thread. Read last week's standup thread (ts in the ledger).

4. Don't double-count

One logical change = one narrative line. The leaderboard counts raw merged PRs; "What happened" groups them into outcomes.
1 — Header ENG/PRODUCT weekly — <one-line takeaway>
2 — Snapshot <n> PRs merged · <n> active shippers · <n> major discussions
3 — What happened (5–7 bullets, ordered by impact): • *Area:* outcome → why it mattered — *Owner(s)* (<url|#PR>) Lead with outcomes, collapse fixups into one shipped thing, include Slack-only events. Banned filler: "great", "big week", "kudos", "various improvements".
4 — PR leaderboard (from the per-person counts, sorted desc):
text
*PR leaderboard — week of YYYY-MM-DD*
🥇 Alice     ██████  6  (+2)
🥈 Bob       ████    4  (=)
🥉 Carol     ███     3  (-1)
   Dave      ██      2  (new)
+ 12 bot/agent PRs (dependabot ×8, agent ×4)
Bar: one per PR, max 10 wide (scale past 10). Delta vs last week (+N/-N/=, new if 0 last week). 🥇🥈🥉 for top 3. Only people with ≥1 PR. If nobody merged any, skip this and note it in the snapshot.
5 — Streaks — for anyone shipping ≥1 PR ≥2 weeks running: 🔥 Alice — 8-week streak Read/update counts from the ledger (increment shippers, reset the rest). Only show if at least one streak ≥2.
6 — Standup thread prompt — post as a reply to the main message:
text
🗓 Monday async standup — reply in this thread by EOD

• What did you ship last week? (link PRs or describe)
• Top priority this week?
• Any blockers?

{{team_mentions}}
7 — Slack signal / next watch — 1–3 bullets for decisions/blockers/asks that didn't map to a PR.
Weekly leaderboard — Kortix Marketplace | Kortix