lwy-dispatch

v2026.09.25

Internal single-process coordinator for the three IDE-hook events used by the learnwy-* skills. UserPromptSubmit aggregates english-learner + llm-wiki + prompt-optimizer scans; Stop aggregates english-learner + knowledge-consolidation scans; SessionStart aggregates llm-wiki + english-learner + learnwy-status scans. Not user-invokable — installed automatically alongside the underlying skills. Triggers on every UserPromptSubmit / Stop / SessionStart event in Claude Code / Trae.

GitHub
Install command
npx skhub add learnwy/lwy-dispatch
Markdown
SKILL.md

learnwy-dispatch

Single-process coordinator for the three IDE-hook events shared by the learnwy-* skills.

Why

Before this skill, every event fired N separate hook commands — one Node process per skill — and the user saw N back-to-back <system-reminder> blocks per turn. That multiplies the per-turn hook startup cost (~50 ms × N vs ~50 ms) and clutters context.

This skill replaces those entries with one hook per event that imports each skill's pure scanner function, runs them in-process, and emits a single combined reminder.

What runs per event

UserPromptSubmit (hooks/user-prompt-submit.cjs)

OrderModuleReturns reminder when
1english-learner/lib/prompt-scan.scanPromptEnglish ratio ≥ 0.6 OR Chinese learn-intent OR Chinese ratio ≥ 0.3
2llm-wiki/lib/prompt-scan.scanPromptwiki/topics.txt has any keyword overlapping a 4+ char word in the message
3prompt-optimizer/lib/prompt-scan.scanPromptexplicit "optimize my prompt" trigger OR long structured prompt-shape

Stop (hooks/stop.cjs)

OrderModuleReturns reminder when
1english-learner/lib/stop-scan.scanStopAssistant response has 2–4 advanced English words worth surfacing
2knowledge-consolidation/lib/stop-scan.scanStopResponse shows substantive resolution signals (race condition / regression / "subtle"), not session-local trivia

SessionStart (hooks/session-start.cjs)

OrderModuleReturns reminder when
1llm-wiki/lib/session-scan.scanSessionwiki/topics.txt exists — inject ≤30 topics
2english-learner/lib/session-scan.scanSessionFirst session of the day — push 3 due-for-review cards
3learnwy-status/lib/session-scan.scanSessionFirst session of the ISO week — prepend a compact cross-skill digest

Each scanner is a pure (message | payload) => string | null (a couple have minor side effects: prompt-optimizer appends to ~/.learnwy/prompt-optimizer/events.jsonl; KC writes a debounce stamp).

If any scanner throws, the failure is swallowed and the others still run.

Installation

This skill is installed by pnpm run install:hooks like any other skill. The corresponding UserPromptSubmit entries in english-learner, llm-wiki, and prompt-optimizer hooks.json files have been removed — only this skill registers a UserPromptSubmit handler now.

After upgrading from a version without learnwy-dispatch, run:

pnpm run uninstall:hooks   # remove the old per-skill UserPromptSubmit entries
pnpm run install:hooks     # install the dispatcher (and re-register the others)

The pnpm run install:hooks orchestrator performs an uninstall sweep before installing, so you can re-run it any time as a one-shot, idempotent operation.

Not for direct invocation

There is no user-facing slash command and no cli.cjs <subcommand> other than install / uninstall. The skill description's trigger keywords exist purely so the AI surface area knows it is registered — direct invocation has no value.

Discovery
Tags

No tags published for this skill.

Version
Latest version metadata

Version

v2026.09.25

Published

Sep 25, 2026

Category

Uncategorized

License

MIT

Source path

skills/lwy-dispatch

Default branch

main

Latest commit

d727b38

Tree SHA

8dd1452