Skip to content

Latest commit

 

History

History
95 lines (70 loc) · 4.73 KB

AGENTS.md

File metadata and controls

95 lines (70 loc) · 4.73 KB

All paths in the protocol should be absolute

Adding new methods

  • Create the params and output structs in agent-client-protocol-schema/src/{v1,v2}/{agent,client}.rs under the corresponding section, with the fields the RFD or request defines. Follow the schema rules below for each field.

  • If the protocol method name is noun/verb, use verb_noun for the user facing methods and structs.

    Example 1 (noun/noun): Protocol method: terminal/output Trait method name: terminal_output Request/Response structs: TerminalOutputRequest / TerminalOutputResponse Method names struct: terminal_output: &'static str

    Example 2 (noun/verb): Protocol method: terminal/new Trait method name: new_terminal Request/Response structs: NewTerminalRequest / NewTerminalResponse Method names struct: terminal_new: &'static str

  • Add constants for the method names

  • Add variants to {Agent|Client}{Request|Response} enums

  • Add the method to the SideDocs functions in schema-generator/src/main.rs

  • Run npm run generate and fix any issues that appear

  • Run npm run check

  • Update the example agents and clients in tests and examples in both libraries

Schema rules

  • For any nullable field, explicitly define whether it is required or optional and whether null is equivalent to an omitted key before running schema generation.
  • Use DefaultOnError/VecSkipError only when the fallback means less (no metadata, an unsupported capability, a missing display item). If the receiver acts on the value (runs, reads, connects, or applies something), keep it strict so a request fails with -32602 instead of silently doing something else; use DefaultOnNull on such lists so null still means empty.
  • A malformed value for a known discriminator must not fall through to an untagged fallback variant.

Updating existing methods, their params, or output

  • Update the mintlify docs and guides in the docs directory
  • Make the same change in both the stable page and its draft/ copy, unless the change is draft-only
  • Run npm run check to make sure the json and zod schemas gets generated properly

Writing spec prose and schema descriptions

These apply to the docs/protocol pages and to Rust doc comments, which become the descriptions in the generated schema.

  • Say what the protocol does: name the method, field, or behavior. Skip sentences that only describe benefits ("enables rich interactions", "provides a flexible way", "seamless integration").
  • Don't tack on -ing clauses ("…, allowing Clients to…", "…, providing visibility into…"). Write "Clients use it to…" or start a new sentence.
  • Name concrete methods and capabilities instead of abstract nouns. Write "Agents that advertise capabilities.session" or "auth/login and auth/logout", not "the session method surface" or "the authentication surface".
  • Use periods instead of semicolons or em dashes to join clauses. Use straight quotes.
  • Prefer plain words: "use", not "leverage" or "utilize"; "to", not "in order to".
  • Use sentence case for headings. Keep Agent, Client, and acronyms capitalized.
  • v1 is stable: rewording must not add, remove, or change a requirement. Keep every MUST/SHOULD/MAY and its scope as it was, and don't state behavior the v1 spec doesn't already define. Draft v2 pages can change freely.

Never write readme files related to the conversation unless explicitly asked to.

Conventional Commits

This repository uses Conventional Commits for automated releases via release-plz. All commit messages should follow this format:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Commit Types

  • feat: A new feature (triggers minor version bump)
  • fix: A bug fix (triggers patch version bump)
  • docs: Documentation only changes
  • style: Code style changes (formatting, missing semicolons, etc.)
  • refactor: Code changes that neither fix bugs nor add features
  • perf: Performance improvements
  • test: Adding or updating tests
  • chore: Maintenance tasks, dependency updates, etc.
  • ci: CI/CD configuration changes
  • build: Build system or external dependency changes

Examples

feat(schema): add support for dynamic proxy chains
fix(unstable): resolve deadlock in message routing
docs(rfd): update README with installation instructions
chore: bump tokio to 1.40

Scope Guidelines

Common scopes for this repository:

  • schema - Anything that touches the actual generated schema
  • unstable - Any changes that would only touch unstable features
  • unstable-v2 - Any changes that would only touch v2
  • rust - Any changes that only touch Rust code and how Rust handles the data with no changes to the schema
  • rfd - Any changes that only touch RFD documentation