Agent Skills › dtyq/magic › file-bundle

file-bundle

GitHub

用于在Web端通过卡片打包下载工作区文件集合,支持浏览器侧生成ZIP。当卡片不可用时,提供创建持久化ZIP附件作为降级方案,确保用户能获取指定文件组合。

backend/super-magic/agents/skills/file-bundle/SKILL.md dtyq/magic

触发场景

用户请求下载多个文件的集合 用户反馈文件打包卡片无法使用

安装

npx skills add dtyq/magic --skill file-bundle -g -y
更多选项

非标准路径

npx skills add https://github.com/dtyq/magic/tree/master/backend/super-magic/agents/skills/file-bundle -g -y

不安装直接使用

npx skills use dtyq/magic@file-bundle

指定 Agent (Claude Code)

npx skills add dtyq/magic --skill file-bundle -a claude-code -g -y

安装 repo 全部 skill

npx skills add dtyq/magic --all -g -y

预览 repo 内 skill

npx skills add dtyq/magic --list

SKILL.md

Frontmatter
{
    "name": "file-bundle",
    "description": "Use when a user wants to download or package a collection of existing workspace files, including mixed images, documents, audio, video, code, or archives, or reports that a previously provided file bundle card cannot be used."
}

File Bundle

Create a message card with create_client_side_file_bundle through Code Mode in run_sdk_snippet. The card lists the selected files and lets the user download them individually or package them into a ZIP in their browser. The tool does not create, upload, or download an archive itself. This card is currently supported only by the Web client; other clients may not display it or support its download controls.

Choose the Right Capability

  • Existing workspace files delivered to the user: use this skill.
  • External HTTP/HTTPS resources downloaded into the workspace: use the download skill.
  • A ZIP explicitly needed as a persistent project file for later sharing or processing: create that archive through the existing file workflow. Do not substitute a browser-only card.
  • A single file: an ordinary file link is sufficient unless it belongs to the requested collection.

Create a Card

First identify the exact files with the existing file-list or search tools. Include only the requested files; do not infer membership from a directory or previous attachments. Then run:

from sdk.tool import tool

result = tool.call("create_client_side_file_bundle", {
    "title": "Project materials",
    "file_paths": [
        "images/scene.png",
        "documents/script.md",
        "audio/narration.wav",
    ],
})
print(result.content)

Read result.content and check result.ok. Use a collection title in the user's language. Normally, the successful card is the collection's delivery entry; do not also create a ZIP or manifest just to add a final-response link. Use the attachment fallback below when the user cannot use the card.

Attachment Fallback

Prefer the card because Web packages the files when the user clicks, without storing a ZIP in the project. An ordinary ZIP attachment is stored as a project file; deleting it later may only soft-delete it and retain its object-storage usage until cleanup.

If the user reports that the card is missing, cannot be clicked, or cannot download, an unsupported client is one possible cause, not a confirmed diagnosis. Do not repeatedly provide the same card or require the user to switch to Web. Create a ZIP of the same selected files through the existing file workflow and deliver it as a normal downloadable attachment, using the current channel's delivery guidance when applicable. This is an accepted fallback despite its storage cost; do not silently omit unavailable members or expand the collection.

Fallback does not bypass file access, watermark, subscription, or agreement policies. An explicit permission or policy error must be resolved through the existing rules rather than repackaging to evade it. Report attachment readiness only after the ZIP is created and available; never claim the user has saved it.

Parameters and Boundaries

  • title: non-empty collection name, up to 160 characters, without path separators or control characters. The tool adds .zip if needed; source filenames are unchanged.
  • file_paths: non-empty list of exact workspace-relative paths to ordinary files. Any file type is supported. Do not pass directories, wildcard patterns, URLs, sandbox absolute paths, personal files, or files from another project.
  • Project identity comes from the tool context. Files must already be synchronized and have real MagicFS file IDs. Duplicate IDs are removed in first-occurrence order.
  • One call accepts up to 200 paths by default; its complete message detail must fit within 256 KiB. Configured limits can differ. Oversized collections fail without omitting files; use smaller explicit collections.
  • All references must resolve successfully. Cancellation or any invalid member prevents creation of an incomplete card.

Result and Download Behavior

A successful result means the download card is ready. It does not mean that a ZIP exists, that the user clicked download, or that a file was saved to disk. State the actual result and let the user use the card.

result.data contains title, archive_name, project_id, total_bytes, and the complete items list. Each item has file_id, relative_file_path, file_name, and file_size. Read these fields only for precise programmatic follow-up; do not print the full manifest into model context when content is sufficient.

Members are fixed by ID. Downloading uses the latest accessible content for those IDs, not a historical snapshot. A deleted file recreated at the same path does not replace the original member. ZIP entries preserve relative folders; downloading one file saves that source file directly.

Permission is checked again when the user clicks. Images follow the existing quality, watermark, subscription, and agreement policies selected in the UI. Do not pass options to skip these policies or claim that watermark removal is available to every account.

Browser packaging has a capacity limit. If a member cannot be retrieved, no incomplete ZIP is saved. The user can retry, download an individual file, or request a smaller collection. Source files are not deleted, modified, or copied by this tool.

Errors

  • Missing or unsynchronized file: read the reported path and reason, correct the selection or wait for synchronization, then retry.
  • Directory, symlink, or path outside the workspace: select the actual ordinary file inside the current project.
  • Missing project context: run from the intended project topic.
  • Oversized message: split the explicitly selected files into smaller named collections; do not silently truncate.
  • Tool creation success followed by a download error: do not report archive creation or disk-save success. The card's click-time error is separate from the tool result.

版本历史

  • 0f1432c 当前 2026-11-03 04:32

同 Skill 集合

backend/super-magic/agents/skills/agent-info/SKILL.md
backend/super-magic/agents/skills/canvas-designer/SKILL.md
backend/super-magic/agents/skills/chat-history/SKILL.md
backend/super-magic/agents/skills/cli-manager/SKILL.md
backend/super-magic/agents/skills/compact-chat-history/SKILL.md
backend/super-magic/agents/skills/creating-slides/SKILL.md
backend/super-magic/agents/skills/develop-data-analysis-dashboard/SKILL.md
backend/super-magic/agents/skills/document-converter/SKILL.md
backend/super-magic/agents/skills/download/SKILL.md
backend/super-magic/agents/skills/env-manager/SKILL.md
backend/super-magic/agents/skills/html-design-style/SKILL.md
backend/super-magic/agents/skills/im-channels/SKILL.md
backend/super-magic/agents/skills/magic-calendar/SKILL.md
backend/super-magic/agents/skills/magicbase/SKILL.md
backend/super-magic/agents/skills/micro-app-architect/SKILL.md
backend/super-magic/agents/skills/persona-research/SKILL.md
backend/super-magic/agents/skills/sandbox-manager/SKILL.md
backend/super-magic/agents/skills/self-media-pre-publish-analyzer/SKILL.md
backend/super-magic/agents/skills/share/SKILL.md
backend/super-magic/agents/skills/skill-vetter/SKILL.md
backend/super-magic/agents/skills/slide-template-maker/SKILL.md
backend/super-magic/agents/skills/slide-template-replacement/SKILL.md
backend/super-magic/agents/skills/startup-manager/SKILL.md
backend/super-magic/agents/skills/subagents/SKILL.md
backend/super-magic/agents/skills/super-magic/SKILL.md
backend/super-magic/agents/skills/teamshare-cli/SKILL.md
backend/super-magic/agents/skills/use-magicbase/SKILL.md
backend/super-magic/agents/skills/user-info/SKILL.md
backend/super-magic/agents/skills/using-cron/SKILL.md
backend/super-magic/agents/skills/using-llm/SKILL.md
backend/super-magic/agents/skills/using-mcp/SKILL.md
frontend/magic-web/.agents/skills/antd-style-to-tailwind/SKILL.md
frontend/magic-web/.agents/skills/code-review-expert/SKILL.md
frontend/magic-web/.agents/skills/dual-edition-module-migration/SKILL.md
frontend/magic-web/.agents/skills/frontend-storage-requirements/SKILL.md
frontend/magic-web/.agents/skills/magic-web-error-logging/SKILL.md
frontend/magic-web/.agents/skills/sw-best-practices/SKILL.md
frontend/magic-web/.agents/skills/ui-data-testid/SKILL.md
frontend/magic-web/.agents/skills/vercel-composition-patterns/SKILL.md
frontend/magic-web/.agents/skills/vercel-react-best-practices/SKILL.md
backend/super-magic/agents/skills/ai-card-generator/SKILL.md
backend/super-magic/agents/skills/canvas-manager/SKILL.md
backend/super-magic/agents/skills/crew-creator/SKILL.md
backend/super-magic/agents/skills/deep-research/SKILL.md
backend/super-magic/agents/skills/dingtalk-cli/SKILL.md
backend/super-magic/agents/skills/html-api-sdk/SKILL.md
backend/super-magic/agents/skills/html-app-architect/SKILL.md
backend/super-magic/agents/skills/lark-cli/SKILL.md
backend/super-magic/agents/skills/memory/SKILL.md

元信息

文件数
0
版本
0f1432c
Hash
0692594d
收录时间
2026-11-03 04:32

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-04 15:22
浙ICP备14020137号-1