source-control

When a task touches GitHub or another source-control provider: reading or acting on repos, pull requests, issues, or CI with the built-in tools, choosing between them and a cloud agent, or a tool says

SKILL.md

GitHub

Source control

Source control is one integration with Cursor, not one per feature: a GitHub (or GitLab, Bitbucket, Azure DevOps) connection the user set up for cloud agents also powers your inline tools, and vice versa. The user connects once and grants Cursor's app access to the orgs and repositories it may touch; you never collect a token, paste a link, or send them to settings.

Which provider a reference means

  • github.com/owner/repo (or git@github.com:owner/repo) is GitHub; gitlab.com GitLab; bitbucket.org Bitbucket; dev.azure.com or *.visualstudio.com Azure DevOps; cursor.com/codebase/<owner>/<repo> (or an origin.cursor.com clone URL) is Cursor Origin, and either spelling is a valid CloudAgent launch repo. Origin needs no connect step, because the signed-in Cursor account is the Origin account. A bare owner/repo with no host is ambiguous: if the user has exactly one provider connected assume that one; otherwise call CloudAgent "repositories" with search set to the name to see which provider hosts it, and ask only when that lookup still leaves several matches or none.
  • CloudAgent "repositories" lists the repositories the user's connected providers can see (with a search filter and a cursor for more). Use it to resolve a vague repo name, to check whether a repo is reachable before launching, or when the user asks what you have access to. Do not enumerate it speculatively on every turn.

Inline tools versus cloud agents

  • Work that is a few API calls stays in the conversation: checking a pull request, its diff, CI status, or reviews; looking up or filing an issue; commenting, replying, reviewing, or merging; reading a file, a commit, a tag, a release, or the repository tree; labels, sub-issues, discussions, and collaborators; searching code, PRs, issues, users, or orgs. Use the built-in cursor-github tools for this (cursor-github-get_pull_request, cursor-github-list_check_runs_for_ref, cursor-github-search_issues, ...). Each one is one GitHub REST endpoint with GitHub's own parameter names, one page per call, and GitHub's response verbatim: read the Link item it appends to fetch the next page, and expect large results to arrive as a file you can grep. They act as the user's own GitHub account, so they can never do more than the user can.
  • Writing or modifying code, and investigating how code actually behaves, is a cloud agent's job (see the code-changes skill). Never clone a repository onto your computer to look around; the inline tools give you files, diffs, and history without a checkout. There is no inline tool that commits files (no create-or-update-file, delete-file, or push-files): any change to repository contents, however small, goes through a cloud agent. create_branch is the one exception, for giving an agent a branch to work on.
  • Prefer the built-in cursor-github tools over gh, raw GitHub API calls from Shell, or a GitHub plugin/connector when both are present: the built-in needs no setup, is attributed to the user, and its results are already shaped for you. If the user also has the marketplace GitHub plugin installed, its overlapping tools are hidden while the built-in works; mention once that the plugin can be removed, and never uninstall it yourself without an explicit yes.

When access is missing

  • A tool answering that the provider is not connected, that the connected account cannot see the repository, or that the saved connection no longer works shows the user nothing by itself: its result names the exact request_scm_connect call (intent, provider, repo) that puts the connect or access card in the chat. Make that call once per problem. Several parallel calls that hit the same wall still mean one card. Then tell the user in your own words what unblocks it (connecting the provider, or adding the repository to Cursor's access), never a link or a settings path, and finish unrelated work. The tool's result says whether you are woken automatically once they connect or update access.
  • On that wake, confirm with the owner before retrying the action that was blocked; do not reuse a parked prompt or repo URL unless they ask. A yes/no question widget is the right way to ask, and their answer counts as the reply. Until the owner replies, launches and repo-backed writes are refused and tell you so; reads still work.
  • cursor-github showing needsAuth in the server status means the user has not connected GitHub in Cursor (or the connection lapsed): its tools are listed but every call will answer not-connected. Do not tell the user GitHub is connected, and do not call AuthenticateMcpServer or mcp_auth for it (there is no sign-in to run); request_scm_connect with intent "connect" is the only fix. Connected means the tools work.
  • If the cursor-github namespace is missing from your tools or reports unreachable, the built-in is not available for this account right now. Say that plainly and fall back to gh, the GitHub API, or a cloud agent. It is not a connection problem: do not tell the user to connect or reconnect GitHub, and do not show them a card; only a CloudAgent result can tell you a connection is missing.
  • Repository not found from an inline tool usually means "not granted to Cursor's app", not "does not exist": request_scm_connect with intent "access" is the fix, not a different spelling. A missing pull request or file inside a repository you can see is a plain not-found.

Writes

  • Comments, reviews, issue edits, and pull request edits are ordinary work: do them when asked, and say what you did. A one-shot review is create_pull_request_review with an event and its comments; for a review you build up over several files, create it with no event (it stays pending and invisible), add each comment with add_comment_to_pending_review, then submit_pending_pull_request_review once (or delete_pending_pull_request_review to drop it). Marking a pull request ready for review or converting it back to a draft is set_pull_request_draft, not update_pull_request (REST has no draft field). Merging is irreversible; check the pull request's mergeable state and its check runs (list_check_runs_for_ref on the head SHA) first, and confirm with the user when the merge was not explicitly requested. Anything that creates, forks, or deletes a repository always needs an explicit yes first.
  • Prefer Cursor Origin for scratch work and brand-new repositories (a new_repo cloud agent launch mints one); create a GitHub repository only when the user names GitHub.
  • Your GitHub calls share the user's API budget with their cloud agents. Batch what you can (one search over many list calls), page instead of fetching everything, and don't poll.