Skip to content

zhanrz88-sudo/oncallspecialist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🚨 On-Call Specialist Agent

AI-powered on-call assistant for Microsoft ICM β€” from incident triage to R2D generation

Node.js MCP License

Features β€’ Quick Start β€’ Skills β€’ Architecture β€’ Commands


✨ Features

Feature Description
πŸ” Incident Investigation Query ICM incidents, get AI summaries, find similar incidents, check customer impact
πŸ“‹ R2D Generation Auto-generate Ready-to-Dispatch work items in Azure DevOps from ICM incidents
πŸ”¬ Kusto Investigation 3-phase Kusto pipeline: ApiQoSEvent β†’ ContextActivity β†’ DisksBI
🌐 ICM Crawler Puppeteer-based crawler for authored summaries & discussion entries (data the API doesn't expose)
πŸ› οΈ 23+ ICM MCP Tools Full access to incidents, teams, on-call schedules, customer impact via MCP protocol
🧩 Extensible Skills Add new incident types by creating a skill markdown file β€” no code changes needed
πŸ“Š ADO Integration Create/update Azure DevOps work items via REST API with HTML formatting
πŸ‘₯ Team & Contact Lookup Find on-call engineers, search teams, lookup contacts by alias

πŸ“‹ Prerequisites

  • βœ… Node.js v18+ (Download)
  • βœ… Azure CLI installed and logged in (Install Guide)
  • βœ… Microsoft Edge (for ICM Crawler and Kusto Web queries)
  • βœ… ICM Access via your Microsoft account
  • βœ… VPN connected (for Kusto cluster access)

πŸš€ Quick Start

1. Clone & Install

git clone https://github.com/zhanrz88-sudo/oncallspecialist.git
cd oncallspecialist
npm run setup

2. Authenticate

# Login to Azure for ICM API access
az login --scope api://icmmcpapi-prod/mcp.tools

# Login to Azure for ADO access (if using R2D generation)
az login

3. First-Time Setup (ICM Crawler & Kusto)

The ICM crawler and Kusto queries use Edge with a persistent profile. On first use, a browser window opens for interactive login. After that, everything runs headlessly.

4. Use It

# Direct CLI
node oncall-agent/oncall-agent.js incident 123456789

# Or install for GitHub Copilot CLI
npm run install-copilot

🧩 Skills

Skills are markdown-defined workflows that the agent executes step-by-step. Each skill is a self-contained playbook for a specific on-call task.

Skill Trigger What It Does
Triage Incident "triage incident <id>" Parallel investigation: incident details, impact, similar incidents, mitigation hints
Auto Mitigate "mitigate incident <id>" Match incident to known patterns, suggest fix, provide TSG links
Generate R2D "generate R2D for <id>" Full pipeline: ICM β†’ Crawler β†’ Kusto β†’ R2D template β†’ ADO work item
DES Weak Association "break DES association" Specialized R2D for DES deletion blocked by stale storage account references

Adding a New Skill

  1. Create skills/skill-r2d-<name>.md following the existing template format
  2. Define the 8 R2D questions with pre-filled answers for that incident type
  3. Register it in skills/skill-generate-r2d.md β†’ Sub-Skills Registry table
  4. The agent will auto-match it based on incident patterns

πŸ—οΈ Architecture

oncall-specialist/
β”œβ”€β”€ oncall-agent/           # CLI agent + ICM client library
β”‚   β”œβ”€β”€ oncall-agent.js     # Main CLI (incident, oncall, kusto, etc.)
β”‚   β”œβ”€β”€ icm-client.js       # Reusable ICM API client
β”‚   └── *.md                # Agent instructions + skill files
β”œβ”€β”€ icm-mcp-server/         # MCP server for GitHub Copilot integration
β”‚   β”œβ”€β”€ index.js            # MCP protocol server (23+ tools)
β”‚   β”œβ”€β”€ icm-crawler.js      # Puppeteer-based ICM portal crawler
β”‚   β”œβ”€β”€ kusto-web-query.js  # Kusto Web Explorer query runner
β”‚   └── kusto-query.js      # Kusto SDK query runner
β”œβ”€β”€ skills/                 # Skill definitions (shareable)
β”‚   β”œβ”€β”€ skill-generate-r2d.md
β”‚   β”œβ”€β”€ skill-r2d-break-des-storage-association.md
β”‚   β”œβ”€β”€ skill-triage-incident.md
β”‚   └── skill-auto-mitigate.md
β”œβ”€β”€ docs/                   # TSG documents
β”‚   β”œβ”€β”€ tsg-refresh-encryption-scopes.md
β”‚   β”œβ”€β”€ tsg-constructing-blob-uri.md
β”‚   └── ...
└── package.json            # Root package with setup scripts

Data Flow: R2D Generation

ICM Incident ID
    β”‚
    β”œβ”€β”€β–Ί ICM API (23 MCP tools)  ──► title, severity, subscription, region
    β”œβ”€β”€β–Ί ICM Crawler (Puppeteer) ──► authored summary, discussion entries
    β”‚
    β–Ό
Kusto 3-Phase Pipeline
    β”œβ”€β”€β–Ί Phase 1: DiskManagerApiQoSEvent      ──► failed DELETEs, correlation IDs
    β”œβ”€β”€β–Ί Phase 2: DiskManagerContextActivity   ──► root cause, blocking storage account
    └──► Phase 3: DisksBI/StorageAccount       ──► validate DES ↔ storage association
    β”‚
    β–Ό
Sub-Skill Match (pattern-based)
    β”œβ”€β”€β–Ί DES weak association template
    β”œβ”€β”€β–Ί Snapshot stale reference template
    └──► (extensible β€” add your own)
    β”‚
    β–Ό
R2D Template Engine
    β”œβ”€β”€β–Ί 8-question HTML description
    β”œβ”€β”€β–Ί Iteration path auto-calculation
    └──► Acceptance criteria
    β”‚
    β–Ό
Azure DevOps REST API
    └──► Create/Update PBI with tags, area path, assignment

πŸ“– Commands

On-Call Agent CLI

# Incident operations
node oncall-agent/oncall-agent.js incident <id>        # Get incident details + AI summary
node oncall-agent/oncall-agent.js impact <id>           # Customer impact
node oncall-agent/oncall-agent.js find-similar <id>     # Smart similar incident search
node oncall-agent/oncall-agent.js mitigate <id>         # Mitigation hints

# Team & contact
node oncall-agent/oncall-agent.js oncall "Disk Service" # Who is on-call
node oncall-agent/oncall-agent.js team "Disk Service"   # Search teams
node oncall-agent/oncall-agent.js contact <alias>       # Lookup person

# Kusto queries
node oncall-agent/oncall-agent.js kusto disks Disks "<KQL>"
node oncall-agent/oncall-agent.js kusto disksbi DisksBI "<KQL>"
node oncall-agent/oncall-agent.js kusto-tables disks Disks
node oncall-agent/oncall-agent.js kusto-schema disks Disks <table>

ICM Crawler

# Full crawl (authored summary + discussion entries)
node icm-mcp-server/icm-crawler.js <incidentId>

# Summary only
node icm-mcp-server/icm-crawler.js <incidentId> --summary-only

Kusto Web Query

node icm-mcp-server/kusto-web-query.js https://disks.kusto.windows.net Disks "<KQL query>"

πŸ”§ Configuration

Custom Instructions for GitHub Copilot CLI

Add to your Copilot custom instructions to enable the agent:

You have access to an On-Call Specialist Agent.
Run commands via: node <path>/oncall-agent/oncall-agent.js <command> [args]

See oncall-agent/oncall-specialist.instructions.md for the full instruction template.

Key Team Reference

Team ICM Public ID Team ID
Disk Service AZURERT\DiskService 28322

Kusto Clusters

Alias URL Database
disks https://disks.kusto.windows.net Disks
disksbi https://disksbi.kusto.windows.net DisksBI

🀝 Contributing

  1. New Skills: Create a skill-*.md in skills/ following the existing format
  2. New TSGs: Add tsg-*.md in docs/
  3. New Commands: Extend oncall-agent/oncall-agent.js
  4. Bug Fixes: PRs welcome!

πŸ“„ License

MIT License β€” see LICENSE for details.


Made with ❀️ for the Microsoft on-call engineering community

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors