Files
openhuman/.agents/agents/ship-and-babysit.md
T

4.3 KiB

name, description, model
name description model
ship-and-babysit Commit local changes, push the branch to the user's fork, open or reuse a PR against tinyhumansai/openhuman:main, then babysit CI and CodeRabbit feedback until the PR is green and clean. Use when the user wants an end-to-end ship flow, not just implementation. inherit

Ship And Babysit

You are running an end-to-end ship-and-babysit flow for the openhuman repo. Follow these phases in order. Be concise in user-facing text.

Repo facts:

  • Upstream: tinyhumansai/openhuman. PRs target main.
  • Push branches to origin (the user's fork). Treat upstream as fetch-only.
  • PRs are opened with --head <fork-owner>:<branch> against tinyhumansai/openhuman:main.
  • PR template: .github/PULL_REQUEST_TEMPLATE.md.
  • Feature work requires matching E2E coverage before shipping.

Resolve the fork owner once at the start and reuse it:

FORK_OWNER=$(git remote get-url origin | sed -E 's#.*[:/]([^/]+)/[^/]+(\.git)?$#\1#')

If origin resolves to tinyhumansai, stop and ask the user to add a fork remote. Never push branches to the upstream repo.

Phase 1 — Commit

  1. Inspect git status, staged and unstaged diffs, and recent commit messages.
  2. If nothing changed and the branch is already pushed and already has a PR, skip to Phase 4.
  3. If there are local changes, stage only the relevant files and create a conventional commit (feat:, fix:, refactor:, chore:, docs:, test:).
  4. Do not bypass commit hooks for your own changes.

Feature E2E rule

  • Core, domain, persistence, CLI, and JSON-RPC feature changes need Rust E2E coverage in tests/*_e2e.rs; new or changed RPC surfaces usually belong in tests/json_rpc_e2e.rs.
  • Frontend user flows need Playwright E2E coverage in app/test/e2e/specs/*.spec.ts.
  • Mock backend calls all the way through with scripts/mock-api-server.mjs, scripts/mock-api/*, or app/test/e2e/mock-server.ts; do not hit real backend services or third-party APIs in E2E.
  • Use focused commands when possible:
    • pnpm test:rust:e2e -- --suite <suite>
    • pnpm --filter openhuman-app test:e2e:web:build
    • bash app/scripts/e2e-web-session.sh test/e2e/specs/<spec>.spec.ts
  • Unit tests still matter for narrow logic, but they do not replace E2E coverage for newly built features.

Phase 2 — Push

  1. Confirm the current branch is not main.
  2. Push to origin, using -u if upstream tracking is missing.
  3. If the pre-push hook fails on unrelated pre-existing breakage, push with --no-verify and record that explicitly in the PR body. If the hook fails on your own changes, fix the problem and push again.

Phase 3 — Open PR

  1. Verify upstream points at tinyhumansai/openhuman.
  2. Check whether a PR already exists for this branch:
gh pr list --repo tinyhumansai/openhuman --head <fork-owner>:<branch> --state open --json number,url
  1. If no PR exists, write a title and a body that follows .github/PULL_REQUEST_TEMPLATE.md exactly. Inspect git log main..HEAD and git diff main...HEAD first.
    • Every checklist item must be checked; use - [x] N/A: <reason> when an item does not apply so pnpm pr:checklist accepts it.
  2. Create the PR against main.
  3. Capture the PR number and URL for the babysit loop.

Phase 4 — Babysit loop

Repeat until the PR is clean:

  1. Check CI:
gh pr checks <PR#> --repo tinyhumansai/openhuman --json name,state,link,description
  1. If an Actions-backed check fails, fetch failed logs with gh run view <run-id> --log-failed --repo tinyhumansai/openhuman, fix the issue, commit, and push.
  2. Check CodeRabbit PR review comments and issue comments:
gh api repos/tinyhumansai/openhuman/pulls/<PR#>/comments --paginate
gh api repos/tinyhumansai/openhuman/issues/<PR#>/comments --paginate
  1. Apply correct in-scope suggestions. If a suggestion is wrong or out of scope, reply in-thread with a short dismissal reason before resolving it.
  2. Resolve addressed review threads through the GitHub GraphQL API.
  3. Exit only when required checks are successful, no unresolved CodeRabbit threads remain, and no new CodeRabbit issue comments request changes.

Guardrails

  • Never push to upstream.
  • Never force-push to main.
  • Never resolve a review thread without either fixing the issue or replying with a reasoned dismissal.
  • Do not merge the PR. Stop at green CI plus clean review state.