Skip to content

Add agent skills for the teams CLI - #126

Merged
sionsmith merged 2 commits into
osodevops:mainfrom
balcsida:feat/agent-skills
Oct 26, 2026
Merged

sionsmith merged 2 commits into
osodevops:mainfrom
balcsida:feat/agent-skills

Conversation

@balcsida

Copy link
Copy Markdown
Contributor

Adds installable agent skills so Claude Code, Codex and other agents know how to drive teams without reading the whole README. They follow the layout of osodevops/intelligence-layer-skills: one focused skill per workflow surface under skills/<name>/SKILL.md, each with an agents/openai.yaml, and no scripts or assets.

npx skills add osodevops/ms-teams-cli
npx skills add osodevops/ms-teams-cli --skill teams-cli-messaging

What ships:

  • teams-cli-setup: install, delegated sign-in (PKCE and device code, default OSO app, BYO app), profiles, CI and unattended auth, the JSON envelope, the exit code table, pagination, and troubleshooting pointers.
  • teams-cli-messaging: finding ids, reading chats and channels, send/reply/update/react/pin, soft delete and restore, the message get → attachment_items → attachments download pattern, --attach/--image, channel files, and chats.
  • teams-cli-admin: teams, channels, members, tags, apps and tabs, with a read-confirm-write procedure for destructive commands, which have no --yes flag.
  • teams-cli-automation: presence, meetings, activity notifications, change-notification subscriptions with listen, and a polling fallback.
  • README gains an "Agent Skills" section, the docs index links to skills/, CHANGELOG has an Unreleased entry, and docs/attachments-spec.md now names the real skill file instead of a teams-cli skill that never landed.

Verification:

  • Every teams ... line in the skills (116) was checked against the --help output of a binary built from this branch: the subcommand exists and each flag is listed. The skills follow --help where it differs from docs/command-reference.md (chat create --chat-type, no tab update, no subscribe get).
  • npx skills add <local path> --list discovers all four skills.
  • No Rust changes, so no version bump; this is not a release PR.
  • Scope and permission statements come from the repo docs and Graph documentation, not from a live tenant.

@sionsmith

Copy link
Copy Markdown
Contributor

@balcsida thanks for this - we are reviewing this today.

balcsida and others added 2 commits October 26, 2026 23:39
…tion

Four installable SKILL.md files under skills/, following the osodevops
skills convention (one focused skill per workflow surface, each with
agents/openai.yaml):

- teams-cli-setup: install, delegated sign-in, profiles, CI auth, the
  JSON envelope, exit codes and pagination
- teams-cli-messaging: find ids, read, send, reply, react, delete and
  restore, attachments and inline images, channel files, chats
- teams-cli-admin: teams, channels, members, tags, apps and tabs, with
  a confirmation procedure for destructive commands
- teams-cli-automation: presence, meetings, activity notifications,
  change-notification subscriptions, the local listener, and polling

Every command line in the skills was checked against the binary's
--help output. README gets an "Agent Skills" section with the
npx skills add install command; the docs index and CHANGELOG link to
the skills, and the attachments spec names the real skill file.
…ommands

Bring the skills up to date with osodevops#119 and osodevops#125:
- automation: listen binds 127.0.0.1, takes the subscription's
  clientState through TEAMS_CLI_CLIENT_STATE, and answers /lifecycle;
  subscribe create gets --lifecycle-url. The lifetimes now match
  Graph's table (Teams messages and chats up to three days, presence one
  hour, 45 minutes minimum, lifecycle URL over an hour), replacing "at
  most one hour", and say what to do on each lifecycle event.
- setup: --redirect-uri for a bring-your-own app's browser login, what
  is saved to the profile, and what AADSTS50011, a "Sign-in failed"
  error and the 10-minute wait mean.

agent_skill_commands_parse runs every teams line in the skills' code
blocks through Cli::try_parse_from, so a renamed flag or a missing
argument fails the build instead of teaching agents a broken command.
AGENTS.md lists skills/ and adds it to the keep-in-sync rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sionsmith

Copy link
Copy Markdown
Contributor

Thanks @balcsida. The skills are well scoped and accurate. Here's what I verified and what I added.

Verified

  • Command flags: every teams … line in the skills' code blocks (116) exists in --help.
  • Parsing: all 112 runnable lines parse in an isolated HOME with no token (no usage errors; auth login and listen skipped).
  • CLI claims: auth status exits 1 with an authenticated: false success payload; a closed pipe exits 0; only message delete and message attachments delete take --yes; message get is channel-only; the 3 MB --image cap; Scoop's teams manifest.
  • Packaging spec (agentskills.io and Codex openai.yaml): names match their directories; descriptions are 405–476 characters (limit 1024) and say when to use each skill; short_description is 44–52 characters (allowed 25–64); each skill is under 140 lines.

Fixed

  • automation: it said Teams message, chat and presence subscriptions last at most one hour. Graph's table says Teams chat and message subscriptions last up to three days and presence one hour; anything under 45 minutes is raised to 45; and over an hour a Teams subscription needs lifecycleNotificationUrl. The section now also covers Make teams listen safe behind a relay #119, which merged after you opened this: listen binds 127.0.0.1, takes the subscription's secret through TEAMS_CLI_CLIENT_STATE, and answers /lifecycle; subscribe create --lifecycle-url exists. It also says what to do on each lifecycle event.
  • setup: covers Configurable redirect URI and free loopback port for browser login #125's --redirect-uri for a bring-your-own app's browser login, what a login saves to the profile, and what AADSTS50011, a Sign-in failed: error and the 10-minute wait mean.

Drift guard

  • agent_skill_commands_parse (in src/cli/mod.rs) runs every skill command through Cli::try_parse_from. A renamed flag or a missing argument now fails the build. I checked that it catches both, with file and line.
  • AGENTS.md lists skills/ and adds the skills to its keep-in-sync rule.

Rebased onto main. fmt, clippy, all tests and CI on all three OSes are green.

@sionsmith
sionsmith merged commit 4d7a762 into osodevops:main Oct 26, 2026
6 checks passed
@sionsmith sionsmith mentioned this pull request Oct 27, 2026
@balcsida
balcsida deleted the feat/agent-skills branch October 27, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants