/ado-toolkit:ado-pr <PR_ID_OR_URL | create | update | comment [add|reply|resolve]>from ado-toolkit
Azure DevOps pull requests via the Azure CLI (az + azure-devops extension) — review a PR, create or update a PR (German title schema, ADO work items linked and referenced as #id), and create/answer/resolve PR comment threads. Use when the user mentions an ADO pull request / PR, pastes a PR URL or ID, or asks to review, open, update, or comment on a PR. Targets the newest Azure DevOps Server version; assumes you are already signed in (PAT).
Ships in ado-toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Pull-request workflows for Azure DevOps via the Azure CLI (az + azure-devops extension):
review, create, update, and comment on PRs. Use this skill when the user
pastes a PR URL/ID or asks to review, open, update, or comment on an Azure DevOps PR.
Shared setup first. Before the first
azcommand, run Step 0 (connection detection) in ../ado-shared/REFERENCE.md; when anazcommand fails, its Setup Check diagnoses the error first. That file also holds the Command Map, Title schema, German text (umlauts verbatim), Repository Mismatch Check, Quirks, and Error handling & local-state safety rules the workflows below refer to.{org}=organization,{repo}=repository,{project}come from Step 0.
Trigger: User provides a PR ID (numeric) or PR URL, or asks to review a PR.
az repos pr show --id {prId} --org {org} -o json. Note sourceRefName, targetRefName, title, description, createdBy, creationDate, status, repository.name.
Repository check: compare repository.name against the local repository; if different, run the Repository Mismatch Check and stop unless confirmed.refs/heads/ from source and target, then:
git fetch origin {sourceBranch} {targetBranch}
git diff --name-status origin/{targetBranch}...origin/{sourceBranch}
git diff --stat origin/{targetBranch}...origin/{sourceBranch}
git diff origin/{targetBranch}...origin/{sourceBranch}
git log --oneline origin/{targetBranch}...origin/{sourceBranch}
If the source branch no longer exists (merged/deleted, git fetch fails): use lastMergeSourceCommit.commitId from the PR metadata — git fetch origin {commitId}, then diff against {commitId} instead of origin/{sourceBranch}.
If git operations fail for any other reason, report the error and stop. Do NOT fall back to API-based changes.az devops invoke --area git --resource pullRequestThreads --route-parameters project={project} repositoryId={repo} pullRequestId={prId} --org {org} --api-version 7.1 -o json. Filter out system-only threads (every comment has commentType: "system"); show human comments.originalRef. Remember whether you stash below.git stash -u.git checkout origin/{sourceBranch} --detach (or {commitId} --detach if the deleted-branch fallback was used in step 3).git checkout {originalRef}; if you stashed, git stash pop. If any step from 5 onward fails, do this first, then report and stop.Trigger: User asks to create a PR, or $ARGUMENTS starts with create.
Verify branch is pushed:
CURRENT_BRANCH=$(git branch --show-current)
git rev-list --count "origin/$CURRENT_BRANCH..HEAD" 2>/dev/null
If the branch is untracked or has unpushed commits, ask the user whether to push. If yes: git push -u origin $CURRENT_BRANCH. If no: stop.
Check for existing PR: az repos pr list --repository {repo} --source-branch {currentBranch} --status active --org {org} --project {project} --detect false -o json. If a PR exists, show its title and ID and ask whether to update instead (→ PR Update workflow).
Get default branch: az repos show --repository {repo} --org {org} --project {project} --detect false -o json; use defaultBranch (strip refs/heads/) as the target branch.
Gather commit and change information: git log --oneline "origin/{targetBranch}..{currentBranch}" and git diff --name-only "origin/{targetBranch}..{currentBranch}" (the changed-file list feeds the component in step 7).
Ask for the work item ID(s) the PR delivers — the Azure DevOps work item number(s), e.g. 1234. A linked work item is required for every PR here (branch policy enforces it); if the user has none, ask for one before creating the PR — do not proceed without it.
Check for a PR template: Glob for .azuredevops/pull_request_template.md in the repo root; if found, read it and use it as the description structure. If none is found, use the default template in step 7.
Generate title and description.
Prescribed by a calling skill. Another skill may run this workflow for its own kind of PR and prescribe a marker or a description structure of its own. Where it does, that replaces the matching default below; everything else in this workflow — the pushed branch, the required work item and its link, the review in step 8 — stays as written.
Title — shared schema <Marker> #<WorkItemId> Component - Änderungsbeschreibung
(see Title schema in the shared reference):
<Marker> = change-category emoji by majority vote over commit messages: 🐞 bug fixes
(fix/bugfix/hotfix); 🏗️ refactor (refactor/cleanup/restructure); 📖 docs
(docs/documentation); 🏆 features or unclear (default). Tie-break: most recent commit's
category.#1234.Prüfung, never
Pruefung; shared German text rule, which also covers the description below).Description (German). Use the repo's PR template if step 6 found one; otherwise build the
description from this default template (recreate it verbatim — it is our standard structure).
Do not reference the work item in the description (no #1234): it is already linked to the
PR in step 10, so a mention here only adds noise. The work-item reference lives in the title.
**Inhalt**
<kurze Zusammenfassung>
**Betroffene Komponenten**
<betroffene Komponenten/Anwendungen>
**Risikobewertung**
Niedrig|Mittel|Hoch, weil <Begründung>
Fill all three sections — Inhalt (short German summary, optionally the key commits),
Betroffene Komponenten (the affected components), and Risikobewertung (pick
Niedrig/Mittel/Hoch and justify after weil). The description must include a risk
section: if a repo template was found but has none, append Risikobewertung.
(Reminder: per Quirks, the emoji icon — and possibly umlauts — will be mis-echoed in the CLI's returned JSON; that is expected, the PR has them. Still send title and description with the real emoji and umlauts.)
Present to user for review: show generated title and full description; apply requested changes; repeat until approved.
Create the PR: az repos pr create --repository {repo} --source-branch {source} --target-branch {target} --title "{title}" --description "{description}" --org {org} --project {project} --detect false -o json (branch names without refs/heads/). Note the pullRequestId.
Link the work item(s) to the PR — always, for every PR. This is the direct association, in
addition to the #id in the title; the title's #id is not itself a link, so never skip this
step (the description deliberately does not repeat the work item — it is linked here): az repos pr work-item add --id {prId} --work-items {id} [{id2} …] --org {org} -o json.
Report result: show the PR URL and ID (pullRequestId), and the linked work item(s).
Trigger: User asks to update a PR, or $ARGUMENTS starts with update.
currentBranch=$(git branch --show-current)), then az repos pr list --repository {repo} --source-branch {currentBranch} --status active --org {org} --project {project} --detect false -o json.
az repos pr show --id {prId} --org {org} -o json.az repos pr work-item list --id {prId} --org {org} -o json).az repos pr update --id {prId} [--title "{newTitle}"] [--description "{newDescription}"] [--status active|abandoned|completed] --org {org} -o json. Include only the flags for fields being changed (the brackets mark optional flags — omit those you are not updating). To change linked work items: az repos pr work-item add --id {prId} --work-items {id} --org {org} -o json (or ... work-item remove ... --work-items {id}).Trigger: User asks to add a comment to a PR, reply to a PR comment, or resolve/reopen a
comment thread, or $ARGUMENTS starts with comment.
ADO PR comments live in threads; each thread has one or more comments and a status
(active, fixed = resolved, closed, wontFix, byDesign, pending). The az CLI has no
first-class comment command, so use az devops invoke against the git area. POST/PATCH
bodies are passed as a file via --in-file — write them with mktemp as plain UTF-8, and
JSON-escape the comment text (quotes, newlines; umlauts/ß stay literal — see German
text in the shared reference). If a --resource name is rejected, discover it with
az devops invoke --query "[?area=='git']".
az repos pr list ..., else ask for
the ID; then az repos pr show --id {prId} --org {org} -o json.az devops invoke --area git --resource pullRequestThreads --route-parameters project={project} repositoryId={repo} pullRequestId={prId} --org {org} --api-version 7.1 -o json. Skip system-only threads (every comment commentType: "system"); show each human thread's id (threadId), status, and its comments (id, author, content).threadContext only for a file/line-anchored comment):
f=$(mktemp); cat > "$f" <<'JSON'
{ "comments": [ { "parentCommentId": 0, "content": "<text>", "commentType": "text" } ],
"status": "active",
"threadContext": { "filePath": "/path/from/repo/root",
"rightFileStart": { "line": <N>, "offset": 1 },
"rightFileEnd": { "line": <N>, "offset": 1 } } }
JSON
az devops invoke --area git --resource pullRequestThreads --route-parameters project={project} repositoryId={repo} pullRequestId={prId} --http-method POST --in-file "$f" --media-type application/json --org {org} --api-version 7.1 -o json; then rm "$f".threadId and the last comment's id in it (the parentCommentId).f=$(mktemp); printf '{ "parentCommentId": <lastCommentId>, "content": "<text>", "commentType": "text" }' > "$f".az devops invoke --area git --resource pullRequestThreadComments --route-parameters project={project} repositoryId={repo} pullRequestId={prId} threadId={threadId} --http-method POST --in-file "$f" --media-type application/json --org {org} --api-version 7.1 -o json; then rm "$f".threadId.{ "status": "fixed" } to resolve (or "closed"), { "status": "active" } to reopen:
f=$(mktemp); printf '{ "status": "fixed" }' > "$f".az devops invoke --area git --resource pullRequestThreads --route-parameters project={project} repositoryId={repo} pullRequestId={prId} threadId={threadId} --http-method PATCH --in-file "$f" --media-type application/json --org {org} --api-version 7.1 -o json; then rm "$f".Report what changed: the new comment/thread id, or the thread's new status.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub mediainterface/claude-marketplace --plugin ado-toolkit3 skills in this plugin
/ado-pipelineAzure DevOps pipelines and changelogs via the Azure CLI (az + azure-devops extension) — analyse a build/pipeline failure (timeline, failed-task logs, root cause, suggested fix) and generate a changelog of what changed since a build or commit. Use when the user pastes a pipeline/build URL or a build ID, asks about a build failure, or asks what changed since a build or commit. Newest Azure DevOps Server; assumes you are already signed in (PAT)./ado-workitemAzure DevOps work items (tickets) via the Azure CLI (az + azure-devops extension) — create, show, query (WIQL), update, and comment on work items, with each type's content in its own field (acceptance criteria, repro steps, resolution) and the team's Area/Iteration. Type, state, field and relation names depend on the server and project (a German server says Aufgabe, not Task, and "Übergeordnetes Element", not parent); they come from a discovery cache and are fetched only when missing or rejected. Use when the user mentions an ADO work item / ticket / Arbeitselement / Aufgabe / Fehler / User Story, or asks to create, find, update, or comment on one. Newest Azure DevOps Server; assumes you are already signed in (PAT).