bot-command

Create Teams bot command modules with deterministic matching and admin gating.

1|Updated Aug 22, 2025
One-click install
npx skills add https://github.com/interserver/teams-chat-bot --skill bot-command
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bot-command
Source: https://github.com/interserver/teams-chat-bot/tree/main/.claude/skills/bot-command
Command: npx skills add https://github.com/interserver/teams-chat-bot --skill bot-command

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of creating consistent, testable bot command handlers without breaking the dispatcher’s match/ordering rules or leaking command existence to non-admin users.

Core Features & Use Cases

  • Command Module Scaffold: Creates a new server/commands/<camelCaseName>.js module that exports exactly { match(text, lcText, deps), execute(matchResult, deps) } so the dispatcher can load it.
  • Deterministic Matching & Admin Gating: Ensures match() is synchronous, does not throw, and places if (deps.ima !== 'admin') return null; as the first line when the command is admin-only to avoid information leakage.
  • Safe Execution & Proper Registration: Guides the addition of the module to server/commands/index.js and the creation of a test/commands.test.js match test so ordering and regex behavior don’t regress.

Quick Start

Create a new module at server/commands/uptime.js and implement an anchored match() that parses the admin-only input, then register it in server/commands/index.js and add a matching test in test/commands.test.js.

Frequently Asked Questions about bot-command

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new command handler to a Teams bot without breaking the dispatcher?

To add a Teams bot command safely, create a module exporting { match, execute } and register it in the dispatcher's index file. This enforces the required export shape and ordered registration to prevent match regressions.

How do I prevent non-admin users from knowing a bot command exists?

Preventing bot command information leakage requires placing `if (deps.ima !== 'admin') return null;` as the first line inside match(). This admin gating ensures the command only resolves for authorized users.

Why does my bot command match function throw an error during text parsing?

A bot command match function throws errors when it lacks synchronous, non-throwing regex parsing logic. The match function must be deterministic and safely return null instead of throwing exceptions during text evaluation.

How do I test bot command regex matching and dispatcher ordering?

Testing bot command regex matching involves adding match behavior assertions to your command test suite. This verifies the anchored match function and ensures the ordered registration in the dispatcher does not regress.

What is the correct way to route a bot command reply in a Teams messaging context?

Routing a bot command reply correctly uses context.sendActivity(MessageFactory.text(...)). This ensures the execute function safely returns the text response through the proper Teams messaging channel.

Can I use async operations inside a bot command's match function?

Async operations are not supported inside a bot command's match function. The matcher must be synchronous and non-throwing to guarantee deterministic evaluation before the dispatcher routes to execute.