Skip to content

Commit 4f35e4c

Browse files
omalleyandyclaude
andcommitted
docs: update skill docs for v0.16.0 upstream changes
Add CrUX field data, source-mapped stacks, Error.cause chains, and Error object formatting to skill documentation. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5b220f8 commit 4f35e4c

3 files changed

Lines changed: 43 additions & 8 deletions

File tree

skills/chrome-devtools/SKILL.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ The server does not inject code into the page; it uses DevTools network data. Yo
7474
| List HTTP/WebSocket requests | `list_network_requests` (optional `resourceTypes: ['websocket']`) |
7575
| Inspect one request/response | `get_network_request` (reqid, optional file paths for bodies) |
7676
| Console errors/warnings | `list_console_messages` (optional `types`), `get_console_message` |
77-
| Performance / CWV | `performance_start_trace`, `performance_stop_trace`, `performance_analyze_insight` |
77+
| Performance / CWV | `performance_start_trace`, `performance_stop_trace`, `performance_analyze_insight` (includes CrUX field data) |
7878
| Emulation | `emulate` (viewport, userAgent, networkConditions, etc.), `resize_page` |
7979

8080
See [Tool reference](../../docs/tool-reference.md) for full parameters.
@@ -85,11 +85,24 @@ Tool responses are shaped by internal formatters. You don’t call them directly
8585

8686
- **SnapshotFormatter**: Turns the a11y tree into the text snapshot with `uid`s and optional “selected in DevTools” hint. Use `verbose: true` on `take_snapshot` for more detail.
8787
- **NetworkFormatter**: Formats request/response (URL, status, headers, body). Large bodies can be truncated or written to `requestFilePath`/`responseFilePath`.
88-
- **ConsoleFormatter**: Formats console messages (level, text, stack, resolved arguments when detailed data is requested).
89-
- **IssueFormatter**: Formats DevTools issues (e.g. deprecations, violations) when included in responses.
88+
- **ConsoleFormatter**: Formats console messages (level, text, stack, resolved arguments when detailed data is requested). Error objects logged via `console.log(new Error(...))` now include the full message, source-mapped stack trace (1-based line/column), and `Error.cause` chain (shown as nested "Caused by:" sections).
89+
- **IssueFormatter**: Formats DevTools "issues" (e.g. deprecations, violations) when included in responses.
9090

9191
A full **Network & Console breakdown** (data flow, collectors, filter options, what you see in responses) is in [network-and-console-breakdown.md](./network-and-console-breakdown.md).
9292

93+
## Performance traces and CrUX field data
94+
95+
Performance traces now include **CrUX (Chrome User Experience Report)** real-user field metrics alongside lab data:
96+
97+
- **Metrics shown**: LCP (with breakdown: TTFB, load delay, load duration, render delay), INP, CLS
98+
- **Scope**: Data may be for the specific URL or the entire origin, indicated in the output
99+
- **Privacy**: URLs from traces are sent to Google's CrUX API to fetch field data
100+
- **Disable**: Start the server with `--no-performance-crux` to opt out of CrUX data
101+
102+
## Error debugging improvements
103+
104+
Stack traces for uncaught errors and `console.log(Error)` are now **source-mapped** (showing original file paths and 1-based line/column numbers instead of minified bundles). Error objects also display their full **Error.cause** chain as nested "Caused by:" sections with their own stack traces.
105+
93106
## Telemetry
94107

95108
Google collects usage statistics (e.g. tool invocation success, latency, environment) to improve the server. Collection is **on by default**.

skills/chrome-devtools/network-and-console-breakdown.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,35 @@ Example: only errors and issues → `types: ['error', 'issue']`.
118118
- **Single message (detailed)** from `get_console_message`:
119119
- **Console message**: ID, type, message text, **Arguments** (resolved values), **Stack trace** (with file:line when available).
120120
- **Issue**: ID, description (markdown), “Learn more” links, **Affected resources** (e.g. request reqid, element uid).
121-
- **Uncaught error**: ID, message, stack.
121+
- **Uncaught error**: ID, message, **source-mapped stack trace** (1-based line/column), and **Error.cause chain** (nested "Caused by:" sections, each with its own message and stack).
122+
123+
### Error object formatting (v0.16.0+)
124+
125+
When an Error object is logged via `console.log(new Error(...))` or thrown as an uncaught exception, the ConsoleFormatter now extracts:
126+
127+
- **Message**: The error message string.
128+
- **Source-mapped stack trace**: Stack frames are resolved through source maps, showing original file paths and 1-based line/column numbers instead of minified/compiled references.
129+
- **Error.cause chain**: If the error has a `.cause`, it's shown as a "Caused by:" section with its own message and stack. Chains are followed recursively.
130+
131+
Example detailed output for an uncaught error with a cause chain:
132+
```
133+
Message: error> Uncaught Error: foo failed
134+
### Stack trace
135+
at Iife (main.js:18:11)
136+
at <anonymous> (main.js:14:1)
137+
Caused by: Error: bar failed
138+
at foo (main.js:10:11)
139+
...
140+
Caused by: Error: b00m!
141+
at bar (main.js:3:9)
142+
...
143+
```
122144

123145
### Formatters (internal)
124146

125147
- **ConsoleFormatter** (`formatters/ConsoleFormatter.ts`):
126148
- **Summary**: `toString()``msgid=X [type] text (N args)`.
127-
- **Detailed**: `toStringDetailed()` → ID, message, Arguments, Stack trace. For detailed, it can resolve `args` via `jsonValue()` and resolve stack via DevTools (when available).
149+
- **Detailed**: `toStringDetailed()` → ID, message, Arguments, Stack trace. For detailed, it can resolve `args` via `jsonValue()` and resolve stack via DevTools (when available). Error-subtype arguments are expanded with message, stack, and cause chain.
128150
- **IssueFormatter** (`formatters/IssueFormatter.ts`):
129151
- **Summary**: `toString()``msgid=X [issue] title (count: N)`.
130152
- **Detailed**: `toStringDetailed()` → ID, description, links, affected resources (request id, element uid, etc.).

skills/chrome-devtools/reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Use this alongside [SKILL.md](./SKILL.md). Full parameter details: [docs/tool-re
3030

3131
### Performance (3)
3232
- **performance_start_trace**`reload`, `autoStop`; optional `filePath` for trace file
33-
- **performance_stop_trace** – Optional `filePath`
33+
- **performance_stop_trace** – Optional `filePath`. Now includes **CrUX field data** (LCP with breakdown, INP, CLS) from real users alongside lab metrics. Disable with `--no-performance-crux`.
3434
- **performance_analyze_insight**`insightSetId`, `insightName` (from trace results)
3535

3636
### Network (2)
@@ -43,15 +43,15 @@ Use this alongside [SKILL.md](./SKILL.md). Full parameter details: [docs/tool-re
4343
- **take_screenshot** – Optional `uid`, `fullPage`, `format`, `quality`, `filePath`
4444
- **evaluate_script**`function` (JS function as string), optional `args` (array of `{uid}`). Return value must be JSON-serializable.
4545
- **list_console_messages** – Optional `pageSize`, `pageIdx`, `types`, `includePreservedMessages`
46-
- **get_console_message**`msgid`
46+
- **get_console_message**`msgid`. Error objects show source-mapped stacks (1-based line/column) and Error.cause chains.
4747

4848
## Formatters (internal)
4949

5050
| Formatter | Used for | Notes |
5151
|-----------|----------|--------|
5252
| SnapshotFormatter | `take_snapshot` output | Text snapshot with `uid`s; `verbose` adds more a11y data |
5353
| NetworkFormatter | `list_network_requests`, `get_network_request` | URL, status, headers, body (truncated or saved to file) |
54-
| ConsoleFormatter | `list_console_messages`, `get_console_message` | Level, text, stack, resolved args |
54+
| ConsoleFormatter | `list_console_messages`, `get_console_message` | Level, text, source-mapped stack, resolved args, Error.cause chains |
5555
| IssueFormatter | DevTools issues in responses | Deprecations, violations, etc. |
5656

5757
## Telemetry

0 commit comments

Comments
 (0)