# AI Skills for Real-Time Debugging

Treasure AI Studio provides skills that generate diagnostic queries to help you quickly identify root causes of common real-time issues.

Use these skills when:

- You have a **parent segment ID** and need to investigate an issue.
- You need a quick read on **activation failures**, **profile merges**, or **stitching quality**.
- You want a structured approach to diagnosing real-time problems.


Prerequisites
Install the [`td-skills`](/treasure-code/guide/td-skills) package to get started.

## Available Skills

The following skills are available for real-time debugging:

| Skill | What It Answers | Expected Output |
|  --- | --- | --- |
| `activations` | Did the activation fire? Why did it fail? | Fast summary of activation delivery errors and volume |
| `identity` | Did the event stitch to the right profile? | Quick read on new, updated, and merged real-time profiles |
| `identify-top-key-values` | Are bad stitching values polluting the graph? | Surfaces dominant key values, including null or empty patterns that cause data quality issues |
| `id-graph-canonical-id-size` | Are canonical groups becoming unusually large? | Helps spot possible over-stitching or "mega-profile" patterns |
| `id-graph-ids-to-canonical-id` | Is one ID mapping to multiple canonical IDs? | Helps detect inconsistent stitching and over-stitching cases |
| `rt-journey-monitor` | Is the journey running as expected? Where is it failing? | Journey execution monitoring and activation failure debugging |


## Debugging Workflows

Choose the right skills based on the symptom you are investigating.

### Activation Not Firing

When a webhook, streaming egress, or downstream action did not execute as expected, start with these skills:

1. **`activations`** — Query activation logs for your parent segment to check whether the activation fired and identify delivery errors.
2. **`rt-journey-monitor`** — If the activation is part of a journey, check whether the journey itself is executing correctly and where it might be failing.


### Missing or Incorrect Profile Data

When personalization attributes are missing, incomplete, or returning unexpected values, the root cause is often related to identity resolution. Use these skills:

1. **`identity`** — Check recent profile merges and stitching activity for your parent segment.
2. **`identify-top-key-values`** — Inspect the distribution of stitching key values to find null, empty, or junk values that degrade data quality.
3. **`id-graph-canonical-id-size`** — Analyze canonical ID group sizes to detect over-stitching, where too many IDs collapse into a single profile.
4. **`id-graph-ids-to-canonical-id`** — Check whether a single ID maps to multiple canonical IDs, which indicates inconsistent stitching.


## Example Prompts

To use a skill, provide it with your parent segment ID and the specific question you want to answer. The following examples use parent segment `394649` as a placeholder — replace it with your own.

### Activation debugging


```text
Use the activations skill to query activation logs for parent segment 394649.
```

### Identity and profile debugging


```text
Use the identity skill to check recent profile merges for parent segment 394649.
```


```text
Use the identify-top-key-values skill to debug stitching key distributions
for parent segment 394649.
```

### ID graph analysis


```text
Use the id-graph-canonical-id-size skill to analyze canonical ID group sizes
for parent segment 394649.
```


```text
Use the id-graph-ids-to-canonical-id skill to detect IDs mapping to multiple
canonical IDs.
```

## Best Practices

Before starting a debugging session, gather the following information:

- **Parent segment ID** for the real-time configuration you are investigating.
- **A specific user or device ID** that demonstrates the issue.
- **A recent time window** when the issue occurred.
- **The symptom** you are observing:
  - Activation did not send
  - Personalization returned empty or partial data
  - Profile stitched incorrectly
  - Event counts or merges look suspicious


Then choose the smallest set of skills that match your symptom:

- **Activation problem** — Start with `activations`, then `rt-journey-monitor` if the activation is journey-triggered.
- **Identity or merge problem** — Start with `identity`.
- **Suspected junk IDs or over-stitching** — Use `identify-top-key-values`, `id-graph-canonical-id-size`, and `id-graph-ids-to-canonical-id`.
- **Journey progression or delivery issue** — Use `rt-journey-monitor`.