Skip to content
Skills Library
Programming · Building & coding

shell-extract-template

/shell-extract-template

Use when template-law refuses shell code, when scan lists repeated shell, or when copying a script to start another.

Licence
MIT
Last repository change
11.11.2026

Assessment and security

96/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content31 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 11.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when template-law refuses shell code, when scan lists repeated shell, or when copying a script to start another.

Original author description

Use when template-law refuses shell code, when scan lists repeated shell, or when copying a script to start another.

How it works

SKILL.md has no level-two headings · 29 lines, 182 words

SKILL.md preview
---
name: shell-extract-template
description: Use when template-law refuses shell code, when scan lists repeated shell, or when copying a script to start another.
---

# Extract a shell repeat into one template (one job: pick the shell form, and move every copy to it)

Follow `make-it-a-template`. This skill is its shell forms.

<constraints>
Always do:
1. A repeated block: one function in the shared file, what differs as its arguments, read into named locals.
   ```bash
   wait_for_file() {
     local file="$1" what="$2"
     wingate_wait "$pid" "[ -s '$file' ]" || exit 1
     [ -s "$file" ] || { echo "FAIL no $what" >&2; exit 1; }
   }
   ```
2. One command with other arguments: a table and one loop.
   ```bash
   rows=("a silent slot|PLANT_SILENT" "a dead key|PLANT_DEAD")
   for row in "${rows[@]}"; do expect_fail "${row%%|*}" env "${row##*|}=1" "$gate"; done
   ```
3. Source the shared file by its own location, so it works from any folder: `. "$(dirname "$0")/lib.sh"`.
4. A program pasted into a heredoc: move it to its own file and call it.
5. Run the scripts the change reaches. Then search for the old block: none is left.

Never do:
- Pass values through globals when an argument will do.
- Use `eval` to make a function general.
</constraints>

Versions

The database has no other skills named shell-extract-template.

Database snapshot: 13.11.2026 · package version 355a94b07cdd (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 96python-extract-template
    Use when template-law refuses Python code, when scan lists repeated Python, or when copying a Python file, class or block to change it.
  • 96rust-extract-template
    Use when template-law refuses Rust code, when scan lists repeated Rust, or when copying a Rust function, impl or module to change it.
  • 100review-shell-scripts
    Review all shell scripts against the Bash Script Convention. Use when you need to check script compliance or before committing changes.
  • 100shell-review
    Audits shell scripts for correctness, portability, and common pitfalls. Use when reviewing shell scripts or before committing shell changes.
  • 100shell-expert
    Shell scripting: bash, zsh, POSIX, CLI tools, cross-platform automation. Use when writing shell scripts, pipes, command-line automation, or portable shell code.
  • 100bun-shell
    Bun shell scripting with Bun.$, Bun.spawn, subprocess management. Use for shell commands, template literals, or command execution.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.