General engineering
AuraScore 89/100

Smart Meter Interval Data Reconciliation Pipeline

Build an automated ETL script to validate and reconcile interval smart meter logs.

Deploy this template when building batch reconciliation scripts for Advanced Metering Infrastructure (AMI) feeds. It outputs an automated parsing script that identifies missing intervals and malformed power consumption reads.

Template

Role: Principal Power Distribution Data Engineer specializing in Advanced Metering Infrastructure (AMI) analytics.

Context

  • Regional grid operator: {{grid_operator}}
  • Raw meter payload format: {{meter_data_format}}
  • Meter read cadence: {{interval_duration_minutes}}
  • Billing tariff matrix: {{tariff_schedule_table}}
  • Raw file storage bucket: {{staging_bucket_uri}}
  • Pipeline failure sink: {{error_log_destination}}

Task

Develop an automated Python batch processing script that ingests raw interval consumption files from {{staging_bucket_uri}} in {{meter_data_format}}, validates interval continuity according to {{interval_duration_minutes}}, computes aggregate kWh usage matched to {{tariff_schedule_table}}, and routes corrupted records to {{error_log_destination}} for {{grid_operator}}.

Method

  1. Initialize storage connection clients and ingest batch files from {{staging_bucket_uri}}.
  2. Parse incoming {{meter_data_format}} meter records and map fields to internal data classes.
  3. Validate meter sequence timestamps against the expected {{interval_duration_minutes}} cadence to identify gaps.
  4. Perform validation checks on raw registers: flag zero-consumption anomalies, reverse energy flow, and negative values.
  5. Map interval timestamps to active time-of-use pricing windows defined in {{tariff_schedule_table}}.
  6. Aggregate interval kilowatt-hours into peak, shoulder, and off-peak billing buckets per meter identifier.
  7. Route failed records and syntax anomalies into {{error_log_destination}} with machine-readable error reasons.
  8. Emit a structured reconciliation summary containing total meters processed, error count, and aggregated kWh.

Constraints

  • MUST process data using streaming chunk iterators to avoid out-of-memory errors on large batch files.
  • MUST NOT drop invalid records silently; all discarded reads must append to {{error_log_destination}}.
  • Execution runtime MUST complete without depending on proprietary enterprise billing SDKs.
  • Script must provide deterministic outputs when re-run against identical raw source files.

Output format

1. Script Configuration

  • Configuration block mapping cloud storage pointers and parser flags (under 20 lines).

2. Processing Script

  • Complete Python ETL script containing parsing, validation, and tariff mapping functions (110-190 lines).

3. Verification Commands

  • Shell commands demonstrating local execution and error destination verification (under 15 lines).

Self-review

  • Ensure the gap detection logic correctly accounts for daylight saving time boundaries.
  • Verify all variables from context are explicitly referenced and configured in the script.
  • Confirm that mathematical conversions between kW instantaneous demand and kWh interval energy are accurate.
AuraScore breakdown
89/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 engineering12/12 · Strong

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

Output specification14/14 · Strong

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.

developers
developers-general
energy-utilities
ami
smart-meter
etl