arknights-operator-gacha
Generate an Arknights operator agent based on gacha probabilities. Use when user wants to create a random Arknights character agent with authentic lore and personality.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/hg-hg/arknights-operator-gachaArknights Operator Gacha
Generate a random Arknights operator agent with authentic lore-based personality.
Architecture
This skill uses a worker script + LLM generation architecture:
- Worker script (
gacha_worker.py): Executes all deterministic tasks (roll, fetch, create, download) - LLM (this agent): Generates creative content (SOUL.md) and spawns operator
Language Detection
CRITICAL: Detect user language from their gacha command:
- If command is in Chinese (e.g., "抽卡", "召唤干员") → cn / zh
- If command is in English (e.g., "gacha", "pull") → en
Store detected language and use it for ALL subsequent steps (SOUL.md writing, spawn task, etc.).
Workflow
Step 1: Execute Worker Script
Run the deterministic worker:
result = exec(
"python3 ~/.openclaw/workspace/skills/arknights-operator-gacha/scripts/gacha_worker.py",
timeout=120
)
Worker performs:
- Roll star rating (1-100)
- Fetch operator list from
https://arknights.fandom.com/wiki/Operator/{N}-star- Parses the
mrfz-wtabletable to extract operator info - Returns a dict:
{operator_name: {"avatar_url": "...", "detail_url": "..."}}
- Parses the
- Randomly select operator (with avatar and detail URLs)
- Fetch Chinese name from Fandom page (data-source="cnname")
- Check for duplicates (auto re-roll if exists)
- Create agent via
openclaw agents add - Create template IDENTITY.md (bilingual)
- Download avatar (using URL from step 2, with domain whitelist and validation)
- Git commit initial files
- Output JSON to stdout
Worker output format:
{
"success": true,
"stars": 6,
"operator": {
"en_name": "Lin",
"cn_name": "林",
"avatar_url": "https://static.wikia.nocookie.net/.../Lin_icon.png",
"en_detail_url": "https://arknights.fandom.com/wiki/Lin",
"cn_detail_url": "https://prts.wiki/w/%E6%9E%97"
},
"agent_name": "lin",
"workspace": "~/.openclaw/workspace-lin",
"duplicate": false,
"dialogue_url": "https://arknights.fandom.com/wiki/Lin/Dialogue"
}
Note: The worker provides both English and Chinese URLs:
en_detail_url: Fandom wiki page (English lore)cn_detail_url: PRTS wiki page (Chinese lore)dialogue_url: Fandom Dialogue page (voice lines, always English)avatar_url: Operator icon from Fandom
Step 2: Handle Result
If duplicate: true:
- Inform user: "检测到重复干员,正在重新抽取..." / "Duplicate operator detected, re-rolling..."
- Return to Step 1 (worker will re-roll)
If success: false:
- Show error message
- Stop workflow
If success: true:
- Announce: "恭喜你抽到了 [cn_name] ([stars]★)!" / "Congratulations! You've pulled [en_name] ([stars]★)!"
- Continue to Step 3
Step 3: Generate SOUL.md
Fetch lore from URLs provided by worker:
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-hg-hg-arknights-operator-gacha": {
"enabled": true,
"auto_update": true
}
}
}