Investigation mode

From openai/plugins · View interactive version

Investigation mode is an AI agent skill from the GitHub repository openai/plugins. Orchestrated debugging coordinator. Triggers on frustration signals (stuck, hung, broken, waiting) and systematically triages: runtime logs → workflow status → browser verify → deploy/env. Reports findings at every step.

How to use this skill

Skill file

Investigation Mode — Orchestrated Debugging

When a user reports something stuck, hung, broken, or not responding, you are the diagnostic coordinator. Do not guess. Follow the triage order, report what you find at every step, and stop when you have a high-confidence root cause.

Reporting Contract

Every investigation step MUST follow this pattern:

  1. Tell the user what you are checking — "I'm checking the runtime logs for errors…"
  2. Share the evidence you found — paste the relevant log line, status, error, or screenshot
  3. Explain the next step — "The logs show a timeout on the DB call. I'll check the connection pool next."

Never silently move between steps. The user is already frustrated — silence makes it worse.

Triage Order

Work through these in order. Stop as soon as you find the root cause.

1. Runtime Logs (check first — most issues leave traces here)

Tell the user: "Checking runtime logs…" → share what you found → explain next step.

2. Workflow / Background Job Status

If the app uses workflows, queues, or cron jobs:

Tell the user: "Checking workflow run status…" → share the run state → explain next step.

3. Browser Verification

Use agent-browser to visually verify what the user sees:

Tell the user: "Taking a browser screenshot to see the current state…" → share the screenshot → explain what you see.

4. Deploy / Environment Status

Tell the user: "Checking deployment status…" → share the deployment state → explain findings.

Stop Condition

Stop investigating when:

Do not keep cycling through steps hoping something appears. If logs are empty and workflows look fine, say so and ask the user what they expected to happen.

Common Hang Causes

When logs point to code issues, check for these frequent culprits:

Add Logging (If Missing)

If the investigation reveals insufficient observability, add structured logging immediately — you cannot debug what you cannot see.

// API routes — wrap handlers with try/catch + logging
export async function POST(request: Request) {
  console.log('[api/route] incoming request', { method: 'POST', url: request.url });
  try {
    const result = await doWork();
    console.log('[api/route] success', { resultId: result.id });
    return Response.json(result);
  } catch (error) {
    console.error('[api/route] failed', { error: String(error), stack: (error as Error).stack });
    return Response.json({ error: 'Internal error' }, { status: 500 });
  }
}
// Workflow steps — log entry/exit of every step
const result = await step.run('process-data', async () => {
  console.log('[workflow:process-data] step started');
  const data = await fetchData();
  console.log('[workflow:process-data] step completed', { count: data.length });
  return data;
});

Key principle: Every async boundary, every external call, every step entry/exit should have a log line. When something hangs, the last log line tells you exactly where it stopped.

Cross-reference: For comprehensive logging setup (OpenTelemetry, log drains, Sentry, Vercel Analytics), see the observability skill. For workflow-specific debugging, see the workflow skill.

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.