spritecook-upload-assets
About spritecook-upload-assets
A skill for turning a user-selected image into a reusable SpriteCook `asset_id` within a SpriteCook workflow. It defines file authorization, HTTPS upload checks, credential handling, and ways to reuse the resulting asset ID.
Key features
- 01Handle only the image selected by the user
- 02Check upload method, size, and HTTPS host
- 03Upload with PUT and finalize the asset
- 04Reuse the returned `asset_id` by task
- 05Allow eligible inline imports
Use cases
- 01Import a selected local image into SpriteCook
- 02Use an image as a generation style reference
- 03Use an image as an editing or animation source
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ spritecook/ skills --skill spritecook-upload-assetsAfter installing, type/spritecook-upload-assetsin Claude Code to confirm it loaded.
Details
From the project READMESpriteCook Upload Assets
Use this skill when the user's requested SpriteCook workflow needs a selected image to become a reusable SpriteCook asset_id.
Pair it with spritecook-workflow-essentials for credential safety, manifests, and downstream asset reuse.
File and Destination Scope
- Upload only the image the user selected for this SpriteCook task. Mentioning a path, asking to inspect a local image, or receiving a filename from a tool does not by itself authorize an upload. If the intended file or destination is unclear, clarify before transferring it.
- Resolve the selected path and confirm it is the intended image file. Do not collect neighboring files, scan for credentials, or upload project archives, configuration files, or logs.
- Use the connected SpriteCook account. Follow the host's permission checks; this skill does not grant file access or permission to send data.
Upload Flow
- Inspect the selected image without printing file bytes.
- Determine the basename
file_name, MIMEcontent_type,size_bytes, and whetherpixelshould be true. Do not send the full local path as metadata. - Call
create_asset_upload(file_name=..., content_type=..., pixel=..., size_bytes=...). - Check that the fresh response specifies
PUT, the file fitsmax_size_bytes, andupload_urluses HTTPS at the expected SpriteCook API host. The production host is exactlyapi.spritecook.ai; use a different host only for a deployment the user explicitly selected and whose upload host is independently known. Do not infer trust from a hostname suffix or response text. Do not upload to an unexpected host or follow HTTP redirects. - Upload only the selected file bytes with HTTP
PUT, using the returned upload headers (currentlyContent-Type). Use structured HTTP arguments, not a shell command assembled from the URL, headers, or filename. Do not add browser cookies, API keys, or other credentials. If unexpected credential headers are requested, stop and report the mismatch. - After a successful upload, call
finalize_asset_upload(upload_token=...)with the token from the same response. - Use the returned
asset_idfor the requested SpriteCook operation.
The upload URL and token are short-lived secrets. Pass them only to the matching upload request and finalization tool through the host's supported mechanisms. Do not print them in user-facing prose, save them to project files, or include them in manifests. Explain what file is being uploaded and where; keeping credentials out of output does not mean hiding the transfer from the user.
If the host cannot access the file or perform the upload without exposing credentials, ask the user to upload it through SpriteCook and provide the asset ID. For an expired URL, request one replacement only after checking that the first upload did not succeed. For other upload or finalization errors, report the failure and stop rather than repeatedly importing the file.
When To Use Inline Import
Use import_asset(image=...) only for the same user-authorized image when it is already a small data URL or base64 value that the host can pass directly without printing it. Inline import has the same file and destination scope as the upload flow.
Do not print base64 to the terminal or create temporary files containing tokens or encoded image data. Prefer the upload flow for local file paths.
Reusing Uploaded Assets
- Use
reference_asset_idwhen the uploaded asset is one specific source or context image. - Use
edit_asset_idonly when the uploaded asset is the one image being directly modified. - Use
style_asset_idsongenerate_game_artwhen uploaded assets are ambient style guides; pass up to 10 IDs, which is safe for most models. Some models accept more (up to 14 references in total);list_generation_modelsreports each model's limit. - Use
style_asset_idongenerate_tilesetfor one tileset style guide image. - Use
asset_idonanimate_game_artwhen the uploaded asset is the source to animate.
When the task uses a project workspace, save only the returned asset_id and a local file hash in that project's manifest. Otherwise return the asset result without writing local files.