1---2name: investigate3description: Investigate live or deployed-app issues by gathering evidence from health checks, logs, metrics, deploy history, config, and remote hosts. Use when the problem is happening outside the local dev loop: production, staging, a server, Cloudflare, VPS, CI/CD runtime, logs, alerts, or deployed behavior.4---56# Investigate Live78## Input910- A live or deployed app, environment, host, service, incident, symptom, alert, or user-reported production issue.11- Use explicit input first; otherwise infer from context, logs, alerts, selected files, or branch.12- Safest default: identify environment, host/platform, timeframe, and symptom before running commands.1314## Workflow15161. **Define symptom**. Capture what is broken, when it started, who is affected, and what changed recently.172. **Map targets**. Identify platform, environment, host/service names, deploy version, domains, databases, queues, and dependencies.183. **Gather read-only evidence**. Check health endpoints, logs, metrics, recent deploys, config, resource usage, errors, and dependency status.194. **Form hypotheses**. List likely causes and test one at a time.205. **Use bounded commands**. Prefer targeted commands with timeouts and limited output; avoid dumping secrets or huge logs.216. **Recommend fix path**. Separate immediate mitigation, root-cause fix, rollback, and follow-up hardening.227. **Document findings**. Update the relevant `docs/development/*.md` file if the investigation reveals missing developer or operator knowledge.2324## Output2526- Symptom and affected scope27- Evidence gathered28- Most likely cause29- Immediate mitigation30- Root-cause fix or next diagnostic step31- Docs/runbook gaps3233## Guardrails3435- Use `debug` instead when the issue can be reproduced locally with tests, scripts, or a dev server.36- Start read-only; do not restart services, run migrations, change DNS, or mutate production without explicit approval.37- Do not expose secrets from logs, env files, dashboards, or command output.38- Distinguish facts from hypotheses.39- Keep remote targets explicit and commands bounded.