sxsphinxstack

Skills / Automate a task

Automate a task

Write a script that completes a repetitive task they actually do. Covers input, output, dry runs, logs, scheduling, and a safe off switch. Use when they mention a repetitive task, ask "can I automate this", or want a script that runs by itself.

Use this skill. Nothing to install.

Open in ChatGPT Open in Claude prefilled and ready; just hit send
for Gemini, Copilot, or Cursor: paste it, then say "use the automate a task skill"

Don't have an agent?  ·  Raw file: skills/automate-a-task.md

Watch the first two minutes

This is how a session goes, including the part everyone is afraid of. Click through it.

(pastes the skill) every monday i copy my shifts from the work site into my calendar and i hate it
Perfect chore: weekly, mechanical, and actually yours. First: does the work site have a feed or an export button anywhere, or is it read-off-the-page only?
just the page. but i'm nervous about a script running while i'm not looking. what if it trashes my files or spams something
Nothing destructive runs cold. Anything that renames, moves, or deletes gets a dry-run mode first: it prints what it would do and only touches copies until you've read the output twice. This particular script just reads a page and writes a calendar file, so the blast radius is tiny anyway.
my laptop is usually closed on monday mornings though
Then it runs in the cloud on a GitHub Actions schedule, free tier. Honest limits: the timing is best-effort, free minutes are capped, and schedules on inactive repos get suspended. All fine for a weekly chore.
how will i know it actually ran?
Every run writes a dated log line, and we trigger the workflow once by hand before trusting the clock. If a run fails, it fails loudly with a clear message and a nonzero exit instead of leaving half-finished work.

Scripted example of a real session.

What if it breaks something while I'm not looking?

The skill treats that fear as a design requirement. Destructive steps rehearse in dry-run mode against copies of real files before they earn the originals. Every run leaves visible output, so a silent failure has nowhere to hide. And the script does one job, readable top to bottom, so when the source page changes shape you can see exactly where it stopped. These are the kinds of chores people kill first:

Downloads janitor One email instead of three apps Price-drop watcher on a schedule

What you end up with

A script that does the real chore, on a schedule, with proof. Here is the shift script's log after its first unattended week.

Example
A WEEK OF RUNS, NOBODY WATCHING
$ tail runs.log
2026-07-13 07:02  ok    4 shifts found, calendar updated
2026-07-14 07:01  ok    no changes
2026-07-15 07:02  ok    no changes
2026-07-16 07:03  FAIL  page layout changed, wrote
                        nothing (exit 1)
2026-07-16 18:40  ok    selector fixed, 4 shifts found
2026-07-17 07:02  ok    no changes
2026-07-18 07:01  ok    1 shift added, calendar updated
THE README LINE
Runs every morning at 07:00 via GitHub Actions
(.github/workflows/shifts.yml). To stop it,
comment out the `schedule:` block.
  1. The failure is the best line in the log. The page changed shape, and the script wrote nothing rather than half a calendar, said why, and exited nonzero. That behavior was built in step 3, before scheduling.
  2. "No changes" is still a line. Visible output on every run is what makes an unattended script trustworthy; a quiet log means it ran and found nothing, a missing line means it didn't run.
  3. The off switch is documented. One README line says what runs, when, and how to turn it off. Future you will need exactly that.

Anatomy of a cron line

The five fields that scare everyone read left to right:

0 7 * * 1  python fetch_shifts.py

Questions people actually ask

Do I need a server for this?

No. Chores on your own machine run under cron or launchd. Chores that must run while your laptop is closed go in a GitHub Actions scheduled workflow on the free tier. Both cost nothing.

Is scraping a website allowed?

The skill has the script behave like a polite visitor: check robots.txt, fetch once per run, and prefer an official feed or API whenever one exists. If the site offers an export, that beats scraping every time.

Where do passwords and tokens go?

In an env var locally and in Actions secrets on GitHub. Never in the script, never committed. If the chore needs your login to a site, that's worth a pause to check the site's terms before automating.

Python or JavaScript?

Whichever you've touched. The skill favors plain files and standard tools over frameworks either way, so the script stays readable top to bottom.

What happens when the page changes shape?

The script fails with a clear message and a nonzero exit instead of producing half-finished work, and the dated log makes the failure visible. You fix the selector and re-run by hand, which the log above shows happening in real life.

Where to go from here

More chores worth killing:

School calendar feed A repo that maintains itself Chore rotation bot

Level the script up:

Use an API: richer data in Ship on GitHub: a repo of its own Train a model on the data it collects

Ideas to use it on

Curious? Read the full skill — the exact instructions your agent gets
---
name: automate-a-task
category: code
description: Write a script that completes a repetitive task they actually do. Covers input, output, dry runs, logs, scheduling, and a safe off switch. Use when they mention a repetitive task, ask "can I automate this", or want a script that runs by itself.
---

# automate-a-task

Automate a chore someone actually does: a script that does
the boring thing, then a scheduler that runs it without them. The
payoff is the shift in stance from doing tasks to writing things that
do tasks. It only lands if the chore is real.

## Ground rules

- Start from a real chore. Ask what they do every week that feels
  mechanical: checking a page for changes, sorting a downloads
  folder, collecting posts from feeds, reformatting a file for
  school or work. If the task is not theirs, there is no reliable way to verify
  whether it remains useful, so keep asking until one is.
- One script, one job, readable top to bottom. Python or Node,
  whichever they have touched; plain files and standard tools over
  frameworks. If it scrapes, respect the site: check robots.txt,
  fetch once per run, and prefer an official feed or API when one
  exists.
- Destructive steps get a rehearsal. Anything that renames, moves, or
  deletes runs in dry-run mode first, printing what it would do, and
  only touches copies of real files until the output has been read
  twice.
- Free scheduling only: cron or launchd on their machine, or a
  GitHub Actions scheduled workflow for anything that should run
  while their laptop is closed. Name the honest limits: Actions cron
  is best-effort timing, free minutes are capped, and schedules on
  inactive repos get suspended.
- Any key or token the script needs goes in an env var locally and
  in Actions secrets on GitHub. Never in the script, never committed.

## The path

1. Do the chore manually once, together, narrating each step. The
   narration is the spec; write it as comments before any code.
2. Script the core: input to output, run by hand, output checked
   against a manual pass of the same chore. Dry-run flag first if
   anything is destructive.
3. Harden lightly: the missing file, the page that changed shape,
   the empty feed. Fail with a clear message and a nonzero exit
   instead of half-finished work.
4. Schedule it. Local chore: a cron or launchd entry they write and
   can recite back. Cloud chore: a workflow YAML with `schedule:`,
   pushed, then triggered once by hand with `workflow_dispatch` to
   prove it runs before waiting for the clock.
5. Make results visible: the script writes a dated log line, commits
   an output file, or produces something they will notice. Silent
   automation is broken automation waiting to be discovered.
6. Let it run on its own at least once, then read the log together.

## Done

- A script in a repo that does the real chore end to end
- Scheduled and proven: at least one unattended run with visible
  output or log
- Destructive steps had a dry run; secrets live in env vars or
  Actions secrets only
- A README line saying what runs, when, and how to turn it off
- They can name the next chore they would automate

Then: use-an-api if the chore wants richer data, or ship-on-github
if the script deserves a repo of its own.