[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C2WQ4708EYFVQB9R2S23Q4":3,"skill-same:01M6C2WQ4708EYFVQB9R2S23Q4":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":17,"categories":18,"keywords":29,"publishedAt":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":13,"ownerHtmlUrl":46,"ownerBlogUrl":13,"ownerDescription":13,"updatedAt":47,"install":48,"resources":61},"01M6C2WQ4708EYFVQB9R2S23Q4","agents","智能体路由优先级参考","Reference WorldArchitect agent routing priority and modal lock patterns.","参考 WorldArchitect 的智能体路由优先级与模式锁定模式。","jleechanorg\u002Fjleechan-skills","jleechanorg","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F221404966?v=4","01M6C1VJ99XG950X1DWPEBCBGX",null,"01M6C1VJDK5YVDNT3362RT5WSB",6,"MIT","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002Flegacy-pre-2026-08-27\u002Fpackages\u002Fagents\u002FSKILL.md",[19,24],{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BRZZF9D7PVFN5MXSPWWD61","AI 工程师","PROFESSION","适用职业",{"categoryNo":25,"categoryName":26,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BSAA4FBTWZP6X98STEHG99","智能体开发","SCENARIO","使用场景",[30,31,32,33,34,35],"routing","modal","reference","worldarchitect","patterns","lock","2026-11-10 10:12:30",false,"---\nname: agents\ndescription: Reference WorldArchitect agent routing priority and modal lock 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 Injection (world_logic.py)\n\nModal exit enforcement via server-side choice injection:\n\n```python\n# In _inject_modal_finish_choice_if_needed():\n# 1. Uses pre-update state (not post-update) to prevent race conditions\n# 2. Checks modal is active (no stale guards blocking)\n# 3. Adds canonical finish choice as LAST item in planning_block.choices\n# 4. Uses structured_fields[\"planning_block\"] not structured_response (preserves injection)\n```\n\n**Key fix**: Use `current_game_state_dict` (pre-update) instead of `updated_game_state_dict` to avoid race condition where LLM sets `level_up_in_progress=False` in same turn.\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| Finish choice position | LLM response overwrote server injection | world_logic.py:5414 | Use structured_fields not structured_response |\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- `.claude\u002Fskills\u002Fcharacter-creation-modal-exit.md` - 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 Injection (world_logic.py)\n\nModal exit enforcement via server-side choice injection:\n\n```python\n# In _inject_modal_finish_choice_if_needed():\n# 1. Uses pre-update state (not post-update) to prevent race conditions\n# 2. Checks modal is active (no stale guards blocking)\n# 3. Adds canonical finish choice as LAST item in planning_block.choices\n# 4. Uses structured_fields[\"planning_block\"] not structured_response (preserves injection)\n```\n\n**Key fix**: Use `current_game_state_dict` (pre-update) instead of `updated_game_state_dict` to avoid race condition where LLM sets `level_up_in_progress=False` in same turn.\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| Finish choice position | LLM response overwrote server injection | world_logic.py:5414 | Use structured_fields not structured_response |\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- `.claude\u002Fskills\u002Fcharacter-creation-modal-exit.md` - 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","42ccd02cbf5e8e47839dc3eab6fc754dc6b339cf",".claude\u002Fskills_archive\u002Flegacy-pre-2026-08-27\u002Fpackages\u002Fagents",0,"https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills","https:\u002F\u002Fgithub.com\u002Fjleechanorg","2026-11-14 14:55:35",{"source":9,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add jleechanorg\u002Fjleechan-skills --skill agents",{"tool":54,"command":55},"bunx","bunx skills add jleechanorg\u002Fjleechan-skills --skill agents",{"tool":57,"command":58},"pnpm","pnpm dlx skills add jleechanorg\u002Fjleechan-skills --skill agents","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002Flegacy-pre-2026-08-27\u002Fpackages\u002Fagents\u002FSKILL.md",true,[],[63,71,78,86,94,103],{"skillNo":64,"name":65,"nameZh":13,"description":66,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":70},"01M7DRVZXXMGY4G81K5GVF4V20","disk-reclaim-playbook","Use Disk Magician to diagnose disk growth or qualify cleanup on macOS or Linux.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fdisk-reclaim-playbook\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":72,"name":73,"nameZh":13,"description":74,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":70},"01M7B63PNTT2TY78RFKHD8SP3X","claudea-bench","Compare `claudea` and normal `claude` 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\u002Fclaudea-bench\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":13,"description":81,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":85},"01M7622KQJ32AV4K5BXEMVSSEB","pr","Alias for the canonical pr-lifecycle PR workflow skill (\u002Fpr-workflow, \u002Fprw).","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpr\u002FSKILL.md",[],[],"2026-11-12 13:55:43",{"skillNo":87,"name":88,"nameZh":13,"description":89,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":93},"01M7432W92AKC4D1TKJ00VCMMT","whisper","OpenAI's general-purpose speech recognition model. Supports 99 languages, transcription, translation to English, and language identification. Six model sizes from tiny (39M params) to large (1550M params). Use for speech-to-text, podcast transcription, or multilingual audio processing. Best for robust, multilingual ASR.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fwhisper\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":95,"name":96,"nameZh":13,"description":97,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":98,"licenseFileUrl":99,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":93},"01M7432T6BN1A9SHB8RBQR5EMP","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":13,"description":106,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":93},"01M7432NDC7S6C6MX7M6RW8CTT","pr-report","This skill should be used when the user asks for a PR report, PR audit, PR delta analysis, \u002Fpr-report, or wants per-PR summary with delta files\u002Flines. Generates a structured report for one or more open PRs covering purpose, files changed, +\u002F− line counts, \u002Fcode-standards + \u002Fthermo review findings, \u002Fponytail simplification opportunities, file-overlap combination candidates, and \u002Fgreen status per pr-green-definition. Output: machine-readable JSONL + human-readable markdown. Read-only by default; can apply simplifications if user opts in.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fpr-report\u002FSKILL.md",[],[]]