add_vcs_link
Links a task to a pull request, commit, or branch so PR-driven status automation and shipped-code reports can match the task to the code that implements it.
Instructions
Link a task to a pull request, commit, or branch. This is what makes the task↔PR join real: a task with no VCS link cannot be matched to the code that implements it, so PR-driven status automation and any 'what shipped for this task?' report simply will not see it. Call it as soon as the PR exists. Only task_id and url are needed — provider, link_type and external_id are inferred from a GitHub or GitLab URL. If the PR is ALREADY merged (or closed) by the time you call this — e.g. you finished, merged, and are linking retroactively — pass status='merged' (or 'closed'). Without it the link starts as 'open' and the done-evidence gate will block move→done on it forever: no GitHub webhook fires for a merge that happened before the link existed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Link URL, e.g. https://github.com/owner/repo/pull/123. | |
| title | No | Human-readable label, e.g. the PR title. | |
| status | No | PR status, if you already know it: open, merged, closed. Pass 'merged' when linking a PR that was merged before this call — that is the one case a webhook can never backfill. Omit it to let the link start as 'open' (the safe default when the PR is still active). Calling add_vcs_link again on the same PR with a status update is safe — it corrects the existing link rather than failing. | |
| task_id | Yes | Task ID. | |
| provider | No | VCS provider: github, gitlab. Inferred from the URL host; defaults to github. | |
| link_type | No | What the URL points at: pr (alias: pull_request), commit, branch. Inferred from the URL path; defaults to pr. | |
| external_id | No | PR number, commit SHA, or branch name. Inferred from the URL; only needed when the URL is not a recognised PR/commit/branch link. |