SuperAPI AI Directory

unzip

Office & productivity

View repository

Updated 10-15 17:30

About this skill

Unzip Skill

When the user asks to unzip (without specifying a file), find the most recently modified .zip file in the project and extract it to the project root.

Steps

  1. Find the zip file: Use Bash (find . -name "*.zip") to locate zip files. Glob may miss files with spaces in the name. Pick the most recently modified one. If multiple are found, tell the user which one you're using.

  2. Get the absolute path: Run pwd to get the project root absolute path (e.g. /root/app/code). Combine it with the filename to form the full path. Do NOT use command substitution ($(...)) — it is blocked by ACL. Instead, read the pwd output from the previous Bash call and construct the path manually as a string literal.

  3. Check if base64-encoded: Run:

    file "path/to/file.zip"
    

    If the output says "ASCII text" instead of "Zip archive data", the file is base64-encoded and must be decoded first.

  1. Decode if needed: If base64-encoded, decode it in-place using Node (never use base64 -d — it is blocked by ACL):

    node -e "const fs=require('fs'); const data=fs.readFileSync('/root/app/code/file.zip','utf8'); fs.writeFileSync('/root/app/code/file.zip', Buffer.from(data,'base64'));"
    

    Then verify with file again to confirm it's now a valid zip.

  2. Snapshot package.json: Before extracting, read and store the current contents of package.json (if it exists) so you can compare it after extraction.

  3. Extract it: Use the absolute path for both arguments:

    npx extract-zip "/root/app/code/Scope Engine V6.zip" /root/app/code
    

    Always use absolute paths — npx extract-zip requires the destination to be absolute.

  4. Check if package.json changed: After extraction, read package.json again and compare it to the snapshot from step 5. If the contents differ (or it didn't exist before), install dependencies:

    pnpm install --no-frozen-lockfile
    

    If pnpm install fails due to blocked builds, update pnpm-workspace.yaml to set allowBuilds entries to true and retry.

  5. Restart the dev server: If dependencies were installed, use the DevServerRestart tool to restart the dev server.

  6. Report: Tell the user what was extracted, whether deps were reinstalled, and whether the dev server was restarted.

If the user specifies a file or destination

  • If they give a specific zip path, use that instead of searching.
  • If they give a destination directory, use that instead of the project root.

Notes

  • tar is blocked by ACL in this environment — always use npx extract-zip instead.
  • base64 -d is blocked by ACL — always use the Node one-liner to decode base64-encoded zips.
  • npx extract-zip does not require a separate install step; npx handles it.
  • Command substitution ($(...)) is blocked by ACL — never use it. Always get pwd in a separate Bash call first, then hardcode the resulting path as a string literal in subsequent commands.
  • Glob tool may not find files with spaces in their names — prefer find . -name "*.zip" via Bash.
  • npx extract-zip requires an absolute path for the destination directory, not a relative ..