Auto-start onboarding: agent speaks first via TUI kickoff

Install hermes-client-onboarding launcher that runs hermes --tui -s
skill -q kickoff so Phase 1 begins without waiting for user hello.
This commit is contained in:
domfelipe 2026-08-03 00:09:39 -03:00
parent f86c06d521
commit 3b98cb7253
4 changed files with 94 additions and 20 deletions

View file

@ -117,8 +117,9 @@ test -f ~/.hermes/skills/hermes-client-onboarding/SKILL.md && echo skill_ok
hermes --version
hermes doctor
# 4. onboarding interativo
hermes chat -s hermes-client-onboarding
# 4. onboarding interativo (agente fala primeiro — Phase 1)
hermes-client-onboarding
# ou: hermes --tui -s hermes-client-onboarding -q "Inicie AGORA o onboarding…"
# completar fases 16 com chaves reais de teste
# 5. smoke telegram
@ -146,6 +147,17 @@ hermes config set model.base_url "https://api.deepseek.com/v1"
Não imprime secrets.
## Launcher (agente fala primeiro)
O bootstrap instala `~/.local/bin/hermes-client-onboarding`, que abre o TUI com kickoff automático:
```bash
hermes-client-onboarding
```
Isso usa `hermes --tui -s hermes-client-onboarding -q "…"` — o Hermes **envia a primeira mensagem sozinho** e continua interativo.
`hermes chat -s …` sem `-q` / sem launcher espera o usuário falar primeiro.
## Licença
MIT (skill + bootstrap DomHubs). Hermes Agent em si: licença do projeto Nous Research.

View file

@ -7,7 +7,7 @@ set -euo pipefail
SKILL_NAME="hermes-client-onboarding"
DEFAULT_BASE="${HERMES_ONBOARD_BASE:-https://setup.domhubs.com.br/hermes}"
HERMES_INSTALL_URL="${HERMES_INSTALL_URL:-https://hermes-agent.nousresearch.com/install.sh}"
KICKOFF_MSG="${HERMES_ONBOARD_KICKOFF:-Inicie agora o onboarding de cliente Hermes. Siga a skill hermes-client-onboarding fase a fase (Phase 1 primeiro). Fale em português brasileiro.}"
KICKOFF_MSG="${HERMES_ONBOARD_KICKOFF:-Inicie AGORA o onboarding de cliente Hermes. Siga a skill hermes-client-onboarding: pre-flight em silêncio e abra a Phase 1 com a primeira pergunta. Você fala primeiro — não espere eu dizer oi. Português brasileiro.}"
CONDUCTOR="${HERMES_ONBOARD_CONDUCTOR:-}"
NO_LAUNCH=0
@ -104,6 +104,9 @@ copy_tree() {
if [[ -f "$dest/scripts/apply-core-config.sh" ]]; then
chmod +x "$dest/scripts/apply-core-config.sh"
fi
if [[ -f "$dest/scripts/start-onboarding.sh" ]]; then
chmod +x "$dest/scripts/start-onboarding.sh"
fi
}
fetch_skill_to() {
@ -115,7 +118,9 @@ fetch_skill_to() {
curl -fsSL "${base}/skill/${SKILL_NAME}/SKILL.md" -o "$dest/SKILL.md"
curl -fsSL "${base}/skill/${SKILL_NAME}/references/troubleshooting.md" -o "$dest/references/troubleshooting.md"
curl -fsSL "${base}/skill/${SKILL_NAME}/scripts/apply-core-config.sh" -o "$dest/scripts/apply-core-config.sh"
curl -fsSL "${base}/skill/${SKILL_NAME}/scripts/start-onboarding.sh" -o "$dest/scripts/start-onboarding.sh" || true
chmod +x "$dest/scripts/apply-core-config.sh"
[[ -f "$dest/scripts/start-onboarding.sh" ]] && chmod +x "$dest/scripts/start-onboarding.sh"
[[ -s "$dest/SKILL.md" ]] || die "failed to download SKILL.md from $base"
}
@ -137,6 +142,14 @@ install_skill() {
copy_tree "$staging" "$hermes_dest"
log "Skill installed for Hermes → $hermes_dest"
# Launcher: auto-starts Phase 1 (agent speaks first)
mkdir -p "${HOME}/.local/bin"
if [[ -f "$staging/scripts/start-onboarding.sh" ]]; then
cp -f "$staging/scripts/start-onboarding.sh" "${HOME}/.local/bin/hermes-client-onboarding"
chmod +x "${HOME}/.local/bin/hermes-client-onboarding"
log "Launcher → ~/.local/bin/hermes-client-onboarding (agent fala primeiro)"
fi
# Codex / agents (optional)
if [[ -d "${HOME}/.codex" ]] || need_cmd codex; then
mkdir -p "${HOME}/.codex/skills"
@ -196,30 +209,38 @@ pick_conductor() {
fi
}
launch_hermes_onboarding() {
# Auto-start: TUI + -q submits first turn; session stays interactive.
export HERMES_ONBOARD_KICKOFF="$KICKOFF_MSG"
if [[ -x "${HOME}/.local/bin/hermes-client-onboarding" ]]; then
if [[ -r /dev/tty ]]; then
exec "${HOME}/.local/bin/hermes-client-onboarding" </dev/tty
else
exec "${HOME}/.local/bin/hermes-client-onboarding"
fi
fi
# Fallback without launcher binary
if [[ -r /dev/tty ]]; then
exec hermes --tui -s "$SKILL_NAME" -q "$KICKOFF_MSG" </dev/tty
else
exec hermes --tui -s "$SKILL_NAME" -q "$KICKOFF_MSG"
fi
}
launch_conductor() {
local c="$1"
case "$c" in
skip)
log "Skill pronta. Rode depois:"
echo " hermes chat -s ${SKILL_NAME}"
log "Skill pronta. Rode depois (agente fala primeiro):"
echo " hermes-client-onboarding"
echo " # ou: hermes --tui -s ${SKILL_NAME} -q \"${KICKOFF_MSG}\""
need_cmd codex && echo " codex \"${KICKOFF_MSG}\""
return 0
;;
hermes)
need_cmd hermes || die "hermes missing"
log "Abrindo Hermes com skill ${SKILL_NAME}..."
echo ""
echo "────────────────────────────────────────"
echo "Quando o chat abrir, envie (ou já use):"
echo " ${KICKOFF_MSG}"
echo "────────────────────────────────────────"
echo ""
# Reattach stdin to TTY after curl|bash so the chat is interactive
if [[ -r /dev/tty ]]; then
exec hermes chat -s "$SKILL_NAME" </dev/tty
else
exec hermes chat -s "$SKILL_NAME"
fi
log "Abrindo Hermes (auto-start Phase 1)..."
launch_hermes_onboarding
;;
codex)
need_cmd codex || die "codex not found — install Codex or use --conductor hermes"
@ -243,8 +264,9 @@ main() {
install_skill
if [[ "$NO_LAUNCH" -eq 1 ]]; then
log "Done (--no-launch). Start with:"
echo " hermes chat -s ${SKILL_NAME}"
log "Done (--no-launch). Start with (agent speaks first):"
echo " hermes-client-onboarding"
echo " # ou: hermes --tui -s ${SKILL_NAME} -q \"…\""
exit 0
fi

View file

@ -66,6 +66,24 @@ After install, confirm with `hermes --version` and `hermes doctor`.
Conduct the onboarding as a structured dialogue. Move phase by phase. Never skip confirmation of secrets or user IDs.
### Auto-start (when preloaded / first turn)
When this skill is preloaded (`-s hermes-client-onboarding`) or the first user message is a kickoff like “Inicie o onboarding…”, **you speak first**:
1. Run Pre-flight Checks quietly (minimal output).
2. Immediately open **Phase 1** with the first question(s) — do **not** wait for “oi”, “olá”, or an empty prompt.
3. Do not dump the whole checklist; one short pre-flight status line is enough, then the Phase 1 questions.
Preferred launch (agent auto-starts):
```bash
hermes-client-onboarding
# or:
hermes --tui -s hermes-client-onboarding -q "Inicie AGORA o onboarding…"
```
Plain `hermes chat -s hermes-client-onboarding` without a kickoff waits for user input — avoid that for demos.
### Phase 1 — Context & Goals
Ask:

View file

@ -0,0 +1,22 @@
#!/usr/bin/env bash
# Launch Hermes with hermes-client-onboarding and auto-start Phase 1
# (agent speaks first — does not wait for the user to say "oi").
set -euo pipefail
export PATH="${HOME}/.local/bin:/usr/local/bin:${PATH}"
SKILL_NAME="${HERMES_ONBOARD_SKILL:-hermes-client-onboarding}"
KICKOFF="${HERMES_ONBOARD_KICKOFF:-Inicie AGORA o onboarding de cliente Hermes. Siga a skill hermes-client-onboarding: execute o pre-flight em silêncio e abra a Phase 1 fazendo a primeira pergunta ao usuário. Você fala primeiro — não espere eu dizer oi ou começar.}"
if ! command -v hermes >/dev/null 2>&1; then
echo "error: hermes not on PATH" >&2
exit 1
fi
# TUI: -q becomes HERMES_TUI_QUERY — first turn auto-submits, session stays interactive.
if [[ -t 0 && -t 1 ]]; then
exec hermes --tui -s "$SKILL_NAME" -q "$KICKOFF" "$@"
fi
# Non-TTY fallback (CI/scripts): one-shot only
exec hermes chat -s "$SKILL_NAME" -Q -q "$KICKOFF" "$@"