General-purpose coding policy for Baruch's AI agents
73
92%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Low
Low-risk findings worth noting
The shape of one task round, and what the lead does between the steps of
skills/herdr-teamlead/SKILL.md. Read this when a round deviates from the happy path.
| Responsibility | Repository writes | Output |
|---|---|---|
| developer | authorized source work in its own worktree | pushed branch and report |
| tester | test code as a report-directory patch | test plan, patch or verification report |
| reviewer | none | independent COMMENT review and report |
| advisor, investigator, architect | none | bounded recommendation, diagnosis or design report |
| release | release operations only | verified release report |
| judge | none | binding dispute ruling |
Activate the responsibilities the next task decision needs. Add specialty
requirements through references/specialists.md; a profile on the bench needs
no worker or monitoring loop. One worker holds one assignment in a dispatch.
Compatible expertise may share a responsibility. Consultations with the same
canonical responsibility use separate dispatches, each with its own engagement.
The owner planner applies capability and contribution eligibility before affordable task familiarity and measured headroom. Step 5 in the skill names the executable contract. Use measured costs to improve calibration; preserve the pinned judge and the developer's early-fix reservation.
If no eligible worker fits, record the gap and staff or sequence the work. Never silently drop a required responsibility or let a contributor independently verify its own work. Specialist advice does not replace required reviewer and tester passes.
An implementation task runs through the round twice, and only the second pass gates release. Investigation-only tasks use Step 12's knowledge-deliverable gate; they do not require a pushed branch or release reports.
Phase 1 — pre-development (optional). An architect or advisor supplies the
needed design or interaction report. An investigator may first resolve a causal
question. Assess each consultation before using its outcome. The tester maps each acceptance
criterion to a test, or delivers those tests as a patch (tester Mode A or B).
Plan that work with --round tester=test_plan and record its actual contribution
through assess-specialist before selecting Phase 2 verifiers. A test patch
author is an implementation contributor, even while holding the tester role.
The developer implements against both, runs the repo's gates, pushes the
branch, and stops without opening a PR.
Skip Phase 1 for a change small enough that a design note would say less than the diff. Nothing in Phase 1 is a pass; it is preparation.
Phase 2 — post-push verification (mandatory). The reviewer reviews the pushed branch and posts a COMMENT review (Mode B). The tester runs the gates and the acceptance tests against that same branch (Mode C). Both report against the current tip by SHA.
The release hand-off reads Phase 2 reports and nothing else. A design note is not a review of the code that got written, and a test plan is not a test run.
Phase 2 excludes actual design and implementation contributors from reviewer
and tester. The owner applies recorded contribution history; use --exclude
for relevant contributions outside it. Assess uncertain prior consultations
under references/specialists.md. The reviewer responsibility is verification
only; it no longer carries pre-development Mode A. Historical reviewer
responsibility remains unknown until its actual contribution is established.
Consultations can enter later when a new question could change implementation or verification. Scope any resulting correction through the accepted behavior and existing correction allowance; a specialist recommendation grants no new implementation authority. A completed consultation returns to the next needed assignment, or closes an investigation-only knowledge deliverable through Step 12.
roster.sh names the live workers. An unnamed pane has no
dispatch handle; name it first.verify-authority.sh <owner/repo> answers whether the
operator owns the repo. Ownership is the namespace, never write permission,
and the answer becomes the authority line in every brief.teamlead.sh measure reads each worker's own usage numbers.
A worker that is working or blocked is skipped with null windows rather
than interrupted.teamlead.sh plan assigns the requested responsibilities with
specialty requirements and explicit contribution exclusions where needed.
It contacts nobody; owner state migration may save an older ledger.compose-briefs.sh renders the templates from one values
file, refusing to write anything when a placeholder is unfilled or a
supplied key matches no template. The lead decides the values; the script
decides nothing.provision-worktree.sh creates every worktree the briefs
name, from the shared checkout. A worker never runs git there, so its
checkout has to exist before the brief arrives.teamlead.sh apply uses Step 10's explicit context mode,
then sends the assignment prompt. The recovery reference governs developer
fix retention and the separate assessed specialist continuation path.
It re-reads live status and refuses to type into a busy worker.supervision-watch observes every enrolled worker. Verify
candidates with wait-report.sh --once, ledger outcomes, and acknowledge
handled events under references/supervision.md.Before relying on consultation output, save the report delivery receipt and run
assess-specialist under references/specialists.md. Record the accepted outcome
in the task ledger and resolve its supervision obligations separately. Keep
useful sessions available for likely follow-up, while preserving scoped lessons
outside the session. No idle specialist counts as active work.
The lead appends decisions throughout this flow to the persistent task ledger,
including before pauses and handoffs. references/task-ledger.md separates
dispatch and report observations from assignment acceptance and task completion.
All references to the round log here mean that ledger.
A report is the worker's only channel to the lead. Read all of it, every time —
a ## BLOCKED section can sit under a report that otherwise reads as finished.
rules/agent-team-operation.md Fix Loops. Keep a stable task identifier and
advance its fix counter; changing worker or scope never restarts it.
Name the findings and prior report in each brief. Re-check the findings
with scoped briefs, then run full verification before release.## BLOCKED section — the worker stopped on something it could not
decide. Resolve it in the NEXT brief, which reaches it through a fresh
dispatch. Never type the answer into the worker that is waiting.wait-report.sh exit 3 — the worker is at an approval or question
dialog. Read the pane, relay the dialog text to the operator verbatim, and
stop the round for that worker. The lead never answers it — an approval
dialog is input, and input to a blocked agent is exactly what Dispatch
Safety forbids. The operator answers; the wait resumes once
herdr agent get <name> reports a state other than blocked.wait-report.sh --once exit 1 — delivery remains pending. Record the
checkpoint, acknowledge its event with a scheduled pending recheck, and resume
the fleet watcher. Never send a second copy of the brief on a status hint.For an authorized implementation release, Step 12 requires all four:
A Phase 1 design note or test plan does not satisfy 2 or 3. A report against an
older SHA does not either: re-run Phase 2 against the current tip. After scoped
re-checks close the findings, re-run Phase 2 with full briefs before handing off
to release. Scoped reports alone never satisfy this gate.
Reassess both passes against current contribution history before releasing. A later discovery that a verifier shaped the task's design or implementation invalidates its independence, even when the reviewed SHA is unchanged. Preserve the historical receipt, append the new gate decision and its evidence to the task ledger, and obtain a fresh independent report. Never rewrite the prior review or treat an old approval as authority over newer contribution evidence.
At Step 12, apply skills/herdr-teamlead/references/assignment-reasoning.md to
the findings and their proposed corrections. Preserve required judge rulings
and operator decisions; scope classification never waives a blocking finding.
Read this task's confirmed fix history, name the next fix number,
and return to Step 4 with self-contained briefs carrying the findings and prior
reports. Preserve the developer for retained fixes; use a fresh context for the
fresh-worker stage. Never reset the counter during re-planning. At an exhausted
allowance, a contested verdict, or a lead override, go to Step 13 first. Use the
recorded bounded plan for authorized extra attempts; collect each preceding
attempt's actual blocking review before continuing.
At Step 19, the lead never edits the branch itself. At an exhausted allowance,
record the checkpoint and concrete correction proposal through the owner commands
in skills/herdr-teamlead/references/dispatch-recovery.md. Report implementation
as waiting_for_operator while the bounded decision is pending; finish the skill
until it arrives. Record an explicit approval once and continue within it.
Otherwise return to Step 12 carrying ACTION: verbatim as required work. Count
that implementation as the next fix, under the same task identifier, and gate the
resulting tip again before release.
The registry build's PR #27 went through 12 automated review rounds — policy reviewer plus Copilot — because the code reached the bots before the team's own reviewer and tester had seen it. Each round cost a full CI cycle and a context reload on the developer.
A plain branch push does not trigger the policy reviewer. That gap is the opening: the developer pushes the branch and stops. The tester and the reviewer run against the pushed branch, the developer folds their blocking findings in, and only then does the PR open — so the bots review work the team has already agreed on, and the usual outcome is one round instead of twelve.
The hand-off is therefore split around the bots:
Skill(skill: "release") Steps 1–4 — readiness, PR,
version reasoning, and the review request.The lead releases nothing until it holds a reviewer Mode B report and a tester Mode C report against the SHA the developer pushed. A newer push invalidates both: re-run Phase 2 against the new tip.
The workers share one GitHub account, and GitHub refuses APPROVE and
REQUEST_CHANGES on that account's own PR. Internal reviews are posted as
COMMENT reviews with each finding labelled blocking or advisory per
rules/review-severity.md. The COMMENT state carries no gate, so the LEAD is
the gate: a blocking finding in an internal review sends the round back,
whatever GitHub's merge box says.
A reserved seat outside ordinary staffing, on the most capable model
available. It holds no other responsibility. rules/agent-team-operation.md
Judge Seat is the contract; this section is the operational detail for
Steps 13–19 of skills/herdr-teamlead/SKILL.md.
Dispatch it on exactly one of four triggers:
references/dispatch-recovery.md.It is read-only without exception: no file edit, no mutating git or gh
command, no GitHub post, no subagent dispatch. It reads both positions and the
governing rule, verifies the disputed facts against the tree itself rather
than trusting either side's framing, and returns a report opening with three
lines — RULING: uphold A | uphold B | amend — <line> | blocked — <question>,
ACTION: naming the minimal step, UNVERIFIED: naming anything it could not
check — followed by its numbered reasons.
blocked is the judge declining to rule on a dispute it cannot settle from
the tree and the rule text alone. The round stops there and the named question
goes to the operator. The lead does not dispatch a second judge and does not
rule in its place.
The ruling binds the round the moment the lead reads it. Only the operator overrides one; record the override and why in the round log.
The judge worker is declared in the main config.json and is measured and
planned like every other seat, but its seat is pinned rather than ranked: the
judge block names the agent, model and effort, the planner never chooses who
judges, and the pinned worker never holds another seat.
It runs on the same Claude subscription as the claude worker, so both
declare the same window_group and the planner charges a seat's cost against
every worker sharing that window. When that window is exhausted the round
halts: there is no substitute judge, no fallback to another vendor's flagship,
and no degraded ruling.
verify-authority.sh.Step 10 of skills/herdr-teamlead/SKILL.md follows these outcomes. Before a
finish, apply the whole-fleet pause/handoff contract in references/supervision.md.
--dry-run — inspect the context choice, requested tier, and relaunch
argv. It contacts no worker, writes no ledger, and proves no live tier or
qualification. Finish here.Step 19 follows these branches. Before a finish, preserve any user question and
apply the whole-fleet pause/handoff contract in references/supervision.md.
The RULING: line binds the round. Only the operator overrides it.
For an investigation-only task, a non-blocked ruling returns to Step 12's knowledge-deliverable gate with the ruling and any required authorized research. Apply the existing correction allowance and judge rules to remaining findings. Do not enter implementation Phase 2 or Step 20 without implementation/release authorization. A blocked ruling follows the operator-question path below.
uphold A / uphold B / amend, ACTION: changing no branch content
— record the ruling. Proceed to Step 20 only with Step 12's broad reports
against the current tip. Otherwise re-run Phase 2 with full briefs carrying
the ruling. Do not re-dispatch the judge for the same settled dispute.uphold A / uphold B / amend, ACTION: changing the branch — apply
the round-flow reference's Branch-Changing Ruling contract. Finish here while
its required operator decision is pending; otherwise return to Step 12 with
ACTION: as the next counted fix.blocked — the judge declined to rule. Stop the round and put its
named question to the operator. Do not dispatch a second judge and do not
rule in its place. Finish here..tessl-plugin
hooks
rules
skills
adopt-fork-pr
herdr-standup
herdr-teamlead
references
teamlead
templates
tests
migrate-to-plugin
onboard-repo
release
tests