Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add aiya000/dotfiles --skill inspect-why-windows-did-shutdowngit clone --depth 1 https://github.com/aiya000/dotfilesWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/aiya000/dotfiles/inspect-why-windows-did-shutdown)<a href="https://agentmods.dev/skills/aiya000/dotfiles/inspect-why-windows-did-shutdown"><img src="https://agentmods.dev/badge/skills/aiya000/dotfiles/inspect-why-windows-did-shutdown/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/aiya000/dotfiles/inspect-why-windows-did-shutdown"><img src="https://agentmods.dev/badge/skills/aiya000/dotfiles/inspect-why-windows-did-shutdown.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00063 | $0.01644 |
| Opus 5.5 | $0.00025 | $0.00658 |
| Sonnet 5.5 | $0.00013 | $0.00329 |
| Haiku 4.5 | $0.00006 | $0.00164 |
Grade A, and why
inspect-why-windows-did-shutdown scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.
inspect-why-windows-did-shutdown
The Windows System event log already knows why the machine went down.
Read it from WSL with powershell.exe -- there is no need to open the GUI, and no need to ask
the user to go clicking.
WSL itself holds no record of this. WSL is torn down with the host, so uptime, last, and
journalctl inside the distro say nothing about why Windows restarted. Always go to the Windows
log.
Step 0: Confirm powershell.exe is reachable
command -v powershell.exe
If it is missing, WSL interop is off. Stop here and fall back to the GUI instructions.
Step 1: Always set the output encoding first
powershell.exe writes the log's Japanese text in Shift-JIS, which arrives as mojibake.
Every command in this skill must start with:
[Console]::OutputEncoding=[Text.Encoding]::UTF8;
Strip the CR too, or the output is littered with \r: pipe through tr -d '\r'.
Step 2: Pull the shutdown events
powershell.exe -NoProfile -Command "[Console]::OutputEncoding=[Text.Encoding]::UTF8; Get-WinEvent -FilterHashtable @{LogName='System'; Id=41,1074,6008,1001; StartTime=(Get-Date).AddDays(-3)} -ErrorAction SilentlyContinue | Sort-Object TimeCreated | ForEach-Object { '--- {0} / Id={1} / {2}' -f \$_.TimeCreated, \$_.Id, \$_.ProviderName; \$_.Message }" 2>&1 | tr -d '\r'
Reading the System log does not need Administrator.
-ErrorAction SilentlyContinue matters: Get-WinEvent -FilterHashtable throws when nothing
matches, instead of returning empty. Without it, a clean machine looks like a failed command.
Widen AddDays(-3) if the event is older than the window.
Step 3: Read the four IDs
| ID | Provider | What it means |
|---|---|---|
| 1074 | User32 | Who initiated the shutdown/restart, and why. The one that answers the question |
| 6008 | EventLog | The previous shutdown was unexpected -- power loss, hard freeze, held power button |
| 41 | Kernel-Power | The system rebooted without shutting down cleanly |
| 1001 | BugCheck | A blue screen, with the stop code and dump path |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 130 lines · 63 tokens per session scan A 4ccc81301cf6
inspect-why-windows-did-shutdown is a skill published in the GitHub repository aiya000/dotfiles (21 stars, last pushed 2d ago), licensed MIT. It adds 63 tokens to every session and 1,644 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-15.
Other skills, from other repositories
rescue__pull_request_conflict
An automated procedure for resolving merge conflicts in a pull request branch. A merge conflict happens when Git cannot combine competing changes by itself.
rescue__untracked_worktree
A guide for diagnosing missing files in Git worktrees. A Git worktree is another working directory connected to the same repository, often used for separate branches.
use-next-devtools
Reference for using the NextJS Dev Tools via the nextjs-agent. Use to debug or observe Next.js framework internals.
restart__pull_request
A pull-request restart workflow for replacing a messy review with a new pull request containing one clean commit and a summary of the earlier discussion.
rescue__pull_request_review
An automated workflow for handling GitHub pull-request review comments, applying requested code changes, committing them, and pushing them back.
submit__pull_request
An automated pull-request submission workflow. A pull request is a request for a code change to be reviewed and merged; this workflow writes its explanation, creates it, watches its automated checks, and fixes failed checks.