$npx -y skills add microsoft/win-dev-skills --skill winui-session-reportAnalyze the current or a recent agent session (GitHub Copilot CLI or Claude Code) and generate a diagnostic report. Use when asking for session feedback, debugging agent behavior, or reviewing what happened during a build session.
| 1 | ### Session Analysis Report |
| 2 | |
| 3 | Generate a diagnostic report for an agent session by running the `Analyze-Session.ps1` script included with this skill. The script auto-detects whether the current session was produced by GitHub Copilot CLI or Claude Code from environment variables and on-disk file format, and dispatches to the appropriate parser. If neither harness can be detected, the script exits with a clear error. |
| 4 | |
| 5 | ### Privacy and sensitivity — surface this guidance to the user |
| 6 | |
| 7 | `Analyze-Session.ps1` always: |
| 8 | |
| 9 | 1. **Embeds a "Privacy and sensitivity" section at the top of the generated `session-report.md`** (right above the Overview table), and |
| 10 | 2. **Prints a yellow PRIVACY NOTICE banner to the console** when it finishes writing the file. |
| 11 | |
| 12 | **You (the agent) must surface this guidance to the user in your response — do not let it stay buried in script output the user might not have read.** When you finish running the script and reporting the findings, include a short privacy reminder in your reply to the user, in plain second-person language. Use this template, adapting wording as needed: |
| 13 | |
| 14 | > ⚠️ **Heads-up before you share `session-report.md`** — this file contains your unredacted session transcript: file contents and paths the agent read or edited, your prompts verbatim (including any secrets you may have pasted), tool output, environment values, and local paths under `C:\Users\<you>\…`. You're responsible for what you share — please open the file in your editor and read it end-to-end before attaching it to a public issue, posting it in chat, or sending it outside your organization. Redact anything sensitive. If you only need to share the high-level metrics, ask me to summarize the file instead of attaching it. |
| 15 | |
| 16 | If the user only wants the high-level metrics (turn counts, skill usage, build success rate) without the per-turn detail, summarize the report and share the summary instead of the file — and tell the user that's what you're doing so they don't have to read it themselves to confirm. |
| 17 | |
| 18 | ### Steps |
| 19 | |
| 20 | 1. **Run the analysis script** to generate the report: |
| 21 | |
| 22 | ```powershell |
| 23 | # Analyze the most recent session (auto-detects harness) and save report |
| 24 | .\Analyze-Session.ps1 -OutputFile session-report.md |
| 25 | |
| 26 | # Or analyze a specific session by ID (searched in both harness locations) |
| 27 | .\Analyze-Session.ps1 -SessionId "<session-id>" -OutputFile session-report.md |
| 28 | |
| 29 | # Or analyze a transcript file directly (format sniffed from content) |
| 30 | .\Analyze-Session.ps1 -EventsFile <path-to-transcript.jsonl> -OutputFile session-report.md |
| 31 | |
| 32 | # Force a specific format if auto-detection picks the wrong harness |
| 33 | .\Analyze-Session.ps1 -Format ClaudeCode -OutputFile session-report.md |
| 34 | |
| 35 | # Skip subagent transcripts (Claude Code only) for a parent-only view |
| 36 | .\Analyze-Session.ps1 -SkipSubagents -OutputFile session-report.md |
| 37 | ``` |
| 38 | |
| 39 | Detection rules: |
| 40 | - The current session is preferred when an explicit ID is available: `COPILOT_AGENT_SESSION_ID` (Copilot CLI) or `CLAUDE_SESSION_ID` (Claude Code) take priority over "most recently modified" so a parallel session in another terminal can't shadow the one the skill was invoked from. |
| 41 | - Environment first: `CLAUDECODE=1` or `CLAUDE_CODE_ENTRYPOINT` -> Claude Code; `COPILOT_*` env vars -> Copilot. |
| 42 | - For Claude Code, the most-recent JSONL whose `cwd` matches the current working directory is preferred. |
| 43 | - For an explicit `-EventsFile`, the format is sniffed from the first events. |
| 44 | - If neither harness is detected, the script exits with a non-zero status and a message naming both supported locations. |
| 45 | |
| 46 | 2. **Review the generated report** — read `session-report.md` and summarize key findings for the user: |
| 47 | - How many turns, how long, token usage |
| 48 | - What skills were loaded and when |
| 49 | - Build success/failure pattern |
| 50 | - Any stuck patterns or tooling issues detected |
| 51 | |
| 52 | 3. **Add your own observations** — append a section to the report with any additional context: |
| 53 | - Was the final app working? What's missing? |
| 54 | - Quality assessment of the generated code |
| 55 | - Suggestions specific to what went wrong |
| 56 | |
| 57 | 4. Include any tooling improvements or recommendations based on the analysis. |
| 58 | - Are there rules that need to be added to the Roslyn analyzer to prevent common mistakes detected during the session? |
| 59 | - Were there bugs or issues with winapp run or the BuildAndRun.ps1 script? |
| 60 | - Are there features that could be added to lower the number of turns required to complete a task? |
| 61 | |
| 62 | ### What the Report Covers |
| 63 | |
| 64 | | Section | Details | |
| 65 | |---------|---------| |
| 66 | | Overview | Harness, session ID, model, duration, turns, tokens (incl. cache tokens for Claude Code) | |
| 67 | | Prompt | The original user request | |
| 68 | | Turn Breakdown | Turns and tokens by cat |