agentleFS
ExplorerFredaExplorerFreda/fskills/aws-sync/SKILL.md

aws-sync

Skill11 starsChanged 3 months agoApache-2.0View on GitHub

Sync a local directory to or from S3 with a dry run, a backgrounded transfer, and a progress-tracking watch command. Usage: /aws-sync <upload|download> <local_dir> <remote_dir> [--region <region>] [extra aws s3 sync flags...]

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Dry run first, always: Run in the foreground:

    line 36
  2. Very specific:

    Do not skip this even if the user approved a similar sync earlier in the conversation.

    line 49
  3. Very specific:

    Never hardcode an S3 bucket name or path -- it always comes from the remote_dir argument the user supplies.

    line 64
  4. Distinctive:

    Never skip the dry run, and never start the real transfer without explicit user confirmation shown against that dry run's numbers.

    line 66
  5. Very specific:

    Keep all log files under /tmp.

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Sync a local directory to or from S3, always dry-running first and running the real transfer in the background so it survives terminal/session disconnects.

Parse the argument string:

  • Token 1: mode, must be upload or download. If missing or not one of these two values, ask the user which mode they want rather than guessing.
  • Token 2: local_dir (a local filesystem path).
  • Token 3: remote_dir (the full S3 path, e.g. s3://some-bucket/some/prefix, including the bucket). Never hardcode a bucket name or path in this skill -- the bucket always comes from whatever the user passes as remote_dir.
  • Remaining tokens: optional flags. Recognize --region <value> (default to us-east-1 if not given); pass any other flags through verbatim to aws s3 sync.

Determine source and destination from mode:

  • upload: source = local_dir, destination = remote_dir
  • download: source = remote_dir, destination = local_dir

Derive a job name from the basename of local_dir, with any character outside [A-Za-z0-9_-] replaced by _. Use it to name log files, always under /tmp:

  • dry run log: /tmp/aws_sync_<job_name>_dryrun.log
  • real transfer log: /tmp/aws_sync_<job_name>.log

Steps:

  1. Validate paths.
    • upload: confirm local_dir exists (ls -ld <local_dir>). If it doesn't, stop and report -- do not create it.
    • download: create local_dir if needed (mkdir -p <local_dir>) since it's the destination.
  2. Dry run first, always. Run in the foreground:
    aws s3 sync <source> <destination> --region <region> --dryrun [extra flags] > <dryrun_log> 2>&1
    Then get the file count with wc -l < <dryrun_log>.
  3. Report before doing anything real. Tell the user the mode, source, destination, region, and the file count from the dry run. If the count is 0, report that everything is already in sync and stop -- do not proceed to step 4.
  4. Confirm before the real transfer. This moves real data into or out of cloud storage and can overwrite existing objects/files, so always confirm with the user before proceeding past the dry run -- show them the file count and both paths. Do not skip this even if the user approved a similar sync earlier in the conversation; each new local_dir/remote_dir pair needs its own confirmation.
  5. Launch the real sync in the background, once confirmed:
    nohup aws s3 sync <source> <destination> --region <region> [extra flags] > <real_log> 2>&1 &
    disown
  6. Give the user a progress command, using the total captured in step 2:
    watch -n 5 'echo "<job_name>: $(wc -l < <real_log> 2>/dev/null || echo 0) / <total_from_dryrun>"'

Rules:

  • Never hardcode an S3 bucket name or path -- it always comes from the remote_dir argument the user supplies.
  • Never skip the dry run, and never start the real transfer without explicit user confirmation shown against that dry run's numbers.
  • Keep all log files under /tmp.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.