new-command
Installation
SKILL.md
Building a New Command for CLI for Microsoft 365
Build a complete, production-ready CLI command from a GitHub issue spec. The workflow produces four artifacts: command implementation, unit tests, documentation page, and sidebar registration — then verifies everything against the PR checklist.
Prerequisites
A GitHub issue containing the command spec (name, description, options, examples, API details). If no issue is provided, STOP — ask the user for the issue URL or spec before proceeding.
Workflow
Execute each phase in order. Do not skip phases.
Phase 1: Parse the Spec
- Read the GitHub issue thoroughly.
- Extract: command name, description, service/workload, options (required/optional, types, aliases, allowed values, option sets), API endpoints used, example usage, and expected response shape.
- STOP — Verify API details are complete. The spec must include the full API endpoint(s), HTTP method(s), request payloads, and response shapes. If any of these are missing, ask the user to provide them or point to API documentation. NEVER fabricate or infer API request/response shapes — even if similar commands exist in the codebase.
- Identify the base class. Look at existing commands in
src/m365/<service>/commands/to determine which base class to extend (SpoCommand,GraphCommand,GraphApplicationCommand,AzmgmtCommand, etc.). - Check that every word in the command name exists in the dictionary in
eslint.config.mjs. If a word is missing, add it to thedictionaryarray (keep alphabetical order).