/engineering:ai-observability-and-debuggingfrom engineering
Builds the observability stack for AI features in multi-tenant SaaS: prompt/response tracing, semantic logging, replay tooling, per-stage latency/cost breakdown, ticket-to-trace linking, and dashboards for operational questions.
Ships in engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
| Input | Required | Purpose |
|---|---|---|
| Domain evidence | yes | trace identifiers, prompt/model versions, tenant privacy rules, stage boundaries, retention policy, and incident questions |
Skill-specific outputs:
Default to read-only analysis. Read only scoped records; redact secrets and regulated data. Writes, execution, network calls, production configuration, customer communication, billing changes, and delegation require explicit authority and an identified owner. Never widen tenant, time-window, or system scope implicitly.
When required telemetry, evidence, execution, network access, or write authority is unavailable, return a partial result with each unassessed item labelled, preserve the safest existing state, and state the evidence or approval needed to continue. Never convert missing evidence into a pass.
| Condition | Action |
|---|---|
| Scope, owner, or threshold is missing | Stop the affected decision and request it |
| Evidence is incomplete but read-only analysis is safe | Produce a qualified partial result and gap list |
| A mutation exceeds authority or tenant boundary | Block it and route for approval |
| Evidence meets the stated threshold | Issue the output with provenance and owner |
Acknowledgement: Shared by Peter Bamuhigire, techguypeter.com, +256 784 464178.
observability-monitoring.ai-eval-harness.ai-on-saas-architecture §5).ai-model-gateway).saas-admin-backoffice-tooling).SKILL.md.| Category | Artifact | Format | Example |
|---|---|---|---|
| Operability | Trace schema | Markdown | docs/ai/trace-schema.md |
| Operability | Replay CLI | Code + docs | tools/ai/replay.py |
| Operability | Per-feature ops dashboard | Dashboard link | docs/ai/dashboards/feature-ops.md |
| Operability | Triage runbook | Runbook | docs/runbooks/ai-triage.md |
references/trace-schema.md — span names, attributes, examples.ai-on-saas-architecture, ai-model-gateway, ai-eval-harness, ai-prompt-injection-and-tenant-safety, observability-monitoring, saas-admin-backoffice-tooling.ai-evidence-export --signal <id> --window <range> --output <dir>) that snapshots state-at-window-end (prompt/model/index/price registries), pulls a stratified sample of failing traces, and generates reproduce scripts. See ai-incident-evidence-capture/references/evidence-bundle-spec.md for the schema and ai-incident-evidence-capture/references/reproduce-script-template.md for the script generator. The replay tooling must support a "show me everything from for on " mode usable by an on-call engineer at T+5 of an incident.A standard ai.* namespace under OpenTelemetry semantic conventions. See references/trace-schema.md for the full schema. Summary:
ai.gateway.requestai.entitlement, ai.kill_switch, ai.rate_limit, ai.caps, ai.prompt.render, ai.safety.in, ai.retrieval, ai.provider.call, ai.safety.out, ai.cost, ai.audit.ai.tenant_id, ai.feature, ai.prompt_id, ai.prompt_version, ai.model_used, ai.region, ai.tokens_in, ai.tokens_out, ai.usd_cost, ai.fallback_used.Each pipeline stage produces a span with:
service.name = "llm-gateway"ai.stage = "<name>"ai.outcome = "ok|denied|error"with tracer.start_as_current_span("ai.entitlement") as span:
span.set_attribute("ai.stage", "entitlement")
span.set_attribute("ai.tenant_id", ctx.tenant_id)
span.set_attribute("ai.feature", ctx.feature)
try:
await entitlements.check(ctx)
span.set_attribute("ai.outcome", "ok")
except NotEntitled as e:
span.set_attribute("ai.outcome", "denied")
span.set_attribute("ai.denial_key", e.key)
raise
Traces export to OTel; sampled at 100% for AI traces by default (volumes are low enough; signal is critical). Reduce sampling once volume scales.
Given a request_id, the replay tool:
ai_requests + S3 payload.Two modes:
--with-provider: re-issue to provider (costs money; useful for "is this still broken?").--from-cache: use stored provider response (free; useful for analysing pipeline changes).CLI: replay --request-id ai_req_01HXY... --mode from-cache
Replay is read-only; never charges credits, never affects metrics.
Two audiences:
Back-office operator view: full trace, payload, retrieval chunks with scores, safety findings, judge-LLM score (if sampled). Filterable by tenant, feature, time, error class. Drill from a customer ticket.
Tenant admin view (optional, premium): for each AI answer, an "explain" affordance that shows:
Hide:
Make tenant-facing explanations always derived from the audit log; never re-generated by the model (that would be the model rationalising, not explaining).
Every AI feature surfaces a copyable request_id (often the last 8 chars) in the UI as a small badge or in a "report issue" flow. The support tool accepts the id and:
For high-volume features, also expose a "feedback?" thumbs-up/down per response, recorded with the request_id.
Standard set per feature:
| Dashboard | Panels |
|---|---|
| Feature ops | QPS, p50/p95/p99 latency by stage, error rate by stage, fallback ratio, abstain rate |
| Cost | USD per hour, per tenant top-20, per model, per feature share |
| Quality | faithfulness, correctness, citation density, judge agreement (rolling) |
| Safety | injection detect rate, output blocks, tool denials, jailbreak suspicions |
| Tenant view | per-tenant requests, cost, errors, denials, top features |
Each panel filterable by time, tenant, region, model, prompt version.
Single-request AI observability is insufficient for agentic features. An agent task is one trace spanning many LLM calls and tool calls, often running for minutes or hours. The trace schema, replay tooling, and task-level dashboards live in ai-agent-observability-and-replay.
Key differences from request-level traces:
| Dimension | Request | Agent task |
|---|---|---|
| Trace lifetime | seconds | seconds to days |
| Spans per trace | 5-20 | 50-500+ |
| Replay | re-call with same inputs | re-run loop with mocked tool I/O |
| Failure modes | latency, content, cost | + step-loop, hallucinated tool args, off-script irreversibles, deadlock |
| Dashboards | per-request metrics | per-task metrics: success rate, intervention rate, step efficiency |
Required schema additions when agents are in scope — root span agent.task with attributes for agent.task.id, agent.feature, agent.prompt.version, agent.tool_set.version, agent.task.steps.used/budget, agent.task.usd.total, agent.task.terminal.state. Per-step child spans agent.step.N. Per-LLM-call and per-tool-call sub-spans. Special spans: agent.handoff, agent.approval. Full schema: ai-agent-observability-and-replay/references/trace-schema-agent.md.
Required dashboards: per-feature task success rate, intervention rate, irreversible-action rate, step efficiency, median cost per completed task; per-tenant agent task volume, agent cost share, wasted-spend share; top-10 tasks by cost in last hour; failure-mode distribution.
Required replay surface: per-task replay re-running a recorded task with candidate prompt/model/tool version; side-by-side step diff; never call live tools in replay.
ai-agent-observability-and-replay — the agent-specific complement with full trace schema, replay tooling, task viewer, and "what would the agent do differently" debugger.ai-agent-runtime-architecture — emits the task-level trace events.ai-agent-eval — consumes traces for replay-based eval.ai-on-saas-architecture — control-plane positioning.ai-model-gateway — instrumented from.ai-eval-harness — surfaces quality signal to dashboards.ai-prompt-injection-and-tenant-safety — safety signals to dashboards.observability-monitoring — broader observability.saas-admin-backoffice-tooling — operator UI.Run the offline K4 diagnostic with Python. Compare the same record on the training and serving paths. A shift in input lengths can trigger investigation while accuracy awaits labels. Check the schema, vocabulary order and adapter base before serving. The example stages the complete rollback bundle, interrupts the index promotion, retries the operation and reports the number of effects. Escalate to the operator named in the trace and send affected users to the correction queue.
references/ai-hallucination-slo-and-grounding/entrypoint.md (opens in a new tab)references/ai-hallucination-slo-and-grounding/references/grounding-and-citation-ux.md (opens in a new tab)references/ai-hallucination-slo-and-grounding/references/slo-and-error-budget-math.md (opens in a new tab)references/routing.md (opens in a new tab)references/trace-schema.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ai-observability, prompt-tracing, llm-debugging, otel, multi-tenant
169 skills in this plugin
/accounting-engineUse when designing or implementing double-entry accounting policy and an embedded ledger engine for invoices, payments, stock, balanced postings, mapped accounts, idempotency, reversals, period locks, audit trails, and financial statements./accounting-finance-controllerUse when coordinating accounting and finance implementation reviews, doctrine routing, control evidence, remediation priorities, and release decisions across a software system./advanced-testing-strategyUse when designing or reviewing test strategy for production systems, APIs, mobile apps, SaaS platforms, ERP workflows, and AI-enabled systems. Covers unit, integration, contract, end-to-end, regression, release-gate, and risk-based testing decisions.npx claudepluginhub peterbamuhigire/chwezi-dev-engine --plugin engineeringOther plugins' skills for the same job