You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If validation fails, the JSON response includes `errors[].agent_action` and `next_steps` so the agent can convert the trace into `ContextTrace`.
@@ -115,7 +133,7 @@ If validation fails, the JSON response includes `errors[].agent_action` and `nex
115
133
116
134
This repository ships an `analyze-agent-context` skill for Cursor, Claude Code, and other Agent Skills / Open Plugins compatible tools.
117
135
118
-
The skill does not fetch traces. It teaches agents to use `context-profiler` whenever the user asks to analyze a trace, loop, transcript, agent run, context growth, stale context, or tool bloat.
136
+
The skill does not make `context-profiler`fetch traces itself. It teaches agents to use Langfuse tooling to fetch Langfuse trace ids, then route the fetched JSON into `context-profiler` for diagnosis whenever the user asks to analyze a trace, loop, transcript, agent run, context growth, stale context, or tool bloat.
119
137
120
138
Canonical skill:
121
139
@@ -181,6 +199,7 @@ The HTML report is self-contained and keeps the existing profiler style:
181
199
}
182
200
```
183
201
202
+
184
203
## Examples
185
204
186
205
See [`examples/README.md`](examples/README.md) for runnable fixtures and conversion patterns.
Copy file name to clipboardExpand all lines: skills/analyze-agent-context/SKILL.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,29 @@ Use `context-profiler` as the trace-source agnostic context analysis harness.
9
9
10
10
## Core Rule
11
11
12
-
Do not fetch traces unless the user asks you to. If another tool already fetched trace data, use that local file or recent JSON output. The source can be Langfuse CLI, Claude Code, Cursor, OpenTelemetry, raw OpenAI/Anthropic requests, or an academic trajectory dataset.
12
+
Do not fetch traces unless the user asks you to. If the user provides a Langfuse trace id and asks to inspect, debug, or analyze it, use the Langfuse skill/CLI to fetch that trace, then hand the fetched JSON to `context-profiler`. Do not manually summarize the raw trace before running `context-profiler`.
13
+
14
+
If another tool already fetched trace data, use that local file or recent JSON output. The source can be Langfuse CLI, Claude Code, Cursor, OpenTelemetry, raw OpenAI/Anthropic requests, or an academic trajectory dataset.
15
+
16
+
Before analysis, verify the CLI is callable:
17
+
18
+
```bash
19
+
context-profiler --version
20
+
```
21
+
22
+
If the command is missing or its entry point is broken, ask the user to install it with `pipx install context-profiler` or `uv tool install context-profiler`.
23
+
If `which -a context-profiler` shows a stale broken executable before the `pipx`/`uv tool` executable, use the working executable path or fix `PATH` before continuing.
13
24
14
25
## Workflow
15
26
16
27
1. Identify the available trace or loop data:
17
28
- File path supplied by user.
18
29
- Recent JSON output from another CLI, such as `langfuse-cli`.
30
+
- Langfuse trace id supplied by user. Fetch it with Langfuse tooling first:
31
+
```bash
32
+
npx langfuse-cli api traces get <trace-id> --fields core,io,observations --json \
0 commit comments