---
name: otto-publish
description: >
  End-to-end Otto release workflow for @otto-assistant/bridge: commit, push,
  verify GitHub Actions npm publish, fix failures, then upgrade on host and
  restart dependent processes. Use when user says "publish".
---

# Otto Publish Workflow

Run this workflow whenever the user asks to publish Otto.

## Required behavior

1. Commit and push requested changes.
2. Verify the GitHub workflow that builds and publishes `@otto-assistant/bridge`.
3. If workflow fails, fix issues and repeat until green.
4. Upgrade npm package on the current host.
5. Restart processes/services that depend on the updated package.
6. Report final published version and verification evidence.

## Release commands

Use repository root unless noted.

```bash
git status --short --branch
git diff
git log -8 --oneline
```

```bash
# stage only requested files
git add <files>

git commit -m "$(cat <<'EOF'
<message>
EOF
)"

git push origin HEAD
```

```bash
# monitor publish workflow
gh run list --workflow "publish-npm.yml" --limit 10
gh run view <run-id> --log
```

```bash
# update package on host
pnpm add -g @otto-assistant/bridge@latest
```

## Validation after host upgrade

```bash
otto --version
```

If bot process is running, restart it with SIGUSR2 so it reloads new code.
