General-purpose coding policy for Baruch's AI agents
76
95%
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
Schema for the cross-invocation state the herdr-teamlead skill's Python utility
writes and reads, per rules/stateful-artifacts.md. The utility is the sole
owner: it writes every record and is the only thing that may change their shape.
| Path | Owner | Purpose |
|---|---|---|
$XDG_STATE_HOME/teamlead/state.json (default ~/.local/state/teamlead/state.json, override --state FILE) | skills/herdr-teamlead/teamlead/state.py | Headroom snapshots plus the append-only role-assignment ledger |
$XDG_CONFIG_HOME/teamlead/config.json (default ~/.config/teamlead/config.json, override --config FILE) | the operator | Per-agent usage / clear commands; teamlead reads it and never writes it |
skills/herdr-teamlead/config.example.json is the ship-ready config to copy into
place. A missing config is refused with the exact cp command to run. The
optional idle_markers / working_markers per-agent keys carry the footer
signatures the stale-state probe reads; an agent with neither is never probed.
slash_delivery picks how that worker's slash commands go out, paste or
type; dialog_next_tab_keys names the keys that cycle a usage dialog's tabs;
composer_glyph, composer_ignore_dim, composer_placeholders, and
recover_keys drive the consumed-command check, the ghost-text and placeholder
exemptions, and the guarded one-shot recovery of a stuck composer.
model_label is cosmetic: it names the model on the worker's pane after a
dispatch. All are documented in
skills/herdr-teamlead/references/herdr.md.
The optional top-level role_costs key is the one config entry that is not
per-agent: {"<role>": <number>}, what one round in that seat is expected to
burn out of a worker's remaining headroom percentage. It overrides the
planner's own weights one role at a time, and a role it omits keeps the
default (DEFAULT_ROLE_COSTS in skills/herdr-teamlead/teamlead/planner.py).
A missing map means no overrides; a value that is not a non-negative finite
number is refused, naming the file and the role. plan is the only reader.
{
"schema_version": 2,
"snapshots": ["<measure output>, oldest first, ring capped at 20"],
"assignments": [
{
"schema_version": 2,
"at": "2026-09-01T21:00:00+00:00",
"role": "developer",
"agent": "grok",
"status": "applied"
}
]
}| Field | Type | Meaning |
|---|---|---|
schema_version | integer | Currently 2. Bumped on any shape change |
snapshots | array | Whole measure documents, oldest first; the ring holds the last 20 |
assignments | array | Append-only ledger of who held which role |
assignments[].schema_version | integer | The row's own version, stamped on write |
assignments[].at | string | ISO-8601 timestamp, from --now or the CLI's clock |
assignments[].role | string | The role handed out |
assignments[].agent | string | The agent that received it |
assignments[].status | string | applied, sent_but_not_started, or unknown |
Every hand-off is recorded, one that never started included: the ledger is what
the tool did, and a round that went out and died is the thing worth looking up
afterwards. status keeps that honesty out of the plan — role_counts skips
rows marked sent_but_not_started, so an assignment nobody began never counts
as experience of the role. The skip list is a deny-list: a version 1 row
migrated forward carries unknown and still counts, which says the tool cannot
prove the outcome rather than that the history should vanish.
Every record carries schema_version, not only the document: a ledger row
outlives the document it arrived in, and a version on the row is what makes a
later migration auditable row by row. Each snapshot is a whole measure
document and arrives already stamped.
Each snapshot is one measure document: schema_version, measured_at, an
agents object keyed by agent name (kind, state, herdr_state,
state_source, pane_id, windows, credits, plan, headroom_pct,
skipped), and failed_agents. headroom_pct is the minimum remaining_pct
across that agent's windows. state_source is herdr or probe, naming which
signal decided state; herdr_state carries what herdr claimed. plan is an
informational plan name and never feeds headroom.
measure appends a snapshot; apply appends one ledger entry
per successful hand-off, so an interrupted round still records exactly what
was sent. Writes are atomic: temp file in the same directory, fsync,
os.replace.plan reads the newest snapshot plus the ledger (role history
breaks a headroom tie), and the config's role_costs for its seat weights;
state prints the document. Neither writes.plan still requires a snapshot, passed with
--snapshot when the state file holds none.Only the owner migrates, and it reads a version in one of three directions.
MIGRATIONS / RECORD_MIGRATIONS chain in
skills/herdr-teamlead/teamlead/state.py, keyed by the version being upgraded
from, and the upgraded file is rewritten in place. A document or row carrying
no schema_version reads as the pre-versioning version 0, which is what
gives the chain a step below 1. The 1 → 2 step stamps status: unknown
on every row written before the field existed.A tool failure is not a version case: unreadable permissions or a directory in the state path still raises, carrying the command that fixes it.
Bump schema_version for any shape change; never repurpose a field. The skill
and the utility ship in the same plugin version, so writer and readers move
together — rules/stateful-artifacts.md Cross-Pipeline Schema Bumps does not
apply here.
headroom_pct that is not a finite number — a string, an object, true,
NaN — reads as unknown with a warning naming the agent and the value,
never a crash. Unknown already has a defined place in the ordering, and a
numeric string is coerced rather than discarded.plan may run off a
stale snapshot deliberately; planning has no side effects.apply never trusts a snapshot for an agent's lifecycle state. It re-reads
the live agent through herdr agent get and refuses a working or blocked
worker before sending a single keystroke..tessl-plugin
hooks
rules
skills
adopt-fork-pr
herdr-standup
herdr-teamlead
references
teamlead
tests
migrate-to-plugin
onboard-repo
release
tests