ado-api-cli
Skill0 starsChanged 8 months agoMITView on GitHub
Use when automating Azure DevOps operations — az devops CLI, REST API calls, PAT management, service principal automation, webhooks, and scripting repeatable ADO administrative tasks.
- Installs packages
- Sends data out
In this repository190 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- accessibility-auditSkill
- accessibility-complianceSkill
- ado-artifactsSkill
- ado-container-deploymentsSkill
- ado-organizationSkill
- ado-pipeline-designSkill
- ado-pipeline-optimizationSkill
- ado-pipeline-securitySkill
- ado-pipelines-opsSkill
- ado-release-managementSkill
- ado-security-policiesSkill
- ado-work-trackingSkill
- adr-writingSkill
- agentic-ai-patternsSkill
- agentic-evalSkill
- agentic-memorySkill
- agentic-reliabilitySkill
- agentic-securitySkill
- ai-data-moatSkill
- ai-harnessSkill
- ai-product-designSkill
- ai-product-monetizationSkill
- ai-product-positioningSkill
- ai-product-retentionSkill
- ai-product-validationSkill
- ai-safety-guardrailsSkill
- add-analytics-instrumentationSkill
- analyze-account-healthSkill
- analyze-ai-topicsSkill
- analyze-chartSkill
- analyze-dashboardSkill
- analyze-experimentSkill
- analyze-feedbackSkill
- compare-user-journeysSkill
- create-chartSkill
- create-dashboardSkill
- daily-briefSkill
- debug-replaySkill
- diagnose-errorsSkill
- diff-intakeSkill
- discover-analytics-patternsSkill
- discover-event-surfacesSkill
- discover-opportunitiesSkill
- instrument-eventsSkill
- investigate-ai-sessionSkill
- monitor-ai-qualitySkill
- monitor-reliabilitySkill
- replay-ux-auditSkill
- review-agent-insightsSkill
- taxonomySkill
- weekly-briefSkill
- what-would-lenny-doSkill
- analytics-reportingSkill
- api-contract-testingSkill
- api-designSkill
- authentication-patternsSkill
- blockchain-auditSkill
- brainstormingSkill
- brand-voiceSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 50
Never commit PATs to repos — use secrets manager
- Distinctive: line 52
Use service principal instead of PAT for long-running automation
- Distinctive: line 141
Not specifying api-version (breaking changes when Microsoft updates API)
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ADO REST API & CLI Automation
When to Use
- Automating project provisioning (new team → create project, teams, areas, iterations)
- Bulk operations (add users, update permissions, create work items from CSV)
- Integrating ADO with external systems via webhooks or REST API
- Building governance scripts (audit policy compliance, report on inactive users)
- CI/CD automation scripts that interact with ADO APIs
Core Jobs
1. az devops CLI Setup
# 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)2. PAT Management
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:
- Never commit PATs to repos — use secrets manager
- Set expiry date (max 1 year, prefer 90 days)
- Use service principal instead of PAT for long-running automation
3. REST API Usage
# 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"4. Webhooks & Service Hooks
# Create webhook for pull request events
az devops service-endpoint webhooks create \
--name "MyWebhook" \
--url "https://myapp.com/webhook" \
--project MyProjectCommon service hook events:
git.push— code pushed to branchgit.pullrequest.created— PR openedbuild.complete— pipeline finishedworkitem.created/workitem.updated— work item changes
5. Python SDK Automation
from 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
Key Concepts
- PAT (Personal Access Token) — short-lived credentials for API access; tied to user
- Service principal — AAD app identity for automated, user-independent access
- REST API version — always specify
api-version(e.g.,7.1); avoidapi-version=previewin production - WIQL — Work Item Query Language; use in
wit_client.query_by_wiql() - Service hook — outbound webhook from ADO to external systems on events
Checklist
- Using service principal (not PAT) for production automation?
- PATs have minimum required scopes?
- PAT expiry dates set (90 days recommended)?
- API calls specify explicit api-version?
- Secrets stored in Azure Key Vault (not hardcoded)?
- Webhook payloads validated with shared secret?
Key Outputs
- Automation scripts for common provisioning tasks
- Service hooks configured for integration with external systems
- PAT rotation schedule documented
- Python/bash scripts for bulk ADO operations
Output Format
- 🔴 Critical — PATs committed to repos, Full Access PAT used for automation, no expiry on PATs
- 🟡 Warning — using PAT instead of service principal for long-running automation, no api-version specified in REST calls
- 🟢 Suggestion — use azure-devops Python SDK instead of raw REST calls, store scripts in
.azuredevops/folder in repo
Anti-Patterns
- Using personal Full Access PAT in CI/CD scripts (breaks on user offboarding)
- Hardcoding PATs in scripts (security incident waiting to happen)
- Polling ADO API in a loop (use webhooks/service hooks instead)
- Not specifying api-version (breaking changes when Microsoft updates API)
Integration
ado-organization— automate project/team provisioningado-pipelines-ops— automate service connection and variable group creationado-security-policies— automate security group membership and policy configuration
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

