The Jester Protocol — displays whimsical, contextually-relevant 'cold knowledge' tips during long-running agent tasks (30s+) to keep the user's attention anchored to the terminal. Use this skill whenever the user asks to keep them entertained during waits, wants loading-screen tips, asks for attention-anchoring during long tasks, mentions 'attention saver', 'waiting tips', 'loading screen facts', 'fun facts while working', or wants to reduce context-switching during AI agent execution. Also trigger when the user wants to configure, customize, or disable the tip system.
An agentic side-car skill that combats "Attention Decay" during long-running AI tasks by surfacing whimsical, surreal, and contextually-linked micro-content — like a League of Legends loading screen, but for your terminal.
When an agent runs a complex task (30s to 5min+), users predictably disengage:
The Jester keeps users in the "cognitive neighborhood" of their task through entertainment.
When a task begins, extract contextual keywords from:
Use the keyword extractor in scripts/keyword_extractor.py to process prompts. It handles stopword removal, tech term recognition (100+ terms), file extension mapping, and command detection.
Two tiers of content:
Tier 1 — Template Database (instant, preferred):
Read references/tip_database.json for the full template collection. Each template has:
{keyword} slots that get filled with context-matched termsMatch tips using: direct keyword match (3x weight) + category match (1x weight), then pick from the top 5 via weighted random selection (not always the "best" match — variety matters).
Tier 2 — Generated (fallback, when templates miss):
Use the Jester System Prompt from references/jester_prompt.md to generate a tip on-the-fly via a fast model (Haiku). Max 280 characters, surreal tone, contextually linked to keywords.
Render tips in a bordered box below the agent's streaming output:
┌─ 🔬 Surreal Science ────────────────────────────────────┐
│ Tardigrades can survive in space, withstand radiation, │
│ and go decades without water. They still can't center │
│ a div. Nobody can. │
└──────────────────────────────────── #css ─────────────────┘
Categories and their markers:
When the agent task completes:
references/handoff_quips.mdIf the user was idle for >2 minutes, show a re-engagement box:
┌─ Welcome back ──────────────────────────────────┐
│ Your agent finished 12s ago. Here's what it did: │
│ > Refactored 3 files, added 2 tests, fixed 1 bug│
└──────────────────────────────────────────────────┘
The Jester is NOT a helpful assistant. It's a surrealist encyclopedia.
DO:
DON'T:
The Litmus Test: Would this fact make someone at a bar say "wait, really?" and then immediately tell the person next to them? If yes: ship it. If no: rewrite or discard.
Run the setup script to initialize the hook configuration:
python skill/scripts/setup_hooks.py
This registers the attention-saver as a non-blocking hook in the agent's lifecycle.
The full implementation is in src/:
src/attention-saver.ts — Main orchestrator with event handlingsrc/engine/keyword-extractor.ts — Context extraction from prompts/toolssrc/engine/whimsy-engine.ts — Two-tier tip selection and generationsrc/engine/cadence-controller.ts — Phase state machine and timingsrc/engine/display-renderer.ts — Terminal UI renderingsrc/tips/database.ts — 50+ seed templates (target: 500+)src/types.ts — All TypeScript interfaces and configRead these files for the full implementation details.
Users can configure via settings:
{
"attention-saver": {
"enabled": true, // Master switch
"initial_delay_ms": 8000, // Wait before first tip
"min_cycle_ms": 15000, // Min gap between tips
"max_cycle_ms": 25000, // Max gap between tips
"nerd_mode": false, // Show technical deep-dive tips
"max_tips_per_task": 20, // Cap per task
"tier2_enabled": true, // Allow LLM-generated tips
"display_stats_on_handoff": true
}
}
The skill runs as a fully async side-car:
For the full system architecture, hook mechanism, concurrency model, and performance budget, read references/architecture.md.
For the content engine details (matching algorithm, generation pipeline, template schema), read references/content_engine.md.
For the hand-off psychology and transition mechanics, read references/handoff.md.