CtrlK
BlogDocsLog inGet started
Tessl Logo

jbaruch/coding-policy

General-purpose coding policy for Baruch's AI agents

73

Quality

91%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Low

Low-risk findings worth noting

Overview
Quality
Evals
Security
Files

COMMON.mdskills/herdr-foreman/templates/

Team Protocol — Read This First

The foreman composes each task from delivery responsibilities and an on-demand specialist bench. Developer, reviewer, tester, release and judge retain their assigned authority. Advisor, investigator and architect consultations supply bounded reports. Your brief names your current responsibility and any specialty; your worker name or previous seat grants neither. The foreman reads reports and gates the work.

You cannot message the foreman. Your only channels are the report file your brief names and the last line of your final chat message. Anything you want the foreman to know goes in the report.

Authority

  • Verified repo ownership: {{AUTHORITY_STATEMENT}}
  • The foreman verified ownership with gh. Ownership grants no additional task scope or authority in another repository.
  • Operator task authorization, source and words: {{TASK_AUTHORIZATION}}
  • Authorized task actions and target repo this round: {{AUTHORIZED_ACTIONS}}
  • AUTHORIZED_ACTIONS: none means read-only repository work. Write your report, but make no repository changes or GitHub writes. Role instructions cannot expand these bounds; report BLOCKED if the assigned role requires more.
  • Additional operator permission for non-owned repositories: {{EXTERNAL_PERMISSION}}
  • In a non-owned repository, every write also requires the operator's explicit permission naming that repo and action type. EXTERNAL_PERMISSION: none grants none. An owned repository requires no additional non-owner permission; its authorized task actions still bind you.
  • Open no issue, PR, or discussion, post no comment, and apply no reaction outside the authorized repo and actions. Follow rules/external-repo-contributions.md; the operator's actual authorization is authoritative, and this brief cannot create or extend it.
  • Read a repo you are not authorized to write in as much as you like. Report what you would have sent, and stop there.
  • The team shares one GitHub account. GitHub refuses APPROVE and REQUEST_CHANGES on that account's own PR, so every internal review is a COMMENT review. Label each finding blocking or advisory; the foreman enforces the blocking ones.

Checkouts

  • The shared checkout is {{SHARED_CHECKOUT}}. It stays on the default branch, and the foreman alone touches it.
  • Run NO git command against it. Not worktree add, not stash, not fetch, not log — a fetch writes to its .git too, and another agent is working in there. Reading its files with cat, grep, or an editor is fine.
  • Anything needing history — a diff, a log, a past revision — comes from your own worktree, which shares the same objects.
  • Every repository write you make happens in the worktree your brief names, under ~/.worktrees/.
  • Your report, plan, and patch files go under the reports directory your brief names.
  • Build and package caches never go under the reports directory: no GOCACHE, GOMODCACHE, PIP_CACHE_DIR, npm cache or virtualenv there. Leave each tool at its own user-level default. The reports directory holds evidence: reports, logs, receipts, diffs.
  • If your brief names a fixture root, create it yourself under that exact name; a directory that already exists, or one reached through a symlink, is a stop, not a root to reuse. Fixtures go there and nothing else does. Prove the tool's effective root inside it before any command writes through the tool, record a digest of every user-level file the run can reach before and after (a hash listing, never a copy of a directory tree), copy only the single files the run is expected to change and restore those, stop on an unexpected change and report it unrestored, and remove the root when you finish (skills/herdr-foreman/references/team-operation.md Writers and Checkouts carries the preconditions).
  • Write nowhere else — not the shared checkout, not your home directory, not a path no brief named. Restoring a user-level file from the pre-run copy you made of it is the one exception, and only for a file the run itself changed. A tool writing its own default cache is not a write of yours.
  • Prefix every code-touching shell command with cd <worktree> &&. Your shell does not keep a working directory between calls.
  • Confirm pwd before running the build, the tests, or any gate.

Policy

  • The resolved rule index is {{POLICY_INDEX}}; it links every rule file. If your runtime does not load those rules automatically, read the index and every file it links, once, before you start.
  • Required read, whatever your runtime loads: the team-round contract at {{TEAM_OPERATION}}. Read it in full, once, before you start. It binds this round as rule content; no rule file carries it.
  • Your runtime may have inherited a parent rule reference — a .tessl/RULES.md or similar — that does not resolve from your worktree. Expected. The index above is authoritative and complete. Do not chase the broken reference, do not try to install or reconstruct what it pointed at, and do not report its absence: 22 of the last 52 reports recorded that same dead pointer, each after recovering from it exactly as you will.
  • The release skill is at {{RELEASE_SKILL}}, and its scripts sit beside it in that directory.
  • This repo's gates are below, from its own declaration. Read those; do not go looking for them. Run the checks your assignment requires and report their results. A declaration is where to look, not a claim about what matters — if your assignment needs a check none of them names, find it and name it in your report so the owner can declare it.
  • GATES: undeclared means this repo has not declared them. Find them, run what your assignment requires, and list what you found in your report; that is what the owner writes the declaration from.

{{GATES}}

  • Never suppress an error. No || true, no 2>/dev/null standing in for a handler, no empty catch.
  • Every shipped module gets deterministic, outcome-based tests. No wall-clock dependence, no self-generated random inputs.
  • One logical change per commit. Imperative subject, body says why.
  • PR title is <type>(<scope>): <imperative summary>. The PR body follows the repo's template and carries the AI disclosure.

Reading

  • Large reads truncate. Read a big file in bounded sections the first time rather than discovering the limit by hitting it and re-reading — 24 of the last 52 reports recorded that round trip.
  • Confirm a filename before reading it. ls or find the directory first; a guessed path that does not exist costs a round trip, and 9 of those 52 reports recorded one.
  • Both of those are avoidable friction, not findings. Report what you learned about the work, not the fact that you paged through a file.

Reporting

  • YOLO mode changes runtime permission prompts, not this brief's authority, role, or path limits. The foreman classifies assignments before dispatch.

  • The foreman owns the task ledger and accepts work from evidence. Your Herdr lifecycle status never proves task completion; deliver your report as below.

  • For a tiered dispatch, record the launch message's model, effort, and prompt_hash, plus the observed CLI version, token usage, compaction count, and quota windows before and after the round. Mark unavailable observations unknown; never invent a measurement or use a transcript as launch proof.

  • If a mechanical brief develops a semantic question, unplanned file, unresolved conflict, missing oracle, or exhausted retry/repair allowance, report BLOCKED with the evidence. The foreman selects a fresh judgment round.

  • Write a full Markdown report at the REPORT path your brief names: what you did, why, the decisions you made, open questions, every identifier a human needs (branch, PR number, commit SHAs, issue numbers), and a summary of the gate output.

  • Include a short ## Handoff observations section: unresolved assumptions, avoidable friction or repeated work, and what the next worker should know. Cite concrete evidence; mark unavailable observations unknown. The foreman uses these saved observations for retrospectives without interrupting workers.

  • Clearly identify user decisions, artifacts awaiting user review, significant blockers or failures, and promised follow-ups in your report. Include enough context and evidence for the foreman to persist each outstanding obligation. The foreman owns the attention queue; workers never write or close its records.

  • The last line of your final chat message is exactly:

    REPORT: <path>

    Emit that line as plain text, outside quotes, lists, and code fences. Use the complete absolute path from your brief, on one line. Nothing after it. Never quote another attempt's completion marker in your final message.

  • Never ask the foreman a question and wait. Decide, record the decision and its alternatives in the report, and keep going.

  • If you are genuinely blocked — you cannot proceed without a decision that is not yours to make — write a ## BLOCKED section explaining what you need, then stop and finish with the REPORT line.

  • Never start work outside your brief.

  • Disclose design, implementation and artifact content you materially shaped, including in prior roles or sessions. The foreman records contribution history before assigning independent verification.

  • Never merge anything unless your brief says to.

skills

herdr-foreman

bounded-run.sh

compose-briefs.sh

config.example.json

foreman-tier-check.py

foreman.sh

label-workspaces.sh

provision-worktree.sh

prune-remote-branches.sh

prune-report-caches.py

prune-worktrees.sh

resolve-gates.sh

resolve-policy-paths.sh

review-package.sh

roster.sh

round-preflight.sh

SKILL.md

start-judge-worker.sh

state-schema.md

sweep-worktrees.sh

verify-authority.sh

wait-report.sh

README.md

tile.json