{"slug":"shellscript-coder-2","title":"shellscript-coder","summary":"Implement and refactor production shell scripts, command-line tools, automation, process wrappers, and Git or infrastructure helpers with reliable failures, useful logs, and machine-readable output.","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-11-16T17:50:45.293399Z","repo":{"url":"https://github.com/sno-ai/sno-station-skills","stars":865,"forks":613,"license":"Apache-2.0","updatedAt":"2026-11-16T05:22:38Z"},"bodyHtml":"<hr>\n<h2>name: shellscript-coder\ndescription: \"Implement and refactor production shell scripts, command-line tools, automation, process wrappers, and Git or infrastructure helpers with reliable failures, useful logs, and machine-readable output.\"\nrequires:\nprograms: []\nharness:\n- {slot: 4.shell, need: required}\n- {slot: 4.file-read-write, need: required}</h2>\n<h1>Shell Script Coder</h1>\n<p>Every development task has a finite budget including setup, tests, and reporting.\nBefore running tests, estimate duration from available timings and identify the changed\nbehavior or directly affected consumer. If timing is unknown, state an estimate; do not\nbuild a timing system or run a preliminary suite. Full evaluation, unit, integration,\nor repository suites require the owner's explicit request, never a skill, PRD, review,\nor default command. Remove checks that neither prove the requested main function nor\nexpose its defects. Repeat only after a relevant change or failure.\nEvery new security check requires the owner's explicit approval for that specific check;\nremove auxiliary security, assertion, hash, or bookkeeping blockers of useful work.</p>\n<p>Write small, production-grade Bash that fits the repository and remains understandable during failure. Local instructions define the runtime and style; they may strengthen these rules but not weaken reliability.</p>\n<h2>Read Before Writing</h2>\n<ul>\n<li>Confirm the required shell from the shebang, callers, CI, and repository docs. Use Bash when the target is Bash; do not claim POSIX portability unless it is required and tested.</li>\n<li>Read the complete target script, immediate callers, sourced libraries, config, and nearby tests. Reuse existing argument, logging, state, and error conventions.</li>\n<li>Before changing a tool version, or using a third-party CLI, API, or service in a way neither the PRD nor existing scripts already show, read its current official documentation; for a version change, read the release notes between the two versions. Name the page and version in the report. When a PRD governs the work and lacks or contradicts that fact, add it to the PRD's execution notes.</li>\n<li>Decide the observable success result, failure result, exit codes, and verification command before editing.</li>\n<li>Preserve unrelated work. Touch only requested behavior and remove only orphans created by the change.</li>\n</ul>\n<h2>Boundaries</h2>\n<ul>\n<li>No backward-compatibility aliases, dual paths, legacy flags, or fallbacks unless the user confirms an external published contract requires them.</li>\n<li>No speculative options or abstractions. Prefer one explicit path over a configurable framework.</li>\n<li>Use deterministic shell or an existing deterministic helper for routing, parsing, retries, validation, and state transitions. Never ask a model to decide them.</li>\n<li>Never use <code>eval</code> or construct executable commands in strings. Use functions and arrays.</li>\n<li>Never print secrets, tokens, credential-bearing URLs, raw environment dumps, or sensitive command lines.</li>\n</ul>\n<h2>Reliability</h2>\n<ul>\n<li>Start new Bash scripts with <code>set -Eeuo pipefail</code> unless a documented caller contract makes one option incompatible. Handle expected nonzero statuses locally instead of globally weakening failure behavior.</li>\n<li>Quote every expansion unless intentional word splitting is proven and commented. Use arrays for argument lists, <code>--</code> before user-controlled paths, <code>[[ ... ]]</code> for tests, and <code>printf</code> rather than <code>echo</code> for data.</li>\n<li>Validate required arguments, enums, paths, and dependencies before mutation. Reject unknown flags and malformed state with a specific message and nonzero exit.</li>\n<li>Keep functions focused, use <code>local</code>, pass values explicitly, and avoid hidden mutable globals. Constants are uppercase and readonly where practical.</li>\n<li>Clean temporary files, locks, mounts, and child processes with traps or an explicit cleanup function. Preserve the original exit status.</li>\n<li>Write durable files atomically: create in the destination directory, flush when required, then rename. Never expose a partially written state file.</li>\n<li>Use <code>flock</code> or the repository's existing lock for shared state. Keep the critical section narrow and define what a lock timeout means.</li>\n<li>Make retryable operations idempotent. Bound retries, use a fresh observation before retrying, and distinguish “already completed” from “failed.”</li>\n<li>Bound external commands with a timeout when they can hang. Propagate signals to children and verify termination when orphaned processes would be harmful.</li>\n<li>For work that may exceed two minutes, emit per-unit progress with completed/total, rate, and ETA.</li>\n</ul>\n<h2>Messages and Agent-Facing Interfaces</h2>\n<p>Design messages as operational evidence, not narration.</p>\n<ul>\n<li>Keep stdout reserved for the primary result. Send progress, diagnostics, and errors to stderr. If <code>--json</code> is supported, stdout contains exactly one valid JSON result and no decoration.</li>\n<li>Error messages name: operation, target, failed condition, consequence, and the next safe action. Include relevant identifiers and paths; omit secrets and noisy stack traces unless a debug mode already exists.</li>\n<li>Progress messages identify the current stage and include stable context so a detached AI agent can tell which task and resource produced the line.</li>\n<li>Use stable, documented exit codes when callers branch on failure classes. Otherwise use <code>0</code> for success and a small nonzero set; do not invent dozens of codes.</li>\n<li>Prefer non-interactive flags and stdin over prompts. A command intended for agents must support <code>--help</code>, reject missing inputs immediately, and never wait silently for a terminal response.</li>\n<li>Make input contracts explicit: required flags, accepted values, path ownership, preconditions, and whether rerunning is safe.</li>\n<li>Make output easy to inspect and bind to the action. For a new JSON interface, prefer a minimal envelope such as <code>ok</code>, <code>operation</code>, <code>target</code>, and either <code>result</code> or <code>error</code>; include recorded commits, digests, or state paths when they are the proof a controller needs.</li>\n<li>Generate JSON with <code>jq</code> or another repository-standard encoder, never by string concatenation.</li>\n</ul>\n<h2>Failure Design</h2>\n<p>For every external command or multi-step mutation, answer:</p>\n<ol>\n<li>What can fail or time out?</li>\n<li>What state may already have changed?</li>\n<li>Can the exact operation be retried safely?</li>\n<li>What evidence lets an AI agent choose retry, repair, or stop?</li>\n</ol>\n<p>Fail closed for publication, deletion, credentials, shared state, and Git ref movement. A partial success must be recorded explicitly; do not collapse it into a generic failure that encourages a destructive retry.</p>\n<h2>Verification</h2>\n<p>Run the narrowest relevant checks first:</p>\n<ol>\n<li><code>bash -n</code> on every touched Bash file.</li>\n<li>The repository's ShellCheck or code-check command when configured; do not add a new lint dependency just for ceremony.</li>\n<li>Focused tests for one accepted path and the nearest rejected boundary.</li>\n<li>When relevant, tests for timeout, interruption, retry/idempotency, concurrent writers, paths with spaces, and partial failure.</li>\n<li>Stop after the affected checks pass; the repository's default suite is not permission to expand the test scope.</li>\n</ol>\n<p>Use temporary directories, local bare Git remotes, and boundary fakes that assert observable behavior. Do not mock repository-internal logic. Re-read the final diff and remove any line that does not improve required correctness, diagnostics, or operability.</p>\n<h2>Delivery</h2>\n<p>Report the changed behavior, input/output contract, important failure semantics, and exact verification commands with results. State any unverified external dependency plainly; never report success over a failing or skipped required check.</p>\n\n\n","files":[{"path":"scripts/selftest/run-selftest.sh","sizeBytes":1326,"isText":true},{"path":"SKILL.md","sizeBytes":7617,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-11-16T17:52:13.184155Z","sha256":"A57B0C0BE0293C2D68A44AF29AD1A4AE77AA4ECD6F8D7B3FA3DC1804A769106E","sizeBytes":4453},"review":null,"source":{"repositoryUrl":"https://github.com/sno-ai/sno-station-skills","path":"plugins/sno-station-standalone/skills/shellscript-coder","license":"Apache-2.0","commit":"8ff231c599de94b3be4903905805b3be87d15ad4","subtreeSha":"C6B53B807CDC1A68E76145A1531929305A6D3EEF7F39F236EB117D138C3A6088","lastSyncedAt":"2026-11-16T17:50:35.850868Z"},"reviewedAt":"2026-11-16T17:55:34.837195Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/sno-ai/sno-station-skills/tree/main/plugins/sno-station-standalone/skills/shellscript-coder"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install sno-ai-sno-station-skills@llmmart"},{"target":"git","command":"git clone https://github.com/sno-ai/sno-station-skills.git"}]}