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
Copy file name to clipboardExpand all lines: skills/analyze-agent-context/SKILL.md
+30-2Lines changed: 30 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,31 @@ Do not fetch traces unless the user asks you to. If the user provides a Langfuse
13
13
14
14
If another tool already fetched trace data, use that local file or recent JSON output. The source can be Langfuse public API JSON, Claude Code, Cursor, OpenTelemetry, raw OpenAI/Anthropic requests, or an academic trajectory dataset.
15
15
16
+
## Analysis Gate
17
+
18
+
The first analysis command must be `context-profiler validate`, `context-profiler diagnose`, or `context-profiler analyze`.
19
+
20
+
Do not write Python scripts, notebooks, `jq` summaries, or ad hoc JSON parsers to analyze the trace before running `context-profiler`. Python is allowed only for narrow operational tasks such as checking whether local settings contain credential keys, or after `context-profiler validate` fails and returns `errors[].agent_action` requiring conversion to `ContextTrace`. After any conversion, pipe the converted data back into `context-profiler`; do not present the conversion script's own findings as the analysis.
21
+
22
+
## Langfuse Credentials
23
+
24
+
Never ask the user to paste API keys or secrets into chat. It is acceptable for the user to provide credentials through local environment variables or a local settings file, but do not expose those values in model-visible output.
25
+
26
+
For Langfuse trace fetching, first use the current process environment:
27
+
28
+
-`LANGFUSE_HOST` or `LANGFUSE_BASE_URL`
29
+
-`LANGFUSE_PUBLIC_KEY`
30
+
-`LANGFUSE_SECRET_KEY`
31
+
32
+
If any value is missing, check whether local Claude settings files contain the needed keys without printing their contents or values:
33
+
34
+
-`.claude/settings.local.json`
35
+
-`.claude/settings.json`
36
+
-`~/.claude/settings.local.json`
37
+
-`~/.claude/settings.json`
38
+
39
+
Only inspect the `env` object for key presence. Do not load, export, print, summarize, or copy secret values from settings files into chat, terminal output, reports, or generated commands. If credentials are present in a local settings file but not in the current process environment, ask the user to run the agent from that configured environment or explicitly approve using that local file as the credential source. If credentials still cannot be found, ask the user to export them in the current shell or point to a local settings file; do not ask them to paste values into chat.
40
+
16
41
Before analysis, verify the CLI is callable:
17
42
18
43
```bash
@@ -34,6 +59,8 @@ If `which -a context-profiler` shows a stale broken executable before the `pipx`
Do not print or inline API keys. If any required environment variable is missing, ask the user to set it without pasting secrets into chat. For traces with more than 100 observations, paginate the observations endpoint before analysis.
80
+
Do not print or inline API keys. Do not automatically export secrets from local Claude settings. If any required value is still missing from the current environment, ask the user to run from the configured environment, approve using the local settings file as a credential source, or export the values in the current shell. For traces with more than 100 observations, paginate the observations endpoint before analysis. Do not analyze `trace.json` or `observations-page-*.json` directly with Python before running `context-profiler`.
54
81
- Current Cursor transcript under `~/.cursor/projects/**/agent-transcripts/**/*.jsonl`.
55
82
- Current Claude Code transcript under `~/.claude/projects/**/*.jsonl`.
56
83
@@ -69,8 +96,9 @@ If `which -a context-profiler` shows a stale broken executable before the `pipx`
69
96
4. If validation fails:
70
97
- Read `next_steps` and `errors[].agent_action`.
71
98
- Use `context-profiler schema trace --json`.
72
-
- Convert the data into `ContextTrace`yourself, then pipe it back into `context-profiler`.
99
+
- Convert the data into `ContextTrace`only when validation says conversion is needed, then pipe it back into `context-profiler`.
73
100
- Users should not manually reshape traces.
101
+
- Do not summarize findings from raw JSON or conversion code; findings should come from `context-profiler` output.
0 commit comments