Refactor a shell script to follow Google Shell Style Guide
Refactors shell scripts to follow Google Shell Style Guide with automated analysis and fixes.
/plugin marketplace add pproenca/dot-claude-old/plugin install shell@dot-claude<path/to/script.sh>Refactor the specified shell script to follow Google Shell Style Guide.
Create TodoWrite with each step:
If $ARGUMENTS is provided, use it as the target script path.
Otherwise, find shell scripts and prompt user:
fd -e sh -e bash --type f 2>/dev/null | head -20
Use AskUserQuestion:
Read the script content to understand its structure.
Run these in parallel:
shellcheck -f gcc "<target_script_path>" 2>&1 || true
If shellcheck not installed, note: brew install shellcheck (macOS) or apt install shellcheck (Linux).
Task tool with:
- subagent_type: "shell:shell-expert"
- prompt: "REVIEW the shell script at <target_script_path>"
Skill tool with: skill: "shell:google-shell-style"
Combine findings from shellcheck and shell-expert. For each violation note:
Present summary:
Use AskUserQuestion:
Use Edit tool to apply approved changes in order:
bash -n "<target_script_path>"
shellcheck -f gcc "<target_script_path>" 2>&1 || true
Compare with baseline - refactoring should reduce issues.
## Refactoring Complete
**File:** [path]
### Changes Applied
- [key changes by category]
### Shellcheck Comparison
| Metric | Before | After | Delta |
|--------|--------|-------|-------|
| Errors | N | N | -N |
| Warnings | N | N | -N |
### Verification
- Syntax check: [PASS/FAIL]
- Shellcheck delta: [Improved/Same/Regressed]
### Shell Expert Assessment
- **Initial Review:** [summary]
- **Recommendation:** [PASS/NEEDS_FIXES]