一键导入
chatops-bot
Deterministic procedure to answer Azure resource questions via pre-canned ARG query categories, in read-only mode, with audit logging.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Deterministic procedure to answer Azure resource questions via pre-canned ARG query categories, in read-only mode, with audit logging.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Deterministic procedure to watch an ARM deployment, evaluate a health gate, and automatically cancel + redeploy the last-known-good template on breach.
Deterministic procedure to find tag-non-compliant Azure resources, emit a fixed-format report, and (on explicit authorisation) deploy ARM patches to apply missing tags.
Deterministic procedure to inspect an ARM template, cross-reference affected resources via ARG, categorize each change, flag policy violations and dependency fan-out, and emit a fixed-format risk report.
Deterministic procedure to surface top cost-driving resources by querying ARG for new/resized resources in a time window, joined with owner tags, and emit a fixed-format markdown report.
Deterministic procedure to provision, monitor, and cancel pre-approved ARM golden-path template deployments with naming guardrails, tag enforcement, and compliance checks.
Deterministic procedure to compare a checked-in ARM template with live Azure state and emit a property-level drift report in markdown + JSON patch (RFC 6902) format.
| name | chatops-bot |
| description | Deterministic procedure to answer Azure resource questions via pre-canned ARG query categories, in read-only mode, with audit logging. |
Inputs:
scope: name of a runbook under runbooks/<scope>.yaml. Defaults to prod.verb: one of ask (default) or audit.question: free-text question from the user (for ask verb only).runbooks/<scope>.yaml as raw text. If a sibling runbooks/<scope>.values.yaml
exists, parse it and substitute every ${key} token in the runbook text with the
corresponding value. Then parse the substituted text as YAML. If <scope>.values.yaml
is missing, abort with:
ABORT: runbooks/<scope>.values.yaml missing — copy <scope>.values.yaml.example and fill in real values.subscriptions[], read_only_mode (MUST be true — if
not, abort with ABORT: read_only_mode must be true for chatops-bot),
audit_log_path, allowed_question_categories[].skills/chatops-bot/rules/rules.yaml. Compute SHA-256 of the file contents;
keep first 8 hex chars as ruleset_hash8.run_id = "CHAT-" + UTC date YYYYMMDD + "-" + scope + "-" + ruleset_hash8.id from rules.yaml
using keyword matching (do NOT use LLM reasoning beyond simple keyword lookup against
id, title, and category fields):
id is in runbook.allowed_question_categories. If not,
output STATUS=BLOCKED REASON=category-not-in-allowed-list CATEGORY=<id> and stop.kql verbatim.⚠️
validate_queryis intentionally skipped per ratification #7. See README.md## Determinism Deviationfor rationale.
generate_query with:
intent: the matched rule's titlesubscriptions: from runbookkql from rules.yaml instead (the tool call is for budget/audit compliance only).execute_query with:
query: the verbatim kql from rules.yamlsubscriptions: from runbookrow_count = -1 and error = <message>.Append one JSON line to runbook.audit_log_path:
{"timestamp_utc":"<ISO8601>","user":"<upn-from-az-login>","question":"<raw question>","kql_generated":"<verbatim kql used>","row_count":<int>,"run_id":"<run_id>"}
On error add "error":"<message>" and set row_count to -1.
The file is append-only. Never truncate.
asktemplates/output-report.md.{{run_id}}, {{scope}}, {{generated_utc}} (ISO 8601 to seconds, UTC, Z suffix){{question}} — the user's raw question{{rule_id}}, {{rule_title}}, {{rule_category}}{{results_table}} — markdown table of result rows, sorted descending by count
(for aggregation queries) or ascending by id (for list queries){{row_count}} — integeraudittemplates/output-audit.md.runbook.audit_log_path (all lines), parse each as JSON.{{run_id}}, {{scope}}, {{generated_utc}}{{audit_table}} — markdown table rows sorted descending by timestamp_utc.
Columns: timestamp_utc, user, question, rule_matched, row_count, run_id.row_count: -1, report error inline.row_count = 0; render an empty results table.rules.yaml cannot be read, abort with: ABORT: rules.yaml unreadable.audit_log_path is not writable, abort with: ABORT: audit_log_path not writable — check runbook.audit_log_path.ask response is exactly: # ChatOps Bot Response.audit response is exactly: # ChatOps Audit Log.ask: Header → Question → Rule Matched → Results → Footer.audit: Header → Summary → Audit Table → Footer.