shell-scripting

shell-scripting is a skill for Claude Code from kouroshez/coding-os. It costs 155 tokens per session (1,876 once invoked), scanned C, original, Apache-2.0.

A guide for writing reliable Bash and Python command-line scripts, including scripts used by builds, hooks, CI, and automation. It treats each script as a clear contract: accept inputs, do one job, show progress, and stop on unexpected errors.

In plain words
What is it for?
Use it to create or review shell scripts, Makefile targets, CI steps, deployment commands, and other command-line automation.
Why use it?
It reduces silent failures, hardcoded environment assumptions, unsafe reruns, and output that is difficult for people or tools to understand.

Skill for Claude Code

Written for Claude Code: paths in frontmatter. Also seen: positional $N argument.

Good fit Use it to create or review shell scripts, Makefile targets, CI steps, deployment commands, and other command-line automation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kouroshez/coding-os/shell-scripting
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add kouroshez/coding-os --skill shell-scripting
Clone the repo
git clone --depth 1 https://github.com/kouroshez/coding-os

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for shell-scripting

README.md
[![agentmods](https://agentmods.dev/badge/skills/kouroshez/coding-os/shell-scripting.svg)](https://agentmods.dev/skills/kouroshez/coding-os/shell-scripting)
Your own site
<a href="https://agentmods.dev/skills/kouroshez/coding-os/shell-scripting"><img src="https://agentmods.dev/badge/skills/kouroshez/coding-os/shell-scripting.svg" alt="Measured on agentmods" height="20"></a>
Per session 155 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,876 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00155 $0.01876
Opus 5 $0.00077 $0.00938
Sonnet 5 $0.00031 $0.00375
Haiku 4.5 $0.00015 $0.00188

Measured 4d ago against content hash a16b6fa84938, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade C, and why

shell-scripting scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/lint_script.sh, scripts/new_script.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf ./*

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

# Wrong — pipefail off: the pipeline "succeeds" even though curl failed
src/core/skills/shell-scripting/SKILL.md · 129 lines

How it starts

The opening of the file, as written. The whole thing — 129 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Shell & CLI Scripting

A script is a contract: given inputs, do exactly one job, report a precise result, fail loud on anything unexpected. A script that hardcodes a path, swallows errors, or prints a paragraph the caller must parse is a liability — it breaks silently in the next environment and taxes every agent that runs it. This skill makes "robust, data-driven, observable" the default shape.

Scaffold a compliant script instead of hand-writing the boilerplate: python3 scripts/new_script.py --lang bash --name deploy --root . Lint an existing one against the discipline: bash scripts/lint_script.sh path/to/script.sh

The seven non-negotiables

Every script — Bash or Python — satisfies all seven. The checklist in assets/script-checklist.md is the ship gate.

  1. Runtime arguments, never hardcoded. Inputs come from flags with sane defaults. No literal machine paths, no baked-in hostnames, no magic constants buried in the body.
  2. Fail-closed. Any unmet precondition or sub-command failure stops the script with a non-zero exit and a message — never continue on error.
  3. Idempotent. Re-running is safe: detect already-done state, refuse to clobber (or require --force).
  4. Observable. Progress to stderr for anything slow; a final, parseable result (one line or --json) on stdout.
  5. Precise output. stdout is the result a caller consumes; stderr is narration. Never mix them.
  6. Algorithmically honest. No O(n²) where a set/index is O(n). Stream large inputs; bound memory. State complexity when non-obvious.
  7. Documented header. PURPOSE / INPUT / OUTPUT / DEPENDENCIES / NOTES at the top — the contract in five lines.

Bash — the robust preamble (copy, don't retype)

#!/usr/bin/env bash
# deploy.sh — PURPOSE: ... / INPUT: ... / OUTPUT: ... / DEPS: ... / NOTES: ...
set -euo pipefail          # -e exit on error · -u unset var is error · -o pipefail catch piped failures
IFS=$'\n\t'                # safe word-splitting (no space-splitting surprises)

cleanup() { rm -f "${_tmp:-}"; }
trap cleanup EXIT          # run on ANY exit path — success, error, or signal

Read the full file on GitHub · 129 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 129 lines · 155 tokens per session scan C a16b6fa84938

Subscribe to this mod's changes

shell-scripting is a skill published in the GitHub repository kouroshez/coding-os (6 stars, last pushed yesterday), licensed Apache-2.0. It adds 155 tokens to every session and 1,876 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

graph-mutation-plan

Cookbook for composing an applygraphmutations plan — stable entitykey patterns, the canonical label/edge vocabulary, evidence/invalidation/confidence discipline, and a worked example. Load this when building a non-trivial mutation plan.

potpie-ai/potpie · 51 tokens

potpie-cli

Use when the task is centered on running, explaining, configuring, or troubleshooting the potpie command: doctor, login, pot management, source registration, search, graph workbench reads/writes, and pot scope behavior.

potpie-ai/potpie · 50 tokens

potpie-change-timeline

Use when an agent needs recent or historical change context: what changed recently, regressions, merged PRs, tickets, docs, incidents, deployments, releases, and source-history ingestion.

potpie-ai/potpie · 43 tokens

potpie-infra-architecture

Use for project infra and architecture context: environments, adapters, runtime configuration, deployments, service dependencies, datastores, API contracts, ownership, incidents, and dependency blast radius.

potpie-ai/potpie · 43 tokens

potpie-project-preferences

Use before writing, modifying, reviewing, refactoring, or testing code so repo/project preferences surface: error handling, file structure, frameworks, logging, dependency choices, testing, security, API style, and naming. Also use after code work when a reusable project preference should be recorded.

potpie-ai/potpie · 63 tokens

memstack-deployment-ci-cd-pipeline

Use this skill when the user says 'CI/CD', 'GitHub Actions', 'pipeline', 'continuous integration', 'continuous deployment', 'ci-cd-pipeline', 'automate deploys', or needs to set up automated build, test, and deployment pipelines. Do NOT use for one-time manual deployments.

cwinvestments/memstack · 73 tokens