Quick Ref / Command

Marketing Kit

/ak:storage

S3-compatible object storage

S3-compatible object storage helper for marketing assets across Cloudflare R2, AWS S3, MinIO, Backblaze B2, and DigitalOcean Spaces.

01

Identify Operation

02

Check Config

03

Check SDK

04

Choose Provider

Rule 01

Marketing assets can use any S3-compatible backend as long as endpoint, bucket, keys, and region are configured.

Rule 02

The skill returns shareable public URLs when S3_PUBLIC_URL or provider URLs are available.

Rule 03

Fallback behavior is intentional: unconfigured storage should not break local asset workflows.

Rule 04

Credentials are never displayed; use least-privilege bucket-scoped access tokens.

Execution Map

Core lanes from input to output, aligned with the command's real execution path.

01

Start

Input, scope, route

  1. 1 Identify Operation Decide whether the user needs upload, download, list, get public URL, delete, sync, or local-only fallback.
  2. 2 Check Config Look for S3_ENDPOINT, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_BUCKET, optional region, and public URL.
02

Work

Agent / skill execution

  1. 3 Check SDK Confirm @aws-sdk/client-s3 is installed; otherwise return configured fallback errors.
  2. 4 Choose Provider Map endpoint shape to Cloudflare R2, AWS S3, MinIO, Backblaze B2, DigitalOcean Spaces, or compatible storage.
03

Verify

Gate, review, validation

  1. 5 Run Client Use s3-client.cjs for upload, download, list, getPublicUrl, or remove operations.
  2. 6 Return URL or Path Return public CDN URL when configured, provider URL when available, or local path only on fallback.
04

Close

Report, handoff, artifact

  1. 7 Handle Failure When not configured, all operations return graceful errors and no exceptions are thrown.

Modes / Routes

upload(localPath, remotePath, options)

Client operation that reads a local marketing asset and sends PutObject when approved.

Research:
Config + path
Review:
Secret exposure
Validate:
Upload result
download(remotePath, localPath)

Client operation that creates parent directories and writes downloaded bytes.

Research:
Object key
Review:
Wrong key
Validate:
Local file
list(prefix, maxKeys)

Client operation that sends ListObjectsV2 for a bounded prefix.

Research:
Prefix
Review:
Overbroad list
Validate:
Object list
remove(remotePath)

Client operation that deletes exactly one approved key.

Research:
Object key
Review:
Wrong deletion
Validate:
Remove result
exists(remotePath)

Client operation that sends HeadObject and returns an existence result.

Research:
Object key
Review:
Auth vs missing
Validate:
Existence result
getPublicUrl(remotePath)

Client operation that constructs a URL without sending a provider request.

Research:
Public URL config
Review:
Private bucket
Validate:
URL string
sync(localFolder, remotePrefix, options)

Client operation that scans a local folder; dry run previews file-to-object mapping without upload.

Research:
Folder mapping
Review:
Unexpected writes
Validate:
Dry-run mapping

Sample Prompt

Concrete invocations for each flag, subcommand, mode, or route available in the live workflow.

Upload asset Recommended
/ak:storage "Upload assets/images/launch-hero.png to campaign/launch/hero.png only after approval; return the URL if configured"
Use when:
You need a generated marketing asset hosted remotely.
Expected:
The client reads the local file, sends PutObject when approved, and returns a public URL or a graceful unconfigured fallback instead of throwing.
Download object
/ak:storage "Download designs/pricing-deck.html to assets/slides/pricing-deck.html after confirming the key"
Use when:
You need one approved remote object written to a local path.
Expected:
The download operation creates parent directories and writes the object bytes to the requested local path, or reports a missing-key or config error without crashing.
List folder
/ak:storage "List approved remote keys under designs/ without deleting or uploading anything"
Use when:
You need to inspect remote asset keys under a prefix.
Expected:
ListObjectsV2 returns a bounded object list for that prefix, or a fallback status when credentials or the SDK are missing.
Remove key
/ak:storage "Remove exactly the approved key drafts/old-banner.png and no other objects"
Use when:
You must delete one approved object and nothing else.
Expected:
The remove operation deletes that single approved key and reports success or a bounded failure without walking the bucket.
Exists check
/ak:storage "Check whether campaign/launch/hero.png exists with HeadObject and do not download it"
Use when:
You only need to know if one remote key is present.
Expected:
HeadObject returns an existence result for that key, distinguishing missing objects from auth or config failures.
Public URL
/ak:storage "Use getPublicUrl for designs/pricing-deck.html without making a provider request"
Use when:
You need a shareable URL for an already uploaded asset.
Expected:
getPublicUrl builds a custom-domain or provider URL from config without sending a request to the bucket.
Sync assets
/ak:storage "Preview syncing assets/slides/ to slides/ as a dry run; show every object key and wait before upload"
Use when:
You want a local asset folder mirrored to remote storage.
Expected:
The sync dry run lists every local-file-to-object mapping and waits for approval before any PutObject.

Handled Scope

  • S3-compatible storage
  • Cloudflare R2
  • AWS S3
  • MinIO
  • Backblaze B2
  • DigitalOcean Spaces
  • Asset URLs
  • Graceful fallback

Next