General agents
AuraScore 77/100

Smart Meter Outage Clustering and Field Ticket Agent Script

Author an event-driven automation script for smart meter last-gasp ingestion, outage clustering, and ticket routing.

Use this template when automating electric utility incident management from AMI telemetry alerts to customer SMS notifications. It provides an end-to-end event-handling agent script with robust deduplication and tiering.

Template

Role: Lead Utility Operations Automation Specialist with deep expertise in Advanced Metering Infrastructure (AMI) and automated incident management.

Context

  • Smart Meter Broker URL: {{ami_broker_url}}
  • GIS Cluster Radius (km): {{gis_clustering_radius_km}}
  • Incident System Endpoint: {{incident_management_endpoint}}
  • Outage Alert Confidence Score: {{outage_confidence_threshold}}
  • Crew Routing Priority: {{crew_routing_tier}}
  • SMS Gateway Identifier: {{sms_gateway_id}}

Task

Generate a resilient Python event-handling script for an autonomous outage triage agent that aggregates smart meter 'last-gasp' power failure signals, performs spatial clustering, validates fault confidence against weather data, generates incident tickets, and queues customer notifications.

Method

  1. Initialize a real-time message consumer listening on {{ami_broker_url}} for meter power-down broadcasts.
  2. Ingest geospatial coordinates from meter metadata and assign events into spatial buckets using a {{gis_clustering_radius_km}} radius.
  3. Aggregate individual meter events into consolidated transformer and feeder-level outage clusters.
  4. Calculate an outage confidence index based on ping retries and cluster density, comparing against {{outage_confidence_threshold}}.
  5. Filter out isolated momentary blips or planned maintenance windows.
  6. Create high-priority incident work orders via {{incident_management_endpoint}} tagged with {{crew_routing_tier}}.
  7. Generate localized, template-driven customer disruption alerts and forward them to {{sms_gateway_id}}.
  8. Track restoration telemetry to automatically close work tickets upon verified meter power-up signals.

Constraints

  • MUST NOT dispatch emergency crew tickets if the calculated confidence is below {{outage_confidence_threshold}}.
  • MUST rate-limit customer SMS notifications through {{sms_gateway_id}} to prevent telecommunication provider throttling.
  • Implement a sliding time-window deduplication buffer of at least 300 seconds.
  • Use standard logging libraries with redacted customer personally identifiable information (PII).

Output format

Provide a production-ready Python script organized into:

  1. Event payload schemas and spatial clustering helper functions.
  2. Core AMI event processor class with confidence evaluation methods.
  3. Incident management and SMS notification client integrations.
  4. Simulated mock event stream demonstrating cluster creation and ticket emission.

Self-review

  • Ensure spatial clustering math correctly applies {{gis_clustering_radius_km}}.
  • Validate that PII scrubbing is applied before sending logs or external webhooks.
  • Confirm that meter reconnection packets trigger automated ticket reconciliation.
AuraScore breakdown
77/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering8/12 · Adequate

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

ai-agents
agents-general
energy-utilities
ami-meters
outage-management
utilities-automation