Skip to content

Black Friday

Annual Pro is $90 for the first year, normally $120. Or start monthly at $6 for two months, then $12.

Ends Dec 4, 11:59 PM PT.

Create an account
← Public packages

@kentcdodds/github

GitHub REST, GraphQL, and pull request helpers for Kody agents.

FollowFork

IntegrationsTopics: github, api, accounts, pr, automation, actions, secrets, mentions

Version
0.2.1
License
MIT
Published
November 3, 2026
Pinned commit
de3cf1c
Rating
No ratings yet
Forks
0
Adaptation effort
—

README

Agent docs

@kentcdodds/github

Intent

One GitHub helpers package for Kody agents, with two BYO OAuth identities: kody-bot (account: 'bot', integration github-bot) is the default for every call; Kent C. Dodds (account: 'kent', integration github-kent) is used only when the user explicitly asks to act as Kent. Agents must not infer Kent from private repos, org access, or “the bot might not have permission.”

What it does

  • Authenticated GitHub REST and GraphQL calls (request, graphql, paginate)
  • Identity check for the selected account (get-viewer)
  • Pull request helpers: info, CI checks, merge (bounded, in-flight wait, durable escalation), draft/ready toggle
  • Create or update GitHub Actions secrets without returning plaintext (actions/put-secret)
  • A mention guard that refuses posts and edits that would @-mention people unless the caller names them in allowedMentions (mention-guard preflights text without posting)

Prerequisites / setup

Two user-owned GitHub OAuth connections to the same BYO GitHub OAuth app (not the Kody platform app), both with god-level scopes (gist, notifications, read:org, read:user, repo, user:email, workflow):

  1. Connect github-bot while signed into GitHub as kody-bot (default).
  2. Connect github-kent while signed into GitHub as kentcdodds (explicit Kent-only).
  3. Reconnect if needed: /connect/oauth?provider=github-bot or /connect/oauth?provider=github-kent.
  4. Agents: see AGENTS.md for import paths and smoke checks.

OAuth access/refresh tokens live on the saved integrations (github-bot, github-kent). Helpers authenticate with createAuthenticatedFetch. Never paste token values in chat, and do not require mirrored user secrets named github-botAccessToken / github-kentAccessToken.

Never post private information in public spaces

GitHub issues, pull requests, comments, reviews, releases, and discussions are often public, and they are hard to fully retract once notifications and email copies go out. Anything posted through this package follows one rule: private information stays out of public spaces. That includes:

  • Production user or org handles, and lists of users or owners
  • Package names that come from production data
  • Email addresses
  • Credential or secret details (values, partial values, names tied to specific accounts, or anything that helps locate a secret)
  • Internal IDs (database, account, run, or job identifiers)
  • Private repository content and security advisory details

When a public post needs to describe production state, it uses counts or aggregates ("12 packages fail the check") instead of identifying details. Put the details in a private place (a private repo, an internal dashboard, or a direct message to the people who need them) and link to that place only when the link itself reveals nothing.

The mention guard below is one enforcement of this rule. It does not catch everything, so authors and agents still own the content of every post.

Mention guard (allowedMentions)

An @-mention notifies the mentioned person or team, so every helper that posts or edits GitHub text refuses mentions by default. This covers request (POST, PATCH, and PUT with a body or title, review comments[].body, and review dismissal message), graphql mutations, and raw /graphql calls made through request. Mentions inside inline code, fenced code blocks, and indented code blocks do not count, and neither do email addresses.

To mention someone on purpose, the caller passes allowedMentions with the handles it intends to notify. Matching is case-insensitive, the leading @ is optional, and teams use org/team. Any mention that is not on the list still refuses the whole post. The error reports how many mentions it found, never which ones.

Appropriate uses of allowedMentions:

  • Replying to someone who is already part of the thread
  • Intentionally asking a specific maintainer or reporter to take a look

Inappropriate uses of allowedMentions:

  • Lists or reports of users, owners, or package names
  • Bulk status reports
  • Anything generated from production data

For the inappropriate cases, rewrite the post with counts or aggregates instead of widening the allow list. A scoped package name such as @scope/name reads as a team mention, so wrap package names in backticks.

Done when

  • Both OAuth connections work; get-viewer for bot returns kody-bot
  • kent is used only after an explicit user request
  • REST/GraphQL and PR helpers succeed with the intended account
  • Actions secrets can be put without plaintext ever leaving the helper
  • Posts and edits with unintended @-mentions refuse before reaching GitHub
Report this listing

Log in to report this listing.