Learn-skills.dev do-nothing-scripting
Derive a do-nothing bash script from an asciinema .cast file, a plain text file, shell history output, or a user interview — encoding each observed command as a manual step that prompts the operator before proceeding.
git clone https://github.com/NeverSight/learn-skills.dev
T=$(mktemp -d) && git clone --depth=1 https://github.com/NeverSight/learn-skills.dev "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/skills-md/abuxton/skills/do-nothing-scripting" ~/.claude/skills/neversight-learn-skills-dev-do-nothing-scripting && rm -rf "$T"
data/skills-md/abuxton/skills/do-nothing-scripting/SKILL.mdDo-Nothing Scripting
Inspired by Dan Slimmon's do-nothing scripting pattern, this skill converts a command sequence — from any source — into a do-nothing bash script: a runnable procedure that walks an operator through each step manually, while making each step trivially replaceable with real automation later.
Role
You are an expert in shell scripting, automation strategy, and the do-nothing scripting pattern. You understand:
- How to read asciinema v3
files and extract the sequence of commands a user ran.cast - How to parse plain text files and shell history output to extract command lists
- How to interview a user to elicit the steps of a manual procedure
- How to identify logical groupings of commands into named steps
- How to write idiomatic, safe bash following modern best practices
- How to structure a do-nothing script so each step can be independently automated over time
- How to surface context variables (usernames, paths, URLs) that a step depends on
Input Modes
This skill accepts four input modes. Choose the mode that matches what the user provides:
| Mode | When to use | Example |
|---|---|---|
| cast | An asciinema recording exists | |
| text | A plain text file lists the commands, one per line | |
| history | The user wants to derive a script from recent shell history | |
| interview | No input file is available; gather steps interactively | (ask the user) |
Do-Nothing Scripting Principles
A do-nothing script:
- Does not execute the steps — it prints instructions and waits for the operator to act
- Encapsulates each step in a function so any step can later be replaced with real automation without changing the rest of the script
- Collects context (dynamic values like usernames or ticket IDs) by prompting the operator once and threading the values through subsequent steps
- Lowers the activation energy for full automation by making the gap between "manual" and "automated" a single function rewrite
Workflow
-
Determine the input source — Ask the user which input mode applies if it is not already clear:
- cast:
"Do you have an asciinema .cast file? If so, what is the path?" - text:
"Do you have a text file listing the commands? If so, what is the path?" - history:
"Would you like to use your recent shell history? Run: history <N> > /tmp/history.txt" - interview:
Continue asking"I don't see an input file. Let's build the script together — what is the first step in your procedure?"
until the user says there are no more steps. Record each step description as a command line in"What is the next step?"
, then proceed as for the text mode./tmp/<name>_steps.txt
- cast:
-
Extract the command list — Use
to pull the command sequence. The script auto-detects the format, or you can override withreferences/extract_commands.py
:--format=# auto-detect (cast, history, or text) python3 skills/do-nothing-scripting/references/extract_commands.py ./tmp/<name>.cast # explicit formats python3 skills/do-nothing-scripting/references/extract_commands.py --format=cast ./tmp/<name>.cast python3 skills/do-nothing-scripting/references/extract_commands.py --format=history ./tmp/history.txt python3 skills/do-nothing-scripting/references/extract_commands.py --format=text ./tmp/steps.txtThe script prints each detected command prefixed with its sequence number. Review the output and discard noise (shell prompts,
, incidentalclear
calls that are part of navigation rather than procedure).cdCapturing history directly:
history 20 > /tmp/history.txt python3 skills/do-nothing-scripting/references/extract_commands.py --format=history /tmp/history.txt -
Group commands into logical steps — Examine the command list and cluster related commands into named steps. Good step names are verb phrases that describe what a human does, not what the computer does:
(notcreate_feature_branch
)git_checkout
(notupdate_config_file
)sed
(notwait_for_pipeline
)watch
Aim for 1–5 commands per step. A step that is a single trivially-automatable command is fine and desirable.
-
Identify context variables — Note any values that will differ between runs: usernames, branch names, ticket IDs, environment names, file paths. These become context variables, collected once in
and passed to step functions.main() -
Write the do-nothing bash script — Generate the script following the template in
. Rules:references/do_nothing_template.sh- Shebang:
#!/usr/bin/env bash - Safety flags:
immediately after the shebangset -euo pipefail - One function per step, named
step_<snake_case_name>() - Each function:
- Prints a heading:
echo "==> Step N: <Human readable name>" - Prints each sub-command the operator must run, indented with spaces
- Calls
at the endwait_for_enter
- Prints a heading:
- A
utility function usingwait_for_enter()read -rp - A
function that prompts for all context variablescollect_context() - A
function that callsmain()
then each step in order, finishing withcollect_contextecho "✓ Done."
as the last line of the filemain "$@"
- Shebang:
-
Annotate automation potential — Add an inline
comment on functions whose body is a single deterministic command. This signals which steps are lowest-effort to convert from manual to automated.# TODO: automate -
Write the script to
and make it executable:./tmp/<name>_do_nothing.shchmod +x ./tmp/<name>_do_nothing.sh -
Validate the script — Run:
bash -n ./tmp/<name>_do_nothing.shFix any syntax errors reported before presenting the result.
-
Present a summary — Show the operator:
- The path to the generated script
- The list of steps and their automation potential
- A note on which context variables are required at runtime
Notes
- Format auto-detection:
inspects the first line for a JSON header (cast), checks whether the majority of lines matchextract_commands.py
(history), and falls back to plain-text otherwise. UseN command
to override when auto-detection is incorrect.--format= - If the cast file contains only
(output) events and no"o"
(input) events,"i"
falls back to parsing command prompts from the output stream. Results may be less accurate; review carefully.extract_commands.py - Text file format: Lines beginning with
are treated as comments and skipped. Blank lines are ignored.# - History format: Accepts the output of
(bash/zsh), which prefixes each line with a sequence number:history
.N command - Do-nothing scripts are not meant to be run in CI or automation pipelines — they are operator guides. Do not add flags or logic that suppress the interactive prompts.
- When a step involves waiting for an external system (a build, a deploy, a human approval), represent it as a
pause with clear instructions — do not attempt to poll or sleep.wait_for_enter - Step functions should remain pure: no side effects, no file writes, no network calls. The only action they take is printing and waiting.
- Prefer
overprintf
for portable output when the string may contain escape sequences; useecho
for simple prose lines.echo