agentleFS
bettyguobettyguo/browser-skills/skills/upload-download-file/SKILL.md

upload-download-file

Skill8 starsChanged 7 months agoMITView on GitHub

Uploads a local file to an HTML5 file input, or triggers a download and captures the resulting path. Composes with multi-step-form for file-attaching workflows.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    macOS sandboxing of Playwright file uploads: if Playwright runs in a security context that can't read ~/Documents, uploads silently fail.

    line 64

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

Upload / Download File

When to invoke

The user task requires uploading a local file or capturing a download. The agent provides the file path in vars.file_path (uploads) or a target directory in vars.download_dir (downloads).

The matcher hits this skill when an <input type="file"> is present on the page.

Recipe

Upload mode (vars.mode = "upload" or auto-detected via input[type=file] presence)

  1. wait_for_selector selector="input[type='file']" state=attached timeout=5s
  2. fill selector="input[type='file']" value="$vars.file_path"
  3. wait extra=300ms

Download mode (vars.mode = "download")

Downloads in headless browsers route through the browser's download API; this skill stubs the recipe for now and defers to the runner's download event handler (M5 wiring).

Success criteria (upload mode)

  • assert input_type_file_has_files selector="input[type='file']"

When NOT to use

  • File-attach widgets that don't use a real <input type="file"> (proprietary drag-and-drop). Vision fallback or a per-site bespoke approach.
  • Multi-file uploads requiring drag-drop reorder. Not in v0.1.

Known failures

  • Sites that gate file inputs behind a click-to-reveal: the input isn't attached until a wrapper button is clicked. Run a click primitive first; spec your agent to chain.
  • Server-side validation of file size / type: the skill submits; the agent reads validation errors via the form's error-message recipe.
  • macOS sandboxing of Playwright file uploads: if Playwright runs in a security context that can't read ~/Documents, uploads silently fail. Document in the agent's expected setup.

Related skills

  • fill-multi-step-form — common parent flow
  • verify-page-loaded — run before to ensure the file input has rendered

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.