Claude To Im Skill Fix
Description
这是一个 Claude Code Skill,用于自动修复 https://github.com/op7418/Claude-to-IM-skill 在 Windows上的已知兼容性问题。原 skill 主要在 macOS/Linux 开发,在 Windows 上存在 5 个已知 bug(PowerShell 5.1语法不兼容、核心库缺失、环境变量未注入等)。本 skill 会先诊断你的环境,列出问题,经确认后自动修复。
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
claude-to-im-skill-fix
这个 skill 用于修复 Claude-to-IM-skill 在 Windows 上的已知安装问题。
背景
Claude-to-IM-skill 是一个将 Claude Code 桥接到飞书、Telegram、Discord 等 IM 平台的工具。 它的原始代码主要在 macOS/Linux 上开发和测试,在 Windows 上存在若干兼容性问题, 需要手动修补才能正常运行。
本 skill 会自动诊断并修复这些问题。
使用方法
在 Claude Code 中说:
/claude-to-im-skill-fix
或者用自然语言,例如:
- "帮我修复飞书桥接"
- "Claude-to-IM 跑不起来"
- "fix claude to im"
skill 会先诊断你的环境,列出发现的问题,经你确认后再执行修复。
已知问题清单(Windows 专项)
1. 核心库 `Claude-to-IM` 目录缺失
**现象**:启动时报 `Could not resolve "claude-to-im/src/lib/bridge/..."` 构建错误。
**原因**:skill 通过 `npx skills add` 安装时,只下载了 `Claude-to-IM-skill-main`(技能包装层), 但它依赖的核心库 `Claude-to-IM`(`file:../Claude-to-IM`)是一个独立仓库, 需要单独克隆到同级目录。`npm install` 会创建一个指向该目录的 junction, 但如果目录不存在,junction 就是悬空的。
**修复**:通过 GitHub API 逐文件下载核心库源码,然后 `npm install && npm run build`。 (直接 `git clone` 在某些网络环境下会被重置,GitHub API 更稳定。)
2. PowerShell 5.1 不支持 `Join-Path` 三参数
**现象**:运行 `supervisor-windows.ps1` 时报 `找不到接受实际参数"bridge.log"的位置形式参数`。
**原因**:`Join-Path path1 path2 path3` 的三参数语法是 PowerShell 6+ 才支持的特性。 Windows 内置的 PowerShell 版本是 5.1,不支持这种写法。
**修复**:将所有三参数 `Join-Path` 改为嵌套调用:
# 修复前(PS6+)
$LogFile = Join-Path $CtiHome 'logs' 'bridge.log'
# 修复后(PS5.1 兼容)
$LogFile = Join-Path (Join-Path $CtiHome 'logs') 'bridge.log'
3. `Start-Process` 不能将 stdout 和 stderr 重定向到同一文件
**现象**:启动时报 `无法将 RedirectStandardOutput 和 RedirectStandardError 同时指定为同一文件`。
**原因**:PowerShell 5.1 的 `Start-Process` 不允许 `-RedirectStandardOutput` 和 `-RedirectStandardError` 指向同一个文件路径。
**修复**:将 stderr 重定向到单独的文件 `bridge-stderr.log`:
$StderrFile = Join-Path (Join-Path $CtiHome 'logs') 'bridge-stderr.log'
$proc = Start-Process ... -RedirectStandardOutput $LogFile -RedirectStandardError $StderrFile
4. `$pid` / `$Pid` 是 PowerShell 内置只读变量
**现象**:启动时报 `无法覆盖变量 PID,因为它是只读变量`。
**原因**:PowerShell 中 `$PID` 是自动变量(当前进程 ID),大小写不敏感, 因此 `$pid`、`$Pid`、`$PID` 都指向同一个只读变量,无法赋值。
**修复**:将脚本中所有用作局部变量的 `$pid` / `$Pid` 重命名为 `$bridgePid`
Related Skills
Epic Sync
Sync epic issue bodies, labels, and local coordination snapshots from GitHub.
Git 使用 Git Worktrees
创建孤立的 Git worktrees,带有智能目录选择与安全验证。
Git Claude skills github
[Building agent skills blog](https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-ag
Git #148
, [#161](https://github.com/affaan-m/everything-claude-code/pull/161))
Git GitHub MCP
| Token | Repos, issues, PRs, workflows |
Git GitHub MCP Server
Official first-party server to read repos, manage issues/PRs, and automate workflows.
Git