跳到正文
Skillpedia
通用编程7.8k · #13035

zip-export-deliverable

它能做什么

这项技能帮助智能体把完成的项目目录转换为 ZIP 压缩包。适合需要以单个文件交付代码库或项目的人。

适用场景

  • ✓当交付物是必须导出为 ZIP 文件的项目目录时。
  • ✓当项目文件和文件夹已经存在,只剩打包的时候。
  • ✓当你希望确认 ZIP 文件确实已被创建的时候。

技能链接

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/zip-export-deliverable/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/zip-export-deliverable/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我的项目文件夹已经完成。请检查所有文件是否都在,然后把整个文件夹压缩为 ZIP 以便交付。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体列出项目文件以确认它们存在,然后在单独的步骤中使用带递归参数的 zip 命令。之后它检查 ZIP 文件,确认已经创建。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

ZIP Export Deliverable Finalization

Purpose

When a task requires delivering a codebase or project directory as a ZIP archive, this skill ensures the deliverable is actually created through an explicit finalization step, rather than assuming directory creation equals completion.

When to Apply

Use this skill when:

  • The task deliverable is a codebase, project, or directory structure
  • The deliverable must be exported or packaged as a ZIP file
  • You have already created the project files and directory structure

Common Pitfall

Do NOT assume that creating the project directory and files means the deliverable is complete. The ZIP archive itself must be explicitly created as a final step.

Step-by-Step Instructions

Step 1: Verify Project Structure

Before creating the ZIP, confirm all required files and directories exist:

ls -la ./project/
# or
find ./project -type f | head -20

Step 2: Create Dedicated Final Iteration

Add a final step/iteration specifically for ZIP creation. This should be a distinct action, not combined with other tasks.

Step 3: Execute ZIP Command

Run the zip command with recursive flag:

zip -r project.zip ./project

Or with a custom name:

zip -r <deliverable-name>.zip ./<project-directory>

Step 4: Verify ZIP Creation

Confirm the ZIP file was created successfully:

ls -lh project.zip
# Should show file size > 0
unzip -l project.zip | head -20
# Should list contents

Step 5: Report Completion

Explicitly confirm the ZIP deliverable has been created in your final response to the user.

Code Example

import subprocess
import os

def finalize_deliverable(project_dir="project", zip_name="project.zip"):
    """Create ZIP archive of project deliverable."""
    
    # Step 1: Verify project exists
    if not os.path.exists(project_dir):
        raise FileNotFoundError(f"Project directory {project_dir} not found")
    
    # Step 2: Create ZIP
    result = subprocess.run(
        ["zip", "-r", zip_name, f"./{project_dir}"],
        capture_output=True,
        text=True
    )
    
    if result.returncode != 0:
        raise RuntimeError(f"ZIP creation failed: {result.stderr}")
    
    # Step 3: Verify
    zip_size = os.path.getsize(zip_name)
    print(f"Created {zip_name} ({zip_size} bytes)")
    
    return zip_name

Checklist

  • All project files are created in the expected directory
  • A dedicated step is allocated for ZIP creation
  • zip -r <name>.zip ./<directory> command is executed
  • ZIP file existence and size are verified
  • Deliverable completion is explicitly confirmed to the user

Related Patterns

  • File creation should always include verification steps
  • Deliverables should be explicitly validated before marking tasks complete
  • Archive/export operations need their own iteration, not implicit completion
常见问题

用什么命令生成 ZIP?

技能使用带 -r 参数的 zip 命令,以包含所有子文件夹。

如何检查 ZIP?

技能列出该文件,以确认 ZIP 存在并显示其大小。

我可以自己选择 ZIP 的名称吗?

可以,技能展示了为压缩包指定自定义名称的方法。

详情

作者的原始描述

Ensures codebase deliverables are properly exported as ZIP archives through a dedicated finalization step

repo: HKUDS/AgentPilot

热度

GitHub 星标
7.8k
排名
#13035
许可证
MIT
更新时间
2026/11/1

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能