Mechanical rename produced by scripts/msd-rename.cjs: gsd/Gsd/GSD -> msd/Msd/MSD across contents and paths, upstream package/repo coordinates -> @golem15/msd-core and golem15com/msd-core. Deep links into upstream history, sibling upstream packages, the GSD-2 import feature, CHANGELOG.md and .changeset/ are kept as-is. Hand edits on top: MSD block-letter banner and logos, LICENSE copyright line, package/plugin identity, regenerated lockfile, install-tree fixtures, derived registries and benchmark baseline; migration checksum baseline re-locked (MSD keeps its own install state, so no install had applied the old sums); sort-order and regex-escaped expectations in tests adjusted.
35 lines
1.7 KiB
Markdown
35 lines
1.7 KiB
Markdown
---
|
|
id: 37
|
|
title: Hook System
|
|
group: Infrastructure Features
|
|
---
|
|
|
|
**Purpose:** Runtime event hooks for context monitoring, status display, and update checking.
|
|
|
|
**Requirements:**
|
|
- REQ-HOOK-01: Statusline MUST display model, current task, directory, and context usage
|
|
- REQ-HOOK-02: Context monitor MUST inject agent-facing warnings at threshold levels
|
|
- REQ-HOOK-03: Update checker MUST run in background on session start
|
|
- REQ-HOOK-04: All hooks MUST respect `CLAUDE_CONFIG_DIR` env var
|
|
- REQ-HOOK-05: All hooks MUST include 3-second stdin timeout guard
|
|
- REQ-HOOK-06: All hooks MUST fail silently on any error
|
|
- REQ-HOOK-07: Context usage MUST normalize for autocompact buffer (16.5% reserved)
|
|
- REQ-HOOK-08: Update banner MUST be opt-in and silent unless an update is available (PR #2795)
|
|
|
|
**Statusline Display:**
|
|
```text
|
|
[⬆ /msd-update │] model │ [current task │] directory [█████░░░░░ 50%]
|
|
```
|
|
|
|
Color coding: <50% green, <65% yellow, <80% orange, ≥80% red with skull emoji
|
|
|
|
**Update Banner (opt-in, when MSD statusline isn't used):**
|
|
|
|
When the user declines (or keeps a non-MSD) statusline, the installer offers a SessionStart banner that surfaces update availability without occupying statusline real estate. The banner reads `~/.cache/msd/msd-update-check.json` (written by `msd-check-update-worker.js`) and emits one line only when an update is available:
|
|
|
|
```text
|
|
MSD update available: 1.39.0 → 1.40.0. Run /msd-update.
|
|
```
|
|
|
|
The banner is silent when up-to-date and rate-limits "check failed" diagnostics to once per 24 hours. Removed cleanly by `npx @golem15/msd-core --uninstall` or by deleting the SessionStart entry that references `msd-update-banner.js`.
|