Ask Prod Skill🔗
The Ask Prod Skill helps an AI assistant answer questions about live production or staging behavior using Lightrun MCP. It guides the assistant to collect focused runtime data from running services, then translate that data into a clear answer.
The skill is available in the lightrun-ai repository as lightrun-ask-prod.
Before using this skill, install the shared Lightrun AI Skills package and complete the requirements in Lightrun AI Skills.
When to use this skill🔗
Use the Ask Prod Skill when you want an AI assistant to answer a specific question that requires live runtime evidence from Lightrun MCP.
This skill is useful when you need to know:
- The current value of a variable, field, cache entry, request, response, or runtime expression.
- How long an operation takes in a live environment.
- How often a line of code or branch executes.
- What range of values an expression takes over time.
- Which branch or path runs for a specific customer, tenant, request, or condition.
For production-scale questions, include the scope you want the assistant to inspect. For example, specify whether the answer should come from one agent, a set of agents, a tag, a custom source, a region, or a customer-specific traffic path. This helps the assistant avoid presenting a single-instance result as a global production answer.
How to use this skill🔗
Start a new AI assistant chat and ask the assistant to use the Ask Prod Skill for the question you want answered.
Use a prompt like this:
Use the Lightrun Ask Prod Skill to answer this production question.
Question:
Show details of a few recent requests sent to POST /api/v1/users.
Target service:
user-service in production.
What I know:
The request is handled by UserController.createUser. I want request details observed from the live service, not an example inferred from the API contract.
The assistant should identify the specific value or measurement you are asking for, locate the relevant code, run the Lightrun MCP preflight check, select the right runtime source, and collect runtime data from the live service.
Example questions🔗
The Ask Prod Skill can help answer questions such as:
- Show the current value of
cacheSizein the selected production instances. - How many users are logged in across the selected production instances?
- Show details of a few recent requests sent to
POST /api/v1/users. - Show details of a few recent responses from the external sales tax service.
- Is this cache key currently in use?
- Show the runtime distribution for trade requests coming in now.
- Let me know if this list is empty in production during the next 24 hours.
- What values are showing up in production for this expression when
varXis true? - Which branch of
calculateDiscountruns for customer X?
What the skill does🔗
The skill gives the assistant a structured workflow for answering production questions with live runtime evidence:
- It starts by clarifying the value, behavior, or measurement being requested.
- It chooses the Lightrun MCP capability that matches the question.
- It locates the exact source file and line number needed for runtime instrumentation.
- It runs
get_runtime_sourcesto discover available agent pools, agents, tags, and custom sources. - It selects the runtime source scope that matches the question, such as a single agent, multiple agents, a tag, or a custom source.
- It collects data with the relevant runtime tool.
- It summarizes the result in plain language, including the runtime sources covered and any remaining uncertainty.
This approach helps the assistant avoid guessing from static code and keeps the final answer grounded in live application behavior.
Source coverage and scoped answers🔗
Ask Prod answers are only as broad as the runtime sources being inspected. A single application instance can answer questions about that instance, but it cannot prove a fleet-wide condition unless the assistant targets a representative set of instances, a tag, or a custom source that covers the requested scope.
For multi-instance services, ask the assistant to select a target that matches the question:
- Use a specific agent when you need to inspect one known instance.
- Use multiple agents when the answer should compare behavior across selected instances.
- Use a tag or custom source when the answer should cover a service, environment, region, tenant group, or another shared runtime scope.
When full coverage is not available, the assistant should say so directly. For example: "Across the selected production instances, X users were logged in during the collection window. Other instances were not included in this result."
For count-style questions across multiple instances, the assistant should collect results from the selected sources and aggregate only those results. If traffic, tagging, or source selection does not cover every relevant instance, the final answer should describe the observed scope instead of claiming a complete production total.
Use runtime actions with observation windows🔗
Ask Prod uses runtime actions to collect evidence from live services. Runtime actions can support both short collection windows and longer observation windows, so the assistant can either wait briefly for results in the current session or leave the action active for later review.
When the user expects the code path to run quickly, the assistant can wait for an immediate answer or for a short period of time. For example, this is useful when the relevant flow will be triggered right away and there is no diagnostic value in waiting longer.
When the expected signal needs a longer or uncertain observation window, such as waiting to see whether a list becomes empty during the next 24 hours, the assistant should keep the action active and explain when to check the result.
For each runtime action, the assistant should:
- Create the action against the selected runtime scope and keep track of the action ID.
- Explain the observation window and what signal is being collected.
- Check the action status before creating duplicate actions for the same question.
- Retrieve results when new hits are available.
- Cancel actions that are no longer needed, or explain why an action remains active.
For a fuller runtime investigation pattern, see the Live Runtime Debugging Skill.
Runtime capabilities🔗
The assistant selects the runtime capability based on the question:
| If the question asks... | The assistant uses... |
|---|---|
| What is the current value of an expression? | Snapshot expression capture with snapshot_create, snapshot_status, and snapshot_get_values |
| How long does an operation take? | Execution duration with get_runtime_execution_duration |
| How often does a line or branch run? | Execution count with get_runtime_execution_count |
| What range of numeric values appears over time? | Numeric metrics with get_runtime_numeric_metric |
Expected investigation flow🔗
During a successful Ask Prod investigation, the assistant should:
- Restate the question and identify the runtime value, behavior, or measurement needed.
- Locate the source file and line number that can produce the requested data.
- Run
get_runtime_sourcesto discover available Lightrun runtime sources. - Select the source scope that matches the question, such as an agent, multiple agents, a tag, or a custom source.
- Choose the correct Lightrun MCP tool for the requested measurement.
- Create a runtime action with an observation window that matches the question.
- Wait briefly for results when the user expects the code path to run soon, or keep the action active for a longer observation window.
- Return a direct answer with the collected runtime evidence, covered sources, collection window, and any limits of the result.
Troubleshooting🔗
The assistant cannot find Lightrun MCP tools🔗
Confirm that Lightrun MCP is installed, enabled, and authenticated in your AI client. Then ask the assistant to list the available Lightrun MCP tools.
For setup instructions, see the MCP quickstart guide.
get_runtime_sources returns no sources🔗
Confirm that the target application is running with the Lightrun agent connected and that your Lightrun user has access to the relevant agent pool, tag, or custom source.
Several runtime sources match the question🔗
Include the service name, environment, tag, agent pool, custom source, customer segment, or region in your prompt. If the assistant still finds several plausible targets, choose the runtime source manually.
A single source cannot answer a fleet-level question🔗
Ask the assistant to target a tag, custom source, or multiple agents that match the requested service and environment. If full coverage is not available, the assistant should frame the result in terms of the selected runtime sources instead of presenting it as a complete production answer.
Runtime actions return no data🔗
Confirm that the selected runtime source matches the code path you are asking about. If the operation is infrequent, ask the assistant to keep the action active for a longer observation window and trigger the relevant flow again.
The question needs a longer observation window🔗
Ask the assistant to state the observation window clearly. The assistant should provide the action ID, the selected runtime scope, the signal being collected, and the condition for checking results later.
The code location is unclear🔗
Add the class, function, endpoint, field name, or repository path to your prompt. The assistant should ask for clarification when it cannot identify a reliable instrumentation location.