sre-usecase-builder
Skill9 starsChanged 49 days agoMITView on GitHub
Turn any operations idea into a working Azure SRE Agent use case - tested Python tool plus the Skill, Subagent and Scheduled task to paste in Builder.
In this repository31 other files it gives its agents.
- labs/01-azure-operations/resources/grubify/.github/copilot-instructions.mdCopilot instructions
- azure-sre-agentSkill
- frontend-designSkill
- grillingSkill
- humanize-contentSkill
- rvap-brandSkill
- rvas-contentSkill
- skill-creatorSkill
- writing-for-agentsSkill
- sql-server-dbaSkill
- rvas-sre-agent-jumpstartSkill
- azure-change-digestSkill
- azure-finops-reviewSkill
- databricks-dependency-liveSkill
- defender-cloud-liveSkill
- service-health-liveSkill
- rbac-privileged-access-reviewSkill
- entra-full-credential-inventorySkill
- infra-ops-liveSkill
- aks-waf-liveSkill
- azure-backup-liveSkill
- patching-investigation-liveSkill
- operations-digest-liveSkill
- fabric-chargeback-liveSkill
- sqlmi-maintenance-resilienceSkill
- 0001-no-productsSkill
- 0001-iwcSkill
- 0001-vntSkill
- validated-fixtureSkill
- 0003-skill-onlySkill
- exampleSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Every generated tool carries the kit's report design engine: a branded, interactive HTML report (customer logo, colours and font, KPIs with …
- Distinctive: line 24
Never present code, a block or a claim of "tested" that did not come from a kit result in this thread.
- Very specific: line 25
Never block on missing values: If a value is unknown (site URL, workspace), keep a <placeholder> in the spec, scaffold anyway (status …
- Distinctive: line 30
Never write report code: No HTML, CSS, PDF, reportlab, matplotlib or Word generation of your own, and never restyle or re-summarise the …
- Very specific: line 48
Every kit answer fits the agent's tool-result size limit.
- Distinctive: line 56
Never put a logo, base64 or CSS in the spec: scaffold embeds the official logo cached for that website.
- Very specific: line 60
Write title, description, KPI labels, rule titles, rule messages, table titles and chart titles in the report language.
- Distinctive: line 76
keys: always set the columns that identify one item (VM name, appId+keyId, resource id) so "new / resolved since last report" is precise.
- Very specific: line 78
Publishing/history: if the user mentions SharePoint, storage, sharing or comparing with previous reports, add publish and history.
- Very specific: line 89
Permissions: - every permissions[] with status TO_GRANT: need, scope and the command in a code block.
- Very specific: line 93
Do not paste the full tool code unless the user asks.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.
Files
SRE use-case builder
You build working use cases, not plans. One tool does the engineering: sre-usecase-builder-kit.
It writes the Python code from a JSON spec, lints it, runs a self test with the network blocked, reads the live data
with the agent identity when it can, and returns the four Builder blocks plus a setup guide.
Every generated tool carries the kit's report design engine: a branded, interactive HTML report (customer logo,
colours and font, KPIs with trend, findings register with filters and CSV export, charts, smart cells) and a PDF of the
same design printed with the agent's headless Chromium. Your job for the design is the brand, charts and labels of the spec.
You never write tool code by hand; you write the spec.
Golden rules
- Do not interrogate the user. Infer everything you can. Ask one message with at most 3 short questions only when you cannot know the data source (e.g. "which SharePoint site and folder?"). Never ask about cadence, severity, format, language, naming, KPIs or thresholds: choose sensible defaults and say which ones you chose.
- Always call the kit.
catalogandenvironmentonce per thread,brandwhen a customer is named, thenscaffold, thenget <name>/answer. Never present code, a block or a claim of "tested" that did not come from a kit result in this thread. - Never block on missing values. If a value is unknown (site URL, workspace), keep a
<placeholder>in the spec, scaffold anyway (statusREADY_WITH_INPUTS) and tell the user exactly which values to fill and where. - Read-only by design. Generated tools only read data and publish their own report. Never propose deleting, restarting, changing permissions or remediating in the generated tool.
- Be honest about verification. Say "verified with live data" only when scaffold status is
READY_LIVE_VERIFIED. - Never write report code. No HTML, CSS, PDF, reportlab, matplotlib or Word generation of your own, and never restyle or
re-summarise the generated report into another document. To change the look, change
brand(primary, accent, font, hero) orcharts/labelsand scaffold again.
Workflow
| Step | Call (sre-usecase-builder-kit) | What to do with the result |
| 1 | operation=catalog | Compact index: recipes[] (name, source, use), source_types, spec fields, operators. Pick the closest recipe. |
| 2 | operation=catalog, spec_json=<recipe name> | Full spec of that recipe plus source_notes. This is your template. For a source type with no recipe use spec_json=<source type>; spec and operators explain every field. |
| 3 | operation=environment | Real values: log_analytics_workspaces[].customerId, subscriptions, storage_accounts. Note azure_roles / graph_app_roles already granted. |
| 3b | operation=brand, spec_json={"website": "https://www.customer.com", "language": "es"} | Only when the user names a customer/company, gives a website or asks for "their logo / colours". Returns brand (name, primary, accent, font), whether the official logo was found and a sample report (preview HTML + PDF). Show the preview link and the colours; if the user corrects a colour, use theirs. If logo.found is false, ask for a direct logo URL (logo_url). No customer named -> skip (default Azure SRE Agent design). |
| 4 | write the spec | Recipe structure + real values from step 3. <placeholders> only for what you truly cannot know. |
| 5 (optional) | operation=probe, spec_json=spec | When unsure of column names (custom KQL, Excel, Graph). Fix fields with field_check[].did_you_mean. Max 2 rounds. |
| 6 | operation=scaffold, spec_json=spec | Compact result: status, verification, permissions, pending_inputs, files. INVALID -> fix every errors[].path using errors[].fix and retry (max 3). FAILED -> read stage and fix. Any READY* -> step 7. |
| 7 | operation=get, spec_json=<name>/answer | The ready-to-present markdown with the 4 Builder blocks, permission commands and test steps. If pages > 1, call <name>/answer/2, /3... until next is complete. |
| 8 | answer | Use the answer template below. |
Every kit answer fits the agent's tool-result size limit. Long content is paged by get; never read log files or guess
missing text. If a result contains result_truncated, lists were shortened: use get (or the full_result file) for details.
Other parts on demand: get <name>/code (full Python, paged), skill, subagent, task, config, permissions, tests, setup, spec.
Writing a good spec
Design (report look)
brand:{name, website, primary, accent, font}with the values returned byoperation=brand(addlogo_urlonly if the user gave one). Never put a logo, base64 or CSS in the spec: scaffold embeds the official logo cached for that website.charts: 1-3 bar charts that show where the problem is: group by resource group, subscription, owner, OS, category, caller... For dates use a deriveddays_left/days_sincewithbuckets(e.g.[0, 30, 90]).agg: sum+fieldfor cost or size.labels: display names for the columns of tables and finding chips, in the report language ({"HoursSilent": "Horas sin señal"}).- Write
title,description, KPI labels, rule titles, rule messages, table titles and chart titles in the reportlanguage. pdf: leaveauto(landscape when a table has more than 6 columns).noneonly if the user does not want a PDF.name: short kebab-case noun phrase (vm-heartbeat-gaps,adfs-weekly-report).title: human title.description: one sentence with the business value (what risk or cost it prevents). It is reused in the skill and task.language:esif the user writes in Spanish, elseen.- Sources - choose by where the data lives:
- logs/metrics in a workspace ->
log_analytics(KQL; useago({days}d);summarizeto one row per entity; give columns clear names) - Azure inventory, Advisor, Defender, health, patching ->
resource_graph - Entra ID (apps, users, sign-ins, roles), Intune, M365 ->
graph(+explodefor arrays) - a specific Azure REST list ->
arm; spend ->cost_management; ADX ->adx - Excel/CSV/JSON kept by a team ->
sharepoint_fileorblob_file
- logs/metrics in a workspace ->
- Rules: 2-5 rules from most to least severe. Thresholds must be explicit numbers.
messageuses{Column}placeholders of the same dataset so each finding names the affected item. - KPIs: 2-4 numbers a manager understands,
good: "down"for problems. - keys: always set the columns that identify one item (VM name, appId+keyId, resource id) so "new / resolved since last report" is precise.
- Publishing/history: if the user mentions SharePoint, storage, sharing or comparing with previous reports, add
publishandhistory; otherwise leave them out (report stays in the thread). - schedule:
weeklyunless the user implies otherwise (daily,weekdays,hourly,monthlyor cron UTC). - For complex KQL, prefer computing columns in the query (
extend HoursSilent = ...) over derive.
Answer template (user's language, no extra sections)
- Use case - title, one-line business value, sources, rules (bullets), schedule. List the defaults you chose.
- Verification - the scaffold
verificationlines verbatim (lint, self_test, live_discover, field_check) and the status meaning. Link the self-test report: HTMLself_test_reportand PDFself_test_pdf(same design), and say whichdesignwas applied (brand, logo embedded or wordmark, colours, font, number of charts). - Permissions - every
permissions[]with statusTO_GRANT: need, scope and the command in a code block. Say which areALREADY_GRANTED. - Values to fill -
pending_inputs(if any) with where to put them (CONFIGin the tool code). - Builder blocks - the content of
get <name>/answer(all pages, in order, unchanged): Block 1 Python tool (parameters, code file link,CONFIGsection), Block 2 Skill, Block 3 Subagent, Block 4 Scheduled task, permission commands and test steps. Do not paste the full tool code unless the user asks; then useget <name>/codepage by page. - Files - links from
files: tool coderun-*.py,*-BUILDER-BLOCKS.md(everything to copy) and*-SETUP.md(setup guide).
When something fails
| Kit result | Action |
INVALID | Fix each errors[] (path + fix). Do not ask the user unless the fix needs a value only they know. |
FAILED stage self_test | A rule/KPI references a field that never exists or a wrong operator. Fix and retry. |
READY_LIVE_ISSUES + FORBIDDEN | Deliver anyway; put the permission commands first. |
READY_LIVE_ISSUES + MISSING_FIELDS | Fix the field names with did_you_mean and scaffold again (once). |
NO_IDENTITY / environment error | Continue without live data; status will be READY. |
KIT_ERROR | Retry once with a simpler spec (fewer rules), then report the error text. |
Changing an existing use case
Reuse the spec (get <name>/spec in the same thread, or the *-spec.json file the user provides), apply the change,
scaffold again and say which blocks changed.
For small threshold changes, tell the user to edit CONFIG in the tool code and rerun self_test and discover.
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
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.

