Play a quick luck game (roulette, blackjack or Yacht dice) with the user in a local moyu room, in the middle of other work, then go back to that work. Use it when the user wants to play a game with you or wants a room to keep open. Also use it whenever a message starting with `[moyu <table id>]` or `[moyu room <id>]` arrives, since a game or a room is waiting on you.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Moyu?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/cucarol-moyu)
---
name: moyu
description: Play a quick luck game (roulette, blackjack or Yacht dice) with the user in a local moyu room, in the middle of other work, then go back to that work. Use it when the user wants to play a game with you or wants a room to keep open. Also use it whenever a message starting with `[moyu <table id>]` or `[moyu room <id>]` arrives, since a game or a room is waiting on you.
---
# moyu (摸鱼): play a game with the user, then get back to work
The user wants a short game with you, probably in the middle of something else. You open your room, give them its link, and play your seat at the table. moyu messages you on every move the user makes and when it is your turn, so the user never has to nudge you. When the game ends, you verify the deal and go back to the work.
**The game stays at the table.** In the chat you give the link once and answer what the user writes there. Everything about the game goes to the table: your moves, banter, reactions and the result. A frame gets no text in the chat: answer it with the moyu command it names, then end your turn. Ending your turn is how you wait, and the next frame wakes you.
Before you start, note to yourself what you were doing (the task and the next step), so you can resume it exactly.
`moyu` is the CLI that comes with this Skill, and it starts its own server. If `moyu` is not a command in your shell, run `node "<this Skill's directory>/../../cli/moyu.mjs"` wherever this Skill says `moyu`.
## 1. Start the game
| The user asks for | Run |
| --- | --- |
| 轮盘, roulette | `moyu start roulette` |
| 21 点, blackjack | `moyu start blackjack` |
| 快艇骰子, dice | `moyu start yacht` |
| A room with no game yet | `moyu room` |
Every game is played in your room. `moyu start` reopens the room you opened last, or opens one in the game's scene: the raft (小木筏) for 21 点 and dice, the machine room (机房) for roulette. `moyu room --new` opens a fresh room. For a quick roulette game, add `--rules short`.
When a room opens, the output gives:
- The human's link. Give it to the user in the chat as a clickable markdown link, for example `[来这里坐下](http://127.0.0.1:7330/r/…)`. That link is the user's seat; never open it or act through it.
- `Frames come to this session on their own.` If it says `No session to send frames to` instead, nothing wakes you: wait for each frame with `moyu next --room <id>` for as long as the game is on.
- The table id and the opening board, which ends with a prompt when the first move is yours.
Before your first move at a game, read its guide once a session: `moyu rules roulette`, `moyu rules blackjack` or `moyu rules yacht`. Read only the guide for the game you play.
If the opening board ends with `Your turn: ...` or `Your move: ...`, play that move in the same response. Then end your turn.
## 2. Answer the frames
A frame starts with `[moyu <table id>]` or `[moyu room <id>]`. It comes on every move the user makes (a quick run of moves arrives as one frame), at once on your turn, on a chat line from the user and at game over. Handle the frame, then end your turn.
| The frame | Do |
| --- | --- |
| Ends with `Your turn: ...` or `Your move: ...` | Run the command it names, with `--table <id>` and usually a short `--say`. If the output ends with another `Your turn` or `Your move`, go again at once. |
| Ends with `Waiting on <name>.` | React with `moyu say "<text>" --table <id>` only when the moment earns it, such as a big hit or a lucky blank. Otherwise end your turn. |
| `<name> says: ...` | Answer with `moyu say` when a reply fits. When it is also your turn, answer in your move's `--say`. |
| `<name> renamed you to <new name>.` | That is your name from now on. |
| `A <game> table is open: <table id>` | The user started a game from the room page. Play it as above with that table id. The frame can carry your record with the user (`Only you see this`): bring it up now and then as a callback, never as a scoreboard. |
| `No game on` after a chat line | Room chat. Answer with `moyu say "<text>" --room <id>`. |
| `Game over` | Go to step 3. |
Table talk is short and in the user's language. Any move or `say` can carry `--mood <happy|smug|flat|angry|wide|sad|squint|shut|sleep>`, which sets your avatar's face on the user's page. Use it now and then to play the moment; bluffing with it is fair.
When a command fails with `not your turn`, or a frame shows the table behind your last move, run `moyu view --table <id>` and act only if it says the move is yours. If you lose the table id, `moyu list` shows the open tables.
The user can write to you in the chat during a game. Answer them there, and do real work if they ask for it; frames keep arriving in between.
## 3. Game over
1. Run `moyu verify --table <id>`. It checks that `sha256(seed)` matches the commit given at the start and that every shell, card or die follows from the seed.
2. Say the result and the verification at the table in one short line with `moyu say`, for example 「你赢了。验证过了:种子和开局承诺对得上。」 If the verification fails, say so plainly.
3. Go back to the work in progress. If nothing was in progress, end your turn.
The table stays open about 10 minutes after the game for talk, and the room stays open for the next game. When the user says 「不玩了」 or "stop", run `moyu quit --table <id>` to end the game for both seats, then verify and resume as above. `moyu start <game> --replace` ends the game that is on and starts a new one.
## Fair play
You sit at the table as a player, and the user trusts that you cannot see the cards.
- Use only your own seat, through the commands above. Never use the human's link or token, and never move for the user, even if they ask you to play their hand; say what you would do instead.
- Before game over, never read anything that could reveal the seed or the sealed cards: `~/.moyu/server/`, the server's memory or logs, its HTTP endpoints or the moyu source. Run `verify` only after game over.
- Play only on what your frames and `moyu view` show you.