[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6E36FFNCWRQP7QJY3XERY3X":3,"skill-same:01M6E36FFNCWRQP7QJY3XERY3X":70},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":42,"linkOnly":43,"markdownContent":44,"markdownBody":45,"frontMatter":46,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":50,"repositoryHtmlUrl":51,"repositoryHomepageUrl":52,"ownerHtmlUrl":53,"ownerBlogUrl":6,"ownerDescription":54,"updatedAt":55,"install":56,"resources":69},"01M6E36FFNCWRQP7QJY3XERY3X","nightly-session-watch",null,"Nightly sweep of the last 24h of pi-go sessions — anomalous runs, loop aborts, tool error rates, token waste, real prompt-token spend, and whether the observation and palace pipelines are still recording. Triages each finding to the specialist skill that diagnoses it. Use for an unattended daily health check, or on demand after a bad night.","dimetron\u002Fpi-go","dimetron","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F877433?v=4","01M6E34QX9HKYKMWJVZQEPR2Q3","Dmytro Rashko","01M6E34R2A6563XM0PTZE8KPGG",224,"MIT","https:\u002F\u002Fgithub.com\u002Fdimetron\u002Fpi-go\u002Fblob\u002Fmain\u002F.pi-go\u002Fskills\u002Fnightly-session-watch\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41],"nightly session watch","watch","session","health check","specialist","for","last","recording","error","bad","token","pipelines","daily","go","use","pi","check","prompt","sweep","tool","loop","health","sessions","2026-11-10 10:12:30",false,"---\nname: nightly-session-watch\ndescription: Nightly sweep of the last 24h of pi-go sessions — anomalous runs, loop aborts, tool error rates, token waste, real prompt-token spend, and whether the observation and palace pipelines are still recording. Triages each finding to the specialist skill that diagnoses it. Use for an unattended daily health check, or on demand after a bad night.\n---\n\n# Nightly Session Watch\n\nOne sweep over everything that happened in the last 24 hours, in priority order:\nwhat **broke**, what it **cost**, and what to **do about it**.\n\nEverything runs through `pi session-stats` — the same Go code path the\n`session-stats` agent tool uses, so there is no second implementation to drift.\nNo LLM call, no network, reads only `~\u002F.pi-go\u002Fsessions\u002F*\u002Fevents.jsonl`.\n\nThis is the umbrella check. It is deliberately shallow — it finds and ranks, it\ndoes not diagnose. Every finding names the skill that goes deeper:\n\n| Finding | Goes deeper with |\n|---|---|\n| `agent loop aborted: ...` | `pi-loop-forensics` |\n| Tool call errors | `pi-check-session-logs` |\n| Which tools dominate | `tools-stats` |\n| Slow turns \u002F throughput | `token-perf` |\n\nDo not re-implement those here. If the sweep surfaces three aborted runs, the\nanswer is \"run loop-forensics on these three\", not a second loop analysis.\n\n## Run it\n\n```bash\npi session-stats                 # last 24h\npi session-stats --hours 72      # wider window\npi session-stats --all           # include sessions with no anomalies\npi session-stats --json          # counters only, for a cron wrapper\n```\n\nOther flags: `--high-tool-calls` and `--high-turns` move the anomaly\nthresholds, `--session-dir` points at a different session root.\n\n## Steps\n\n1. **Run `pi session-stats`.** Present its markdown as-is — it is already\n   ordered by severity.\n\n2. **Read the numbers before interpreting them.** Three traps:\n   - Tool *error rate* matters more than error count. `read` failing 5 times in\n     253 calls is noise; a tool failing 8 of 8 is broken or misconfigured.\n   - A heavy session is not automatically a bad session. High tool calls on a\n     long task is work, not waste. Waste is the **Token waste** section.\n   - **Prompt tokens dwarf everything else.** They are re-sent on every request,\n     so the figure is dominated by the fixed block — system prompt plus tool\n     declarations — not by the task. A large number there is not evidence of a\n     bad night; a large number *per session* on short sessions is.\n\n3. **Triage each finding** to the table above and name the skill to run next.\n   Do not run them automatically — they are slower and interactive.\n\n4. **Propose fixes, grouped into config, code, and prompt.** Patterns worth\n   recognising:\n\n   | Symptom | Likely fix |\n   |---|---|\n   | One tool at ~100% error rate | Missing credential or unavailable MCP server — check config before code |\n   | `edit` error rate above ~20% | Editing without reading first, or on stale content — a prompt\u002Fledger problem |\n   | Oversized results from a tool marked **uncapped** | Wire it into `compactToolResult` in `internal\u002Ftools\u002Fcompactor.go` |\n   | Oversized results from a tool marked **yes** | The compactor is not running — check the after-tool callback chain |\n   | Duplicate results inside one session | Dedup is not running, same cause as above |\n   | `observations` DEGRADED or STALLED | The recording pipeline is down; see `specs\u002Fmemory-fixes\u002F` |\n   | Palace last write many days old | Nothing is filing drawers — the bridge is not wired, or the palace is gated off |\n\n5. **Say plainly when nothing is wrong.** A quiet night is a valid result and\n   belongs in one line, not padded into a report.\n\n## What it checks, and why each one\n\n- **Per-session anomalies** — high tool calls, excessive turns, errors, heavy\n  git activity, long idle runs.\n- **Loop aborts** — the guard ending a run is the most user-visible failure\n  there is. Grouped by reason: \"repeated a phrase\" and \"identical tool call\"\n  have different causes and different fixes.\n- **Tool error rates** — as a rate against call count, so a busy tool with a few\n  failures does not outrank a broken tool nobody uses.\n- **Token waste** — results over the compactor's 24k `MaxChars`, plus results\n  re-sent byte-identical inside one session. Each oversized tool is labelled\n  with whether `compactToolResult` covers it, which separates *\"a component is\n  broken\"* from *\"this tool was never wired up\"*.\n- **Token spend** — `promptTokenCount` \u002F `candidatesTokenCount` straight from\n  the provider's `usageMetadata`. Measured, not estimated.\n- **Pipeline health** — the observation and palace stores. Both are best-effort\n  by design: every failure downgrades to a warning nobody reads, so they can be\n  dead for months while looking fine. The check is a **ratio**, not a presence\n  test — a store holding a handful of rows across thousands of sessions is\n  broken in the way that looks healthiest.\n\n## Scheduling it\n\n`--json` prints a stable object for a cron wrapper:\n\n```json\n{\n  \"hours\": 24,\n  \"total_sessions\": 175,\n  \"anomalous_sessions\": 25,\n  \"aborted_runs\": 0,\n  \"reclaimable_tokens\": 232957,\n  \"prompt_tokens\": 127052076\n}\n```\n\nAlert on `aborted_runs > 0`, on `reclaimable_tokens` crossing a threshold you\npick, or on `prompt_tokens \u002F total_sessions` drifting up. Keep the JSON as the\ntrigger and the markdown as what a human reads.\n\nNightly is the intended cadence: 24h is long enough for a pattern to show and\nshort enough that the offending session is still fresh.\n\n## Limits worth stating\n\n- `prompt_tokens` and output tokens are provider-reported and exact.\n  `reclaimable_tokens` is `chars \u002F 4` — fine for ranking and trends, not a\n  billing figure.\n- Only **tool result** volume feeds the waste number. The fixed per-request\n  overhead is visible in the token-spend section instead.\n- The window is selected by `events.jsonl` **mtime**, so a session that started\n  before the window but was still running inside it is included whole.\n- Duplicate detection is byte-exact within a single session. A near-duplicate,\n  or the same file read across two sessions, is not counted.\n","# Nightly Session Watch\n\nOne sweep over everything that happened in the last 24 hours, in priority order:\nwhat **broke**, what it **cost**, and what to **do about it**.\n\nEverything runs through `pi session-stats` — the same Go code path the\n`session-stats` agent tool uses, so there is no second implementation to drift.\nNo LLM call, no network, reads only `~\u002F.pi-go\u002Fsessions\u002F*\u002Fevents.jsonl`.\n\nThis is the umbrella check. It is deliberately shallow — it finds and ranks, it\ndoes not diagnose. Every finding names the skill that goes deeper:\n\n| Finding | Goes deeper with |\n|---|---|\n| `agent loop aborted: ...` | `pi-loop-forensics` |\n| Tool call errors | `pi-check-session-logs` |\n| Which tools dominate | `tools-stats` |\n| Slow turns \u002F throughput | `token-perf` |\n\nDo not re-implement those here. If the sweep surfaces three aborted runs, the\nanswer is \"run loop-forensics on these three\", not a second loop analysis.\n\n## Run it\n\n```bash\npi session-stats                 # last 24h\npi session-stats --hours 72      # wider window\npi session-stats --all           # include sessions with no anomalies\npi session-stats --json          # counters only, for a cron wrapper\n```\n\nOther flags: `--high-tool-calls` and `--high-turns` move the anomaly\nthresholds, `--session-dir` points at a different session root.\n\n## Steps\n\n1. **Run `pi session-stats`.** Present its markdown as-is — it is already\n   ordered by severity.\n\n2. **Read the numbers before interpreting them.** Three traps:\n   - Tool *error rate* matters more than error count. `read` failing 5 times in\n     253 calls is noise; a tool failing 8 of 8 is broken or misconfigured.\n   - A heavy session is not automatically a bad session. High tool calls on a\n     long task is work, not waste. Waste is the **Token waste** section.\n   - **Prompt tokens dwarf everything else.** They are re-sent on every request,\n     so the figure is dominated by the fixed block — system prompt plus tool\n     declarations — not by the task. A large number there is not evidence of a\n     bad night; a large number *per session* on short sessions is.\n\n3. **Triage each finding** to the table above and name the skill to run next.\n   Do not run them automatically — they are slower and interactive.\n\n4. **Propose fixes, grouped into config, code, and prompt.** Patterns worth\n   recognising:\n\n   | Symptom | Likely fix |\n   |---|---|\n   | One tool at ~100% error rate | Missing credential or unavailable MCP server — check config before code |\n   | `edit` error rate above ~20% | Editing without reading first, or on stale content — a prompt\u002Fledger problem |\n   | Oversized results from a tool marked **uncapped** | Wire it into `compactToolResult` in `internal\u002Ftools\u002Fcompactor.go` |\n   | Oversized results from a tool marked **yes** | The compactor is not running — check the after-tool callback chain |\n   | Duplicate results inside one session | Dedup is not running, same cause as above |\n   | `observations` DEGRADED or STALLED | The recording pipeline is down; see `specs\u002Fmemory-fixes\u002F` |\n   | Palace last write many days old | Nothing is filing drawers — the bridge is not wired, or the palace is gated off |\n\n5. **Say plainly when nothing is wrong.** A quiet night is a valid result and\n   belongs in one line, not padded into a report.\n\n## What it checks, and why each one\n\n- **Per-session anomalies** — high tool calls, excessive turns, errors, heavy\n  git activity, long idle runs.\n- **Loop aborts** — the guard ending a run is the most user-visible failure\n  there is. Grouped by reason: \"repeated a phrase\" and \"identical tool call\"\n  have different causes and different fixes.\n- **Tool error rates** — as a rate against call count, so a busy tool with a few\n  failures does not outrank a broken tool nobody uses.\n- **Token waste** — results over the compactor's 24k `MaxChars`, plus results\n  re-sent byte-identical inside one session. Each oversized tool is labelled\n  with whether `compactToolResult` covers it, which separates *\"a component is\n  broken\"* from *\"this tool was never wired up\"*.\n- **Token spend** — `promptTokenCount` \u002F `candidatesTokenCount` straight from\n  the provider's `usageMetadata`. Measured, not estimated.\n- **Pipeline health** — the observation and palace stores. Both are best-effort\n  by design: every failure downgrades to a warning nobody reads, so they can be\n  dead for months while looking fine. The check is a **ratio**, not a presence\n  test — a store holding a handful of rows across thousands of sessions is\n  broken in the way that looks healthiest.\n\n## Scheduling it\n\n`--json` prints a stable object for a cron wrapper:\n\n```json\n{\n  \"hours\": 24,\n  \"total_sessions\": 175,\n  \"anomalous_sessions\": 25,\n  \"aborted_runs\": 0,\n  \"reclaimable_tokens\": 232957,\n  \"prompt_tokens\": 127052076\n}\n```\n\nAlert on `aborted_runs > 0`, on `reclaimable_tokens` crossing a threshold you\npick, or on `prompt_tokens \u002F total_sessions` drifting up. Keep the JSON as the\ntrigger and the markdown as what a human reads.\n\nNightly is the intended cadence: 24h is long enough for a pattern to show and\nshort enough that the offending session is still fresh.\n\n## Limits worth stating\n\n- `prompt_tokens` and output tokens are provider-reported and exact.\n  `reclaimable_tokens` is `chars \u002F 4` — fine for ranking and trends, not a\n  billing figure.\n- Only **tool result** volume feeds the waste number. The fixed per-request\n  overhead is visible in the token-spend section instead.\n- The window is selected by `events.jsonl` **mtime**, so a session that started\n  before the window but was still running inside it is included whole.\n- Duplicate detection is byte-exact within a single session. A near-duplicate,\n  or the same file read across two sessions, is not counted.\n",{"name":5,"description":7},"main","bcfcd42255878c3d40e545abcdeb2520b6d31a52",".pi-go\u002Fskills\u002Fnightly-session-watch",34,"https:\u002F\u002Fgithub.com\u002Fdimetron\u002Fpi-go","https:\u002F\u002Fpi-go.sh","https:\u002F\u002Fgithub.com\u002Fdimetron","🎸💻 🚧🦞","2026-11-15 03:48:24",{"source":8,"skillName":5,"commands":57,"prompt":67,"zipAvailable":68},[58,61,64],{"tool":59,"command":60},"npx","npx skills add dimetron\u002Fpi-go --skill nightly-session-watch",{"tool":62,"command":63},"bunx","bunx skills add dimetron\u002Fpi-go --skill nightly-session-watch",{"tool":65,"command":66},"pnpm","pnpm dlx skills add dimetron\u002Fpi-go --skill nightly-session-watch","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdimetron\u002Fpi-go\u002Fblob\u002Fmain\u002F.pi-go\u002Fskills\u002Fnightly-session-watch\u002FSKILL.md",true,[],[71,93,116,133,148,168],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":42},"01M70SJ3216A0Y2NXYJJ2MVER0","verify-session-flow","Formally verify the interactive session flow before or after changing it. Use when editing internal\u002Ftui\u002Ftui.go's handleKey, handleInterruptKey, handleInputSubmit, ctrlCCount or quitting, internal\u002Ftui\u002Fagent_loop.go's enqueuePrompt, submit, steerPrompt, cancelAgent or handleAgentDone, or the deferred-init splash — or when a user reports that Ctrl+C quit on the first press, that Esc did not stop a turn or a goal loop, that a queued prompt was lost when they canceled, or that the TUI hung on a spinner nothing could clear.","https:\u002F\u002Fgithub.com\u002Fdimetron\u002Fpi-go\u002Fblob\u002Fmain\u002Finternal\u002Fextension\u002Fbundled_skills\u002Fverify-session-flow\u002FSKILL.md",[],[21,78,79,80,81,82,83,33,39,36,84,85,86,87,88,89,90,32,91,92],"verify session flow","verify","flow","submit","editing","init","when","interactive","reports","first","goal","CTRL","clear","spinner","tui",{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":42},"01M70SJ02CTB40V2VFGAF80SBG","verify-run-pipeline","Formally verify the \u002Frun phase machine before or after changing it. Use when editing internal\u002Ftui\u002Frun.go's phase transitions (handleRunAgentDone, runGates result handling, verifyRunComplete, retryRun, reportGateHang, merge), internal\u002Fsop\u002Fverdict.go's Passed, or the checklist refresh — or when a run merged work it should not have, retried a hung gate, lost a cycle at the retry budget, or merged on a stale PASS.","https:\u002F\u002Fgithub.com\u002Fdimetron\u002Fpi-go\u002Fblob\u002Fmain\u002Finternal\u002Fextension\u002Fbundled_skills\u002Fverify-run-pipeline\u002FSKILL.md",[],[100,101,79,102,103,104,82,105,106,107,33,84,108,109,110,111,112,113,114,115],"pipeline","verify run pipeline","run","run pipeline","retry","cycle","run phase","machine","phase","refresh","work","verdict","transitions","result","merge","sop",{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":42},"01M70SHWJV9N3PQWRAMCQE9C2E","verify-history-rewrite","Formally verify the session-history rewrite path before or after changing it. Use when editing internal\u002Fsession\u002Fautocompact.go, internal\u002Fsession\u002Fcompaction*.go, internal\u002Fsession\u002Fstore.go's Compact\u002FClearEvents\u002FrewriteEvents, internal\u002Fagent\u002Fagent.go's Run\u002FRunStreaming\u002FrunPreTurn, or internal\u002Ftui\u002Fcommands.go's clearConversation\u002FclearSessionContext and the context gauge — or when a turn is canceled mid-flight, a tool call and its result get separated, a session's history disappears while the agent is still working, or the model is sent a tool result whose call was compacted away.","https:\u002F\u002Fgithub.com\u002Fdimetron\u002Fpi-go\u002Fblob\u002Fmain\u002Finternal\u002Fextension\u002Fbundled_skills\u002Fverify-history-rewrite\u002FSKILL.md",[],[123,124,125,79,126,127,82,21,38,128,33,129,84,130,131,113,102,132,32,92],"history","rewrite","verify history rewrite","get","model","call","compact","store","gauge","commands",{"skillNo":134,"name":135,"nameZh":6,"description":136,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":137,"categories":138,"keywords":139,"publishedAt":42},"01M70SHSJ5A2XV5SXBXM96RH7P","verify-goal-loop","Formally verify the \u002Fgoal automatic loop before or after changing it. Use when editing internal\u002Ftui\u002Fgoal.go, internal\u002Ftui\u002Fagent_loop.go's handleAgentDone\u002FcancelAgent\u002FsteerPrompt, or internal\u002Ftools\u002Fgoal.go's GoalController — or when a goal loop will not stop, stops one cycle early, closes a goal that is not met, or restarts a goal you finished.","https:\u002F\u002Fgithub.com\u002Fdimetron\u002Fpi-go\u002Fblob\u002Fmain\u002Finternal\u002Fextension\u002Fbundled_skills\u002Fverify-goal-loop\u002FSKILL.md",[],[39,140,141,79,88,142,82,105,33,84,143,144,32,92,145,146,147],"verify goal loop","verify goal","goal loop","you","automatic","Tools","it","stop",{"skillNo":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":152,"categories":153,"keywords":154,"publishedAt":42},"01M70SHPYN1AS6D6RJ8HN270RZ","verify-agent-lifecycle","Formally verify the subagent lifecycle before or after changing it. Use when editing internal\u002Fsubagent\u002Forchestrator.go's Spawn, trackAgent, forwardAgentEvents, terminalStatus, Cancel, ShutdownWithTimeout or evictCompletedAgentsLocked, or internal\u002Fsubagent\u002Fpool.go — or when a canceled agent is reported as failed, an agent vanishes from the list with no verdict, the orchestrator panics on a pool release, or an agent can be canceled twice.","https:\u002F\u002Fgithub.com\u002Fdimetron\u002Fpi-go\u002Fblob\u002Fmain\u002Finternal\u002Fextension\u002Fbundled_skills\u002Fverify-agent-lifecycle\u002FSKILL.md",[],[155,156,157,79,158,82,33,84,159,160,161,162,111,163,164,165,166,32,146,167],"lifecycle","verify agent lifecycle","agent lifecycle","as","cancel","subagent","can","with","orchestrator","spawn","release","list","pool",{"skillNo":169,"name":170,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":173,"publishedAt":42},"01M6E37WZM8ZF36DRYQGZDGP7M","test-new-skill","https:\u002F\u002Fgithub.com\u002Fdimetron\u002Fpi-go\u002Fblob\u002Fmain\u002Finternal\u002Ftui\u002F.pi-go\u002Fskills\u002Ftest-new-skill\u002FSKILL.md",[],[174,175,176,177],"test","new skill","test new skill","new"]