/itsm-tooling-skills:chatops-runbook-automationfrom itsm-tooling-skills
Guides building ChatOps incident-channel bots (Slack/Microsoft Teams) with automated runbook execution, permission-scoped destructive actions, confirmation gates, and audit logging.
Ships in itsm-tooling-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
During an incident, the fastest path from "we know the fix" to "the fix
is applied" is often a chat command — /restart checkout-api-prod typed
directly into the incident channel — rather than someone context-
switching to a separate tool, re-authenticating, and running the same
command from a terminal. ChatOps platforms (a Slack/Teams bot backed by
StackStorm, Rundeck, or a custom webhook handler) exist to close that
gap: a runbook becomes a slash command any authorized on-call engineer
can trigger from inside the incident channel, with the action and its
output visible to everyone in the channel in real time. But the same
property that makes ChatOps valuable during an incident — a chat message
away from executing a real action against production — is exactly what
makes an under-guarded destructive command dangerous: a mistyped
service name, a command run by someone without full context, or a bot
with no confirmation step for a hard-to-reverse action (a database
failover, a mass pod restart, a rollback) can turn a ChatOps
convenience into the incident's actual root cause. This skill covers
building the bot/automation layer (Slack/Teams integration,
StackStorm/Rundeck-style runbook execution), permission-scoping who can
run what, requiring an explicit confirmation step for destructive
actions, and logging every execution for audit — treating automation
speed and safety as a design tradeoff to make deliberately, not an
afterthought.
#chatops-audit channel,
a SIEM, or the execution backend's own history) that is separate from
the ephemeral incident channel — incident channels get archived,
renamed, or are simply hard to search months later.Classify every candidate runbook action by risk tier before automating it — this decision should happen before any bot code is written, not be discovered by trial and error in production:
Tier 1 (read-only/diagnostic): "get pod status", "show recent deploys",
"tail error logs" — safe to expose broadly, no confirmation needed.
Tier 2 (reversible, low blast radius): "restart one pod", "scale up
replicas" — require role-scoped access, log every execution,
confirmation optional based on team risk tolerance.
Tier 3 (destructive or hard-to-reverse): "rollback a production
deploy", "failover a database", "delete a resource", "restart an
entire service fleet" — require role-scoped access AND an explicit
confirmation step AND full audit logging; never fully automated
with no human trigger unless it's a pre-approved, narrowly-scoped
auto-remediation with its own separate review.
Register the slash command and route it to the execution backend, keeping the chat-side handler thin — validate and forward, don't embed execution logic in the bot itself. Slack slash command example (illustrative handler):
# slack_bot.py (illustrative — framework-agnostic sketch)
@app.command("/restart")
def handle_restart(ack, command, respond):
ack()
service = command["text"].strip()
user = command["user_id"]
if not is_authorized(user, action="restart", target=service):
respond(f"You are not authorized to restart `{service}`.")
return
respond(f"Requesting restart of `{service}` — confirm with `/confirm {service}`")
pending_confirmations[user] = {"action": "restart", "target": service, "ts": time.time()}
Require an explicit, time-boxed confirmation step for Tier 2/3 actions, so a single mistyped or misread command doesn't execute immediately:
@app.command("/confirm")
def handle_confirm(ack, command, respond):
ack()
user = command["user_id"]
pending = pending_confirmations.get(user)
if not pending or time.time() - pending["ts"] > 60:
respond("No pending action to confirm, or confirmation window expired.")
return
result = execution_backend.trigger(pending["action"], pending["target"], requested_by=user)
audit_log.write(action=pending["action"], target=pending["target"], user=user, result=result)
respond(f"Executed: {pending['action']} on `{pending['target']}` — {result}")
Warning — destructive action risk: a ChatOps command that executes a destructive action (rollback, failover, mass restart, delete) immediately on the first message, with no separate confirmation step, is a standing risk of an accidental trigger — a mistyped target, a message sent to the wrong channel, or a command run by someone who misread the runbook. Always require a distinct confirmation action (a second explicit command, a button click with a short expiry) for anything in Tier 2/3, and never treat "it asked a yes/no question in the same message" as equivalent — a genuinely separate step, ideally naming the specific target back to the user, catches far more mistakes.
Scope authorization per action and per target, not per bot
installation. A user authorized to restart checkout-api in
staging should not implicitly be authorized to trigger a database
failover in production:
# rbac.yaml (illustrative)
roles:
checkout-oncall:
actions: ["restart", "scale"]
targets: ["checkout-api-staging", "checkout-api-prod"]
platform-oncall:
actions: ["restart", "scale", "rollback", "database-failover"]
targets: ["*"]
Map chat-platform user IDs to these roles via the same identity source of truth used elsewhere (the enterprise IdP — see enterprise-sso-and-idp-federation-configuration) rather than a hand-maintained list embedded in the bot's config that drifts from the actual on-call roster.
Wire StackStorm or Rundeck as the actual execution backend when runbooks need multi-step logic or richer built-in audit/ACL support rather than a from-scratch webhook handler. StackStorm rule example (triggering a pre-defined action in response to a chat event):
# stackstorm rule (illustrative)
name: chatops_restart_checkout
trigger:
type: chatops.command
parameters: { command: "restart", target: "checkout-api-prod" }
criteria:
trigger.payload.user_role: { type: "equals", pattern: "platform-oncall" }
action:
ref: kubernetes.restart_deployment
parameters:
deployment: "checkout-api"
namespace: "prod"
Rundeck equivalent (a job with an explicit ACL policy restricting who can execute it):
# rundeck ACL policy (illustrative)
by:
group: platform-oncall
for:
job:
- equals: { name: "restart-checkout-api-prod" }
allow: [run]
Log every executed action to a durable, searchable audit trail, including who confirmed it, what target, what the result was, and the incident (if any) it was executed under:
{
"timestamp": "2026-07-28T14:18:03Z",
"action": "restart",
"target": "checkout-api-prod",
"requested_by": "U04829",
"confirmed_by": "U04829",
"incident_ref": "INC0048213",
"result": "success",
"execution_backend": "stackstorm"
}
Post a summary of the action back into the incident channel and write the structured record to a durable log/SIEM — the incident channel is for real-time visibility, the durable log is what a postmortem or compliance audit actually needs months later.
Reflect ChatOps-executed changes into the ITSM record when the org runs ServiceNow or an equivalent change-tracking system, so a production change made via chat during an incident has the same audit trail as one made through the normal change process:
POST /api/now/table/incident/<INCIDENT_SYS_ID>/comment
{ "comment": "ChatOps action executed: restart checkout-api-prod, confirmed by jane.doe, result: success" }
See servicenow-itsm-integration for the fuller Change Request linkage pattern this should follow for anything that constitutes an actual production change, not just a diagnostic query.
Rate-limit and time-box confirmation windows so a stale pending confirmation can't be triggered by an unrelated later message, and so a bot outage or restart doesn't leave an ambiguous half-confirmed action in an unclear state — expire pending confirmations after a short window (e.g. 60 seconds) and require the user to re-issue the original command if it expires.
kubectl/cloud-API calls in its own handler code is
harder to audit and harder to secure than delegating to a purpose-
built execution layer.Symptom: An on-call engineer, moving fast during a real Sev1,
mistypes a service name in a ChatOps rollback command, and the
command executes immediately against the wrong (unrelated, healthy)
service.
Fix: This is exactly the scenario the confirmation step in step 3
exists to catch — require the confirmation step to explicitly restate
the target back to the user ("Confirm rollback of payments-api-prod
— reply /confirm payments-api-prod") rather than a bare "yes/no,"
so a mistyped target is visible and catchable before execution, not
only after.
Symptom: A junior engineer who has access to the ChatOps bot (but was never intended to be authorized for production database failovers) successfully triggers one during an incident, because the bot's authorization check only verifies "is this user allowed to use the bot," not "is this user allowed to run this specific action." Fix: Scope authorization per action and per target (step 4), not per bot installation — a flat "can use ChatOps" permission is not equivalent to action-level RBAC, and the two are commonly conflated when a bot is built quickly under time pressure.
Symptom: Months after an incident, a postmortem needs to determine exactly which ChatOps actions were executed and by whom, but the only record is scrollback in an incident Slack channel that's since been archived and is no longer searchable. Fix: Write every executed action to a durable, structured audit log outside the incident channel (step 6) at execution time, not after the fact — the incident channel is for real-time visibility during the incident, not the system of record for what actually happened.
Symptom: A ChatOps bot restart or brief outage leaves a user's pending confirmation in an ambiguous state — they're unsure whether their earlier command is still "waiting to be confirmed" or was lost, and they re-issue it, potentially causing a double-execution. Fix: Time-box confirmation windows to a short, explicit duration (step 8) and have the bot respond clearly on restart/reconnect that any prior pending confirmation has expired and must be re-issued from scratch — never leave an implicit, open-ended pending state.
Symptom: A runbook action that was originally Tier 2 (reversible, e.g. "restart one pod") gets extended over time to also handle a Tier 3 case (e.g. the same command now also supports "restart entire fleet" via a wildcard target) without anyone re-reviewing its confirmation/RBAC requirements for the new, higher-blast-radius case. Fix: Treat a change to an action's scope (not just adding a new action) as triggering the same risk-tier classification review from step 1 — a command that quietly grew from single-target to fleet-wide needs its confirmation and authorization requirements re-evaluated, not inherited from when it was a narrower, lower-risk action.
Scenario: The platform team builds a ChatOps restart/rollback
capability for checkout-api, wired through StackStorm, with
Tier-3-appropriate safeguards for the rollback action.
Risk-tier classification:
Tier 1: /status checkout-api — read-only, no confirmation, broad access
Tier 2: /restart checkout-api-<env> — reversible, confirmation required, role-scoped
Tier 3: /rollback checkout-api-prod — destructive, confirmation required, narrowly role-scoped
Slack command handler (thin — validates and forwards):
@app.command("/rollback")
def handle_rollback(ack, command, respond):
ack()
target = command["text"].strip()
user = command["user_id"]
if not rbac.is_authorized(user, action="rollback", target=target):
respond(f"You are not authorized to roll back `{target}`.")
return
pending_confirmations[user] = {"action": "rollback", "target": target, "ts": time.time()}
respond(f"Confirm rollback of `{target}` — reply `/confirm {target}` within 60s.")
StackStorm execution (only triggered after confirmed, and only for
platform-oncall role, per the RBAC mapping in step 4):
name: chatops_rollback_checkout_prod
trigger:
type: chatops.confirmed_command
parameters: { action: "rollback", target: "checkout-api-prod" }
criteria:
trigger.payload.user_role: { type: "equals", pattern: "platform-oncall" }
action:
ref: kubernetes.rollback_deployment
parameters: { deployment: "checkout-api", namespace: "prod" }
Audit record written on execution, plus a comment posted back to the linked ServiceNow incident:
{
"timestamp": "2026-07-28T14:22:11Z",
"action": "rollback",
"target": "checkout-api-prod",
"requested_by": "U04829",
"confirmed_by": "U04829",
"incident_ref": "INC0048213",
"result": "success"
}
POST /api/now/table/incident/INC0048213/comment
{ "comment": "ChatOps action executed: rollback checkout-api-prod, confirmed by jane.doe, result: success" }
Result: the rollback that mitigates the Sev1 happens in under a minute from the incident channel, with an explicit confirmation step that would have caught a mistyped target, scoped to only the on-call role authorized for production rollbacks, and durably logged both in the audit system and the ServiceNow incident record for the postmortem.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
chatops, incident-response, runbook-automation, slack-bot, teams-bot, stackstorm
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin itsm-tooling-skills6 skills in this plugin
/linear-issue-tracking-best-practicesGuides Linear's cycle-based workflow model — Issues, Projects, and time-boxed Cycles instead of Jira's sprint/board configuration, Linear's opinionated status workflow (Triage → Backlog → Todo → In Progress → In Review → Done/Cancelled), its keyboard-driven/low- friction issue creation philosophy, and the Linear API/SDK for programmatic issue management. Use when the user asks to "set up Linear for our team," "should we use Linear or Jira," "create a Linear issue via the API," "design our Linear cycle/project structure," "why did our Jira migration to Linear feel different," or "reduce process overhead in our issue tracker." Cross-references the Jira-focused ticket-workflow skill for teams comparing or migrating between tools.
/pagerduty-and-opsgenie-oncall-configurationConfigures on-call schedules, escalation policies, and alert routing/ deduplication rules in PagerDuty and Opsgenie — the tool-specific API/ Terraform configuration that implements an on-call rotation, not the generic on-call process design. Use when the user asks to "set up a PagerDuty schedule," "configure an Opsgenie escalation policy," "route alerts to the right team in PagerDuty," "add alert deduplication so we stop getting paged 50 times for one outage," "add a secondary on-call layer," or "configure a maintenance window/override in PagerDuty or Opsgenie."
Other plugins' skills for the same job