Refactor code structure for improved readability and maintainability

This commit is contained in:
2026-03-05 23:52:58 +00:00
parent a92fbff801
commit f2626f7007
6 changed files with 181 additions and 69 deletions
+10
View File
@@ -135,6 +135,16 @@ list_agents_raw() {
done
}
# ── Naming convention ─────────────────────────────────────────────────────
# Normalizes an agent ID to an env-var suffix.
# Convention: uppercase, hyphens → underscores. No stripping of suffixes.
# "assistant-bot" → "ASSISTANT_BOT"
# "asistente-2" → "ASISTENTE_2"
# "devops-bot" → "DEVOPS_BOT"
normalize_id() {
echo "$1" | tr '[:lower:]-' '[:upper:]_'
}
# ── Usage helper ──────────────────────────────────────────────────────────
need_arg() {
[[ -n "${1:-}" ]] || { echo "Usage: $0 <agent-id>"; exit 1; }