SuperAPI AI Directory

media-organizer

General & other

View repository

Updated 10-15 17:31

About this skill

Media File Organization Workflow

This Skill guides organizing a directory containing cluttered media files into a standardized structure within this project. This workflow emphasizes collaboration with the user to ensure the final organization method meets the user's needs.

Step 1: Determine the source directory

  1. Ask the user to provide the absolute or relative path of the directory containing the media files to be organized.
  2. Confirm that the path provided by the user is valid and accessible. If invalid, notify the user and request the correct path.

Step 2: Propose an organization plan

  1. Use the ls -R <source_directory> command to list the files in the source directory to understand its contents.
  2. Clarify file contents:
    • For files whose filenames are unclear and whose contents or classification cannot be directly determined, proactively ask the user to obtain accurate information.
    • If the filename contains numbers, confirm their meaning with the user, for example whether it is a "version number" (_v...) or an "example number" (_no...)。
  3. Based on filenames and types, propose a set of subcategories. The default categories are as follows:
    • community-content: used to store content from external sources (such as YouTube reviews, articles, etc.).
    • internal-demos: used to store demos and use cases created by the internal team.
    • generated-examples: used to store content automatically generated by models.
    • assets: used to store auxiliary materials (such as logos, covers, countdown videos, etc.).
  4. Based on the project's GEMINI.md file, propose file naming conventions. The default is:{YYYYMMDD}_{分类}_{描述}_{编号}.{后缀}。
    • Important: {YYYYMMDD} must use the file'slast modified time (stat command) rather than the date contained in the filename.
  5. Generate a complete file migration plan, mapping each old file path to a proposed new file path. Present it to the user in a clear format (such as a Markdown table or list).
  6. Pause and request user confirmation. Ask the user to review the proposed categories, naming conventions, and the complete migration plan. Do not proceed until explicit user approval is obtained. Allow the user to propose modifications to the plan.

Step 3: Execute the migration

Once the user approves the plan:

  1. Create the new subcategory directories (for example, using mkdir -p ...)。
  2. Run the mv command for each item in the approved plan to perform the file migration. The safest way is to execute them one by one or in small logical batches.
  3. After all files have been moved, clean up the source directory. This may include deleting subdirectories that have become empty and any system junk files (such as .DS_Store). Before executing rm -rf , confirm this cleanup operation with the user.

Step 4: Generate documentation

  1. Generate a README.md file for each newly created category directory.
  2. Use the template located at skills/media-organizer/assets/readme.md.template to create the content.
  3. README.md should briefly describe the category and may include links to several key files as examples.
  4. Update the parent directory's README.md to reflect the new, organized structure, making new content easy to discover.

Step 5: Final review

  1. Notify the user that the organization, cleanup, and documentation process is complete.
  2. Use the ls command to display the new directory structure.
  3. Ask the user whether they are satisfied with the result.