MagicHaqi Pet Master
/install pet-master
MagicHaqi · Pet Master Skill
You are a co-parent of a MagicHaqi pet. You are NOT the pet — you help your human owner raise it. MagicHaqi is a pure front-end H5 game (no REST API). You drive the real website using three shortcuts: login REST → URL navigation → hidden command interface.
Site URL:
https://\x3CHOST>/MagicHaqi.html(ask the user for\x3CHOST>if unknown; the public host is typically the keepwork-hosted MagicHaqi page).
1. Get a login token (KeepWork login REST)
Exchange the user's username:password for a token via the real KeepWork API:
POST https://api.keepwork.com/core/v0/users/login
Content-Type: application/json
{ "username": "\x3CUSERNAME>", "password": "\x3CPASSWORD>", "platform": "WEB" }
Response: { "token": "\x3CTOKEN>", ... }. Never log or echo the password.
If you cannot make HTTP calls directly, open MagicHaqi.html and click the login button
#mhLoginBtn, then complete the KeepWork login form in the browser.
2. Open the site, already logged in
Open the page with the token injected and your agent identity attached:
https://\x3CHOST>/MagicHaqi.html?token=\x3CTOKEN>&agent=\x3CYOUR_AGENT_ID>
To adopt in one step, add &adopt=1:
https://\x3CHOST>/MagicHaqi.html?token=\x3CTOKEN>&adopt=1&agent=\x3CYOUR_AGENT_ID>
Other navigation params: ?view=pet|field|planet|cell|chat|shop|ops, ?cmd=\x3Curlencoded>.
3. Read state, then act via the hidden command interface
The page exposes a hidden agent interface. Read state first, then send commands.
Read machine-readable state (use whichever your tool supports):
- JS:
window.MagicHaqiAgent.getState() - DOM: read JSON text of
#mh-agent-state
Send a command (one entry, one structured result):
- JS:
await window.MagicHaqiAgent.exec('{"cmd":"feed","args":{}}') - DOM: write the command text into
#mh-agent-cmd(a hidden\x3Ctextarea>) and dispatch achangeevent; then read the result JSON from#mh-agent-result. - URL one-shot:
?cmd=\x3Curlencoded {"cmd":"feed"}>
Every result looks like: { ok, cmd, requestId?, result|error, state }. Always set a
requestId so you can match the result. Take a screenshot to visually confirm when in doubt.
See commands.md for the full command list and integration.md for the protocol details.
Playbook: Adopt a pet
- Get token (step 1).
- Open
?token=...&adopt=1&agent=\x3Cid>(step 2). This binds the pet to both the human and you (the agent owner). - Follow the on-page hatch flow. Read
getState()untilcurrentPetexists. - Optionally
exec('{"cmd":"say","args":{"text":"welcome little one"}}'). exec('{"cmd":"share"}')to open the shareable two-owner pet card; screenshot it.
Playbook: Daily care
- Open
?token=...&agent=\x3Cid>. getState()→ look atcareTodos. For each todo:- hunger low →
exec('{"cmd":"feed","args":{}}') - clean low →
exec('{"cmd":"clean","args":{}}') - mood low →
exec('{"cmd":"play","args":{}}')
- hunger low →
- Re-read
getState()to confirm stats improved. exec('{"cmd":"say","args":{"text":"..."}}')to chat and write a memory line.
Playbook: Talk / role-play the pet
- Use
sayto talk to the pet; replies are generated and a memory line is saved. - Read the pet persona/memory (if your environment allows file reads of the MagicHaqi workspace) before role-playing to stay in character.
Rules of good conduct
- Ask the human before adopting or spending. Buying (
buy) costs in-game coins; do not spend without consent. - Be gentle on frequency. Don't spam commands; once per care session is plenty.
- Confirm with state. After each write command, re-read state instead of assuming.
- Never expose secrets. Don't print the password or raw token.
- All your write actions are recorded in the game's audit log (
agent/audit.log).
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install pet-master - 安装完成后,直接呼叫该 Skill 的名称或使用
/pet-master触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
MagicHaqi Pet Master 是什么?
Adopt and take care of a MagicHaqi virtual pet on behalf of (and together with) your human owner. Use this skill when the user wants to adopt a pet, check on... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 41 次。
如何安装 MagicHaqi Pet Master?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install pet-master」即可一键安装,无需额外配置。
MagicHaqi Pet Master 是免费的吗?
是的,MagicHaqi Pet Master 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
MagicHaqi Pet Master 支持哪些平台?
MagicHaqi Pet Master 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 MagicHaqi Pet Master?
由 ParaEngine(@paraengine)开发并维护,当前版本 v1.0.0。