AgentSkillsCN

existing-destination-only-upload

对文件上传严格执行目标文件夹政策。在处理数据摄取、同步或传输流程时使用,要求只有在目标文件夹已存在的情况下方可上传文件。切勿自动创建缺失的目标文件夹;而应返回明确的错误信息,并跳过该文件夹。

SKILL.md
--- frontmatter
name: existing-destination-only-upload
description: Enforce strict destination-folder policy for file uploads. Use when handling ingestion, synchronization, or transfer workflows where files must be uploaded only if the destination folder already exists. Never create missing destination folders automatically; instead return a clear error and skip that folder.

Existing Destination Only Upload

Apply these rules on every upload workflow:

  1. Resolve destination base directory from configured runtime settings.
  2. For each requested folder, search for an existing destination folder with the same name inside the destination base.
  3. If the destination folder exists, continue upload for that folder.
  4. If the destination folder does not exist, stop processing that folder and return an explicit error.
  5. Never call folder-creation logic for missing destination folders.
  6. Keep behavior per-folder, not global:
    • Existing folders upload normally.
    • Missing folders fail with clear error.
  7. Report final result with counts:
    • ok: folders uploaded
    • error: folders rejected for missing destination

Use this error message pattern:

text
No existe carpeta destino con nombre '<folder_name>' dentro de BASE_STORAGE_DIR.

Before executing batch uploads, validate destination readiness:

  1. Enumerate source folder names to upload.
  2. Enumerate existing destination folders in BASE_STORAGE_DIR.
  3. Show a preflight summary of:
    • folders allowed (exist)
    • folders rejected (missing)