[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6WM8N0YNKSQPA2YP4KY796G":3,"skill-same:01M6WM8N0YNKSQPA2YP4KY796G":61},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":35,"linkOnly":36,"markdownContent":37,"markdownBody":38,"frontMatter":39,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":6,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":46,"install":47,"resources":60},"01M6WM8N0YNKSQPA2YP4KY796G","worldai-agent-routing",null,"Apply WorldArchitect.AI agent-routing priority, modal-lock, and stale-state guard patterns.","jleechanorg\u002Fjleechan-skills","jleechanorg","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F221404966?v=4","01M6C1VJ99XG950X1DWPEBCBGX","01M6C1VJDK5YVDNT3362RT5WSB",6,"MIT","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fworldarchitect\u002Fskills\u002Fworldai-agent-routing\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[23,24,25,26,27,28,29,30,31,32,33,34],"routing","worldai agent routing","ai agent","state","modal","guard","stale","worldarchitect","patterns","lock","agent-routing","apply","2026-11-10 10:12:30",false,"---\nname: worldai-agent-routing\ndescription: Apply WorldArchitect.AI agent-routing priority, modal-lock, and stale-state guard patterns.\n---\n\n# Agent Routing & Modal Lock Patterns\n\n**COMPACTNESS RULE**: Keep this file under 200 lines. Link to code instead of duplicating implementation details.\n\n**Error Handling**: Warnings only - no assertions, retries, or default content. Log issues explicitly and let validation catch failures rather than silently backfilling missing data.\n\n## Agent Routing Priority ($PROJECT_ROOT\u002Fagents.py)\n\nRouting order in `get_agent_for_input()`:\n1. **GodModeAgent** - Manual override (`GOD MODE:` prefix)\n2. **Character Creation Completion Override** - Forced exit from modal\n3. **MODAL LOCKS** - CharacterCreationAgent, LevelUpAgent (highest priority active state)\n4. **CampaignUpgradeAgent** - State-based (ascension ceremonies)\n5. **CharacterCreationAgent** - State-based (new character or level-up)\n6. **Active Combat** - State-based (in_combat=True)\n7. **Semantic Intent Classifier** - Primary routing brain (FastEmbed)\n8. **Explicit Mode Override** - API parameter\n9. **StoryModeAgent** - Default fallback\n\n## Modal Lock Enforcement\n\n### Critical Pattern: Stale Flag Guards\n\n**Problem**: Leftover flags (e.g., `level_up_pending=True`) from previous modal sessions can incorrectly reactivate modals.\n\n**Solution**: Check for explicit `False` flags that indicate intentional deactivation:\n\n```python\n# In agents.py get_agent_for_input():\nlevel_up_in_progress = custom_state.get(\"level_up_in_progress\")\nif level_up_in_progress is False:  # Explicit False = stale guard\n    level_up_modal_active = False\n\nlevel_up_pending_flag = custom_state.get(\"level_up_pending\")\nif level_up_pending_flag is False and not bool(level_up_in_progress):\n    level_up_modal_active = False\n```\n\n**Why**: `None` (unset) vs `False` (explicit guard) distinction prevents modal reactivation from stale data.\n\n### Modal Scoping: Cross-Modal Flag Isolation\n\n**Problem**: Character creation lock was protecting ALL custom_state flags, including level-up flags.\n\n**Solution**: Scoped protection per modal type (world_logic.py `_should_protect_field()`):\n- Character creation modal: Only protects character creation flags\n- Level-up modal: Only protects level-up flags\n- Prevents cross-modal interference (char creation forcing `level_up_in_progress=True`)\n\n### Level-Up Activation Triggers\n\nModal activates when ANY of these are true:\n1. `level_up_in_progress=True` (explicit in-progress flag)\n2. `level_up_pending=True` (pending flag from rewards)\n3. `rewards_pending.level_up_available=True` (rewards system signal)\n\n**Prevented by stale guards**: If `level_up_in_progress=False` or `level_up_pending=False` explicitly set, modal won't activate.\n\n## Finish Choice Ownership\n\nThe model authors planning choices, including modal completion choices. The\nbackend must not inject or synthesize a finish choice. If a registered\n`AdjustmentSpec` applies, follow the repository's ZFC adjuster contract and\nprovide its required provenance and evidence. Before changing level-up routing,\nread `.claude\u002Fskills\u002Fworldai-zfc\u002FSKILL.md` and\nthe `zfc-adjuster` skill.\n\n## Time Freezing During Modals\n\nLevel-up and character creation modals freeze game time:\n\n```python\n# In world_logic.py should_freeze_time():\nis_char_creation = not custom_state.get(\"character_creation_completed\", False)\nis_level_up_mode = custom_state.get(\"level_up_in_progress\", False) or \\\n                   custom_state.get(\"level_up_pending\", False)\nreturn is_char_creation or is_level_up_mode\n```\n\n## Common Issues & Fixes\n\n| Issue | Root Cause | Fix Location | Fix |\n|-------|-----------|--------------|-----|\n| Modal bypass | `level_up_pending=True` didn't activate lock | agents.py:2871-2876 | Added pending flag to activation logic |\n| Routing inconsistency | Injection used different detection logic than routing | agents.py + world_logic.py | Unified stale flag guards |\n| Cross-modal interference | Char creation protected level-up flags | world_logic.py `_should_protect_field()` | Scoped protection per modal |\n| Missing finish choice | Model output lacks a completion choice | model prompt\u002Fschema contract | Improve the prompt\u002Fschema; do not synthesize a choice in backend code |\n| Stale reactivation | Old flags reactivated completed modals | agents.py:2864-2876 | Check explicit False flags |\n\n## Testing Patterns\n\n**Unit Tests** ($PROJECT_ROOT\u002Ftests\u002F):\n- `test_rev_439p_modal_bypass.py` - Activation with `level_up_pending=True`\n- `test_rev_0g1y_inconsistent_detection.py` - Stale flag guard consistency\n- `test_world_logic.py::TestModalLockFlagScoping` - Cross-modal isolation\n\n**E2E Tests** (testing_mcp\u002Fcreation\u002F):\n- `test_level_up_modal_flow_real.py` - Full modal lifecycle with real LLM\n- `test_character_creation_agent_real_e2e.py` - Character creation flows\n\n## Quick Reference\n\n**Agent matching check order**:\n1. State-based: `matches_game_state(game_state)`\n2. Intent-based: Semantic classifier or `matches_input(user_input)`\n3. Explicit: Mode parameter override\n\n**Modal debugging**:\n- Check `level_up_in_progress`, `level_up_pending`, `rewards_pending.level_up_available`\n- Look for stale flags: explicit `False` values blocking activation\n- Verify `character_creation_completed` not interfering with level-up\n\n**See also**:\n- the `character-creation-modal-exit` skill - Character creation specific patterns\n- `$PROJECT_ROOT\u002Fagents.py` - Full implementation (lines 2739-3200)\n- `$PROJECT_ROOT\u002Fworld_logic.py` - Modal injection and protection (lines 1800-1900, 5400-5500)\n","# Agent Routing & Modal Lock Patterns\n\n**COMPACTNESS RULE**: Keep this file under 200 lines. Link to code instead of duplicating implementation details.\n\n**Error Handling**: Warnings only - no assertions, retries, or default content. Log issues explicitly and let validation catch failures rather than silently backfilling missing data.\n\n## Agent Routing Priority ($PROJECT_ROOT\u002Fagents.py)\n\nRouting order in `get_agent_for_input()`:\n1. **GodModeAgent** - Manual override (`GOD MODE:` prefix)\n2. **Character Creation Completion Override** - Forced exit from modal\n3. **MODAL LOCKS** - CharacterCreationAgent, LevelUpAgent (highest priority active state)\n4. **CampaignUpgradeAgent** - State-based (ascension ceremonies)\n5. **CharacterCreationAgent** - State-based (new character or level-up)\n6. **Active Combat** - State-based (in_combat=True)\n7. **Semantic Intent Classifier** - Primary routing brain (FastEmbed)\n8. **Explicit Mode Override** - API parameter\n9. **StoryModeAgent** - Default fallback\n\n## Modal Lock Enforcement\n\n### Critical Pattern: Stale Flag Guards\n\n**Problem**: Leftover flags (e.g., `level_up_pending=True`) from previous modal sessions can incorrectly reactivate modals.\n\n**Solution**: Check for explicit `False` flags that indicate intentional deactivation:\n\n```python\n# In agents.py get_agent_for_input():\nlevel_up_in_progress = custom_state.get(\"level_up_in_progress\")\nif level_up_in_progress is False:  # Explicit False = stale guard\n    level_up_modal_active = False\n\nlevel_up_pending_flag = custom_state.get(\"level_up_pending\")\nif level_up_pending_flag is False and not bool(level_up_in_progress):\n    level_up_modal_active = False\n```\n\n**Why**: `None` (unset) vs `False` (explicit guard) distinction prevents modal reactivation from stale data.\n\n### Modal Scoping: Cross-Modal Flag Isolation\n\n**Problem**: Character creation lock was protecting ALL custom_state flags, including level-up flags.\n\n**Solution**: Scoped protection per modal type (world_logic.py `_should_protect_field()`):\n- Character creation modal: Only protects character creation flags\n- Level-up modal: Only protects level-up flags\n- Prevents cross-modal interference (char creation forcing `level_up_in_progress=True`)\n\n### Level-Up Activation Triggers\n\nModal activates when ANY of these are true:\n1. `level_up_in_progress=True` (explicit in-progress flag)\n2. `level_up_pending=True` (pending flag from rewards)\n3. `rewards_pending.level_up_available=True` (rewards system signal)\n\n**Prevented by stale guards**: If `level_up_in_progress=False` or `level_up_pending=False` explicitly set, modal won't activate.\n\n## Finish Choice Ownership\n\nThe model authors planning choices, including modal completion choices. The\nbackend must not inject or synthesize a finish choice. If a registered\n`AdjustmentSpec` applies, follow the repository's ZFC adjuster contract and\nprovide its required provenance and evidence. Before changing level-up routing,\nread `.claude\u002Fskills\u002Fworldai-zfc\u002FSKILL.md` and\nthe `zfc-adjuster` skill.\n\n## Time Freezing During Modals\n\nLevel-up and character creation modals freeze game time:\n\n```python\n# In world_logic.py should_freeze_time():\nis_char_creation = not custom_state.get(\"character_creation_completed\", False)\nis_level_up_mode = custom_state.get(\"level_up_in_progress\", False) or \\\n                   custom_state.get(\"level_up_pending\", False)\nreturn is_char_creation or is_level_up_mode\n```\n\n## Common Issues & Fixes\n\n| Issue | Root Cause | Fix Location | Fix |\n|-------|-----------|--------------|-----|\n| Modal bypass | `level_up_pending=True` didn't activate lock | agents.py:2871-2876 | Added pending flag to activation logic |\n| Routing inconsistency | Injection used different detection logic than routing | agents.py + world_logic.py | Unified stale flag guards |\n| Cross-modal interference | Char creation protected level-up flags | world_logic.py `_should_protect_field()` | Scoped protection per modal |\n| Missing finish choice | Model output lacks a completion choice | model prompt\u002Fschema contract | Improve the prompt\u002Fschema; do not synthesize a choice in backend code |\n| Stale reactivation | Old flags reactivated completed modals | agents.py:2864-2876 | Check explicit False flags |\n\n## Testing Patterns\n\n**Unit Tests** ($PROJECT_ROOT\u002Ftests\u002F):\n- `test_rev_439p_modal_bypass.py` - Activation with `level_up_pending=True`\n- `test_rev_0g1y_inconsistent_detection.py` - Stale flag guard consistency\n- `test_world_logic.py::TestModalLockFlagScoping` - Cross-modal isolation\n\n**E2E Tests** (testing_mcp\u002Fcreation\u002F):\n- `test_level_up_modal_flow_real.py` - Full modal lifecycle with real LLM\n- `test_character_creation_agent_real_e2e.py` - Character creation flows\n\n## Quick Reference\n\n**Agent matching check order**:\n1. State-based: `matches_game_state(game_state)`\n2. Intent-based: Semantic classifier or `matches_input(user_input)`\n3. Explicit: Mode parameter override\n\n**Modal debugging**:\n- Check `level_up_in_progress`, `level_up_pending`, `rewards_pending.level_up_available`\n- Look for stale flags: explicit `False` values blocking activation\n- Verify `character_creation_completed` not interfering with level-up\n\n**See also**:\n- the `character-creation-modal-exit` skill - Character creation specific patterns\n- `$PROJECT_ROOT\u002Fagents.py` - Full implementation (lines 2739-3200)\n- `$PROJECT_ROOT\u002Fworld_logic.py` - Modal injection and protection (lines 1800-1900, 5400-5500)\n",{"name":5,"description":7},"main","8144f00ebafc4306264c63239e4b9fa42e48a90e","plugins\u002Fworldarchitect\u002Fskills\u002Fworldai-agent-routing",0,"https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills","https:\u002F\u002Fgithub.com\u002Fjleechanorg","2026-11-14 14:55:35",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add jleechanorg\u002Fjleechan-skills --skill worldai-agent-routing",{"tool":53,"command":54},"bunx","bunx skills add jleechanorg\u002Fjleechan-skills --skill worldai-agent-routing",{"tool":56,"command":57},"pnpm","pnpm dlx skills add jleechanorg\u002Fjleechan-skills --skill worldai-agent-routing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fworldarchitect\u002Fskills\u002Fworldai-agent-routing\u002FSKILL.md",true,[],[62,80,101,115,129,145],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":35},"01M716Y5MTJ6GYJZ2ATXCJK8G4","instinct","Use when the user invokes \u002Finstinct or \u002Fin, or asks to \"message Instinct\", \"ask Instinct\", \"tell Instinct\", \"check Instinct\", or read replies from the configured peer assistant. iMessage first, WhatsApp Web as fallback.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Finstinct\u002FSKILL.md",[],[64,69,70,71,72,73,74,75,76,77,78,79],"user","when","replies","check","use","identity","whatsapp","gmail","read","message","ask",{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":91,"publishedAt":35},"01M716Y4HF7FVVMJSA2CCVN5VF","hr","Compatibility alias for history-resume; produce the same fresh-state, provenance-aware resume briefing.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fhr\u002FSKILL.md",[86],{"categoryNo":87,"categoryName":88,"taxonomyType":89,"taxonomyTypeDesc":90},"01JBSEEDCAT000000000000038","人力资源","PROFESSION","适用职业",[82,92,93,94,95,96,97,98,99,26,100],"resume","compatibility","provenance","for","history","produce","alias","briefing","fresh",{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":108,"publishedAt":35},"01M716Y1FFNFKFJYYKF8HQA6T8","history-resume","Resume briefing for the current repository branch or worktree using fresh state and admitted history sources.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fhistory-resume\u002FSKILL.md",[107],{"categoryNo":87,"categoryName":88,"taxonomyType":89,"taxonomyTypeDesc":90},[96,92,109,110,69,111,99,112,95,113,114,26,100],"history resume","branch","analysis","repository","worktree","sources",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":35},"01M716XWXJ8EPHK4RH9T14TR85","grok","Alias for the canonical grokbot browser conversation workflow; \u002Fgrok talks to the Grok bot the same way \u002Fdot talks to Dot.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgrok\u002FSKILL.md",[],[117,122,123,124,95,125,98,126,127,128],"dot","bot","workflow","canonical","conversation","browser","grokbot",{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":35},"01M70N9Q07DTE0EW5KFXMMMSJ0","codexa-bench","Compare `codexa` and normal `codex` on a fair split of comparable work by default; use `--strict` for duplicate runs of the exact same task.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcodexa-bench\u002FSKILL.md",[],[136,137,138,73,139,95,140,141,142,143,144],"codexa bench","work","split","default","duplicate","task","compare","normal","codex",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":149,"licenseFileUrl":150,"sourceHtmlUrl":151,"categories":152,"keywords":162,"publishedAt":35},"01M6C24S2X60SP8BBFGAEKPEGW","frontend-design","Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML\u002FCSS layouts, or when styling\u002Fbeautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ffrontend-design\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ffrontend-design\u002FSKILL.md",[153,156,159],{"categoryNo":154,"categoryName":155,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000009","前端开发",{"categoryNo":157,"categoryName":158,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":160,"categoryName":161,"taxonomyType":89,"taxonomyTypeDesc":90},"01JBSEEDCAT000000000000032","设计师",[163,164,165,73,166,167,168,69,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,70,187],"frontend","design","frontend design","generic","ui design","react","html","components","code","artifacts","ui","aesthetics","Production","web components","landing","applications","quality","web","css","create","examples","with","react components","web ui","pages"]