下载地址
https://www.zhengdianxue.com/wp-content/uploads/skills/cztech--local-file-to-markdown.zip将提示词发送给你的 AI 安装该 skills
请根据 https://skillhub.cn/install/skillhub.md,安装 @cztech/local-file-to-markdown。本地文件 AI 阅读优化器是一款面向 WorkBuddy 的文件阅读预处理 Skill。 当用户上传文件,或明确授权 WorkBuddy 读取某个本地文件夹时,本技能会自动识别当前设备能够处理的文件格式,在本机将文件内容临时整理成结构清晰、便于 AI 检索和理解的 Markdown。AI可先读取文件索引,再按需读取相关章节、页码或片段,避免一次性加载大量无关内容。
核心能力 • 支持 TXT、TEXT、LOG 等常见文本文件。 • 支持 HTML、HTM、MHTML、MHT 网页及网页归档。 • 支持 EML 邮件正文和基础邮件信息。 • 支持 DOCX、ODT、RTF 等办公文档。 • 支持 EPUB、FB2 电子书,并保留章节顺序。 • 支持 PPTX 的幻灯片文字、基础表格和演讲者备注。
• 支持文字型 PDF,并保留页码来源。 • 在本机 OCR 能力通过检测时,支持图片和无文字层扫描 PDF。 • 在本机离线语音能力通过检测时,可启用 WAV 录音转写。 • 自动识别损坏、加密、超限或无法处理的文件,并如实报告,不会用空白结果冒充成功。 隐私与安全 所有文件转换和预处理均在用户设备本地完成。本技能不会调用独立的云端 OCR、云端转写或在线格式转换服务,也不会自动下载模型或转换软件。
源文件始终以只读方式处理。本技能不会在源文件夹中生成 Markdown、缓存、图片、日志或其他中间文件。临时内容保存在受保护的任务空间中,并在任务完成、失败或取消后自动清理。 需要注意:本地预处理不等于所选 AI 模型也是本地运行。整理后的 Markdown交给 WorkBuddy或用户所选模型阅读时,相关数据处理仍受 WorkBuddy、模型服务商和用户账户政策约束。
使用方式 用户无需学习转换命令,只需直接提出任务,例如: • 总结我上传的这些 PDF 和 Word 文件。 • 读取这个已授权文件夹,找出所有合同中的付款条件。 • 比较这些文档对同一个问题的不同说法。 • 识别这些扫描件中的文字并整理重点。 • 如果本机支持录音转写,将这段 WAV 整理成会议纪要。 首次调用时,本技能会先检测当前设备的本地能力,只向用户显示这台设备实际可以处理的格式。
没有通过本地检测的格式会被清楚地标记为不可用,不会偷偷切换到在线服务。 适用场景 适用于办公资料整理、合同阅读、研究文献分析、小说与写作素材管理、电子书检索、邮件归纳、知识库准备和大批量文件问答。 将文件规范化为 Markdown 通常可以改善 AI 的阅读、定位和重复调用效率,并可能减少不必要的 Token 或积分消耗,但实际效果取决于文件结构、内容规模和所使用的模型。
阅读全文 (展开查看完整说明)
概述
Local File to Markdown for WorkBuddy
Locally preprocess only the files the user supplied or roots they explicitly authorized. The Markdown is private task scratch for WorkBuddy reading, not a persistent conversion product.
First activation in every new task
Run python scripts/local_reader.py probe before handling input. Use its capabilities.converters list as the complete current-format list; never replace it with a static or theoretical list.
Then give the full onboarding once:
- Conversion and preprocessing use local scripts and verified on-device capabilities. They do not call independent cloud conversion, OCR, or transcription services.
- WorkBuddy receives the files, and the selected model reads the prepared Markdown under WorkBuddy's, the model provider's, and the user's account policies. With a cloud model, relevant content may be sent to that model. Local preprocessing does not make model inference local.
- Source files are read only. Nothing is written beside them or anywhere in their directory tree. Normal completion, ordinary failure, and confirmed cancellation clean task scratch automatically. If process-tree termination cannot be confirmed, report
cleanup-pendingand preserve authenticated scratch for later guarded cleanup. - Show exactly the formats returned by this probe. Mention native OCR/transcription only if the corresponding extensions are present.
- Say that normalization may improve reading, locating, and reuse efficiency and may reduce unnecessary Token or credit use. Never promise a saving, percentage, speedup, or benefit for every format.
- Give examples: summarize an uploaded document; search an explicitly authorized document folder; transcribe a
.wavrecording only when the probe advertises.wav. Compressed audio and video (.mp3,.m4a,.mp4,.mov,.mkv,.avi) are unavailable in this release and must never be passed to a decoder or cloud fallback.
If no file or directory was supplied, stop after this explanation and wait. Do not scan Desktop, Downloads, a home directory, or any default location.
Required lifecycle
- Recover and authorize.
probefirst performs a guarded sweep. Use only explicit input paths and explicit authorized roots. Do not follow links, junctions, mount points, hidden directories, or paths outside those roots. - Prepare. Run
preparewith every authorized root as--authorizeand every selected file/folder as--path. Task output stays only in the Skill-owned private OS-temporary workspace. Each task has a 12-hour lease and an OS-level task lock; process exit alone never makes a prepared task stale. If native probing returns cleanup-pending, stop before discovery/conversion and retain the authenticated probe scratch and cleanup identity. - Report. Read the JSON result and tell the user each file's
converted,partial,skipped,failed, orcancelledstatus, including every reason and warning. A mixed batch is not a full success. - Authenticated read. Keep the returned
task_idandnonceprivate. Runreadforindexfirst, then only the manifest-listed chunks relevant to the request. Each authenticated read refreshes the lease. Never read arbitrary temporary paths or load all chunks unless the request requires the full contents. - Optional export. Only after the user explicitly requests persistent Markdown, run
export --task-id ... --nonce ... --target .... The target must resolve outside every manifest-authorized/source tree. Export is atomic and does not overwrite unless the user explicitly authorizes--overwrite. - Cleanup. Put
cleanup --task-id ... --nonce ...in the finalization path after the answer, failure, cancellation, or export. A priorcleanup-pendingstate is retryable. If cleanup still returnscleanup-pending, reportcompleted_with_issues; do not claim complete cleanup.sweeptakes a nonblocking task lock and deletes only identity-revalidated tasks whose 12-hour lease expired.
The sequence is always prepare -> authenticated read -> cleanup. A per-file failure does not authorize a different route.
Non-negotiable boundaries
- Never write Markdown, caches, thumbnails, logs, locks, profiles, or temporary files into the source tree.
- Never use online OCR, cloud transcription, remote URLs, telemetry, model downloads, or another cloud converter as fallback. When
probedoes not advertise a format, reportskipped/local-capability-unavailable. - Never retain task caches for convenience or future questions. Normal cleanup is mandatory.
- Never imply that local conversion prevents WorkBuddy or a cloud model from processing the Markdown under their own data policies.
- Enforce the built-in budgets: 1,000 supported files, 256 MiB Markdown, 4 GiB task scratch, 8 GiB global task root, 4 GiB cumulative reads/expansion, 10 minutes per conversion worker, and 12 hours per task. Read bytes are budgeted before hashing and counted through discovery and streamed snapshots. Scratch is reserved under a root-wide lock and monitored while workers run. Enumeration/access truncation, timeout, cancellation, decoding replacement, and cleanup problems are explicit non-success results.
Persistent Markdown exists only through the authenticated export command after the user confirms a destination. With no safe external destination, return skipped/no-safe-export-destination. Otherwise leave no persistent output.
This artifact remains a verified prototype. Do not claim WorkBuddy-native compatibility until real WorkBuddy import, authorized-path handoff, read, and cleanup smoke tests pass.
Read [format support](references/format-support.md) for routing limits, [privacy and permissions](references/privacy-and-permissions.md) for boundaries, and [the result contract](references/result-contract.md) for status handling.