Azure DevOps
Full Azure DevOps integration over REST API v7.1. Covers 13 domains (work items,
repos/PRs, iterations/capacity, pipelines, search, wiki, test plans, security,
variable groups, environments/approvals, branch policies, attachments, core).
When to use
User mentions Azure DevOps / dev.azure.com / VSTS and wants to: manage sprints,
create/update/link work items, run WIQL queries, list repos or browse files,
create/review/complete/abandon PRs, run/queue/cancel pipelines and read build logs,
search code/wiki/work-items, edit wiki pages, manage test plans, check security
alerts, edit variable groups, approve/reject environment deployments, or set
branch policies (min reviewers, build validation).
Setup (auth)
All scripts live under scripts/ in the source repo. Authenticate once:
# OAuth device-code flow (recommended; tokens auto-refresh)
python scripts/auth.py login --org MyOrganization
# OR Personal Access Token
python scripts/auth.py login --org MyOrganization --pat YOUR_PAT
python scripts/auth.py status # check
python scripts/auth.py logout
PAT scopes (create at https://dev.azure.com/{org}/_usersSettings/tokens):
Work Items R/W, Code R/W, Build R/Execute, Wiki R/W, Test Management R/W,
Advanced Security Read, Project & Team Read, Identity Read.
Credentials are stored in the system keyring (macOS Keychain / Windows Credential
Locker / Linux Secret Service) under service azure-devops-skill.
Key commands (per script)
Common args: --project MyProject, plus --repo, --id, --pr-id, etc.
- core.py —
list-projects, list-teams, get-identity --search "x@y.com"
- work_items.py —
get|create|update|delete, batch-get --ids 1,2,3,
add-children, link/unlink, add-comment/list-comments, get-revisions,
my-items, iteration-items --iteration-path "Proj\\Sprint 1",
run-wiql --query "SELECT [System.Id] FROM WorkItems WHERE...",
list-queries/run-query, recycle-bin
- repos.py —
list, list-branches, create-branch --source main,
search-commits, list-prs, create-pr --source feat --target main --title ...,
get-pr, update-pr, add-reviewer --vote 10, create-thread/add-thread-comment,
complete-pr [--merge-strategy rebase --keep-source], abandon-pr,
get-diff --base main --target feat, list-files
- work.py —
list-iterations, create-iteration --start-date --finish-date,
team-iterations --timeframe current, assign-iteration, get-capacities,
set-capacity --activity Development --capacity-per-day 6
- pipelines.py —
list-builds, get-build, build-logs [--log-id N],
list-definitions, run --pipeline-id N [--variable K V], get-run/list-runs,
queue-build, cancel-build, build-status, get-artifacts, update-stage
- search.py —
code --query, wiki --query, work-items --query
- wiki.py —
list, list-pages, get-page/get-page-content,
create-or-update-page --path /X --content "..."
- test_plans.py —
list-plans/create-plan, list-suites,
list-test-cases, add-test-cases --ids, list-results/get-result
- security.py —
list-alerts [--state active --severity high --type dependency],
get-alert
- variable_groups.py —
list/get/create/update/delete,
add-variable --key K --value V [--secret], remove-variable
- environments.py —
list/create/get/delete, list-checks,
list-approvals [--state all], approve/reject --approval-id guid --comment
- policies.py —
list, list-types, create-min-reviewers --min-reviewers 2 --reset-on-push,
create-build-policy --build-definition-id N, update --enabled false|--blocking true,
list-evaluations --pr-id, delete
- attachments.py —
upload, attach, upload-and-attach, list,
download, remove --index N
Reference: common work-item fields
Title System.Title · State System.State · Assigned To System.AssignedTo ·
Description System.Description · Area System.AreaPath · Iteration
System.IterationPath · Priority Microsoft.VSTS.Common.Priority · Story Points
Microsoft.VSTS.Scheduling.StoryPoints · Tags System.Tags · Repro Steps
Microsoft.VSTS.TCM.ReproSteps · Acceptance Criteria Microsoft.VSTS.Common.AcceptanceCriteria
Reference: link types
Related System.LinkTypes.Related · Parent→Child System.LinkTypes.Hierarchy-Forward
· Child→Parent System.LinkTypes.Hierarchy-Reverse · Predecessor
System.LinkTypes.Dependency-Forward · Successor System.LinkTypes.Dependency-Reverse
Gotchas
- Iteration paths use backslashes and must be escaped in shell:
"Proj\\Sprint 1".
- Reviewer
--vote: 10 = approve, 5 = approve w/ suggestions, -10 = reject.
- Variable group secrets: pass
--secret so the value is masked at rest.
add-variable is the safe way to set one var; update replaces the whole set.
- Helper scripts are NOT vendored here — pull
scripts/*.py from the source repo
(sanjay3290/ai-skills, path skills/azure-devops/scripts/).
1---2name: azure-devops3description: "Use when working with Azure DevOps (dev.azure.com): manage sprints/iterations, create or update work items (User Story, Bug, Task, WIQL queries), list repos, create/review/complete pull requests, run or queue pipelines/builds, search code, manage wiki pages, check Advanced Security alerts, edit variable groups, approve deployment environments, or configure branch policies."4version: 1.0.05license: Apache-2.06tags: [azure-devops, work-items, pull-requests, pipelines, repos, wiki, variable-groups, branch-policies, ci-cd, rest-api]7source: https://github.com/sanjay3290/ai-skills/tree/main/skills/azure-devops8derived_from: awesomeclaude9prerequisites:10 commands: [python]11metadata:12 source: https://skillmd.com/skills/aashutosh396/azure-devops13---1415# Azure DevOps1617Full Azure DevOps integration over REST API v7.1. Covers 13 domains (work items,18repos/PRs, iterations/capacity, pipelines, search, wiki, test plans, security,19variable groups, environments/approvals, branch policies, attachments, core).2021## When to use22User mentions Azure DevOps / `dev.azure.com` / VSTS and wants to: manage sprints,23create/update/link work items, run WIQL queries, list repos or browse files,24create/review/complete/abandon PRs, run/queue/cancel pipelines and read build logs,25search code/wiki/work-items, edit wiki pages, manage test plans, check security26alerts, edit variable groups, approve/reject environment deployments, or set27branch policies (min reviewers, build validation).2829## Setup (auth)30All scripts live under `scripts/` in the source repo. Authenticate once:3132```bash33# OAuth device-code flow (recommended; tokens auto-refresh)34python scripts/auth.py login --org MyOrganization35# OR Personal Access Token36python scripts/auth.py login --org MyOrganization --pat YOUR_PAT37python scripts/auth.py status # check38python scripts/auth.py logout39```4041PAT scopes (create at `https://dev.azure.com/{org}/_usersSettings/tokens`):42Work Items R/W, Code R/W, Build R/Execute, Wiki R/W, Test Management R/W,43Advanced Security Read, Project & Team Read, Identity Read.4445Credentials are stored in the system keyring (macOS Keychain / Windows Credential46Locker / Linux Secret Service) under service `azure-devops-skill`.4748## Key commands (per script)49Common args: `--project MyProject`, plus `--repo`, `--id`, `--pr-id`, etc.5051- **core.py** — `list-projects`, `list-teams`, `get-identity --search "x@y.com"`52- **work_items.py** — `get|create|update|delete`, `batch-get --ids 1,2,3`,53 `add-children`, `link`/`unlink`, `add-comment`/`list-comments`, `get-revisions`,54 `my-items`, `iteration-items --iteration-path "Proj\\Sprint 1"`,55 `run-wiql --query "SELECT [System.Id] FROM WorkItems WHERE..."`,56 `list-queries`/`run-query`, `recycle-bin`57- **repos.py** — `list`, `list-branches`, `create-branch --source main`,58 `search-commits`, `list-prs`, `create-pr --source feat --target main --title ...`,59 `get-pr`, `update-pr`, `add-reviewer --vote 10`, `create-thread`/`add-thread-comment`,60 `complete-pr [--merge-strategy rebase --keep-source]`, `abandon-pr`,61 `get-diff --base main --target feat`, `list-files`62- **work.py** — `list-iterations`, `create-iteration --start-date --finish-date`,63 `team-iterations --timeframe current`, `assign-iteration`, `get-capacities`,64 `set-capacity --activity Development --capacity-per-day 6`65- **pipelines.py** — `list-builds`, `get-build`, `build-logs [--log-id N]`,66 `list-definitions`, `run --pipeline-id N [--variable K V]`, `get-run`/`list-runs`,67 `queue-build`, `cancel-build`, `build-status`, `get-artifacts`, `update-stage`68- **search.py** — `code --query`, `wiki --query`, `work-items --query`69- **wiki.py** — `list`, `list-pages`, `get-page`/`get-page-content`,70 `create-or-update-page --path /X --content "..."`71- **test_plans.py** — `list-plans`/`create-plan`, `list-suites`,72 `list-test-cases`, `add-test-cases --ids`, `list-results`/`get-result`73- **security.py** — `list-alerts [--state active --severity high --type dependency]`,74 `get-alert`75- **variable_groups.py** — `list`/`get`/`create`/`update`/`delete`,76 `add-variable --key K --value V [--secret]`, `remove-variable`77- **environments.py** — `list`/`create`/`get`/`delete`, `list-checks`,78 `list-approvals [--state all]`, `approve`/`reject --approval-id guid --comment`79- **policies.py** — `list`, `list-types`, `create-min-reviewers --min-reviewers 2 --reset-on-push`,80 `create-build-policy --build-definition-id N`, `update --enabled false|--blocking true`,81 `list-evaluations --pr-id`, `delete`82- **attachments.py** — `upload`, `attach`, `upload-and-attach`, `list`,83 `download`, `remove --index N`8485## Reference: common work-item fields86Title `System.Title` · State `System.State` · Assigned To `System.AssignedTo` ·87Description `System.Description` · Area `System.AreaPath` · Iteration88`System.IterationPath` · Priority `Microsoft.VSTS.Common.Priority` · Story Points89`Microsoft.VSTS.Scheduling.StoryPoints` · Tags `System.Tags` · Repro Steps90`Microsoft.VSTS.TCM.ReproSteps` · Acceptance Criteria `Microsoft.VSTS.Common.AcceptanceCriteria`9192## Reference: link types93Related `System.LinkTypes.Related` · Parent→Child `System.LinkTypes.Hierarchy-Forward`94· Child→Parent `System.LinkTypes.Hierarchy-Reverse` · Predecessor95`System.LinkTypes.Dependency-Forward` · Successor `System.LinkTypes.Dependency-Reverse`9697## Gotchas98- Iteration paths use backslashes and must be escaped in shell: `"Proj\\Sprint 1"`.99- Reviewer `--vote`: 10 = approve, 5 = approve w/ suggestions, -10 = reject.100- Variable group secrets: pass `--secret` so the value is masked at rest.101- `add-variable` is the safe way to set one var; `update` replaces the whole set.102- Helper scripts are NOT vendored here — pull `scripts/*.py` from the source repo103 (sanjay3290/ai-skills, path skills/azure-devops/scripts/).