ado-pr-teams-notify
Skill2 starsChanged 14 days agoMITView on GitHub
Set up and operate Azure DevOps pull-request notifications in a Microsoft Teams channel through one Power Automate flow - one updating Adaptive Card per PR plus a one-line thread reply per event, drafts skipped, many repos and branches into one flow. Covers the Teams Workflows template, flow package export/edit/import, Service Hook subscriptions (REST), end-to-end state tests, backfilling an open PR, adding repos, switching channels and the known gotchas. Browser-agnostic (ego-browser, Playwright, Chrome DevTools MCP); the REST steps also run with a PAT only. Use when asked to send Azure DevOps PR activity to Teams.
In this repository18 other files it gives its agents.
- ado-open-prSkill
- ado-pr-code-reviewSkill
- ado-pr-resolve-commentsSkill
- agent-playtestSkill
- explain-diff-htmlSkill
- generate-pr-notesSkill
- git-commit-conventional-strictSkill
- install-atlassian-mcpSkill
- install-azure-devops-mcpSkill
- install-playwright-mcpSkill
- install-sentry-mcpSkill
- prd-to-sdd-specSkill
- sdd-qa-to-ticketSkill
- setup-project-configSkill
- spec-recalibrateSkill
- sync-api-specSkill
- tech-plan-to-ticketSkill
- tech-plan-to-wikiSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 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.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 32
Not for GitHub or GitLab PRs, or for Teams notifications from other sources.
- Very specific: line 68
No PAT? Run the same REST calls inside a logged-in ADO tab (recipe in references/ado-rest.md).
- Very specific: line 89
After every import the flow is Off.
- Distinctive: line 91
Only a reply moves a thread to the bottom.
- Very specific: line 92
Do not use light-grey or white elements (⚪ ⬜, Light text color): cards render on a white/dark surface and become invisible.
- Distinctive: line 95
Never click Import/On for the user if the harness blocks it.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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 pull requests → one card per PR in a Teams channel
Install this skill
npx skills add jamesyang124/agent-skills --skill ado-pr-teams-notify -gAzure DevOps Service Hooks (4 per repo) ──HTTP POST──▶ Power Automate flow (Teams "webhook alerts" template, one URL)
created · commented · updated(any type) │ Switch on eventType
├─ created → post root card (skip drafts)
├─ updated → update root card + 1-line reply
└─ commented → update root card + 1-line reply (quote)Result in Teams: one main card per PR (updated in place) + one short reply per event (bumps the thread to the bottom
of the channel and notifies). The card shows what a reader needs without opening the thread. Layout and exact copy:
references/card-and-copy-spec.md. Architecture and the reasoning behind each choice: references/architecture.md.
When to Use
- Set up PR notifications from Azure DevOps to a Teams channel (one card per PR, one reply per event).
- Operate an existing setup: backfill an open PR, add a repo, remove old hooks, change card layout, move to another channel, or find out why someone cannot see the cards.
Not for GitHub or GitLab PRs, or for Teams notifications from other sources.
Arguments
Invoke /ado-pr-teams-notify with the task (setup, test, backfill-pr <N>, add-repo <repo=branch>, switch-channel) and the inputs listed below; the skill asks for what is missing. All paths below are relative to this skill's folder.
What you need before starting (ask the user for anything missing)
| Input | Where it comes from |
ADO org, project, and repo = target branch list | the user (branch = the PR target; use the repo's default branch unless told otherwise, and say so if it differs from what they stated) |
| Teams team + channel | the user; the channel must be one the flow owner is a member of. Private channel = only its members can see the cards |
| Jira base URL, display timezone | the user (cards link [KEY-123] in PR titles; times shown in that timezone) |
| A browser session logged in to Teams, Power Automate and Azure DevOps | the user (this skill does not log in; an SSO session must already exist) |
| Optional: an ADO personal access token | lets the REST steps run without a browser (ADO_PAT) |
Browser: any of ego-browser, Playwright, Chrome DevTools MCP works; mapping in references/browser-adapters.md.
Phases
- Create the template flow (Teams). In the target channel use Workflows → "Send webhook alerts to a channel". This yields a flow with a
Teams-webhook trigger, a connection, and the webhook URL (HTTP POST URL of the trigger). Record: team id (
groupId), channel id (19:…@thread.tacv2), flow id, webhook URL. (The ids are also visible in the flow's code view / the Teams channel link.) - Export the template (
flows/<id>/export→ name → Export → Download; zip) and unzip it. - Generate the merged flow and import it over the template:
(python3 scripts/gen_flow_definition.py --export-dir <unzipped export> --config config.json --out-dir buildconfig.json: copyscripts/config.example.json.) It writesbuild/andflow-package.zip. Import with My flows → Import → Import Package (Legacy): upload the zip; flow row = Update → pick the existing flow; connection row = Select during import → your Teams connection; Save; Import. After import the flow is Off: open its details page and turn it On. The final Import click may be blocked by an auto-mode safety classifier for agents; if it is, stage everything and ask the human to click Import once. - Create the Service Hooks (4 per repo, all to the same webhook URL):
No PAT? Run the same REST calls inside a logged-in ADO tab (recipe inexport ADO_PAT=…; python3 scripts/ado_hooks.py create --org ORG --project PROJ --webhook-url URL --repo hubs=master --repo infra=mainreferences/ado-rest.md). The comment hook gets the same target-branch filter as the others so comments follow only PRs that were announced. - Verify with a state sequence:
scripts/build_test_payloads.pythenscripts/send_event.sh URL …; read the card text back from the Teams page after each step (test plan and expected values:references/test-plan.md). Report results as text unless the user wants screenshots. - Hand over: tell the user what remains manual (Import click, deleting test posts, anything only a human could verify such as how the
colors render) and give them
references/card-and-copy-spec.mdas the "what RDs will see" description.
Operating the setup later
| Task | How |
| Show an already-open PR in Teams | scripts/backfill_pr.py --pr N … (posts a real created event; skips drafts) |
| Add a repo | ado_hooks.py create --repo NAME=BRANCH (idempotent) |
| Remove old hooks | ado_hooks.py list then delete --id |
| Change card layout/copy | edit scripts/gen_flow_definition.py, regenerate, re-import, turn the flow back On, re-run the state sequence |
| Move to another channel | repeat phase 1 for the new channel, put its ids in config.json, regenerate, import over the new template flow, repoint the hooks to its webhook URL |
| Someone cannot see the cards | they are not in the (private) channel/team; add them. Nothing to change in the flow |
Rules that save hours (details in references/troubleshooting.md)
- Edit the flow by regenerating the package, not by clicking in the designer. The designer DOM is hard to automate; the package route is deterministic.
- After every import the flow is Off. A POST to an Off flow returns HTTP 400
WorkflowTriggerIsNotEnabled. - Teams bot posts cannot be deleted (no menu item, no connector action). Use obviously fake PR numbers for tests and expect to leave them.
- Only a reply moves a thread to the bottom; editing a card does not. That is why every event posts one short reply.
- Do not use light-grey or white elements (⚪ ⬜,
Lighttext color): cards render on a white/dark surface and become invisible. - Colored columns get padding in Teams, so a "1px" state bar still renders thick; keep it only if the user wants the at-a-glance color.
- Real ADO event wording differs from fake payloads. Names are cut at the first verb in
message.text; verify against the first real PR. - Never click Import/On for the user if the harness blocks it; stage and hand it over. Never put the webhook URL signature or PAT into committed files.
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.

