Skip to content

Commit cf61dfc

Browse files
committed
Update xdebug skill: xstep output contract and reading guide
The skill's xstep "Key fields" still advertised the pre-slim shape ({step, location, variables}). Update it to the current shape and add a "Reading the output" guide: stack[0] = current frame, diff reconstruction onto the last full snapshot, scope reset on a frame change, and the 'type: value' rendering. The skill is the surface that actually reaches the model when /xdebug is used, so the read-rules belong where they will be read -- more reliable than hoping the model fetches the $schema URL.
1 parent a0a59e2 commit cf61dfc

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

skills/xdebug/SKILL.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,14 @@ Trace execution forward from start to finish. Captures complete execution flow,
7171
Stop at breakpoint, step forward N times, record variable changes at each step. See how variable values affect branching ("this variable was X, so it went into this branch").
7272

7373
**Output**: JSON with `$schema` URL for semantic details.
74-
**Key fields**: `{breaks: [{step, location, variables}]}` - Variables show diff only (changed values).
74+
**Key fields**: `{breakpoint, breaks: [{step, stack, variables?, diff?, recording_type}]}`
75+
76+
**Reading the output** (slim by design — no field duplicates another):
77+
- `breakpoint` sits at the top level, shared by every step (not repeated per break).
78+
- A break's stop location and function are `stack[0]` (file/line/function). `stack` is innermost-first: index 0 is the current frame, the rest are its callers; each `line` is the stop line for index 0 and the call-site line for callers.
79+
- `recording_type: "full"` (first step) carries the complete `variables` snapshot. `"diff"` steps carry only `diff` and omit `variables`.
80+
- To get current values, apply successive `diff`s onto the last `full` snapshot; variables absent from a `diff` are unchanged. On a stack-frame change scope resets — old locals appear as `removed`, new ones as `added` with their values.
81+
- Values are rendered as `"type: value"` strings, e.g. `"int: 0"`, `"array: [1, 2, 3]"`.
7582

7683
```bash
7784
~/.composer/vendor/bin/xstep --break=file.php:line --steps=N [--context=TEXT] [--include-vendor=PATTERNS] -- command

0 commit comments

Comments
 (0)