feat: add unified switch.py for cross-platform skill porting

Single script to copy skills between AI platforms (Cursor, Codex,
Copilot, Gemini CLI, OpenCode) with path rewriting and optional
runtime switching. Includes interactive mode for newcomers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-02-28 19:05:12 +03:00
parent da0cedf256
commit 7b69228d23
5 changed files with 427 additions and 4 deletions
+26 -4
View File
@@ -44,13 +44,35 @@
- **1С:Предприятие 8.3** — для сборки/разборки EPF/ERF (навыки генерации XML работают без платформы)
- **Node.js 18+** — для `/web-test` (тестирование через браузер)
### Кроссплатформенный режим (Python)
### Другие AI-платформы
На Windows рекомендуется использовать PS1-рантайм (по умолчанию) как более стабильный и протестированный. Python-порты — для **Linux/Mac** или если PowerShell недоступен. PS1-скрипты — мастер-версия; Python-порты производные (см. [Python Porting Guide](docs/python-porting-guide.md)).
Навыки совместимы с Cursor, GitHub Copilot, OpenAI Codex, Gemini CLI и OpenCode. Скрипт `switch.py` копирует навыки в нужный формат с перезаписью путей:
```bash
python scripts/switch-to-python.py # переключить на Python
python scripts/switch-to-powershell.py # вернуть на PowerShell
python scripts/switch.py # интерактивный режим (пошаговый диалог)
python scripts/switch.py cursor # скопировать навыки для Cursor
python scripts/switch.py cursor --runtime python # Cursor + Python-рантайм
python scripts/switch.py --undo cursor # удалить копию
```
Поддерживаемые платформы:
| Платформа | Целевой каталог | Слеш-команды |
|-----------|----------------|--------------|
| Claude Code | `.claude/skills/` | `/epf-init`, `/mxl-compile`, ... |
| Cursor | `.cursor/skills/` | через меню команд |
| GitHub Copilot | `.github/skills/` | `/skills` в чате |
| OpenAI Codex | `.codex/skills/` | `$skill-name` |
| Gemini CLI | `.gemini/skills/` | автоактивация |
| OpenCode | `.opencode/skills/` | через skill tool |
### Переключение рантайма (PowerShell ↔ Python)
На Windows рекомендуется PS1-рантайм (по умолчанию). Python-порты — для **Linux/Mac** или если PowerShell недоступен. PS1-скрипты — мастер-версия; Python-порты производные (см. [Python Porting Guide](docs/python-porting-guide.md)).
```bash
python scripts/switch.py --runtime python # переключить на Python
python scripts/switch.py --runtime powershell # вернуть на PowerShell
```
Дополнительные зависимости Python-рантайма: