Investigate Ticket
Research-only workflow — no code changes, no fixes, no PRs. Produces a structured summary with evidence, then hands off to ticket creation or the user.
Process
- Gather context — accept a ticket ID/URL, Slack thread, Datadog alert, or verbal description. If a Linear ticket exists, fetch it.
- Initial Datadog scan — quick, broad search for obvious signals. The goal is orientation, not root cause. Do not form a hypothesis yet.
- Trace the full execution path — from the entry point (controller, webhook handler, cron job), trace through every branch, early return, and conditional to the expected outcome. For each branch, note:
- What condition triggers it
- What log message it produces (exact string and structured attributes)
- Whether a feature flag gates it (note the flag key) Do NOT skip branches that seem unlikely — those are where non-obvious bugs hide.
- Check feature flags — if you found flags in step 3, look up each flag's current state in LaunchDarkly (see reference.md for details).
- Validate each branch in Datadog — search for the exact log messages and structured attributes from the code using
@field:valuequeries, not free-text. This tells you which code path was actually taken (see reference.md for search strategy). - Check data state in Snowflake — if the issue involves unexpected data or "works for some users but not others," query Snowflake to verify actual data state (see reference.md). Skip if purely code/config.
- Cross-reference — check git history for recent changes. Look for related Linear tickets. Check if the issue correlates with a deploy or flag change.
- Summarize findings — present a structured summary (see Findings Format in reference.md).
- Hand off — ask the user what to do next:
- Update an existing Linear ticket with findings
- Create a new ticket (redirect to appropriate ticket skill, carrying context forward)
- Keep findings, no ticket action
Hard Rules
- Always search Datadog before concluding. Not optional.
- Always include file paths and line numbers. "The booking service" is not acceptable.
- NEVER implement fixes. This is research only. If you're writing production code, STOP.
- Present findings before any ticket action. The user decides next steps, not you.
- Don't invent root causes. If you can't determine it from evidence, say so.
- Carry context forward. When handing off to a ticket skill, pass all findings.
- Trace the full path before forming a hypothesis. Walk every branch from entry point to outcome.
- Use structured Datadog queries, not free-text guesses. Read the code's logger calls first.
Red Flags — STOP If You Notice These
| You're about to... | STOP and... |
|---|---|
| Write a fix for the bug you found | This is investigation only — present findings first |
| Skip Datadog because "I already understand the issue" | Search Datadog anyway — you might find something unexpected |
| Form a root cause theory before tracing the full code path | Trace entry point → every branch → expected output first. Hypotheses from partial code reads miss early-return bugs |
| Search Datadog with free-text keywords only | Read the code's logger calls first, then search using structured attributes (@field:value) |
| Assume the code is wrong without checking data | Query Snowflake to verify actual data state before blaming code logic |
| Ignore a feature flag in the code path | Look up the flag state in LaunchDarkly — it may be gating the behavior you're investigating |
Cross-Referenced Skills
write-bug-ticket,write-tech-debt-ticket,write-feature-ticket— for creating tickets from findingsdatadog-investigate— API reference for Datadog queries when no Datadog MCP is available