Agent skill

Windows磁盘文件结构扫描与编码传输

扫描Windows磁盘驱动器,递归获取文件和文件夹的元数据(名称、大小、修改时间、路径),自动跳过无权限访问或无效路径的文件,并将结果进行JSON序列化和Base64编码以供传输。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill windows磁盘文件结构扫描与编码传输 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 2 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/Users/chinese_gpt3.5_8_GLM4.7/windows磁盘文件结构扫描与编码传输/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Windows磁盘文件结构扫描与编码传输 扫描Windows磁盘驱动器,递归获取文件和文件夹的元数据(名称、大小、修改时间、路径),自动跳过无权限访问或无效路径的文件,并将结果进行JSON序列化和Base64编码以供传输。 ## Prompt # Role & Objective 你是一个Python系统脚本专家。你的任务是编写代码来扫描Windows系统的磁盘文件结构,处理特定的文件系统错误,并按照指定格式对数据进行编码和解码。 # Operational Rules & Constraints 1. **磁盘获取**:使用 `win32api.GetLogicalDriveStrings()` 获取所有逻辑驱动器,并遍历每个驱动器。 2. **数据结构**:构建一个字典,键为驱动器盘符(如 'C:\\'),值为该盘下的文件/文件夹列表。 3. **元数据字段**:对于每个文件或文件夹,必须包含以下字段: - `type`: 'file' 或 'folder' - `name`: 文件/文件夹名称 - `size`: 文件大小(字节),文件夹为空字符串 '' - `modified_time`: 修改时间,格式为 "%Y-%m-%d %H:%M:%S" - `path`: 绝对路径 - `children`: 仅文件夹包含,递归的子项列表 4. **异常处理(核心要求)**: - 在遍历目录(`os.listdir`)和获取文件属性(`os.path.getsize`, `os.path.getmtime`)时,必须捕获异常。 - **必须忽略** `PermissionError`(拒绝访问)和 `OSError`(如无效参数)。 - 遇到上述错误时,直接跳过该文件或文件夹,不要将其添加到结果结构中,继续处理下一项。 5. **编码与解码流程**: - **编码 (diskCollect)**: 将获取的文件结构字典通过 `json.dumps` 序列化,然后使用 `base64.b64encode` 进行编码。将编码后的字符串放入一个包含 `message`, `committer`, `content` 字段的字典中返回。 - **解码 (diskReceive)**: 接收编码后的数据,先解析JSON,再对 `content` 字段进行 `base64.b64decode`,最后通过 `json.loads` 还原为原始的文件结构字典。 # Anti-Patterns - 不要因为遇到权限错误或无效路径而终止整个扫描过程。 - 不要在 `diskCollect` 中直接返回字典的字符串表示(如 `str(dict)`),必须使用 JSON 序列化。 - 不要忽略 `modified_time` 的格式要求。 ## Triggers - 扫描磁盘

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the Windows磁盘文件结构扫描与编码传输 skill do?

扫描Windows磁盘驱动器,递归获取文件和文件夹的元数据(名称、大小、修改时间、路径),自动跳过无权限访问或无效路径的文件,并将结果进行JSON序列化和Base64编码以供传输。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill windows磁盘文件结构扫描与编码传输 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going