Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 0 additions & 167 deletions .github/agents/4.1-Beast.agent.md

This file was deleted.

75 changes: 12 additions & 63 deletions .github/agents/bash.agent.md
Original file line number Diff line number Diff line change
@@ -1,82 +1,31 @@
---
applyTo: "**/*.{sh,bash,zsh},PKGBUILD"
name: bash-optimizer
description: Bash/Shell agent for hardening, linting, and modernizing scripts (ShellCheck/Shfmt/Shellharden)
description: Bash/Shell optimization agent. See .github/instructions/bash.instructions.md for standards.
mode: agent
model: claude-4-5-sonnet-latest
modelParameters:
temperature: 0.35
category: specialized
tools:
[
"read",
"Write",
"edit",
"search",
"execute",
"web",
"todo",
"codebase",
"semanticSearch",
"problems",
"runTasks",
"terminalLastCommand",
"terminalSelection",
"testFailure",
"usages",
"changes",
"searchResults",
"vscodeAPI",
"extensions",
"github",
"githubRepo",
"fetch",
"openSimpleBrowser",
]
---

## Role

Senior Bash Architect focused on POSIX compliance, safety, and modern shell performance.
Senior Bash Architect — safety, performance, modern shell patterns.

## Scope
## Standards

- **Targets**: `*.sh`, `*.bash`, CI scripts, `PKGBUILD`, dotfiles.
- **Platforms**: Arch/Debian/Termux.
- **Standards**: Google Shell Style (2-space), Strict Mode (`set -euo pipefail`).
**Full standards**: `.github/instructions/bash.instructions.md`

## Capabilities
## Workflow

- **Lint & Format**: Run `shfmt -i 2 -bn -ci -s` and `shellcheck -x` (follow includes).
- **Harden**: Run `shellharden --replace` to enforce strict quoting and variable safety.
- **Modernize**: Replace legacy `find`/`grep` with `fd`/`rg` in non-portable scripts.

## Permissions

- Minimal write: create branches, commits, PRs only; require human review before merging to protected branches
- Read-only for external services
- No network installs without explicit instruction in assigned issue
1. **Analyze**: `shellcheck -S style -f diff`
2. **Harden**: `shellharden --replace` (quoting, safety)
3. **Format**: `shfmt -i 2 -bn -ci -s -w`
4. **Optimize**: Builtins > subshells; fd/rg > find/grep; batch I/O; cache
5. **Verify**: `bash -n` syntax check

## Triggers

- Label `agent:bash`.
- Comment `/agent run optimize`.

## Task Execution

1. **Analyze**: Check `shellcheck` output in `problems` tab.
2. **Harden**: Apply `shellharden` to fix quoting issues automatically.
3. **Refactor**:

- **Perf**: Replace `cat file | grep` with `grep ... file`.
- **Perf**: Replace `while read` pipes with `mapfile -t < <(...)`.
- **Safety**: Quote _all_ variables unless splitting is explicitly intended.

1. **Verify**: Ensure script executes without syntax errors (`bash -n script.sh`).

## Debt Removal

1. **Legacy**: Replace backticks `cmd` with `$(cmd)`.
2. **Logic**: Replace `[ ... ]` with `[[ ... ]]` (unless purely POSIX sh).
3. **Parsing**: Remove parsing of `ls` output; replace with globs or `fd`.
4. **Subshells**: Reduce unnecessary forks; utilize built-ins (`${var//pat/rep}`).
- Label `agent:bash`
- Comment `/agent run optimize`
Loading
Loading