hgxszhj/https-github.com-zhaoxuya520-reverse-skill / skills
reverse-skill-router
FlaggedRoutes reverse engineering, exploitation, penetration testing, malware, mobile, firmware, browser automation, documentation, and security tasks to the appropriate specialist skill. Use when a task spans modules or the correct reverse-skill entrypoint is unclear.
scripts/test-bash-workflow.sh
View on GitHub#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")"
SCRATCH="$(mktemp -d)"
trap 'rm -rf "$SCRATCH"' EXIT
echo "=== Testing Bash Workflow ==="
# Portable in-place rewrite: works with GNU sed and BSD sed (macOS).
# Avoids platform-specific `sed -i` / `sed -i ''` branching.
replace_in_file() {
local expr="$1"
local file="$2"
local tmp
tmp="$(mktemp "${file}.XXXXXX")"
sed "$expr" "$file" > "$tmp"
mv "$tmp" "$file"
}
# Test 1: case-init.sh creates proper structure
echo "[Test 1] case-init.sh basic execution"
bash "$SCRIPT_DIR/case-init.sh" \
--hint "authorized web review" \
--case-name "test-bash-01" \
--package-root "$SCRATCH" \
--auth-granted \
--target-url "https://example.test/" \
--network-profile "authorized_target_only" > /dev/null
if [ ! -f "$SCRATCH/work/test-bash-01/scope.md" ]; then
echo "FAIL: scope.md not created"
exit 1
fi
# Test 2: case-init.sh rejects unknown presets before writing artifacts
echo "[Test 2] case-init.sh rejects unknown preset"
invalid_preset_case="test-bash-invalid-preset"
if bash "$SCRIPT_DIR/case-init.sh" \
--hint "invalid preset regression" \
--case-name "$invalid_preset_case" \
--project-root "$SCRATCH" \
--preset "definitely-not-valid" > /dev/null 2>&1; then
echo "FAIL: case-init accepted unknown preset"
exit 1
fi
if [ -e "$SCRATCH/work/$invalid_preset_case" ]; then
echo "FAIL: case-init wrote a partial case for unknown preset"
exit 1
fi
# Test 3: case-guard.sh validates valid scope
echo "[Test 3] case-guard.sh accepts valid scope"
if ! bash "$SCRIPT_DIR/case-guard.sh" --case-root "$SCRATCH/work/test-bash-01" > /dev/null; then
echo "FAIL: case-guard rejected valid scope"
exit 1
fi
# Test 4: case-guard.sh rejects invalid network mode
echo "[Test 4] case-guard.sh rejects invalid network mode"
replace_in_file 's/mode: authorized_target_only/mode: invalid_mode/g' "$SCRATCH/work/test-bash-01/scope.md"
if bash "$SCRIPT_DIR/case-guard.sh" --case-root "$SCRATCH/work/test-bash-01" > /dev/null 2>&1; then
echo "FAIL: case-guard accepted invalid network mode"
exit 1
fi
# Test 5: case-guard.sh rejects ungranted auth
echo "[Test 5] case-guard.sh rejects ungranted auth"
replace_in_file 's/mode: invalid_mode/mode: authorized_target_only/g' "$SCRATCH/work/test-bash-01/scope.md"
replace_in_file 's/status: granted/status: pending/g' "$SCRATCH/work/test-bash-01/scope.md"
if bash "$SCRIPT_DIR/case-guard.sh" --case-root "$SCRATCH/work/test-bash-01" > /dev/null 2>&1; then
echo "FAIL: case-guard accepted pending auth"
exit 1
fi
echo "TOTAL=5 PASS=5 FAIL=0"
echo "=== All Bash Workflow Tests Passed ==="
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 469k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 469k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 469k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |