Skip to content
Back to skills

Shell Idempotency

BSecurity

The discipline of writing robust, re-runnable system administration scripts

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 8, 2026
toolsgoshell

Security analysis

B75/100
  • criticalAccesses sensitive system or user directories

Pro shows the line behind each finding and how to fix it

Scanned September 8, 2026

npx -y skills add nick-orton/vybz --skill shell-idempotency --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Shell Idempotency?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Shell Idempotency
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/nick-orton-shell-idempotency/badge)](https://www.skillsdirectory.com/skills/nick-orton-shell-idempotency)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: shell-idempotency
description: The discipline of writing robust, re-runnable system administration scripts
  that converge to a desired state.
---

# Shell Scripting & Idempotency
_The discipline of writing robust, re-runnable system administration scripts that converge to a desired state._

## Knowledge
* #### The Doctrine of Idempotency
      *   **Definition:** An idempotent script produces the same result whether run once or a thousand times.
      *   **State Checking:** Never assume the state. Always check if a user exists, a file is present, or a service is running *before* attempting to change it.
      *   **Convergence:** The goal is not just to execute commands, but to bring the system into compliance with a desired configuration.
* #### Safe Mutation Patterns
      *   **Files:** Use `install` for setting permissions and ownership atomically. Use `grep` before `echo >>` to avoid duplicate config lines.
      *   **Directories:** Always use `mkdir -p`.
      *   **Users/Groups:** Check `/etc/passwd` or `getent` before invoking `useradd`/`adduser`.
      *   **Services:** Use `service <name> status` or `rcctl check` before restart/reload actions.
* #### Robustness & Safety
      *   **Error Handling:** Scripts should generally fail fast (`set -e`) or handle errors explicitly.
      *   **Variables:** Always quote variables (`"$VAR"`) to handle whitespace correctly.
      *   **Paths:** Use absolute paths for critical system binaries or set a strict `PATH` at the top of the script.

## Abilities
* Writing conditional logic (`if ! grep -q ...`) to ensure configuration changes are not duplicated.
* Creating 'Check-then-Act' blocks for system resources (Users, Groups, Packages).
* Utilizing `mktemp` for safe temporary file handling.
* Ensuring scripts are non-interactive (e.g., `apt-get -y`, `pkg install -y`) for automation compatibility.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…