[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71AHKRSW1KGSDXV16D95EY6":3,"skill-same:01M71AHKRSW1KGSDXV16D95EY6":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":14,"repositoryHtmlUrl":50,"repositoryHomepageUrl":6,"ownerHtmlUrl":51,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":52,"install":53,"resources":66},"01M71AHKRSW1KGSDXV16D95EY6","hermes-windows-gateway-fix",null,"Comprehensive guide to troubleshooting and fixing Hermes Gateway startup issues on Windows","sapsapshen\u002Fai-memory-router","sapsapshen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F20347959?v=4","01M6XDQEF1DP50DKF37H81J3J5","shenmian","01M6XDQEJPE41Y3DT2763X8ZJN",0,"MIT","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fhermes\u002Fhermes-windows-gateway-fix\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"fix","hermes windows gateway fix","hermes","gateway","windows","encoding","startup","troubleshooting","issues","check","cli","process","guide","missing","Unicode","with","errors","imports","when","2026-11-10 10:12:30",false,"---\nname: hermes-windows-gateway-fix\ntitle: Fix Hermes Gateway on Windows\ndescription: Comprehensive guide to troubleshooting and fixing Hermes Gateway startup issues on Windows\ntrigger: When hermes gateway fails on Windows with process check errors, Unicode encoding errors, or missing imports\nplatforms: [cli, gateway]\ntags: [windows, troubleshooting, gateway, encoding]\n---\n\n# Fixing Hermes Gateway on Windows\n\nThis skill addresses common Windows-specific issues when running `hermes gateway`.\n\n## Common Errors\n\n1. **Process check error**: `OSError: [WinError 11]` (trying to load malformed program)\n2. **Unicode encoding**: `UnicodeEncodeError: 'gbk' codec can't encode character`\n3. **Missing imports**: `ImportError: cannot import name 'remove_pid_file'`\n\n## Step-by-Step Fix\n\n### 1. Fix Process Checking (status.py)\n\nThe main issue is in `gateway\u002Fstatus.py` where `os.kill()` fails on Windows. The function needs Windows-compatible logic:\n\n```python\ndef get_running_pid() -> Optional[int]:\n    \"\"\"Windows compatible version.\"\"\"\n    record = _read_pid_record()\n    if not record:\n        remove_pid_file()\n        return None\n\n    try:\n        pid = int(record[\"pid\"])\n    except (KeyError, TypeError, ValueError):\n        remove_pid_file()\n        return None\n\n    if sys.platform == \"win32\":\n        # Windows: check file freshness instead of os.kill()\n        try:\n            pid_path = _get_pid_path()\n            mtime = pid_path.stat().st_mtime\n            if time.time() - mtime > 300:  # Older than 5 minutes\n                remove_pid_file()\n                return None\n            return pid\n        except:\n            remove_pid_file()\n            return None\n    else:\n        # Unix\u002FLinux: normal os.kill check\n        try:\n            os.kill(pid, 0)\n            return pid\n        except (ProcessLookupError, PermissionError):\n            remove_pid_file()\n            return None\n```\n\n### 2. Fix Unicode Encoding Errors\n\nWindows console uses GBK encoding. Fix Unicode characters in `gateway\u002Frun.py`:\n\n```python\n# Quick fix script\nimport re\nwith open('gateway\u002Frun.py', 'r', encoding='utf-8') as f:\n    content = f.read()\n\n# Replace problematic Unicode characters\nreplacements = [\n    ('✓', '[OK]'),\n    ('✗', '[FAIL]'),\n    ('🧠', '[BRAIN]'),\n]\n\nfor old, new in replacements:\n    content = content.replace(old, new)\n\nwith open('gateway\u002Frun.py', 'w', encoding='utf-8') as f:\n    f.write(content)\n```\n\n### 3. Create Windows Batch File\n\nSave as `START_HERMES.bat`:\n\n```batch\n@echo off\nchcp 65001 >nul\nset PYTHONIOENCODING=utf-8\nset PYTHONUTF8=1\ncd \u002Fd \"C:\\Users\\sap\\hermes-agent\"\n\n:: Optional: Fix Unicode characters\npython -c \"\ntry:\n    with open('gateway\\\\\\\\run.py', 'r', encoding='utf-8') as f:\n        c = f.read()\n    if '✓' in c:\n        c = c.replace('✓', '[OK]').replace('✗', '[FAIL]')\n        with open('gateway\\\\\\\\run.py', 'w', encoding='utf-8') as f:\n            f.write(c)\n        echo Fixed Unicode characters\nexcept:\n    pass\n\"\n\npython hermes gateway\npause\n```\n\n### 4. Complete Python Fix Script\n\nCreate `fix_windows_gateway.py`:\n\n```python\n\"\"\"\nComplete fix for Hermes Gateway Windows issues\n\"\"\"\nimport os\nimport sys\nfrom pathlib import Path\n\ndef fix_all():\n    hermes_dir = Path.cwd()\n    \n    # 1. Set environment\n    os.environ['PYTHONIOENCODING'] = 'utf-8'\n    os.environ['PYTHONUTF8'] = '1'\n    \n    # 2. Fix Unicode in gateway\u002Frun.py\n    run_file = hermes_dir \u002F \"gateway\" \u002F \"run.py\"\n    if run_file.exists():\n        with open(run_file, 'r', encoding='utf-8') as f:\n            content = f.read()\n        \n        # Replace checkmarks\n        if '✓' in content or '✗' in content:\n            content = content.replace('✓', '[OK]').replace('✗', '[FAIL]')\n            with open(run_file, 'w', encoding='utf-8') as f:\n                f.write(content)\n            print(\"Fixed Unicode characters\")\n    \n    # 3. Clean PID file\n    try:\n        from hermes_constants import HERMES_HOME\n        pid_file = HERMES_HOME \u002F \"gateway.pid\"\n        if pid_file.exists():\n            pid_file.unlink()\n            print(\"Cleaned PID file\")\n    except:\n        pass\n    \n    # 4. Start gateway\n    print(\"Starting Hermes Gateway...\")\n    os.system(f\"{sys.executable} hermes gateway\")\n\nif __name__ == \"__main__\":\n    fix_all()\n```\n\n## Quick Commands\n\n```bash\n# Fix and start in one command\ncd C:\\Users\\sap\\hermes-agent\npython -c \"import os; os.environ['PYTHONIOENCODING']='utf-8'; import sys; sys.path.insert(0,'.'); from hermes_cli.main import main; sys.argv=['hermes','gateway']; main()\"\n```\n\n## Verification Steps\n\n1. Check process checking works:\n   ```python\n   python -c \"from gateway.status import get_running_pid; print('OK' if get_running_pid() is None else 'Running')\"\n   ```\n\n2. Check no Unicode errors:\n   ```python\n   python -c \"with open('gateway\u002Frun.py', 'r', encoding='utf-8') as f: print('✓' in f.read())\"\n   ```\n\n3. Start gateway:\n   ```bash\n   python hermes gateway\n   ```\n\n## Pitfalls and Solutions\n\n| Problem | Solution |\n|---------|----------|\n| `OSError: [WinError 11]` | Replace `os.kill()` with file time check in `status.py` |\n| `UnicodeEncodeError` | Replace ✓\u002F✗ with [OK]\u002F[FAIL] in `gateway\u002Frun.py` |\n| `ImportError` | Ensure `status.py` has all required functions |\n| GBK encoding errors | Set `PYTHONIOENCODING=utf-8` and `chcp 65001` |\n\n## Related Skills\n\n- Check `hermes-windows-wsl-gateway` for WSL-specific issues\n- Check `gateway-troubleshooting` for general gateway problems","# Fixing Hermes Gateway on Windows\n\nThis skill addresses common Windows-specific issues when running `hermes gateway`.\n\n## Common Errors\n\n1. **Process check error**: `OSError: [WinError 11]` (trying to load malformed program)\n2. **Unicode encoding**: `UnicodeEncodeError: 'gbk' codec can't encode character`\n3. **Missing imports**: `ImportError: cannot import name 'remove_pid_file'`\n\n## Step-by-Step Fix\n\n### 1. Fix Process Checking (status.py)\n\nThe main issue is in `gateway\u002Fstatus.py` where `os.kill()` fails on Windows. The function needs Windows-compatible logic:\n\n```python\ndef get_running_pid() -> Optional[int]:\n    \"\"\"Windows compatible version.\"\"\"\n    record = _read_pid_record()\n    if not record:\n        remove_pid_file()\n        return None\n\n    try:\n        pid = int(record[\"pid\"])\n    except (KeyError, TypeError, ValueError):\n        remove_pid_file()\n        return None\n\n    if sys.platform == \"win32\":\n        # Windows: check file freshness instead of os.kill()\n        try:\n            pid_path = _get_pid_path()\n            mtime = pid_path.stat().st_mtime\n            if time.time() - mtime > 300:  # Older than 5 minutes\n                remove_pid_file()\n                return None\n            return pid\n        except:\n            remove_pid_file()\n            return None\n    else:\n        # Unix\u002FLinux: normal os.kill check\n        try:\n            os.kill(pid, 0)\n            return pid\n        except (ProcessLookupError, PermissionError):\n            remove_pid_file()\n            return None\n```\n\n### 2. Fix Unicode Encoding Errors\n\nWindows console uses GBK encoding. Fix Unicode characters in `gateway\u002Frun.py`:\n\n```python\n# Quick fix script\nimport re\nwith open('gateway\u002Frun.py', 'r', encoding='utf-8') as f:\n    content = f.read()\n\n# Replace problematic Unicode characters\nreplacements = [\n    ('✓', '[OK]'),\n    ('✗', '[FAIL]'),\n    ('🧠', '[BRAIN]'),\n]\n\nfor old, new in replacements:\n    content = content.replace(old, new)\n\nwith open('gateway\u002Frun.py', 'w', encoding='utf-8') as f:\n    f.write(content)\n```\n\n### 3. Create Windows Batch File\n\nSave as `START_HERMES.bat`:\n\n```batch\n@echo off\nchcp 65001 >nul\nset PYTHONIOENCODING=utf-8\nset PYTHONUTF8=1\ncd \u002Fd \"C:\\Users\\sap\\hermes-agent\"\n\n:: Optional: Fix Unicode characters\npython -c \"\ntry:\n    with open('gateway\\\\\\\\run.py', 'r', encoding='utf-8') as f:\n        c = f.read()\n    if '✓' in c:\n        c = c.replace('✓', '[OK]').replace('✗', '[FAIL]')\n        with open('gateway\\\\\\\\run.py', 'w', encoding='utf-8') as f:\n            f.write(c)\n        echo Fixed Unicode characters\nexcept:\n    pass\n\"\n\npython hermes gateway\npause\n```\n\n### 4. Complete Python Fix Script\n\nCreate `fix_windows_gateway.py`:\n\n```python\n\"\"\"\nComplete fix for Hermes Gateway Windows issues\n\"\"\"\nimport os\nimport sys\nfrom pathlib import Path\n\ndef fix_all():\n    hermes_dir = Path.cwd()\n    \n    # 1. Set environment\n    os.environ['PYTHONIOENCODING'] = 'utf-8'\n    os.environ['PYTHONUTF8'] = '1'\n    \n    # 2. Fix Unicode in gateway\u002Frun.py\n    run_file = hermes_dir \u002F \"gateway\" \u002F \"run.py\"\n    if run_file.exists():\n        with open(run_file, 'r', encoding='utf-8') as f:\n            content = f.read()\n        \n        # Replace checkmarks\n        if '✓' in content or '✗' in content:\n            content = content.replace('✓', '[OK]').replace('✗', '[FAIL]')\n            with open(run_file, 'w', encoding='utf-8') as f:\n                f.write(content)\n            print(\"Fixed Unicode characters\")\n    \n    # 3. Clean PID file\n    try:\n        from hermes_constants import HERMES_HOME\n        pid_file = HERMES_HOME \u002F \"gateway.pid\"\n        if pid_file.exists():\n            pid_file.unlink()\n            print(\"Cleaned PID file\")\n    except:\n        pass\n    \n    # 4. Start gateway\n    print(\"Starting Hermes Gateway...\")\n    os.system(f\"{sys.executable} hermes gateway\")\n\nif __name__ == \"__main__\":\n    fix_all()\n```\n\n## Quick Commands\n\n```bash\n# Fix and start in one command\ncd C:\\Users\\sap\\hermes-agent\npython -c \"import os; os.environ['PYTHONIOENCODING']='utf-8'; import sys; sys.path.insert(0,'.'); from hermes_cli.main import main; sys.argv=['hermes','gateway']; main()\"\n```\n\n## Verification Steps\n\n1. Check process checking works:\n   ```python\n   python -c \"from gateway.status import get_running_pid; print('OK' if get_running_pid() is None else 'Running')\"\n   ```\n\n2. Check no Unicode errors:\n   ```python\n   python -c \"with open('gateway\u002Frun.py', 'r', encoding='utf-8') as f: print('✓' in f.read())\"\n   ```\n\n3. Start gateway:\n   ```bash\n   python hermes gateway\n   ```\n\n## Pitfalls and Solutions\n\n| Problem | Solution |\n|---------|----------|\n| `OSError: [WinError 11]` | Replace `os.kill()` with file time check in `status.py` |\n| `UnicodeEncodeError` | Replace ✓\u002F✗ with [OK]\u002F[FAIL] in `gateway\u002Frun.py` |\n| `ImportError` | Ensure `status.py` has all required functions |\n| GBK encoding errors | Set `PYTHONIOENCODING=utf-8` and `chcp 65001` |\n\n## Related Skills\n\n- Check `hermes-windows-wsl-gateway` for WSL-specific issues\n- Check `gateway-troubleshooting` for general gateway problems",{"name":5,"tags":43,"title":44,"trigger":45,"platforms":46,"description":7},[23,26,22,24],"Fix Hermes Gateway on Windows","When hermes gateway fails on Windows with process check errors, Unicode encoding errors, or missing imports",[29,22],"main","7a38d8e7073e61c16eda85681cb32fb68a8657a5","skills-store\u002Fhermes\u002Fhermes-windows-gateway-fix","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router","https:\u002F\u002Fgithub.com\u002Fsapsapshen","2026-04-14 21:12:12",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add sapsapshen\u002Fai-memory-router --skill hermes-windows-gateway-fix",{"tool":59,"command":60},"bunx","bunx skills add sapsapshen\u002Fai-memory-router --skill hermes-windows-gateway-fix",{"tool":62,"command":63},"pnpm","pnpm dlx skills add sapsapshen\u002Fai-memory-router --skill hermes-windows-gateway-fix","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fhermes\u002Fhermes-windows-gateway-fix\u002FSKILL.md",true,[],[68,78,85,93,99,107],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":72,"licenseFileUrl":73,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":77},"01M72R8PZX1ABFHJGTYPA4CAF1","webapp-testing","To test local web applications, write native Python Playwright scripts.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fwebapp-testing\u002FSKILL.md",[],[],"2026-11-10 22:39:42",{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":77},"01M72QG37MMZNDY7X7GXPAK5W6","python-packaging","Comprehensive guide to creating, structuring, and distributing Python packages using modern packaging tools, pyproject.toml, and publishing to PyPI.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fpython-packaging\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":72,"licenseFileUrl":89,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":77},"01M72NXR0QMP9G46TW6A2DH59C","canvas-design","These are instructions for creating design philosophies - aesthetic movements that are then EXPRESSED VISUALLY. Output only .md files, .pdf files, and .png files.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fcanvas-design\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fcanvas-design\u002FSKILL.md",[],[],{"skillNo":94,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":72,"licenseFileUrl":95,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":77},"01M72N55TK3EEQ4QK4AWDC2KZS","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":72,"licenseFileUrl":103,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":77},"01M72MTWC150CFAP4Y5GSNKF80","slack-gif-creator","A toolkit providing utilities and knowledge for creating animated GIFs optimized for Slack.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Fslack-gif-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Fslack-gif-creator\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":72,"licenseFileUrl":111,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":77},"01M72KPT3VVNSP88MNAY466TZT","frontend-design","You are a frontend designer-engineer, not a layout generator.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Ffrontend-design\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Ffrontend-design\u002FSKILL.md",[],[]]