Tasks and gates
A task is a specification with acceptance criteria; gates are where you decide.
The task workflow: shepherd run
For a task in .shepherd/tasks:
- Plan: the
brainsplits the task into subtasks (task plan <id> --savestores it). Withworkflow.confirm: trueit waits forshepherd approve <id> plan. - Implement: one
coderper subtask, each in its own worktree. - Review: up to
max_review_roundsrounds with areviewerfrom another vendor. - Checks: your
workflow.checks, or ones detected from the language. - Publish: push and a draft PR with
gh, only after you approve (approve <id> <n>) or with--auto-push. Protected branches (main,master,develop) are never published from.
Reject with shepherd reject <id> plan|<n> --reason "...". Stop a task's run with shepherd cancel <id>: it closes the agents linked to the task and marks it cancelled, and work already committed stays on its branches. shepherd git publish <branch> pushes a branch and opens its PR only when its subtask is waiting for your approval. Follow progress with shepherd runs list or the Runs view.
workflow:
max_review_rounds: 3 # 0 disables review
confirm: true # require plan approval
base_branch: main
checks: ["go vet ./...", "go test ./..."]
draft: trueKeep track of work with tasks
$ shepherd task new "Add login" --description "A login form" --criteria "tests pass"
created task 1-add-login
.shepherd/tasks/1-add-login
$ shepherd task new "Fix logout" --description "Logout leaves a cookie"
created task 2-fix-logout
$ shepherd task list
ID STATE TITLE ISSUE PR
1 new Add login - -
2 new Fix logout - -Bring work in from GitHub instead of typing it (needs gh):
shepherd task import 128 # an issue number in this repo
shepherd task import https://github.com/you/repo/issues/128Put a finished one away, or remove it for good:
$ shepherd task archive 2
archived .shepherd/tasks/_archive/2-fix-logout
$ shepherd task delete 2 --archived --confirm
deleted task 2-fix-logoutWithout --confirm, delete refuses and says it cannot be undone. In the app: Tasks, then the buttons on a task. In the terminal UI: tab 2, a archive, D delete.
Review and approve an agent's work
shepherd run 1 # the task workflow: plan, code, review, checks (REAL AGENTS)
shepherd approve 1 plan # let the plan go ahead
shepherd reject 1 2 --reason "missing tests"
shepherd approve 1 2 # approving a subtask pushes it and opens the PR
shepherd cancel 1 # or stop it: closes the task's agents, keeps committed workIn the app: Runs, the gate strip has Approve and Reject with a reason box. In the terminal UI: tab 3, a and d.