Transfer Skill To Windows
Use this skill when the user wants to make an existing skill work on Windows, especially when the original skill assumes Unix shells, Unix paths, or Linux/macOS tooling.
This skill accepts either:
- - A path to a skill folder
- A path to a zip file that contains a skill folder
The goal is to produce a Windows-compatible version of the skill with the smallest practical set of changes, while preserving the original workflow and intent.
Default output policy:
- - Preserve the original input
- Prefer a sibling output folder with a clear suffix such as INLINECODE0
- If the source input is a zip file, also produce a rebuilt Windows-ready zip that matches the converted folder
What This Skill Produces
This skill helps you:
- - Inspect the incoming skill package or folder
- Detect whether a partially converted Windows copy already exists
- Identify Windows-incompatible assumptions
- Rewrite instructions, commands, and examples for Windows
- Repair machine-specific path mistakes introduced by earlier conversions
- Preserve cross-platform behavior when practical
- Return an updated skill folder ready to use on Windows
- Rebuild and verify the zip artifact when the source was a zip file
When To Use This Skill
Use this skill when the user asks for any of the following:
- - Transfer a skill to Windows
- Make a skill support Windows
- Convert a skill that uses bash or Unix paths
- Patch a skill distributed as a folder or zip so it works on Windows
Do not use this skill for general application migration. This skill is specifically for agent skills and their supporting files.
Inputs To Gather
Before making changes, confirm or infer the following:
- 1. The input type:
- Skill folder path
- Zip file path
- 2. The desired output behavior:
- In-place update
- Create a separate Windows-ready copy
- 3. Whether the user wants:
- Windows-only support
- Cross-platform support with Windows compatibility
Also check whether there is already a derived output nearby, for example:
- - INLINECODE1
- INLINECODE2
- an extracted folder that matches the zip name
- an existing Windows-ready zip
If the user does not specify output behavior, default to creating a separate Windows-ready copy so the source remains untouched.
Workflow
1. Load The Skill Contents
If the input is a folder:
- - Inspect the directory structure
- Locate
SKILL.md and any helper scripts, templates, or config files - Check whether a Windows-oriented sibling copy already exists and may need to be updated rather than recreated
If the input is a zip file:
- - Extract it to a working directory
- Inspect the extracted contents
- Identify the actual skill root that contains INLINECODE4
- Check for an existing extracted or converted copy before creating a new one
If the extracted archive does not contain a SKILL.md, stop and tell the user the package does not look like a valid skill.
If multiple candidate outputs already exist, prefer this order:
- 1. A clearly named Windows-ready copy that already contains Windows files such as INLINECODE6
- A partially converted copy that still needs fixes
- A fresh extraction from the original input
2. Inventory Windows Risks
Inspect SKILL.md and any referenced files for these common issues:
- - Commands written only for
bash, sh, or INLINECODE10 - Use of
&&, export, chmod, rm, cp, mv, cat, grep, sed, awk, find, xargs, tar, unzip, or INLINECODE25 - Unix-style absolute paths such as
/tmp/... or INLINECODE27 - Machine-specific absolute paths embedded in docs or code, such as
/home/... or INLINECODE29 - Path examples that assume
/ separators in shell commands - Shebang-based scripts such as INLINECODE31
- Scripts that depend on executable permission bits
- References to tools commonly missing on Windows
- Instructions that assume case-sensitive filesystems
- Symlink-heavy workflows without Windows fallback guidance
- Test or helper code that imports via hardcoded absolute paths
- Documentation that points to the wrong output folder after conversion
Also inspect supporting files such as:
- -
.ps1, .bat, .cmd, INLINECODE35 - INLINECODE36
- INLINECODE37
- INLINECODE38
- INLINECODE39
- README or usage examples
- Template files referenced by the skill
3. Decide The Conversion Strategy
Prefer this order of solutions:
- 1. Make instructions tool-based rather than shell-specific when possible
- Replace Unix-only shell examples with PowerShell equivalents
- Fix runtime-affecting path assumptions before polishing documentation
- Keep cross-platform examples if they are already valid on Windows
- Add Windows notes only where a direct rewrite would reduce clarity
If a command can be expressed in a VS Code tool workflow, prefer that over raw shell instructions.
4. Rewrite For Windows
Apply the smallest change set that makes the skill usable on Windows.
Typical rewrites include:
- - Replace bash command examples with PowerShell examples
- Replace
export NAME=value with INLINECODE41 - Replace
rm -rf path with INLINECODE43 - Replace
cp src dst with INLINECODE45 - Replace
mv src dst with INLINECODE47 - Replace
cat file with INLINECODE49 - Replace
grep pattern file with INLINECODE51 - Replace
which tool with INLINECODE53 - Replace
chmod +x script.sh by removing the permission requirement or by providing a .ps1 alternative - Replace archive extraction examples with INLINECODE56
- Replace Unix temp-directory assumptions with Windows-safe paths or tool-managed temp locations
- Replace hardcoded import paths with paths derived from the current file location
- Replace machine-specific documentation paths with relative paths when the skill is expected to be moved between machines
Also normalize instructional language:
- - Use Windows path examples when showing local filesystem paths
- Prefer relative paths in examples when the skill folder is portable
- Avoid telling users to invoke
bash -lc unless that is a hard requirement - Prefer PowerShell 5.1 compatible commands unless the skill clearly requires PowerShell 7+
Do not treat these as mandatory problems by themselves:
- - Python shebang lines in
.py files, if the files otherwise run on Windows - Preserved
.sh scripts kept for Linux or macOS compatibility, if Windows alternatives are added and documented
5. Update Supporting Files
If the skill includes helper scripts:
- - Convert
.sh scripts into .ps1 equivalents when needed - Update references inside
SKILL.md to the new script names - Preserve original scripts if the goal is cross-platform support
- If a Windows-native script already exists, validate its behavior and references before rewriting it
If the skill contains examples or templates with shell snippets:
- - Rewrite those snippets for Windows
- Keep the original semantics intact
If the skill references zipped input or extracted folders:
- - Ensure the instructions explicitly say how to handle both on Windows
If the source was a zip file:
- - Ensure the converted folder structure is stable and self-contained
- Rebuild a Windows-ready zip from the converted folder
- Verify the rebuilt archive contents before finishing
6. Validate The Result
Before finishing, verify:
- -
SKILL.md still describes the original task accurately - Every command shown is runnable on Windows or clearly marked otherwise
- Any referenced files actually exist after conversion
- Paths and examples are internally consistent
- The skill does not rely on Unix-only permission or shell behavior without explanation
- The documentation does not reference the wrong sibling output directory
- Any runtime imports or script references do not depend on a machine-specific absolute path
- If the input was a zip file, the rebuilt zip contains the expected converted root and files
7. Report The Outcome
Summarize:
- - What Windows incompatibilities were found
- Which files were changed
- Whether the result is Windows-only or cross-platform
- Whether an existing partial conversion was reused or corrected
- Whether a new Windows-ready zip was rebuilt and verified
- Any remaining limitations, such as required third-party tools
Decision Rules
- - If the skill is documentation-only, focus on rewriting instructions and examples
- If the skill contains scripts, convert the scripts or provide Windows-native alternatives
- If the skill depends on a Unix-only tool with no practical Windows equivalent, call that out explicitly and propose the least disruptive fallback
- If the user provides a zip file, do not assume the archive root is the skill root; inspect it first
- If the user provides a folder path, do not duplicate large files unless the user asked for a separate output
- If a Windows-ready output already exists, inspect it before creating another copy
- If a converted copy already contains a plausible Windows script, prefer validating and fixing it over regenerating everything
- If code and docs disagree, fix the runtime-critical issue first and then align the docs
Completion Criteria
The task is complete when:
- - A valid
SKILL.md exists in the converted skill - Windows users can follow the instructions without relying on bash-only behavior
- Any required helper files are updated or replaced
- Any hardcoded machine-specific path assumptions have been removed or justified
- If the source was a zip, a rebuilt Windows-ready zip exists and its contents were verified
- The user receives a concise summary of the migration and any remaining caveats
Example Prompts
- - Convert this skill folder to work on Windows: INLINECODE65
- Adapt this zipped skill for Windows support and keep it cross-platform: INLINECODE66
- Audit this skill for Unix-only assumptions and produce a Windows-ready copy
Notes For The Agent
- - Prefer precise edits over broad rewrites
- Preserve the author's intent and workflow
- Do not remove useful cross-platform guidance unless it conflicts with Windows usability
- Treat pre-existing
_windows or _windows_ready folders as evidence to inspect, not clutter to ignore - Absolute paths inside docs and tests are high-priority smells because they often survive superficial conversions
- A conversion is not finished until the packaged artifact matches the edited folder when the input was a zip file
- If the skill is ambiguous, ask one focused question after producing the first draft of the conversion plan
将技能迁移至Windows
当用户希望让现有技能在Windows上运行时使用此技能,特别是当原始技能假设使用Unix shell、Unix路径或Linux/macOS工具时。
此技能接受以下输入:
- - 技能文件夹的路径
- 包含技能文件夹的zip文件路径
目标是以最小实际变更集生成Windows兼容版本的技能,同时保留原始工作流程和意图。
默认输出策略:
- - 保留原始输入
- 优先使用带有明确后缀(如windowsready)的同级输出文件夹
- 如果源输入是zip文件,同时生成与转换后文件夹匹配的、已准备好的Windows版zip文件
此技能产出的内容
此技能帮助您:
- - 检查传入的技能包或文件夹
- 检测是否已存在部分转换的Windows副本
- 识别与Windows不兼容的假设
- 重写适用于Windows的说明、命令和示例
- 修复早期转换引入的机器特定路径错误
- 在可行时保留跨平台行为
- 返回可在Windows上直接使用的更新版技能文件夹
- 当源文件为zip时,重建并验证zip制品
何时使用此技能
当用户提出以下任何要求时使用此技能:
- - 将技能迁移到Windows
- 让技能支持Windows
- 转换使用bash或Unix路径的技能
- 修补以文件夹或zip形式分发的技能,使其能在Windows上运行
请勿将此技能用于通用应用程序迁移。此技能专门用于代理技能及其支持文件。
需要收集的输入
在进行更改之前,确认或推断以下信息:
- 1. 输入类型:
- 技能文件夹路径
- Zip文件路径
- 2. 期望的输出行为:
- 原地更新
- 创建独立的Windows就绪副本
- 3. 用户希望:
- 仅Windows支持
- 跨平台支持并兼容Windows
同时检查附近是否已有衍生输出,例如:
- - windows
- windows_ready
- 与zip名称匹配的解压文件夹
- 现有的Windows就绪zip文件
如果用户未指定输出行为,默认创建独立的Windows就绪副本,以保持源文件不变。
工作流程
1. 加载技能内容
如果输入是文件夹:
- - 检查目录结构
- 定位SKILL.md以及任何辅助脚本、模板或配置文件
- 检查是否已存在面向Windows的同级副本,可能需要更新而非重新创建
如果输入是zip文件:
- - 将其解压到工作目录
- 检查解压后的内容
- 识别包含SKILL.md的实际技能根目录
- 在创建新副本之前检查是否已有解压或转换的副本
如果解压后的归档文件中不包含SKILL.md,则停止并告知用户该包看起来不是有效的技能。
如果已存在多个候选输出,优先按以下顺序处理:
- 1. 已明确命名且包含.ps1等Windows文件的Windows就绪副本
- 仍需修复的部分转换副本
- 从原始输入重新解压
2. 盘点Windows风险
检查SKILL.md及所有引用的文件,查找以下常见问题:
- - 仅针对bash、sh或zsh编写的命令
- 使用&&、export、chmod、rm、cp、mv、cat、grep、sed、awk、find、xargs、tar、unzip或which
- Unix风格绝对路径,如/tmp/...或/usr/local/...
- 嵌入在文档或代码中的机器特定绝对路径,如/home/...或C:\Users\...
- 在shell命令中假设使用/分隔符的路径示例
- 基于shebang的脚本,如#!/bin/bash
- 依赖可执行权限位的脚本
- 引用Windows上通常缺失的工具
- 假设区分大小写文件系统的说明
- 没有Windows回退指导的符号链接密集型工作流
- 通过硬编码绝对路径导入的测试或辅助代码
- 转换后指向错误输出文件夹的文档
同时检查支持文件,例如:
- - .ps1、.bat、.cmd、.sh
- _meta.json
- package.json
- pyproject.toml
- requirements.txt
- README或使用示例
- 技能引用的模板文件
3. 决定转换策略
优先按以下顺序选择解决方案:
- 1. 尽可能使说明基于工具而非特定shell
- 将仅限Unix的shell示例替换为PowerShell等效命令
- 在完善文档之前,先修复影响运行时的路径假设
- 如果跨平台示例在Windows上已有效,则保留
- 仅当直接重写会降低清晰度时,才添加Windows说明
如果命令可以通过VS Code工具工作流表达,优先于原始shell说明。
4. 为Windows重写
应用使技能在Windows上可用的最小变更集。
典型重写包括:
- - 将bash命令示例替换为PowerShell示例
- 将export NAME=value替换为$env:NAME = value
- 将rm -rf path替换为Remove-Item -Recurse -Force path
- 将cp src dst替换为Copy-Item src dst
- 将mv src dst替换为Move-Item src dst
- 将cat file替换为Get-Content file
- 将grep pattern file替换为Select-String -Path file -Pattern pattern
- 将which tool替换为Get-Command tool
- 将chmod +x script.sh替换为移除权限要求或提供.ps1替代方案
- 将归档解压示例替换为Expand-Archive
- 将Unix临时目录假设替换为Windows安全路径或工具管理的临时位置
- 将硬编码的导入路径替换为基于当前文件位置的路径
- 当技能预期在不同机器间移动时,将机器特定的文档路径替换为相对路径
同时规范指导性语言:
- - 在展示本地文件系统路径时使用Windows路径示例
- 当技能文件夹可移植时,在示例中优先使用相对路径
- 避免告诉用户调用bash -lc,除非这是硬性要求
- 除非技能明确要求PowerShell 7+,否则优先使用PowerShell 5.1兼容命令
以下情况本身不视为强制性问题:
- - .py文件中的Python shebang行,如果这些文件在Windows上能正常运行
- 为Linux或macOS兼容性保留的.sh脚本,如果已添加并记录了Windows替代方案
5. 更新支持文件
如果技能包含辅助脚本:
- - 在需要时将.sh脚本转换为等效的.ps1脚本
- 更新SKILL.md中对新脚本名称的引用
- 如果目标是跨平台支持,则保留原始脚本
- 如果已存在Windows原生脚本,在重写之前验证其行为和引用
如果技能包含带有shell片段的示例或模板:
如果技能引用了压缩输入或解压文件夹:
- - 确保说明明确说明如何在Windows上处理两者
如果源文件是zip文件:
- - 确保转换后的文件夹结构稳定且自包含
- 从转换后的文件夹重建Windows就绪的zip文件
- 在完成前验证重建的归档内容
6. 验证结果
在完成之前,验证:
- - SKILL.md仍然准确描述原始任务
- 显示的每个命令在Windows上可运行,或已明确标记为不可运行
- 转换后所有引用的文件确实存在
- 路径和示例内部一致
- 技能不依赖仅限Unix的权限或shell行为而未加说明
- 文档未引用错误的同级输出目录
- 任何运行时导入或脚本引用不依赖机器特定的绝对路径
- 如果输入是zip文件,重建的zip包含预期的转换后根目录和文件
7. 报告结果
总结:
- - 发现了哪些Windows不兼容问题
- 哪些文件被更改
- 结果是仅限Windows还是跨平台
- 是否重用或修正了现有的部分转换
- 是否重建并验证了新的Windows就绪zip文件
- 任何剩余的限制,如所需的第三方工具
决策规则
- - 如果技能仅包含文档,专注于重写说明和示例
- 如果技能包含脚本,转换脚本或提供Windows原生替代方案
- 如果技能依赖没有实际Windows等效工具的仅限Unix工具,明确指出并提出干扰最小的回退方案
- 如果用户提供zip文件,不要假设归档根目录就是技能根目录;先检查
- 如果用户提供文件夹路径,除非用户要求单独输出,否则不要复制大文件
- 如果已存在Windows就绪输出,在创建另一个副本之前先检查
- 如果转换后的副本已包含合理的Windows脚本,优先验证和修复