agentic-api
AGENTS.md346 starsChanged 6 days agoApache-2.0View on GitHub
Instructions for AI coding agents working on this repository. Read .agents/skills/agentic-api-engineering/SKILL.md before implementing, refactoring, fixing, or reviewing code. It defines repository-wide discovery, reuse of existing typed extension points, Rust design and Clippy expectations, provider documentation/parity evidence, and the recorder/test workflow. Apply its shared preparation once. For Rust changes, use the bundled Rust skill; use the focused review skills where relevant. This repository is Rust-first under the vllm-project GitHub organization. - Rust -- primary and active implementation language at the repo…
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 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 repository6 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agentic-api-engineeringSkill
- executor-architecture-reviewSkill
- pr-reviewSkill
- rust-skillsSkill
- storage-schema-changeSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
22 rules. About 0 are common, 9 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 7
Read .agents/skills/agentic-api-engineering/SKILL.md before implementing, refactoring, fixing, or reviewing code.
- Very specific: line 24
Read and follow TERMINOLOGY.md when naming API, state, tool, streaming, MCP, or reasoning concepts in code, documentation, issues, and pull …
- Very specific: line 26
Treat TERMINOLOGY.md as normative for preferred prose.
- Very specific: line 28
When local wording conflicts with current OpenAI documentation, prefer the OpenAI term unless this repository has a distinct implementation …
- Very specific: line 70
Before adding or updating replay cassettes, read crates/agentic-server-core/tests/cassettes/README.md and use its recorder workflow and …
- Distinctive: line 99
Read the release guide before preparing or publishing a release or changing release automation.
- Distinctive: line 106
Use the Cargo workspace's declared version as the source of truth.
- Distinctive: line 110
Verify actual registry artifacts before reporting a release complete or updating website install versions.
- Very specific: line 135
Read the target streaming pipeline before changing streaming code in events/ or executor/.
- Distinctive: line 146
Keep transport free of semantic-event and output-item decisions.
- Distinctive: line 147
Keep the relay free of response-assembly state.
- Distinctive: line 148
Do not introduce unbounded channels.
- Very specific: line 150
Run synchronous ingestion inline by default.
- Very specific: line 156
Use .agents/skills/executor-architecture-review/SKILL.md for a focused, read-only boundary review while planning or reviewing these changes.
- Distinctive: line 161
Read Schema, migrations, and where data goes before changing the schema, a migration, or what is persisted.
- Very specific: line 169
Do not use loose/untyped JSON signatures (serde_json::Value and similar) at a public API boundary.
- Very specific: line 173
Prefer borrowing (&T, &str, &[T]) and avoid .clone() unless ownership or lifetime requirements make it necessary.
- Very specific: line 179
Never hold a Mutex/RwLock guard across .await.
- Very specific: line 184
Avoid speculative optimization: minimize allocations in hot paths with borrowing, slices, Bytes, and known capacities, then validate …
- Very specific: line 189
Always sign off commits with the -s flag (git commit -s).
- Distinctive: line 190
Use conventional commit prefixes:
- Distinctive: line 203
Ensure all pre-commit hooks pass before opening the PR.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
AGENTS.md
Instructions for AI coding agents working on this repository.
Before coding or reviewing
Read .agents/skills/agentic-api-engineering/SKILL.md before implementing,
refactoring, fixing, or reviewing code. It defines repository-wide discovery, reuse of existing typed extension
points, Rust design and Clippy expectations, provider documentation/parity evidence, and the recorder/test workflow.
Apply its shared preparation once. For Rust changes, use the bundled
Rust skill; use the focused review skills where relevant.
Project Overview
This repository is Rust-first under the vllm-project GitHub organization.
- Rust -- primary and active implementation language at the repo root.
- Docs -- MkDocs documentation in
docs/. - Python -- a lightweight distribution and launcher for the packaged Rust gateway; the gateway implementation remains Rust-first.
Terminology
- Read and follow
TERMINOLOGY.mdwhen naming API, state, tool, streaming, MCP, or reasoning concepts in code, documentation, issues, and pull requests. - Treat
TERMINOLOGY.mdas normative for preferred prose. Preserve exact field names and item types when discussing a wire protocol. - When local wording conflicts with current OpenAI documentation, prefer the OpenAI term unless this repository has a
distinct implementation concept documented in
TERMINOLOGY.md.
Project Structure
.
├── TERMINOLOGY.md # Normative project vocabulary
├── crates/agentic-server/ # Axum binary, transport handlers, and configuration
├── crates/agentic-server-core/ # Protocol types, execution, tools, and persistence
├── crates/agentic-llm-d/ # Split-execution state backend for the llm-d coordinator
├── crates/agentic-cli-docs/ # Build-time generator for the CLI reference docs
├── crates/agentic-praxis/ # Praxis integration
├── python/agentic_api/ # Python distribution, diagnostics, and launcher
├── tests/python/ # Python package and CLI tests
├── .agents/skills/ # Engineering, Rust, and focused review skills
├── pyproject.toml # Python wheel build metadata
├── Cargo.toml # Workspace manifest and shared dependencies/lints
└── docs/ # Documentation (MkDocs)Setup
Install pre-commit hooks and build the project:
pre-commit install
cargo buildTesting
cargo test
# Python distribution and CLI tests
uv run --python 3.12 --with maturin==1.14.1 --with pytest==9.1.1 python -m pytest tests/python
# Source-install CLI E2E (also exercises the packaged wheel build)
python3 scripts/tests/agentic-cli-e2e-test.py- Before adding or updating replay cassettes, read
crates/agentic-server-core/tests/cassettes/README.mdand use its recorder workflow and existing scenario scripts; do not hand-author captured request/response YAML.
Linting and Formatting
cargo clippy --all-targets -- -D warnings # lint
cargo fmt # format
cargo fmt -- --check # check formatting onlyTo run all pre-commit hooks manually:
pre-commit run --all-filesDocumentation
Install docs dependencies and run docs locally:
uv venv
uv pip install -r docs/requirements.txt
uv run mkdocs serveReleases
- Read the release guide before preparing or publishing a release or changing release automation. Keep that guide synchronized with the workflow inputs and checks.
- PRs and merges validate artifacts; they do not publish packages. Release preparation, crates publication, and PyPI
publication use separate GitHub Actions workflows. Trigger publishing on
mainafter checking the run's commit and version; GitHub Actions handles validation and registry uploads. The crates workflow also publishes the container from the release tag. Container-only recovery uses the dedicated workflow; do not republish packages to repair an image or website failure. - Use the Cargo workspace's declared version as the source of truth. Keep the core dependency and lockfile aligned; do not invent a default release version or a separate Python version.
- Preserve duplicate-version failures and all platform-specific wheel checks. Inspect registry state before retrying
any failed publication; never add
skip-existingor blindly retry a partial upload. - Verify actual registry artifacts before reporting a release complete or updating website install versions. PyPI README/metadata fixes require a new release to reach the published package page.
Code Style
- Rust edition: 2024.
- Maximum line length: 120 characters (configured in
rustfmt.toml). unsafecode is forbidden (unsafe_code = "forbid"inCargo.toml).- Clippy
alllints are denied;pedanticlints are warnings. - Minimum supported Rust version (MSRV): 1.98.1, declared as
rust-versioninCargo.tomland checked by themsrvCI job. Keepmsrvinclippy.tomlequal to it.
The agentic-server and core design architecture
See ARCHITECTURE.md for the full crate breakdown, request lifecycle, module-by-module walkthrough, and contribution guide.
types/owns wire/domain data;events/parses and normalizes upstream events;tool/owns tool discovery, routing, and execution;executor/orchestrates requests across inference, tools, and persistence;storage/owns database models and operations;utils/contains genuinely shared, domain-neutral helpers.- Respect this dependency direction: handlers call core APIs; executor coordinates
events,tool, andstorage; those modules share contracts throughtypes. Do not introduce transport concerns into core types or business logic.
Executor streaming change rules
Read the target streaming pipeline before changing
streaming code in events/ or executor/. RFC #241 is split
into synchronous ingestion #243, client delivery
#244, and execution-placement measurement
#245. New work must converge on those boundaries:
- Assign every responsibility to one stage:
inference.rsowns HTTP/SSE framing,events/owns normalization, the synchronous ingestion state machine owns semantic-event validation and output-item assembly, the stream relay owns ordered client delivery, andengine.rsowns inference rounds, the tool loop, and persistence. - Extend the single ingestion path. Do not add a second parser, lifecycle validator, delta folder, finalizer, tool-call translator, or client-emission path. Different validation policies must share the same state transitions.
- Keep transport free of semantic-event and output-item decisions. Keep ingestion free of client-delivery concerns. Keep the relay free of response-assembly state. Keep the engine free of SSE parsing.
- Do not introduce unbounded channels. A channel needs an entry capacity plus either a byte budget or a maximum item size, defined full/disconnect behavior, cancellation propagation, and task join/error handling.
- Run synchronous ingestion inline by default. Add worker or
spawn_blockingplacement only when representative measurements show a benefit and include queue occupancy, tail latency, memory, and cancellation behavior. - Preserve compile-time extension points: typed output-item state, exhaustive matches, and one declared path for a new semantic event or output-item kind. Test invalid lifecycle order, identifier/index mismatch, duplicate completion, terminal finalization, slow consumers, and disconnects when the changed boundary can encounter them.
Use .agents/skills/executor-architecture-review/SKILL.md for a focused,
read-only boundary review while planning or reviewing these changes.
Storage change rules
Read Schema, migrations, and where data goes before changing
the schema, a migration, or what is persisted. Model SQL stays portable across SQLite and PostgreSQL; backend
differences belong in storage/pool.rs and storage/schema.rs. Keep responses.metadata to what a continuation
needs, and give data read by another path its own column. Use
.agents/skills/storage-schema-change/SKILL.md as the checklist.
Rust Best Practices
- Do not use loose/untyped JSON signatures (
serde_json::Valueand similar) at a public API boundary. Request, response, and tool payloads must be modeled as proper types inagentic-server-core/typesand serialized/ deserialized through them. Functions and APIs introduced in this repo must be typed Rust; untyped JSON is not a substitute for a real type at a public boundary. - Prefer borrowing (
&T,&str,&[T]) and avoid.clone()unless ownership or lifetime requirements make it necessary. Move values when ownership is transferred; useArconly for genuinely shared thread-safe state, and keep required clones explicit and close to task spawn. - Return
Resultfor recoverable failures and propagate with?. Use typedthiserrorerrors in library/core code, preserve sources during conversion, add useful boundary context, and avoidunwrap/expectin production paths except for documented, impossible invariants. - Never hold a
Mutex/RwLockguard across.await. Use Tokio async I/O,spawn_blockingfor blocking or CPU-heavy work, bounded channels for backpressure, andtry_join!for independent fallible work. Spawned tasks must have clear cancellation, shutdown, and join/error handling. - Encode invariants with enums, newtypes,
Option, and validated constructors. Prefer exhaustive matches and safe conversions (From/TryFrom) over stringly typed state, unchecked casts, or panics. - Avoid speculative optimization: minimize allocations in hot paths with borrowing, slices,
Bytes, and known capacities, then validate non-obvious optimizations with measurements.unsaferemains forbidden.
Commits
- Always sign off commits with the
-sflag (git commit -s). - Use conventional commit prefixes:
feat:-- new featurefix:-- bug fixci:-- CI/CD changeschore:-- maintenance tasks (deps, config)docs:-- documentation only
Pull Requests
- Target the
mainbranch. - Include two sections in the PR description:
- Summary -- what the PR does and why.
- Test Plan -- how the changes were verified.
- Ensure all pre-commit hooks pass before opening the PR.
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.

