The RepoKernel PR bridge is the connection between a finished sprint and the pull request that ships it. Four commands cover the full lifecycle: link a PR URL to a sprint, generate a body from sprint frontmatter and post it, sync the PR’s open/draft/merged/closed status back into sprint metadata, and post agent feedback as comments. Every operation is idempotent and rerunnable — dropping aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/xantorres/repokernel/llms.txt
Use this file to discover all available pages before exploring further.
rk pr body or rk pr sync call into an automated loop is safe.
Quick start
Commands
rk pr link
Persist a PR URL under sprint frontmatter extras.pr. Provider is inferred from the URL hostname:
| URL pattern | Provider |
|---|---|
github.com / *.github.com | github |
gitlab.com / *.gitlab.com | gitlab |
bitbucket.org / *.bitbucket.org | bitbucket |
| anything else | rejected with unsupported PR host '<hostname>' |
rk pr link errors loudly on unrecognised hosts rather than silently miscategorizing them. Provider inference returns an explicit unknown internally for non-public hosts, which causes the command to reject them so self-hosted URLs can never be treated as GitHub when they aren’t.
The metadata shape stored on the sprint:
javascript:, data:, vbscript:, file:, and ftp: schemes are rejected.
rk pr body
Render a PR body from the sprint frontmatter and body. The function is pure: the same sprint always produces the same body, so rerunning rk pr body S-042 --write never creates spurious diffs in the PR description.
renderPrBody is deterministic — identical sprint state produces identical output. Safe to call repeatedly in automated flows without generating noisy PR history.rk pr sync
Refresh the PR status field from GitHub via gh pr view --json state,url,title,isDraft,mergedAt. Maps GitHub state to RepoKernel status:
| GitHub | RepoKernel status |
|---|---|
isDraft: true | draft |
mergedAt set | merged |
state: CLOSED | closed |
| anything else | open |
sync only supported for GitHub.
rk pr status
Inspect the persisted PR metadata. Use --json to pipe into automation:
rk pr comment
Post a comment on the linked PR via gh pr comment <url> --body <message>. Requires gh installed and authenticated.
gh_not_installed, not_authenticated, not_found. The Command failed: gh ... prefix Node attaches to process errors is stripped before reaching stderr — --body content cannot leak into logs.
Environment
Write operations (rk pr body --write, rk pr comment, rk pr sync) require the gh CLI to be installed and authenticated. The bridge reuses whatever auth gh has configured — gh auth login or a GITHUB_TOKEN environment variable.
Concurrency
writePrMetadata writes through the shared per-sprint extras lock, so concurrent rk pr and rk tracker commands cannot lose each other’s sibling metadata via a stale extras snapshot. The lock key is sanitised to a single path segment.
End-to-end flow
Agent finishes sprint
The agent completes its work. Call
rk review S-042 to create a review stub and transition the sprint to review status.Post the generated PR body
Generate a body from sprint frontmatter and post it directly to the PR:Because
renderPrBody is pure, you can safely rerun this after updating sprint metadata — no spurious diffs.Update the tracker
Roadmap
Coming next on this surface:- Auto-link from
rk run. When the agent reports the PR URL in its summary, link it without a follow-up command. - Auto-body on close.
rk closewill optionally post the rendered body if a PR is linked. - Watch CI. Surface
gh pr checksstatus alongsiderk team status. --provideroverride. Explicit provider flag to support self-hosted GitHub Enterprise and GitLab CE once those integrations are wired end-to-end.