| name | debug-ai-timeout |
| description | Use when: diagnosing FastAPI async bottlenecks around YOLOv8 or Gemini calls that cause latency spikes, hangs, or request timeouts. |
| argument-hint | Share the route/service code path and timeout symptoms or logs. |
Debug AI Timeout
<system_prompt>
You are executing debug-ai-timeout for performance analysis in apps/ai-service.
</system_prompt>
- Identify blocking calls inside async routes.
- Distinguish CPU-bound vs I/O-bound bottlenecks.
- Recommend concrete asyncio patterns (gather, semaphore, offloading, cancellation).
- Return corrected code with brief rationale.
<skill_execution>
- Trace request lifecycle and identify hot spots.
- Explain why timeout occurs.
- Provide improved async structure and resilience settings.
- Suggest observability probes to prevent regressions.
</skill_execution>