agentleFS
MicrosoftKnown publishermicrosoft/chaos-studio/copilot-cli-plugin/skills/chaos-impact/SKILL.md

chaos-impact

Skill3 starsChanged 5 months agoMITView on GitHub

Synthesize an Azure Monitor impact report for a Chaos Studio v2 ScenarioRun: pulls the run, walks targeted resources, queries metrics/logs/activity-log/alerts over the run window ± buffer, and renders a Markdown + JSON impact card.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If you are an autonomous agent with no user to prompt, call the three Monitor tools on the chaos-studio MCP server directly …

    line 17
  2. Very specific:

    All synthesis logic lives in scripts/Invoke-ChaosImpact.ps1.

    line 29
  3. Very specific:

    Run the script with -ScenarioRunId <id> (positional accepted).

    line 38
  4. Very specific:

    When invoked standalone (no prior start-chaos state file), the orchestrator must supply -SubscriptionId, -ResourceGroup, -WorkspaceName, …

    line 49
  5. Distinctive:

    Run resolution and targeted-resource flattening (collapses instance-level → parent)

    line 79
  6. Distinctive:

    All error cards with remediation commands

    line 85

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

ChaosImpact — Post-Run Azure Monitor Synthesis

⛔ ABSOLUTE RULE: Do NOT improvise, skip, or substitute any step. On ANY error, STOP and wait for the user.

When to use this skill (vs. the MCP server)

This skill is the human-interactive path: it resolves run context from the shared startchaos-state.json, prompts for missing inputs via exit codes, and renders a Markdown card plus a JSON sidecar. Use it when there is a user in the loop — typically right after /start-chaos (or as a post-step of it).

If you are an autonomous agent with no user to prompt, call the three Monitor tools on the chaos-studio MCP server directly (monitor_query_metrics, monitor_query_logs, monitor_search_activity_log) and assemble your own report. The PowerShell skill and the MCP tools are two independent surfaces over the same Azure endpoints — neither calls the other.

Both surfaces target Microsoft.Chaos 2026-05-01-preview plus the pinned Azure Monitor API versions in scripts/Constants.ps1, and use the local az login session for auth.

How It Works

All synthesis logic lives in scripts/Invoke-ChaosImpact.ps1. The script resolves the ScenarioRun, discovers Log Analytics workspaces via diagnostic settings, runs the Monitor query fan-out, classifies signals, and writes both artifacts.

The AI orchestrator's only job is:

  1. Set $env:STARTCHAOS_STATE_PATH to ${SESSION_DIR}/startchaos-state.json (the skill reads but does not write this file).
  2. Run the script with -ScenarioRunId <id> (positional accepted).
  3. Handle exit codes that require user input (see below).
  4. Re-run the script with the user's answers as parameters.

Running the Script

$env:STARTCHAOS_STATE_PATH = "<session-dir>/startchaos-state.json"
& "<skill-dir>/scripts/Invoke-ChaosImpact.ps1" -ScenarioRunId <runId> @extraArgs

When invoked standalone (no prior start-chaos state file), the orchestrator must supply -SubscriptionId, -ResourceGroup, -WorkspaceName, and -ScenarioName — otherwise the script exits 2.

Exit Codes → AI Actions

ExitMeaningAI Action
0Report generatedDone — print the Markdown card from script output.
1Hard errorSTOP. Render the error from script output. Wait for user.
2Missing run contextask_user for any of: -SubscriptionId, -ResourceGroup, -WorkspaceName, -ScenarioName, -ScenarioRunId. Re-run with the supplied parameters.
3Log Analytics workspace not discoverable for ≥ 1 resource, AND -LogAnalyticsWorkspaceId not suppliedask_user whether to (a) supply a workspace ID (re-run with -LogAnalyticsWorkspaceId <id>) or (b) proceed without log signals (re-run with -LogAnalyticsWorkspaceId none).
4Permission gap (caller lacks Monitoring Reader on one or more target resource groups) (Epic 3 — not yet implemented)ask_user to confirm best-effort partial report (re-run with -AllowPartial) or abort.

Script Parameters

ParameterDescription
-ScenarioRunIdRequired (positional). The ScenarioRun resource name.
-SubscriptionId / -ResourceGroup / -WorkspaceName / -ScenarioNameRun context. Read from startchaos-state.json when omitted; required otherwise.
-BufferISO-8601 duration added before/after the run window. Default PT5M.
-LogAnalyticsWorkspaceIdOptional override when diag-settings discovery fails for some resources. Pass none to explicitly skip log signals.
-MaxResourcesPer-run resource cap. Default 50. Instance-level targets (VMSS / AKS) are collapsed to parent before counting.
-OutputDirWhere to drop artifacts. Default $env:STARTCHAOS_SESSION_DIR or current directory.
-IncludeBaselineWhen set, also computes baseline samples (the -Buffer × 2 window before run start). Default on.
-Formatmarkdown, json, or both. Default both.
-AllowPartialContinue past permission gaps and emit a partial report. (Epic 3 — not yet implemented; currently accepted but has no effect.)

What the Script Handles (no AI logic needed)

  • Run resolution and targeted-resource flattening (collapses instance-level → parent)
  • MaxResources cap with explicit coverage caveats
  • Diagnostic-settings discovery + per-resource workspace caching
  • Azure Monitor metrics / Log Analytics / Activity Log / Alerts / Service Health fan-out
  • Baseline subtraction and signal classification
  • Markdown report card + JSON sidecar artifact
  • All error cards with remediation commands

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.