Observability driven development

From adrielp/ai-engineering-harness · View interactive version

Observability driven development is an AI agent skill from the GitHub repository adrielp/ai-engineering-harness. Observability Driven Development (ODD) — design the trace before the feature. Auto-activates when the user wants to "drive with observability", "ODD", "instrument first", "narrative-first", "telemetry-driven", or wants to set up a local OTel feedback loop with the Aspire dashboard. Pairs with /valid

How to use this skill

Skill file

Observability Driven Development (ODD)

"A feature isn't 'done' when its tests pass; it's done when its trace

accurately and legibly narrates the entire request lifecycle."

— Observability 4.0 is Inferable, Adriel Perkins

ODD treats the trace as a first-class design artifact. You design the span

tree before you write the feature, then run code against a local OTel stack so

every change produces a trace you can read in seconds. No guessing, no

post-hoc instrumentation.

When to Use ODD

Reach for ODD when any of the following are true:

or external APIs.

context engineering, tool selection & invocation, state management, error

recovery, memory access).

narrate what the code was doing.

If the work is a pure-compute helper, a config tweak, or a CSS change,

don't use ODD — it's overhead.

The Inner Loop

Write Code → Instrument (OTel spans) → Run Locally → OTel Collector → Aspire → Observe → [repeat]

Every code change produces a trace. Every trace answers a question. The loop

is measured in seconds, not hours. Detail in loop.md.

Workflow

  1. Write the narrative spec before the implementation. Format: see

narrative.md. Save to

thoughts/shared/telemetry/<feature>.md. Template:

thoughts/shared/telemetry/narrative-template.md.

  1. Stand up the local stack if it isn't already running. See

local-setup.md. Prefer the Aspire dashboard via Docker.

  1. Instrument and implement the feature. For SDK setup, span design, and

validation rules, route to otel_instrumentation. For attribute names,

route to otel_semantic_conventions.

  1. Observe in the dashboard after each meaningful change. The trace shape

should converge toward the spec.

  1. Validate with /validate_telemetry thoughts/shared/telemetry/<feature>.md.

Cross-Skill Routing

| Concern | Route to |

|---|---|

| SDK setup, span/metric/log design, sensitive-data rules | otel_instrumentation |

| Attribute naming, namespaces, gen_ai.*, http.*, etc. | otel_semantic_conventions |

| Collector pipelines, sampling, RED metrics derivation | otel_collector |

| OTTL transforms, redaction, normalisation | otel_ottl |

ODD owns the loop. Routing skills own the mechanics.

Validation

The /validate_telemetry slash command activates this section.

Mode A: Spec-Driven Validation — `/validate_telemetry <spec-path>`

  1. Read the narrative spec at <spec-path> completely.
  2. Confirm the local Aspire dashboard is reachable (see

local-setup.md).

  1. Trigger the feature locally (HTTP call, CLI invocation, message publish).
  2. Capture the resulting trace. Prefer Aspire MCP if wired and working

(see local-setup.md for the standalone-Docker MCP bug);

fall back to the dashboard's JSON export or an OTLP HTTP intercept.

  1. Diff observed vs. spec on three axes:

no extra INTERNAL noise.

value and the right placement (resource vs. span vs. metric).

and bounded attribute cardinality.

  1. Emit a report:

```markdown

## Telemetry Validation Report — <feature>

### Spec

### Shape

✓ Matches | ✗ Missing: <span-name> | ⚠ Extra: <span-name>

### Attributes

✓ <span>.<attr> present

✗ <span>.<attr> missing

⚠ <span>.<attr> high-cardinality (sample: <values>)

### Metrics

✓ <metric> present, unit <u>, <N> series

✗ <metric> missing

### Recommendations

```

Mode B: Generic Health Check — `/validate_telemetry` (no argument)

  1. Confirm the local Aspire dashboard is reachable.
  2. Sample the most-recent N traces (default 20) and the live metrics list.
  3. Validate against the rules already encoded in otel_instrumentation

(see its §7 Validation Checklist) and otel_semantic_conventions:

deployment.environment.name, service.instance.id,

service.namespace.

for HTTP services.

cookie, credit-card-shaped strings) in any attribute.

  1. Emit a report keyed by the same checklist.

In both modes, never modify code or config silently. The report is the

output. The user decides what to fix.

See Also

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.