故障前后对比证据生成
evidence-before-after
用于为 Zava Learning 事件构建前后对比的可视化证据。首先对故障进行分类,然后渲染真正能说明变化的那一张可视化图表——连通性/配置/RBAC 故障用前后对比路径图或拓扑图,性能/可用性故障用时间序列对比图——外加一张状态/指标差异表。绝不绘制无法说明问题的指标。其输出用于 RCA 和 zava-reporting 交付物。
- License 许可
- MIT
- 最近更新
- 2026-11-10
- Stars
- ★ 189
- Forks
- 198
01 前言 Front Matter
- name
- evidence-before-after
- tools
- [ "RunAzCliReadCommands", "GetAzCliHelp", "ListAvailableMetrics", "GetMetricTimeSeriesElementsForAzureResource", "QueryAppInsightsByResourceId", "QueryLogAnalyticsByResourceId", "PlotBarChart", "PlotAreaChartWithCorrelation", "PlotScatter", "ExecutePythonCode", "SearchMemory" ]
- metadata
- { "kind": "Skill", "api_version": "azuresre.ai/v2" }
- description
- Use to build the before-and-after visual evidence for a Zava Learning incident. First classify the fault, then render the ONE visual that actually explains what changed — a before/after path or topology diagram for connectivity/config/RBAC faults, or time-series comparison charts for performance/availability faults — plus a state/metric delta table. Never plot a metric that does not tell the story. Its output is used in the RCA and the zava-reporting deliverables.
03 SKILL.md 正文
Zava Learning — Before / After Evidence
Prove impact and recovery with the right visual for the fault — not a chart by reflex. Resource
Group: @@RG@@. Services: learner-portal, course-api, assessment-api. Retrieve zava-brand
and zava-report-template with SearchMemory and apply the house style. Use the windows and
root cause confirmed by rca-analysis.
Step 1 — Decide the visual FIRST (do not skip)
Classify what actually changed, then pick the visual that explains that. Plotting a smooth metric for a binary/config fault (e.g. "availability before/after" for an NSG block) is misleading and adds no insight — don't do it.
| Fault class | What changed | Primary visual | Secondary (only if telemetry shows it) |
|---|---|---|---|
| Connectivity / config / NSG / App Gateway probe / RBAC | a path or permission was closed → open (binary) | before→after path/topology diagram (ASCII or Mermaid) + a config-state delta table | one short recovery curve (e.g. 502-rate → 0) |
| Performance / latency / saturation | a metric degraded → recovered (gradual) | time-series before/during/after + percentile delta table | before-vs-after summary bars |
| Availability / reliability (5xx, restarts, replica loss) | error/health rate rose → fell | time-series + delta table | summary bars |
If a fault has both a binary cause and a metric symptom (common), lead with the diagram that explains the cause and use one metric chart only as supporting recovery proof.
Step 2 — Capture the before/after STATE (config & binary faults)
For connectivity/config/RBAC faults, the evidence is the changed configuration, not a metric:
-
Read the relevant config with
RunAzCliReadCommands(e.g. NSG effective rules, App Gateway backend health, Container Apps revision/ingress, role assignments) at the mitigated state, and reconstruct the pre-fix state fromrca-analysis/ change history. -
Build a state delta table:
item · before · after · effect, e.g.NSG rule block-appgw (prio 100 DENY) · present · removed · AppGW→apps unblocked;AppGW backend health · Unhealthy · Healthy · probes pass;GET /api/quiz · 502 · 200. -
Render a before→after path diagram showing the broken hop and the fixed hop. Author it as ASCII (preferred for chat/PagerDuty notes) and/or a Mermaid graph; for a polished report image use
ExecutePythonCode(graphviz/matplotlib). Example shape:BEFORE (blocked) AFTER (fixed) AppGW ──► NSG subnet ──► [apis] AppGW ──► NSG subnet ──► [apis] │ DENY-100 ✗ │ (rule removed) ✓ backend: UNHEALTHY (502) backend: HEALTHY (200)
Step 3 — Pull metrics (performance/availability faults, or as recovery proof)
Only when a metric genuinely tells the story. Define three windows — Before (healthy baseline),
During (detection→mitigation), After (post-fix, long enough to be credible) — using the
exact windows from rca-analysis. Per affected service pull the metric matching the symptom:
- Availability / HTTP 5xx / success rate (
QueryAppInsightsByResourceId). - Latency — for the latency scenario,
ms=<duration>from assessment-api console logs viaQueryLogAnalyticsByResourceId; report p50/p95/p99. - Replica count / restarts / throughput (
ListAvailableMetrics,GetMetricTimeSeriesElementsForAzureResource).
Render brand-colored: before series in Critical red, after in Zava Teal, target/baseline as a
dashed Slate line, every series labeled; annotate mitigation and fix points.
PlotAreaChartWithCorrelation / PlotScatter for the series, PlotBarChart for before-vs-after
bars. Use ExecutePythonCode (matplotlib) only for a comparison the Plot* tools can't express.
Rules
- One headline visual that explains the cause; supporting visuals only if the data backs them.
- Never plot a metric that doesn't change shape across the fault, or fabricate a trend to fill a slide.
- Same units, axes, and aggregation before vs. after — no misleading scales.
- Don't claim recovery a number doesn't support; if the after-window is too short, say so.
Verification
The visual matches the fault class: a before/after diagram + state delta table for config/binary
faults, or a before/after chart + metric delta table for performance/availability faults — all from
real config/telemetry over clearly stated windows, ready for rca-analysis and zava-reporting.
04 同仓库更多 Skills
Zava 事件分析报告生成
zava-reporting
用于将已完成的 Zava Learning 事件分析打包呈现给受众。首先呈现带品牌标识的线程内执行摘要(内联前后对比视觉效果的 markdown),然后生成可下载的交付物——PowerPoint 演示文稿、HTML 电子邮件和 Teams 通知,使用 Zava 企业模板。调用的 agent 可将其缩小为子集(例如仅 HTML 报告)。产出内容和工件;它不负责发送。组装 rca-analysis、evidence-before-after、recommendations-next-steps 和 pr-delivery 的输出。
Zava 治理审计报告生成
zava-audit-report
用于将已完成的 Zava Learning 每周治理审计(NSG/网络安全、RBAC/最小权限或云成本)打包成一份采用 Zava 企业风格、带品牌标识的可下载 PowerPoint 演示文稿。调用的审计 agent 传入其发现结果(带严重级别的条目列表)和简短的安全态势摘要;本技能渲染演示文稿、应用脱敏处理,并返回附件下载链接。产出工件本身;它不负责发送。
ServiceNow 变更请求管理
servicenow-change-management
当 Zava Learning 调查产生了需要变更管理的持久性修复时使用——在为基础设施即代码或应用代码的根本原因打开 GitHub PR 之后,提出引用该 PR 的 ServiceNow 变更请求并附上 RCA 报告。是 ServiceNow 变更请求及附件操作的唯一负责方。
敏感信息脱敏
redaction-guard
每当要输出操作员可见的内容时使用——聊天/话题消息、PagerDuty 或 ServiceNow 记录、提交信息或拉取请求正文,或任何报告制品(HTML、PowerPoint、Teams 卡片)。确定性地屏蔽密钥、凭证、令牌、私钥、URI 中嵌入的密码以及个人身份信息(PII),确保它们不会出现在对话或任何交付物中。这是一项横切护栏,由产生输出的技能调用,而非一个操作手册步骤。
事件改进建议
recommendations-next-steps
用于为 Zava Learning 事件生成前瞻性的建议和后续步骤——包括按优先级排序的预防性、检测性和流程性行动,并附带负责人、目标日期和不采取行动的风险。其输出用于 zava-reporting 交付物。
事件根因分析
rca-analysis
用于为已解决或已缓解的 Zava Learning 事件生成根因分析叙述——包括事件时间线、触发因素与潜在根因(5-Whys)、促成因素以及如何呈现这些内容。定义 RCA 章节格式;其输出用于前后对比、建议和报告等交付物。