agentleFS
jamesyang124jamesyang124/agent-skills/skills/ado-pr-teams-notify/SKILL.md

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.

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
  1. Distinctive:

    Not for GitHub or GitLab PRs, or for Teams notifications from other sources.

    line 32
  2. Very specific:

    No PAT? Run the same REST calls inside a logged-in ADO tab (recipe in references/ado-rest.md).

    line 68
  3. Very specific:

    After every import the flow is Off.

    line 89
  4. Distinctive:

    Only a reply moves a thread to the bottom.

    line 91
  5. Very specific:

    Do not use light-grey or white elements (⚪ ⬜, Light text color): cards render on a white/dark surface and become invisible.

    line 92
  6. Distinctive:

    Never click Import/On for the user if the harness blocks it.

    line 95

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 -g
Azure 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)

InputWhere it comes from
ADO org, project, and repo = target branch listthe 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 + channelthe 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 timezonethe user (cards link [KEY-123] in PR titles; times shown in that timezone)
A browser session logged in to Teams, Power Automate and Azure DevOpsthe user (this skill does not log in; an SSO session must already exist)
Optional: an ADO personal access tokenlets 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

  1. 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.)
  2. Export the template (flows/<id>/export → name → Export → Download; zip) and unzip it.
  3. 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 build
    (config.json: copy scripts/config.example.json.) It writes build/ and flow-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.
  4. Create the Service Hooks (4 per repo, all to the same webhook URL):
    export ADO_PAT=…; python3 scripts/ado_hooks.py create --org ORG --project PROJ --webhook-url URL --repo hubs=master --repo infra=main
    No PAT? Run the same REST calls inside a logged-in ADO tab (recipe in references/ado-rest.md). The comment hook gets the same target-branch filter as the others so comments follow only PRs that were announced.
  5. Verify with a state sequence: scripts/build_test_payloads.py then scripts/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.
  6. 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.md as the "what RDs will see" description.

Operating the setup later

TaskHow
Show an already-open PR in Teamsscripts/backfill_pr.py --pr N … (posts a real created event; skips drafts)
Add a repoado_hooks.py create --repo NAME=BRANCH (idempotent)
Remove old hooksado_hooks.py list then delete --id
Change card layout/copyedit scripts/gen_flow_definition.py, regenerate, re-import, turn the flow back On, re-run the state sequence
Move to another channelrepeat 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 cardsthey 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 (⚪ ⬜, Light text 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.