skills/ado-api-cli/SKILL.md
Use when automating Azure DevOps operations — az devops CLI, REST API calls, PAT management, service principal automation, webhooks, and scripting repeatable ADO administrative tasks.
npx skillsauth add kienbui1995/magic-powers ado-api-cliInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
# Install
pip install azure-cli
az extension add --name azure-devops
# Configure defaults
az devops configure \
--defaults organization=https://dev.azure.com/MyOrg project=MyProject
# Authenticate
export AZURE_DEVOPS_EXT_PAT="your-pat-token"
# OR: az login (uses AAD auth)
Create PAT (via UI): User Settings → Personal Access Tokens → New Token
PAT scope best practices: | Scope | Use case | |-------|---------| | Code (Read) | Clone repos in CI | | Build (Read & Execute) | Trigger pipelines | | Work Items (Read & Write) | Update work items from scripts | | Full Access | Admin scripts — minimize lifetime (7 days) |
# List PATs via API
curl -u ":$PAT" \
"https://vssps.dev.azure.com/MyOrg/_apis/tokens/pats?api-version=7.1-preview.1"
PAT security:
# Base URL pattern
BASE="https://dev.azure.com/MyOrg/MyProject/_apis"
AUTH=$(echo -n ":$PAT" | base64)
# List projects
curl -H "Authorization: Basic $AUTH" \
"https://dev.azure.com/MyOrg/_apis/projects?api-version=7.1"
# Create work item
curl -X POST \
-H "Authorization: Basic $AUTH" \
-H "Content-Type: application/json-patch+json" \
"https://dev.azure.com/MyOrg/MyProject/_apis/wit/workitems/\$User%20Story?api-version=7.1" \
-d '[{"op":"add","path":"/fields/System.Title","value":"New feature"}]'
# Get pipeline runs
curl -H "Authorization: Basic $AUTH" \
"$BASE/_apis/pipelines/1/runs?api-version=7.1"
# Create webhook for pull request events
az devops service-endpoint webhooks create \
--name "MyWebhook" \
--url "https://myapp.com/webhook" \
--project MyProject
Common service hook events:
git.push — code pushed to branchgit.pullrequest.created — PR openedbuild.complete — pipeline finishedworkitem.created / workitem.updated — work item changesfrom azure.devops.connection import Connection
from msrest.authentication import BasicAuthentication
credentials = BasicAuthentication('', PAT)
connection = Connection(base_url=f'https://dev.azure.com/{ORG}', creds=credentials)
# Get clients
wit_client = connection.clients.get_work_item_tracking_client()
build_client = connection.clients.get_build_client()
# Create work item programmatically
from azure.devops.v7_1.work_item_tracking.models import JsonPatchOperation
patch = [JsonPatchOperation(op='add', path='/fields/System.Title', value='Bug: Login fails')]
wit_client.create_work_item(patch, project='MyProject', type='Bug')
Install: pip install azure-devops
api-version (e.g., 7.1); avoid api-version=preview in productionwit_client.query_by_wiql().azuredevops/ folder in repoado-organization — automate project/team provisioningado-pipelines-ops — automate service connection and variable group creationado-security-policies — automate security group membership and policy configurationcontent-media
Use when designing for XR (AR/VR/MR), choosing interaction modes, or adapting 2D UI patterns for spatial computing
testing
Use when creating new skills, editing existing skills, or verifying skills work before deployment
development
Use when you have a spec or requirements for a multi-step task, before touching code
development
Use when executing a structured workflow — select and run a feature, bugfix, refactor, research, or incident template with correct agent and model assignments per phase.