# Create the .skill file (zip format) try: with zipfile.ZipFile(skill_filename, "w", zipfile.ZIP_DEFLATED) as zipf: # Walk through the skill directory for file_path in skill_path.rglob("*"): # Security: never follow or package symlinks. if file_path.is_symlink():
print(f"[WARN] Skipping symlink: {file_path}") continue
rel_parts = file_path.relative_to(skill_path).parts if any(part in EXCLUDED_DIRS for part in rel_parts): continue
if file_path.is_file():
resolved_file = file_path.resolve() ifnot _is_within(resolved_file, skill_path):
print(f"[ERROR] File escapes skill root: {file_path}") returnNone # If output lives under skill_path, avoid writing archive into itself. if resolved_file == skill_filename.resolve():
print(f"[WARN] Skipping output archive: {file_path}") continue
# Calculate the relative path within the zip.
arcname = Path(skill_name) / file_path.relative_to(skill_path)
zipf.write(file_path, arcname)
print(f" Added: {arcname}")
print(f"\n[OK] Successfully packaged skill to: {skill_filename}") return skill_filename
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.