feat(agents): add a shell-reviewer subagent - #10
Conversation
Reviews Bash/POSIX sh/Zsh/Nushell changes strictly against this repo's own cited rules (reference/*.md), running shellcheck/shfmt/nu --ide-check itself and citing the exact rule or SC code for each finding, rather than a generic code-review pass with improvised style opinions.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Code Review
This pull request introduces a new shell-reviewer subagent designed to review Bash, POSIX sh, Zsh, and Nushell scripts against the repository's style guidelines. The review feedback suggests consistently integrating Zsh support throughout the documentation and instructions. Specifically, it recommends explicitly including *.zsh files in the agent's scope, defining Zsh shebang patterns, and adding the zsh -n syntax checking tool to the list of executed tools in both the README and the agent's system prompt.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| The plugin also ships a [`shell-reviewer`](agents/shell-reviewer.md) | ||
| subagent: it reviews Bash/POSIX sh/Zsh/Nushell changes strictly against | ||
| this repo's own cited rules, running `shellcheck`/`shfmt`/`nu --ide-check` | ||
| itself rather than eyeballing style. |
There was a problem hiding this comment.
Since the subagent is instructed to use zsh -n for syntax checking Zsh scripts, we should list it here alongside the other tools to accurately reflect its capabilities.\n\nSuggested change:\nmarkdown\nThe plugin also ships a [`shell-reviewer`](agents/shell-reviewer.md)\nsubagent: it reviews Bash/POSIX sh/Zsh/Nushell changes strictly against\nthis repo's own cited rules, running `shellcheck`/`shfmt`/`zsh -n`/`nu --ide-check`\nitself rather than eyeballing style.\n
| @@ -0,0 +1,68 @@ | |||
| --- | |||
| name: shell-reviewer | |||
| description: Reviews Bash, POSIX sh, Zsh, and Nushell scripts against this repository's cited rule set (reference/*.md) — strict mode, quoting, arrays vs strings, trap-based cleanup, POSIX portability, and stream discipline — citing the exact ShellCheck code or rule for every finding. Use after writing or modifying any shell script, before opening a PR that touches *.sh/*.bash/*.nu, or when asked to review shell code. Not a general-purpose code reviewer — it only has an opinion on shell. | |||
There was a problem hiding this comment.
The subagent is designed to review Zsh scripts as well, so we should include *.zsh in the list of file extensions that trigger a review before opening a PR.\n\nSuggested change:\nmarkdown\ndescription: Reviews Bash, POSIX sh, Zsh, and Nushell scripts against this repository's cited rule set (reference/*.md) — strict mode, quoting, arrays vs strings, trap-based cleanup, POSIX portability, and stream discipline — citing the exact ShellCheck code or rule for every finding. Use after writing or modifying any shell script, before opening a PR that touches *.sh/*.bash/*.zsh/*.nu, or when asked to review shell code. Not a general-purpose code reviewer — it only has an opinion on shell.\n
| Review unstaged or recently-changed `*.sh`, `*.bash`, and `*.nu` files by | ||
| default (`git diff` / `git diff --staged`). The user may point you at | ||
| specific files instead. |
There was a problem hiding this comment.
To ensure Zsh scripts are reviewed by default, *.zsh should be explicitly listed in the default file scope.\n\nSuggested change:\nmarkdown\nReview unstaged or recently-changed `*.sh`, `*.bash`, `*.zsh`, and `*.nu` files by\ndefault (`git diff` / `git diff --staged`). The user may point you at\nspecific files instead.\n
| 1. **Read the shebang first.** It tells you which reference doc applies: | ||
| `#!/usr/bin/env bash` → `shell-standards.md` + `bash.md`; `#!/bin/sh` → | ||
| `posix-sh.md` (POSIX constructs only — no `local`, no arrays, `[ ]` not | ||
| `[[ ]]`, no `pipefail`); zsh → `zsh.md`. A script that mixes dialects | ||
| (e.g. `[[ ]]` under `#!/bin/sh`) is itself a finding. |
There was a problem hiding this comment.
For completeness and clarity, specify the expected shebang patterns for Zsh scripts (e.g., #!/bin/zsh or #!/usr/bin/env zsh) just as is done for Bash and POSIX sh.\n\nSuggested change:\nmarkdown\n1. **Read the shebang first.** It tells you which reference doc applies:\n `#!/usr/bin/env bash` → `shell-standards.md` + `bash.md`; `#!/bin/sh` →\n `posix-sh.md` (POSIX constructs only — no `local`, no arrays, `[ ]` not\n `[[ ]]`, no `pipefail`); `#!/bin/zsh` or `#!/usr/bin/env zsh` → `zsh.md`.\n A script that mixes dialects (e.g. `[[ ]]` under `#!/bin/sh`) is itself a\n finding.\n
| 2. **Run the actual tools, don't eyeball it.** For `.sh`/`.bash` files: | ||
| `shellcheck --severity=style <file>` (ShellCheck infers the dialect from | ||
| the shebang; this repo's `.shellcheckrc` sets `enable=all`, so run it | ||
| from the repo root to pick that up) and `shfmt -d <file>`. For `.nu` | ||
| files: `nu --ide-check <file>`. Quote the actual tool output in your | ||
| findings — don't paraphrase a diagnostic you didn't run. |
There was a problem hiding this comment.
Add the command for checking Zsh scripts (zsh -n <file>) to the list of tools the agent should run, matching the other dialects.\n\nSuggested change:\nmarkdown\n2. **Run the actual tools, don't eyeball it.** For `.sh`/`.bash` files:\n `shellcheck --severity=style <file>` (ShellCheck infers the dialect from\n the shebang; this repo's `.shellcheckrc` sets `enable=all`, so run it\n from the repo root to pick that up) and `shfmt -d <file>`. For `.zsh`\n files: `zsh -n <file>`. For `.nu` files: `nu --ide-check <file>`. Quote\n the actual tool output in your findings — don't paraphrase a diagnostic\n you didn't run.\n
Summary
Adds
agents/shell-reviewer.md, a Claude Code subagent scoped specificallyto this repo's own cited rule set — it reviews Bash/POSIX sh/Zsh/Nushell
changes against
reference/*.md, runsshellcheck/shfmt/nu --ide-checkitself rather than eyeballing style, and cites the exact rule or SC code for
every finding instead of improvising generic opinions.
Wires a one-line mention into
README.md's plugin-install section.Checklist
task ciis greentask hooksis green