pi-herdsman
AGENTS.md121 starsChanged 2 months agoApache-2.0View on GitHub
All repository-local documentation must describe only the current extension behavior. - Keep SKILL.md, docs/reference/, docs/guides/, and all other docs current-version-only. - Do not add historical release, migration, legacy-name, or compatibility guidance for removed behavior. - Document only verified current semantics and known limitations. Repository changes must follow the scope and ownership principles in Product philosophy. Keep Herdsman focused on the orchestration problems it owns. Prefer the smallest integration-agnostic capability supported by demonstrated need, and leave provider-, model-, extension-, tool-, storage-,…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository4 other files it gives its agents.
- docker/AGENTS.mdAGENTS.md
- agentic-system-auditSkill
- testingSkill
- agentsSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
18 rules. About 0 are common, 13 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
All repository-local documentation must describe only the current extension behavior.
- Very specific: line 8
Keep SKILL.md, docs/reference/, docs/guides/, and all other docs current-version-only.
- Distinctive: line 10
Do not add historical release, migration, legacy-name, or compatibility guidance for removed behavior.
- Distinctive: line 12
Document only verified current semantics and known limitations.
- Distinctive: line 19
Keep Herdsman focused on the orchestration problems it owns.
- Distinctive: line 42
When changing an invariant:
- Distinctive: line 45
update only affected projections.
- Distinctive: line 46
remove obsolete or overlapping reinforcement.
- Distinctive: line 47
verify that all remaining representations preserve the same meaning.
- Distinctive: line 53
Do not add runtime skill loading, generated prompt files, a prompt registry, or another synchronization subsystem merely to keep prose …
- Very specific: line 58
Before making a durable architectural change, inspect relevant records in docs/adr/.
- Distinctive: line 122
Run only the scenarios relevant to the change.
- Distinctive: line 127
Test behavior at its lowest authoritative layer.
- Distinctive: line 130
Keep separate test files only for source boundaries or required process/module-mock isolation.
- Very specific: line 131
Add no dependency or fixture abstraction when node:test and a few lines suffice.
- Very specific: line 133
Use project-local .pi-herdsman/ for temporary plans, scopes, specifications, decisions, investigations, review criteria, and handoff state …
- Very specific: line 142
Run Backlog CLI reads and writes from the worktree where .backlog/ exists.
- Distinctive: line 151
Follow the detailed validation order in Development validation.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Repository Project-Local AGENTS.md
Repository documentation
All repository-local documentation must describe only the current extension behavior.
- Keep
SKILL.md,docs/reference/,docs/guides/, and all other docs current-version-only. - Do not add historical release, migration, legacy-name, or compatibility guidance for removed behavior.
- Document only verified current semantics and known limitations.
Product philosophy
Repository changes must follow the scope and ownership principles in Product philosophy.
Keep Herdsman focused on the orchestration problems it owns. Prefer the smallest integration-agnostic capability supported by demonstrated need, and leave provider-, model-, extension-, tool-, storage-, and service-specific semantics to their owners.
Instruction and interface design
Repository changes must follow the principles in Instruction and interface design.
Apply them across runtime behavior, model-facing instructions, tools, schemas, state, validation, documentation, tests, and public interfaces.
Runtime instruction authority
Runtime behavior and authoritative runtime contracts define Herdsman's
operational semantics. SKILL.md, documentation, examples, and tests project
those semantics; they do not independently redefine them.
The runtime contract must remain sufficient without loading SKILL.md.
SKILL.md may reinforce high-salience invariants and add strategy, rationale,
examples, and recovery detail.
When changing an invariant:
- change its authoritative source first;
- update only affected projections;
- remove obsolete or overlapping reinforcement;
- verify that all remaining representations preserve the same meaning.
A behavioral invariant may be reinforced at multiple model-facing decision points when timing or salience materially affects reliability. Those projections must preserve one meaning and must not evolve into independent rules.
Do not add runtime skill loading, generated prompt files, a prompt registry, or another synchronization subsystem merely to keep prose copies aligned.
Architecture decisions
Before making a durable architectural change, inspect relevant records in
docs/adr/. Do not contradict an active ADR without superseding it in the
same change. Record only durable, non-obvious architectural decisions; keep
local implementation facts in code or comments and agent operating instructions
in AGENTS.md.
Code map
extension/index.ts: Pi extension composition, shared registration, and runtime selection.extension/agent-controller.ts: Shared owner-side Agent delegation, control, recovery, and result lifecycle.extension/managed-agent-runtime.ts: Managed-Agent request, result, context, metadata, and nested-delegation runtime.extension/lead-runtime.ts: Lead, Manager, Chief, supervision, project, status, and role lifecycle.extension/agent-definitions.ts: Agent-definition discovery, validation, overrides, and launch arguments.extension/herdr.ts: Herdr topology, startup, shutdown, and process ownership.extension/mailbox.ts: Durable mailbox protocol and record persistence.extension/core.ts: Shared lifecycle and message-preparation logic.extension/errors.ts: Structured extension error categories.extension/lock.ts: Process-lock ownership.extension/presentation.ts: Model, TUI, and status presentation.extension/config.ts: Flat Pi Herdsman configuration.extension/supervision.ts: Chief lease, supervision projection, lead transport, and staff tool contracts.extension/support.ts: Shared extension integration-test mocks and fixtures.extension/extension-contract.test.ts: Extension and model contract behavior.extension/controller-api.test.ts: Controller authorization and live-control behavior.extension/herdr.test.ts: Herdr inspection/read and topology contract behavior.extension/controller-lifecycle.test.ts: Authorized delegation lifecycle behavior.extension/agent-runtime.test.ts: Managed-agent runtime behavior.extension/recovery.test.ts: Failure, recovery, and cleanup behavior.extension/commands.test.ts:/agentsand/chiefconfiguration UI behavior.extension/supervision.test.ts: Chief roles, lease, supervision, transport, and staff tool behavior.extension/supervision-malformed-cleanup.test.ts: malformed supervision cleanup behavior.
Development loop
During implementation, run the smallest relevant test file first:
npm test -- extension/<area>.test.tsNarrow further when useful:
npm test -- --test-name-pattern="<pattern>" extension/<area>.test.tsFocused tests provide development feedback. Focused tests, smoke testing,
review, and all intermediate checks must happen before formatting. Do not
format during those phases. Before handoff, follow the detailed validation
order in Development validation: run
prettier . --write once as the final pre-commit mutation, then run only the
read-only checks npm run check and git diff --check before staging or
committing.
For changes that cross the real Pi/Herdr runtime boundary, use the isolated live smoke harness documented in Smoke testing:
npm run smoke -- core
npm run smoke -- continuation
npm run smoke -- chief-tree
npm run smoke -- manager-recoveryRun only the scenarios relevant to the change. Live smoke is opt-in and must complete before the final formatting/validation sequence.
Testing architecture
- Test behavior at its lowest authoritative layer.
- Integration tests prove wiring and layer crossings, not duplicate lower-layer matrices.
- Table-drive variants of one invariant.
- Keep separate test files only for source boundaries or required process/module-mock isolation.
- Add no dependency or fixture abstraction when
node:testand a few lines suffice.
Use project-local .pi-herdsman/ for temporary plans, scopes, specifications,
decisions, investigations, review criteria, and handoff state used to
coordinate repository work. Reuse an adequate artifact instead of creating a
parallel source of truth. These files remain untracked and are not product
documentation.
Backlog
- The ignored
.backlog/repository exists only in the main worktree. Run Backlog CLI reads and writes from the worktree where.backlog/exists; do not copy, synchronize, or manually edit it in another worktree. - For each newly verified material issue, search first, then record the exact reproduction, expected and observed behavior, impact, and evidence through the CLI. Do not file speculative or duplicate issues; report the task ID, impact, and whether it blocks the current work.
Validation
- Follow the detailed validation order in Development validation.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

