agent-host-protocol
AGENTS.md386 starsChanged 2 months agoMITView on GitHub
Cross-cutting rules for AI coding agents working in this repository. Per-client codegen conventions are in clients/kotlin/AGENTS.md, clients/swift/AGENTS.md, clients/go/AGENTS.md, and clients/dotnet/AGENTS.md. Editorial rules for protocol types are in .github/instructions/general-instructions.instructions.md. Release mechanics are in RELEASING.md. This repo ships seven independently-versioned artifacts (the spec plus the Rust / Kotlin / Swift / TypeScript / Go / .NET clients), each with its own CHANGELOG.md in Keep-a-Changelog format. The publish workflows refuse to release a tag whose matching ## [X.Y.Z] heading is missing. To avoid…
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 repository10 other files it gives its agents.
- clients/dotnet/AGENTS.mdAGENTS.md
- clients/go/AGENTS.mdAGENTS.md
- clients/kotlin/AGENTS.mdAGENTS.md
- clients/swift/AGENTS.mdAGENTS.md
- docs/guide/agents.mdAGENTS.md
- channels-migrationSkill
- ahp-clientSkill
- session-metadata-migrationSkill
- groom-backlogSkill
- release-ahpSkill
The file
We split this AGENTS.md into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 24
Add a one-line fragment whenever your change is
- Distinctive: line 36
Skip the fragment: when the change is purely:
- Very specific: line 67
Create a uniquely named JSON file under docs/.changes/, usually docs/.changes/YYYYMMDD-short-slug.json.
- Very specific: line 70
Do not include the leading Markdown bullet in message.
- Very specific: line 90
Do not edit CHANGELOG.md files for normal feature/fix PRs and do not invent a ## [X.Y.Z] heading.
- Very specific: line 104
Update the canonical definitions and each affected generator.
- Distinctive: line 108
Check source and binary compatibility separately from JSON compatibility.
≈ “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
Agent Guide — Agent Host Protocol Repo
Cross-cutting rules for AI coding agents working in this repository. Per-client
codegen conventions are in clients/kotlin/AGENTS.md,
clients/swift/AGENTS.md, clients/go/AGENTS.md, and
clients/dotnet/AGENTS.md. Editorial rules
for protocol types are in
.github/instructions/general-instructions.instructions.md. Release mechanics
are in RELEASING.md.
Adding changelog fragments
This repo ships seven independently-versioned artifacts (the spec plus
the Rust / Kotlin / Swift / TypeScript / Go / .NET clients), each with its
own CHANGELOG.md in Keep-a-Changelog format. The publish workflows
refuse to release a tag whose matching ## [X.Y.Z] heading is
missing. To avoid merge conflicts in shared CHANGELOG.md files,
normal PRs add JSON changelog fragments under docs/.changes/ instead
of editing the changelogs directly. Release PRs collapse those fragments
into the seven changelogs with npm run changelog:release.
When to add an entry
Add a one-line fragment whenever your change is user-visible:
- A new, removed, renamed, or behaviourally-changed action, command, state
field, error, notification, or version constant in
types/. - A new, removed, or behaviourally-changed public API in one of the
clients/<lang>/source trees (constructor signatures, exported functions/types, transport options, reducer outputs, etc.). - A bug fix that changes observable behaviour for a consumer of the spec or any client.
- A security-relevant change (use
"type": "security").
Skip the fragment when the change is purely:
- Edits under
**/generated/**(those mirror atypes/change that should have its own entry). - Docs in
docs/,README.md, comments, AGENTS.md, CONTRIBUTING.md. - Tests, CI, lint config, formatting, internal refactors with no observable effect.
Which artifact(s) to target
Each fragment may specify a targets array. Omit targets when the same
entry applies to the spec and all clients (the common case for protocol
surface changes). Set targets to a subset when the change is only visible
to specific artifacts.
Map source paths to fragment targets:
| Source path touched | Fragment target(s) |
types/** (protocol surface) | Omit targets (spec + all clients) unless the visibility is intentionally narrower. |
clients/rust/** (non-generated) | "targets": ["rust"] |
clients/kotlin/** (non-generated) | "targets": ["kotlin"] |
clients/swift/** (non-generated) | "targets": ["swift"] |
clients/typescript/** (non-generated) | "targets": ["typescript"] |
clients/go/** (non-generated) | "targets": ["go"] |
clients/dotnet/** (non-generated) | "targets": ["dotnet"] |
schema/** | "targets": ["spec"] |
scripts/generate*.ts that changes any client's generated output | Omit targets or list every affected target. |
Format
Create a uniquely named JSON file under docs/.changes/, usually
docs/.changes/YYYYMMDD-short-slug.json. Use lowercase Keep-a-Changelog
types: added, changed, deprecated, removed, fixed, security.
Do not include the leading Markdown bullet in message.
{
"type": "added",
"message": "`session/cancelTurn` action for client-initiated turn cancellation.",
"issues": [123]
}Scoped client-only example:
{
"type": "fixed",
"message": "`AhpClient.connect` now rejects with `AhpProtocolError` on negotiation failure.",
"targets": ["typescript"]
}Do not edit CHANGELOG.md files for normal feature/fix PRs and do
not invent a ## [X.Y.Z] heading. Changelogs are updated by the release
maintainer per RELEASING.md. Run
npm run verify:change-fragments to validate fragment JSON.
Preserve protocol object types
For new or changed protocol objects with a fixed schema, prefer named, reusable
types in types/ and generated native models. Do not replace a known shape with
raw JSON to work around a generator gap.
Reserve raw JSON for intentionally open data, such as _meta, JSON Schema and
tool payloads, provider extensions, and unknown variants.
Update the canonical definitions and each affected generator. Do not hand-edit
generated files. Preserve wire names, nesting, optionality, numeric mappings,
and collection wrappers such as { items: ... }.
Check source and binary compatibility separately from JSON compatibility. Define an explicit migration for public API changes. Keep native decoding errors visible. Cover known shapes with shared round-trip fixtures, not per-language serialization tests.
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.

