Codex on Windows launches powershell.exe as a login-shell that loads
the user profile despite -NoProfile in our SKILL.md. With Restricted
ExecutionPolicy this spams "выполнение сценариев отключено". Add
-ExecutionPolicy Bypass for codex; keep canonical -NoProfile -File for
all other platforms.
Round-trip safe: cmd_install always copies fresh from .claude/skills/,
so switching codex→cursor strips the EP flag. cmd_switch_runtime
re-emits PS commands via normalize_ps_invocation each pass, so
in-place py↔ps in .codex/skills/ keeps the flag.
Also fix a pre-existing bug in cmd_switch_runtime: file-existence
check used repo_root() instead of project_dir, so in-place runtime
switch in a foreign project always tripped skip_runtime=True and
became a no-op. The bug was masked when project_dir == repo_root
(source-repo workflow).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
After the SKILL.md refactor, paths are wrapped in double quotes and
contain ${CLAUDE_SKILL_DIR}. The legacy RX_PS/RX_PY regexes captured
the leading quote into the path group and didn't accept '$', '{', '}'
characters, breaking three places:
- classify_skill_runtime: misdetected runtime since RX_PY didn't match
python invocations of variable paths
- check_missing_files: built file paths like '"${CLAUDE_SKILL_DIR}/...py'
that never existed → false-positive missing → runtime switch skipped
- switch_runtime_content: failed to convert PS->Py / Py->PS for skills
using the new path format
Fix:
- Regexes now capture optional surrounding quote separately and accept
any non-whitespace non-quote chars in the path
- New helper expand_skill_path() resolves ${CLAUDE_SKILL_DIR} to the
actual on-disk path for file existence checks (handles cross-skill
references via ../<other>/ too)
- check_missing_files derives skill_name from skill_dir to drive the
expansion
Verified via:
python scripts/switch.py claude-code --project-dir <tmp> --runtime python
python scripts/switch.py claude-code --project-dir <tmp> --runtime powershell
python scripts/switch.py codex --project-dir <tmp>
All produce correct output with quotes preserved and cross-skill
references resolved.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
After SKILL.md refactor, paths use ${CLAUDE_SKILL_DIR} which Claude Code
substitutes natively. Other agents (Cursor, Codex, Copilot, etc.) don't
know about this variable, so switch.py now expands it to a literal path
when the target is not claude-code:
${CLAUDE_SKILL_DIR}/<rest> -> <target_prefix>/<skill_name>/<rest>
${CLAUDE_SKILL_DIR}/../<other>/<rest> -> <target_prefix>/<other>/<rest>
For claude-code target the variable is left intact — drop-in install via
copy still works because Claude Code resolves it identically in
project, personal, and plugin scopes.
Verified by running:
python scripts/switch.py codex --project-dir <tmp>
python scripts/switch.py claude-code --project-dir <tmp>
Both produce correct output with 0 leftover variable literals in
non-Claude targets and full preservation in Claude target.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Junction/symlink install mode may cause intermittent MSYS bash
crashes on Windows (add_item / exit code 5). Demote from
recommended to experimental; recommend copy-based install instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Instead of copying skill folders, --link creates directory junctions
(Windows) or symlinks (Linux/Mac) so updates propagate automatically
via git pull. Only supported for claude-code platform (other platforms
require path rewriting in SKILL.md). Also adds safe_rmtree to prevent
shutil.rmtree from following junctions and deleting source files.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- switch.py v1.2: `claude-code --project-dir` now copies skills (was error before)
- Skip runtime conversion for single-runtime skills (e.g. img-grid stays python)
- Distinguish info ("Python-версия не предусмотрена") from real missing-file warnings
- Print .gitignore recommendations for target project on install
- Copy root-level .gitignore from skills dir during install
- Interactive mode asks project path for all platforms, not just claude-code
- Add .gitignore in skills root (__pycache__/) and web-test/ (node_modules, *.png, *.mp4)
- Sync root .gitignore with all 13 platforms from PLATFORMS registry
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 6 new platforms to switch.py (v1.0 → v1.1), total 13.
All follow the open Agent Skills standard (agentskills.io).
Update README with full platform table and agentskills.io reference.
Closes#4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
Add cross-platform Python alternatives alongside existing PowerShell
scripts. PS1 remains the default runtime; Python is opt-in via switch
scripts. All parameters are identical between runtimes.
New files:
- 58 Python scripts in .claude/skills/*/scripts/*.py
- scripts/switch-to-python.py and switch-to-powershell.py
- docs/python-porting-guide.md
- __pycache__/ added to .gitignore
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>