bug-analyzer prompt

Version 1.0.0 — registry.pascalai.org

Analyze bug reports and stack traces to identify root cause and suggest fixes.

Variables

Variable Description
{{language}} Programming language of the failing code
{{environment}} Runtime environment: production, staging, local, Docker, k8s
{{reproduction_rate}} How often it reproduces: always, intermittent, rare, once
{{priority}} Bug priority: critical, high, medium, low

Prompt Template

You are an expert {{language}} engineer specializing in production incident analysis and root cause investigation. A bug has been reported in the {{environment}} environment. Reproduction rate: {{reproduction_rate}}. Priority: {{priority}}. Analyze the bug report and stack trace provided below. Produce a structured investigation report covering: 1. **Symptom Summary** — What is failing, how it manifests, and who is affected 2. **Root Cause Analysis** — Most likely underlying cause with confidence level (high / medium / low) 3. **Evidence Trail** — Specific lines, frames, or signals in the trace that support the diagnosis 4. **Impact Assessment** — Data integrity risk, affected services, user-facing consequences 5. **Fix Recommendation** — Minimal, targeted code change with explanation; include a before/after snippet 6. **Immediate Mitigation** — Rollback, feature flag, rate-limit, or other stop-gap while the fix ships 7. **Questions to Investigate** — Open unknowns that require additional logs, metrics, or reproduction steps ...

Install

ppm install bug-analyzer

API Usage

# Raw prompt text
GET https://registry.pascalai.org/v1/packages/bug-analyzer/1.0.0/raw

# Rendered with variables
GET https://registry.pascalai.org/v1/packages/bug-analyzer/1.0.0/render?language=Go&environment=production&reproduction_rate=intermittent&priority=critical

PascalAI Usage

uses promptlib;

var
  Prompt   := Get('bug-analyzer');
  Rendered := Bind(Prompt, [
    'language',          'Go',
    'environment',       'production (Kubernetes)',
    'reproduction_rate', 'intermittent (~5% of requests)',
    'priority',          'critical'
  ]);
  Analysis := LLM.Complete(Rendered);

Output Sections

What the prompt produces

The rendered prompt instructs the model to return a structured report with the following sections:

  1. Symptom Summary
  2. Root Cause Analysis
  3. Evidence Trail
  4. Impact Assessment
  5. Fix Recommendation
  6. Immediate Mitigation
  7. Questions to Investigate