360 Secure SkillHub
360 安全技能中心

wsl-path-converter

该 Skill 以文字说明形式给出路径格式转换规则:识别形如 X:\ 的 Windows 路径,改写为 /mnt/x/ 前缀,并把反斜杠分隔符替换为正斜杠,其余部分保持不变。适用于在 WSL 环境中读取 Windows 磁盘上的项目文件、图片等资源。

weiqihan
weiqihan
热度 47.82
最近更新 2026-05-11 17:34:20
分类:效率依赖:纯提示词应用场景:文件转换 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add wsl-path-converter
Metadata
name
wsl-path-converter
description
Convert Windows paths to WSL paths for file operations in WSL environment
author
OpenClaw Assistant
version
1.0.0

WSL path conversion skills

This skill is used to convert Windows paths to WSL paths, enabling correct access to Windows files in the WSL environment.

Function Description

In the WSL environment, the disk partitions of Windows are mounted under the /mnt/ directory, for example:

  • C:\ → /mnt/c/
  • E:\ → /mnt/e/ This skill can automatically recognize the Windows path format and convert it into a path accessible by WSL.

Usage

The skill will automatically handle path conversion. When you provide a path in Windows format, it will be automatically converted to WSL format.

Example

When you mentioned a similar path:

  • E:\projects\chess_game.png → automatically converted to /mnt/e/projects/chess_game.png
  • C:\Users\Documents\file.txt → automatically converted to /mnt/c/Users/Documents/file.txt
  • D:\data\images\photo.jpg → automatically converted to /mnt/d/data/images/photo.jpg

Conversion Rules

  1. Recognize Windows paths in the format of X:\
  2. Convert it to the /mnt/x/ format
  3. Convert the Windows path separator \ to the Unix path separator /
  4. Keep the rest of the path unchanged

Application Scenario

  • Read files from Windows disks
  • Access project files in Windows
  • Manipulate images or other resources in Windows
  • Handle Windows paths in the WSL environment