Skip to content

Add a whip that sends a worker an optimization pass - #380

Open
walteribanez555 wants to merge 1 commit into
AgentSystemLabs:mainfrom
walteribanez555:feature/whip
Open

walteribanez555 wants to merge 1 commit into
AgentSystemLabs:mainfrom
walteribanez555:feature/whip

Conversation

@walteribanez555

Copy link
Copy Markdown

Summary

  • J takes out a whip (J or Q puts it away); E or a click at a worker within reach cracks it. A lash flies from your hand (first and third person), a synthesized crack plays, and the worker flinches for everyone on the floor (hop, squash, stars and an "Ow!" bubble, toned down with reduced motion).
  • The server then sends that worker the new worker.whip prompt: an optimization pass over what its branch changed since its base (git diff <base>...HEAD plus uncommitted work), covering simplification, reuse, dead code, efficiency and robustness. It stays scoped to its own diff and keeps intended behavior, verifies the project's way, commits on its own branch, and only pushes to an already-open PR. It's filled with the worker's task, branch, base, PR and other repos, and is editable in ⚙️ Settings under 🪢 The whip. The wording draws on Claude Code's /simplify and /code-review prompts and Anthropic's prompting best practices.
  • Refused (with a toast) for shells, board agents, workers in a meeting, asleep, starting, with a lost worktree, or waiting on an answer (typing into one could answer a permission prompt), plus a 20s cooldown per worker.

How it plugs in

  • Protocol: new domain src/shared/protocol/whip.ts (worker.whip / worker.whipped).
  • Server: src/server/ws/handlers/whip.ts and its line in handlers. The pure logic (vars, refusals, cooldown) is in src/server/whip.ts.
  • Client: src/client/features/whip/ (activity, lash, flinch, sound) with one install line in main.ts, plus a help row and a whip() sound on OfficeSound.
  • Small shared changes:
    • Activities can take a click (Activity.click, offered from pointer.ts), so a click cracks the whip instead of using the desk behind it.
    • Hands.rightHand, so the held whip follows the first-person hand.
  • Docs: README, docs/controls.md, docs/how-it-works.md, docs/agents.md.

Validation

  • npm run typecheck ✅
  • npm test ✅ (623 pass; new tests/whip.test.ts, plus a registry test for Activities.click)
  • npm run build ✅
  • Headless screenshots of the held whip, the lash and the flinch (first and third person) against a stubbed worker. The full round trip with a live Claude worker has not been exercised yet.

🤖 Generated with Claude Code

J takes out a whip; E (or a click) at a worker cracks it. The worker
flinches for everyone on the floor, and the office sends it the new
'worker.whip' prompt: an optimization pass over what its branch has
changed since its base (simplify, reuse, dead code, efficiency,
robustness), scoped to its own diff, verified the project's way, and
committed on its own branch. The prompt is editable in Settings under
"🪢 The whip".

The server refuses shells, board agents, workers in a meeting, asleep,
starting, with a lost worktree, or waiting on an answer (typing into it
could answer a permission prompt), and holds a 20s cooldown per worker.

Activities can now take a click (Activity.click), and Hands exposes the
right hand so a held thing follows it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant