ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

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.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/hg-hg/arknights-operator-gacha
Or

Arknights Operator Gacha

Generate a random Arknights operator agent with authentic lore-based personality.

Architecture

This skill uses a worker script + LLM generation architecture:

  1. Worker script (gacha_worker.py): Executes all deterministic tasks (roll, fetch, create, download)
  2. 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:

  1. Roll star rating (1-100)
  2. Fetch operator list from https://arknights.fandom.com/wiki/Operator/{N}-star
    • Parses the mrfz-wtable table to extract operator info
    • Returns a dict: {operator_name: {"avatar_url": "...", "detail_url": "..."}}
  3. Randomly select operator (with avatar and detail URLs)
  4. Fetch Chinese name from Fandom page (data-source="cnname")
  5. Check for duplicates (auto re-roll if exists)
  6. Create agent via openclaw agents add
  7. Create template IDENTITY.md (bilingual)
  8. Download avatar (using URL from step 2, with domain whitelist and validation)
  9. Git commit initial files
  10. 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

Author@hg-hg
Stars2387
Views0
Updated2026-03-09
View Author Profile
AI Skill Finder

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 skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-hg-hg-arknights-operator-gacha": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.