attach-zip-pack
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 "attach-zip-pack" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-5892906ee7315ea7d2df82cef47616f5469589498280a88b9d3cad9fdb7bdccd. Verify the upstream source and version against https://skillhub.cn/skills/user_f1b049da/wnfb2026835 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
Package multiple files into a ZIP in the browser and download it, suitable for CRM bulk-attachment packaging scenarios. Use when the user needs frontend multi-file ZIP download or refers to toolbox file-zip / jszip functionality.
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: attach-zip-pack
slug: wnfb2026835
displayName: 附件打包ZIP
version: 1.0.0
summary: 浏览器内把多文件打成 ZIP 再下载,适合 CRM 附件打包。
license: MIT
description: 浏览器内把多文件打成 ZIP 再下载,适合 CRM 附件打包。当用户需要前端打 ZIP、多附件打包下载,或提到工具箱 file-zip / jszip 时使用。附件打包 ZIP(JSZip)
灵感:能力工具箱 file-zip(pkg: jszip)。
何时使用
- 多份合同/图片/跟进附件一次打成 zip 下载
- 纯前端打包,不经后端中转(注意体积与内存)
硬约束
- 使用
jszip;条目文件名清洗非法路径字符,禁止../。 - 空列表拒绝打包并提示。
- 大文件:提示内存风险;单次建议总大小有上限说明(如提示 >50MB 慎用)。
- 打包完成后触发下载(可配合
file-saver或URL.createObjectURL)。 - 交付可运行 TS/JS 片段;勿依赖仓库私有 API。
推荐实现要点
import JSZip from 'jszip'
export async function packFilesToZip(
files: Array<{ name: string; data: Blob | ArrayBuffer | string }>,
zipName = 'attachments.zip',
) {
if (!files?.length) throw new Error('请至少选择一个文件')
const zip = new JSZip()
for (const f of files) {
const safe = String(f.name || 'file').replace(/[\\/:*?"<>|]/g, '_').replace(/\.\./g, '')
zip.file(safe, f.data)
}
const blob = await zip.generateAsync({ type: 'blob' })
const url = URL.createObjectURL(blob)
const a = document.createElement('a')
a.href = url
a.download = zipName
a.click()
URL.revokeObjectURL(url)
return { ok: true, name: zipName }
}
Agent 执行步骤
- 实现打包函数;说明与
file-save可联用。 - 自测:2 个文本文件 → 可解压 zip。
- UI:进度可用
generateAsync的onUpdate。
附加
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决浏览器端多文件打包下载的实际业务需求
- 适用于 CRM 附件批量处理等明确场景
Highlights
- 触发描述清晰,覆盖前端 ZIP 打包、工具箱 file-zip/jszip 等关键词
Areas to improve
-
缺少端到端完整使用示例 Reported severity: Minor
文档提供了代码片段,但缺少从用户输入到最终下载的完整调用流程示例
Recommendation: 补充一个完整的使用示例,展示如何获取文件列表、调用打包函数、处理结果
Highlights
- 文档结构清晰,包含使用场景、约束条件、实现要点和执行步骤
- frontmatter 完整,版本信息明确
Areas to improve
-
未覆盖 generateAsync 异常处理 Reported severity: Minor
代码示例中未处理 zip.generateAsync 可能抛出的异常(如内存不足、文件过大等)
Recommendation: 添加 try-catch 包装 generateAsync 调用,提供友好的错误提示
-
file-saver 集成说明不足 Reported severity: Minor
文档提到可与 file-saver 联用,但未提供具体集成方式
Recommendation: 补充 file-saver 的集成示例,说明两种下载方式的优缺点
Highlights
- 提供了可运行的 TypeScript 代码片段
- 包含文件名安全处理和空列表校验
- 提及大文件内存风险提示
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.