Ensures codebase deliverables are properly exported as ZIP archives through a dedicated finalization step
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-zip-export-deliverable-8ba43cc7378e ,按照其中的说明把「zip-export-deliverable」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
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.
Use this skill when:
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.
Before creating the ZIP, confirm all required files and directories exist:
ls -la ./project/
# or
find ./project -type f | head -20
Add a final step/iteration specifically for ZIP creation. This should be a distinct action, not combined with other tasks.
Run the zip command with recursive flag:
zip -r project.zip ./project
Or with a custom name:
zip -r <deliverable-name>.zip ./<project-directory>
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
Explicitly confirm the ZIP deliverable has been created in your final response to the user.
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
zip -r <name>.zip ./<directory> command is executed