mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-27 21:08:00 +00:00
scripts/shortcuts/work
Automate picking up a GitHub issue: sync main, cut a working branch, and
hand the issue off to an LLM CLI to start implementing.
Mirrors the structure of scripts/shortcuts/review and reuses
its lib.sh helpers.
Usage
pnpm work 1234 # default agent: claude
pnpm work 1234 "focus on the retry path" # extra prompt appended verbatim
pnpm work 1234 --agent codex # runs `codex exec` in yolo mode
pnpm work 1234 --agent cursor # runs `cursor-agent --yolo`
pnpm work 1234 --no-checkout # skip git sync; use current branch
The first numeric arg is treated as the issue number, so pnpm work 1234 …
and pnpm work start 1234 … are equivalent.
What it does
- Resolves the target repo from
WORK_REPO, then falls back to theupstreamremote (ororigin). - Fetches the issue (title, body, labels, URL) with
gh. - Checks out
main, fast-forwards fromupstream/origin, then creates a branch<prefix>/<issue>-<slug>(slug derived from the issue title, max 40 chars). If the branch already exists it's checked out andmainis merged in. - Hands off to the agent CLI with a prompt containing the issue body,
repo conventions pointers (CLAUDE.md / AGENTS.md), and any trailing
extra-prompt. For--agent codex, the handoff usescodex exec --dangerously-bypass-approvals-and-sandbox. For--agent cursoror--agent cursor-agent, it usescursor-agent --yolo.
By default the script also tries to assign the issue to @me through GitHub
as soon as work starts.
Config
WORK_REPO=owner/name— override the target repo.WORK_BRANCH_PREFIX=issue— branch is<prefix>/<num>-<slug>.WORK_AUTO_ASSIGN=1— auto-assign the issue to@mewhen work starts. Set to0to disable.- Requires
git,gh,jq, plus the agent CLI (defaultclaude).