one-click-filesave
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "one-click-filesave" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-358d89bf9ac6005270e46497ccd8fbd813e278477f5869acf1ab569f8c5fe4bb. Verify the upstream source and version against https://skillhub.cn/skills/user_f1b049da/qhlm2026642 before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Implement one-click download of text, JSON, or export results using file-saver, suitable for browser scenarios where users need to save or export files.
Introduction source: third_party · user_f1b049da · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: one-click-filesave
slug: qhlm2026642
displayName: 一键保存文件
version: 1.0.0
summary: 用 file-saver 一键下载文本、JSON 或导出结果。
license: MIT
description: 用 file-saver 一键下载文本、JSON 或导出结果。当用户需要浏览器保存文件、导出下载,或提到工具箱 file-save / FileSaver 时使用。一键保存文件(file-saver)
灵感:能力工具箱 file-save(pkg: file-saver)。
何时使用
- 导出跟进笔记、JSON 备份、CSV 文本等为本地文件
- 与 ZIP 打包联用:先生成 Blob,再
saveAs
硬约束
- 使用
file-saver的saveAs(或等价Blob+ 临时<a download>)。 - 文件名清洗非法字符;默认带扩展名。
- 空内容拒绝保存并提示。
- 标明:依赖浏览器下载权限,弹窗拦截时需用户允许。
- 与「附件打包 ZIP」区分:本 Skill 单文件/通用 Blob 下载。
推荐实现要点
import { saveAs } from 'file-saver'
export function saveTextFile(content: string, filename = 'export.txt') {
const text = String(content ?? '')
if (!text) throw new Error('内容为空,无法保存')
const safe = filename.replace(/[\\/:*?"<>|]/g, '_')
saveAs(new Blob([text], { type: 'text/plain;charset=utf-8' }), safe)
}
export function saveJsonFile(data: unknown, filename = 'export.json') {
const body = JSON.stringify(data, null, 2)
saveAs(new Blob([body], { type: 'application/json;charset=utf-8' }), filename.replace(/[\\/:*?"<>|]/g, '_'))
}
Agent 执行步骤
- 实现
saveTextFile/saveJsonFile;可选saveBlob。 - 自测:保存一段中文文本,文件可打开且编码正常。
- UI 按钮文案:「下载」/「保存到本地」。
附加
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供浏览器端文本/JSON 文件一键下载功能,解决用户导出保存的明确需求
- 属于通用工具类别,具有广泛实用价值
Areas to improve
-
description写错位置 Reported severity: Minor
顶层 frontmatter 中 description 字段为空,实际描述内容位于 skill_body 内部
Recommendation: 建议将触发描述移至顶层 frontmatter 的 description 字段,确保触发词能被平台正确识别
Highlights
- 触发词覆盖 file-saver、file-save、FileSaver 等关键词,边界清晰
Highlights
- 结构清晰,包含何时使用、硬约束、实现要点、执行步骤
- 提供端到端代码示例,frontmatter 完整
Areas to improve
-
未处理 saveAs 可能抛出的异常 Reported severity: Minor
saveAs 在用户取消下载或浏览器限制时可能抛出异常,未做捕获处理
Recommendation: 建议添加 try-catch 包裹 saveAs 调用,提供友好的错误提示
Highlights
- 工具来源明确,参数处理正确(文件名清洗、空内容拒绝)
- 覆盖主要异常场景,标明浏览器权限依赖
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.