Skip to content

Commit d84a0d3

Browse files
author
Chojan Shang
committed
docs: make every docs read easy
Signed-off-by: Chojan Shang <[email protected]>
1 parent 68d95fe commit d84a0d3

File tree

8 files changed

+234
-265
lines changed

8 files changed

+234
-265
lines changed

AGENTS.md

Lines changed: 45 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,47 @@
1-
# Repository Guidelines
2-
3-
## Project Structure & Module Organization
4-
- `src/acp/`: runtime package exposing agent/client abstractions, transports, and the generated `schema.py`.
5-
- `schema/`: upstream JSON schema sources; regenerate Python bindings with `make gen-all`.
6-
- `examples/`: runnable scripts (`echo_agent.py`, `client.py`, `gemini.py`, etc.) demonstrating stdio orchestration patterns.
7-
- `tests/`: pytest suite, including opt-in Gemini smoke checks under `tests/test_gemini_example.py`.
8-
- `docs/`: MkDocs content powering the hosted documentation.
9-
10-
## Build, Test, and Development Commands
11-
- `make install` — provision the `uv` virtualenv and install pre-commit hooks.
12-
- `make check` — run Ruff linting/formatting, type analysis, dependency hygiene, and lock verification.
13-
- `make test` — execute `pytest` (with doctests) inside the managed environment.
14-
- `make gen-all` — refresh protocol artifacts when the ACP schema version advances (`ACP_SCHEMA_VERSION=<ref>` to pin an upstream tag).
15-
16-
## Coding Style & Naming Conventions
17-
- Target Python 3.10+ with four-space indentation and type hints on public APIs.
18-
- Ruff enforces formatting and lint rules (`uv run ruff check`, `uv run ruff format`); keep both clean before publishing.
19-
- Prefer dataclasses or generated Pydantic models from `acp.schema` over ad-hoc dicts. Place shared utilities in `_`-prefixed internal modules.
20-
- Prefer the builders in `acp.helpers` (for example `text_block`, `start_tool_call`) when constructing ACP payloads. The helpers instantiate the generated Pydantic models for you, keep literal discriminator fields out of call sites, and stay in lockstep with the schema thanks to the golden tests (`tests/test_golden.py`).
21-
22-
## Testing Guidelines
23-
- Tests live in `tests/` and must be named `test_*.py`. Use `pytest.mark.asyncio` for coroutine coverage.
24-
- Run `make test` (or `uv run python -m pytest`) prior to commits; include reproducing steps for any added fixtures.
25-
- Gemini CLI coverage is disabled by default. Set `ACP_ENABLE_GEMINI_TESTS=1` (and `ACP_GEMINI_BIN=/path/to/gemini`) to exercise `tests/test_gemini_example.py`.
26-
27-
## Commit & Pull Request Guidelines
28-
- Follow Conventional Commits (`feat:`, `fix:`, `docs:`, etc.) with succinct scopes, noting schema regenerations when applicable.
29-
- PRs should describe exercised agent behaviours, link relevant issues, and include output from `make check` or focused pytest runs.
30-
- Update documentation and examples whenever public APIs or transport behaviours change, and call out environment prerequisites for new integrations.
1+
# Repository Handbook
2+
3+
Use this page as the quick orientation for the Python SDK repo. It mirrors the tone of the main README/index and surfaces what you need without hunting through multiple docs.
4+
5+
## Repo Map
6+
7+
| Path | Why it exists |
8+
| --- | --- |
9+
| `src/acp/` | Runtime package: agent/client bases, transports, helpers, schema bindings, contrib utilities |
10+
| `schema/` | Upstream JSON schema sources (regenerate with `make gen-all`) |
11+
| `examples/` | Runnable scripts such as `echo_agent.py`, `client.py`, `gemini.py`, `duet.py` |
12+
| `tests/` | Pytest suite, including optional Gemini smoke tests in `tests/test_gemini_example.py` |
13+
| `docs/` | MkDocs content published at `agentclientprotocol.github.io/python-sdk/` |
14+
15+
## Daily Commands
16+
17+
| Need | Command |
18+
| --- | --- |
19+
| Bootstrap env + pre-commit | `make install` |
20+
| Format, lint, types, deps | `make check` |
21+
| Test suite (pytest + doctest) | `make test` |
22+
| Regenerate schema + bindings | `ACP_SCHEMA_VERSION=<tag> make gen-all` |
23+
24+
## Style Guardrails
25+
26+
- Target Python 3.10+ and keep public APIs typed.
27+
- Ruff handles formatting + linting (`uv run ruff format` / `check`)—keep both clean before pushing.
28+
- Reach for the generated Pydantic models and helpers (e.g. `text_block`, `start_tool_call`) instead of hand-crafting dicts; helpers stay aligned with the schema via `tests/test_golden.py`.
29+
- Place reusable internals in `_`-prefixed modules.
30+
31+
## Testing Expectations
32+
33+
- Tests live under `tests/` and follow the `test_*.py` naming. Mark async tests with `pytest.mark.asyncio`.
34+
- Run `make test` (or `uv run python -m pytest`) before committing and include reproduction steps for new fixtures.
35+
- Gemini CLI checks are opt-in: set `ACP_ENABLE_GEMINI_TESTS=1` and optionally `ACP_GEMINI_BIN=/path/to/gemini` to exercise `tests/test_gemini_example.py`.
36+
37+
## PR Checklist
38+
39+
- Use Conventional Commit prefixes (`feat:`, `fix:`, `docs:`, etc.) and call out schema regenerations explicitly.
40+
- Summarise exercised behaviours, link related issues, and attach `make check` / targeted pytest output in PR descriptions.
41+
- Update docs/examples when user-visible APIs or transports change, and document any new environment requirements.
3142

3243
## Agent Integration Tips
33-
- Bootstrap agents from `examples/echo_agent.py` or `examples/agent.py`; pair with `examples/client.py` for round-trip validation.
34-
- Use `spawn_agent_process` / `spawn_client_process` to embed ACP parties directly in Python applications.
35-
- Validate new transports against `tests/test_rpc.py` and, when applicable, the Gemini example to ensure streaming updates and permission flows stay compliant.
44+
45+
- Start new agents from `examples/echo_agent.py` or `examples/agent.py`; pair them with `examples/client.py` for loopback validation.
46+
- `spawn_agent_process` / `spawn_client_process` embed ACP parties inside Python apps without hand-wiring stdio.
47+
- Validate new transports against `tests/test_rpc.py` and (when relevant) the Gemini example to ensure streaming + permission flows stay compliant.

CONTRIBUTING.md

Lines changed: 35 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,47 @@
1-
# Contributing to `agentclientprotocol/python-sdk`
1+
# Contributing
22

3-
Contributions are welcome, and they are greatly appreciated!
4-
Every little bit helps, and credit will always be given.
3+
Thanks for helping improve the Agent Client Protocol Python SDK! This guide mirrors the concise tone of the README/index so you can skim it quickly and get back to building.
54

6-
You can contribute in many ways:
5+
## Ways to help
76

8-
# Types of Contributions
7+
- **Report bugs** — file an issue with repro steps, OS + Python versions, and any environment toggles.
8+
- **Improve docs/examples** — clarify workflows, add integration notes, or document a new transport.
9+
- **Fix issues** — search for `bug` / `help wanted` labels or tackle anything that affects your integration.
10+
- **Propose features** — describe the use case, API shape, and constraints so we can scope the work together.
911

10-
## Report Bugs
12+
## Filing great issues
1113

12-
Report bugs at https://github.com/agentclientprotocol/python-sdk/issues
14+
When reporting a bug or requesting a feature, include:
1315

14-
If you are reporting a bug, please include:
16+
- The ACP schema / SDK version you’re using.
17+
- How to reproduce the behaviour (commands, inputs, expected vs. actual).
18+
- Logs or payload snippets when available (scrub secrets).
1519

16-
- Your operating system name and version.
17-
- Any details about your local setup that might be helpful in troubleshooting.
18-
- Detailed steps to reproduce the bug.
20+
## Local workflow
1921

20-
## Fix Bugs
22+
1. **Fork & clone** your GitHub fork: `git clone [email protected]:<you>/python-sdk.git`.
23+
2. **Bootstrap tooling** inside the repo root: `make install`. This provisions `uv`, syncs deps, and installs pre-commit hooks.
24+
3. **Create a topic branch:** `git checkout -b feat-my-improvement`.
25+
4. **Develop + document:**
26+
- Keep code typed (Python 3.10+), prefer generated models/helpers over dicts.
27+
- Update docs/examples when user-facing behaviour shifts.
28+
5. **Run the test gauntlet:**
29+
```bash
30+
make check # formatting, lint, type analysis, deps
31+
make test # pytest + doctests
32+
```
33+
Optional: `ACP_ENABLE_GEMINI_TESTS=1 make test` when you have the Gemini CLI available.
34+
6. **(Optional) Cross-Python smoke:** `tox` if you want the same matrix CI runs.
35+
7. **Commit + push:** `git commit -m "feat: add better tool call helper"` followed by `git push origin <branch>`.
2136

22-
Look through the GitHub issues for bugs.
23-
Anything tagged with "bug" and "help wanted" is open to whoever wants to implement a fix for it.
37+
## Pull request checklist
2438

25-
## Implement Features
39+
- [ ] PR title follows Conventional Commits.
40+
- [ ] Tests cover the new behaviour (or the reason they’re not needed is documented).
41+
- [ ] `make check` / `make test` output is attached or referenced.
42+
- [ ] Docs and examples reflect user-visible changes.
43+
- [ ] Any schema regeneration (`make gen-all`) is called out explicitly.
2644

27-
Look through the GitHub issues for features.
28-
Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it.
45+
## Need help?
2946

30-
## Write Documentation
31-
32-
This project could always use more documentation, whether as part of the official docs, in docstrings, or even on the web in blog posts, articles, and such.
33-
34-
## Submit Feedback
35-
36-
The best way to send feedback is to file an issue at https://github.com/agentclientprotocol/python-sdk/issues.
37-
38-
If you are proposing a new feature:
39-
40-
- Explain in detail how it would work.
41-
- Keep the scope as narrow as possible, to make it easier to implement.
42-
- Remember that this is a volunteer-driven project, and that contributions
43-
are welcome :)
44-
45-
# Get Started!
46-
47-
Ready to contribute? Here's how to set up the project for local development.
48-
Please note this documentation assumes you already have `uv` and `Git` installed and ready to go.
49-
50-
1. Fork the `agentclientprotocol/python-sdk` repo on GitHub.
51-
52-
2. Clone your fork locally:
53-
54-
```bash
55-
cd <directory_in_which_repo_should_be_created>
56-
git clone [email protected]:YOUR_NAME/python-sdk.git
57-
```
58-
59-
3. Now we need to install the environment. Navigate into the directory
60-
61-
```bash
62-
cd python-sdk
63-
```
64-
65-
Then, install and activate the environment with:
66-
67-
```bash
68-
uv sync
69-
```
70-
71-
4. Install pre-commit to run linters/formatters at commit time:
72-
73-
```bash
74-
uv run pre-commit install
75-
```
76-
77-
5. Create a branch for local development:
78-
79-
```bash
80-
git checkout -b name-of-your-bugfix-or-feature
81-
```
82-
83-
Now you can make your changes locally.
84-
85-
6. Don't forget to add test cases for your added functionality to the `tests` directory.
86-
87-
7. When you're done making changes, check that your changes pass the formatting tests.
88-
89-
```bash
90-
make check
91-
```
92-
93-
Now, validate that all unit tests are passing:
94-
95-
```bash
96-
make test
97-
```
98-
99-
9. Before raising a pull request you should also run tox.
100-
This will run the tests across different versions of Python:
101-
102-
```bash
103-
tox
104-
```
105-
106-
This requires you to have multiple versions of python installed.
107-
This step is also triggered in the CI/CD pipeline, so you could also choose to skip this step locally.
108-
109-
10. Commit your changes and push your branch to GitHub:
110-
111-
```bash
112-
git add .
113-
git commit -m "Your detailed description of your changes."
114-
git push origin name-of-your-bugfix-or-feature
115-
```
116-
117-
11. Submit a pull request through the GitHub website.
118-
119-
# Pull Request Guidelines
120-
121-
Before you submit a pull request, check that it meets these guidelines:
122-
123-
1. The pull request should include tests.
124-
125-
2. If the pull request adds functionality, the docs should be updated.
126-
Put your new functionality into a function with a docstring, and add the feature to the list in `README.md`.
47+
Open a discussion or ping us in the ACP Zulip if you’re stuck on design decisions, transport quirks, or schema questions. We’d rather collaborate early than rework later.

README.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ pip install agent-client-protocol
1616
uv add agent-client-protocol
1717
```
1818

19-
## Why teams adopt this SDK
19+
## At a glance
2020

21-
- **Schema parity:** Generated Pydantic models in `acp.schema` stay pinned to the official ACP specification so payloads stay valid as the protocol evolves.
22-
- **Runtime ergonomics:** Async base classes, stdio JSON-RPC plumbing, and lifecycle helpers keep custom agents focused on behaviour, not wiring.
23-
- **Batteries included:** `examples/` cover streaming, permission flows, file access, Gemini CLI bridging, and embedded agent/client launches.
24-
- **Helper builders:** `acp.helpers` mirrors the Go/TS SDK convenience APIs for content blocks, tool calls, and session updates.
25-
- **Contrib patterns:** `acp.contrib` packages in-progress utilities (session accumulators, permission brokers, tool call trackers) harvested from reference integrations.
21+
- **Spec parity:** Generated Pydantic models in `acp.schema` track every ACP release so payloads stay valid.
22+
- **Runtime ergonomics:** Async base classes, stdio JSON-RPC plumbing, and lifecycle helpers keep custom agents tiny.
23+
- **Examples ready:** Streaming, permissions, Gemini bridge, and duet demos live under `examples/`.
24+
- **Helper builders:** `acp.helpers` mirrors the Go/TS SDK APIs for content blocks, tool calls, and session updates.
25+
- **Contrib utilities:** Session accumulators, tool call trackers, and permission brokers share patterns from real deployments.
2626

2727
## Who benefits
2828

@@ -37,26 +37,28 @@ See real adopters like kimi-cli in the [Use Cases list](https://agentclientproto
3737
- Browse the [example gallery](https://github.com/agentclientprotocol/python-sdk/tree/main/examples) to see progressively richer integrations you can copy or extend.
3838
- Skim the [docs hub](https://agentclientprotocol.github.io/python-sdk/) for focused references on contrib helpers, releasing, and transport details.
3939

40-
## Resource map
40+
## Quick links
4141

42-
- Docs hub: https://agentclientprotocol.github.io/python-sdk/
43-
- PyPI package: https://pypi.org/project/agent-client-protocol/
44-
- Quickstart: https://agentclientprotocol.github.io/python-sdk/quickstart/
45-
- Use Cases: https://agentclientprotocol.github.io/python-sdk/use-cases/
46-
- Contrib overview: https://agentclientprotocol.github.io/python-sdk/experimental-contrib/
47-
- Releasing workflow: https://agentclientprotocol.github.io/python-sdk/releasing/
48-
- Examples: https://github.com/agentclientprotocol/python-sdk/tree/main/examples (echo agent, richer agent, duet, client, Gemini bridge)
49-
- Tests: https://github.com/agentclientprotocol/python-sdk/tree/main/tests with pytest coverage and opt-in Gemini smoke checks (`ACP_ENABLE_GEMINI_TESTS=1`)
42+
| Need | Link |
43+
| --- | --- |
44+
| Docs hub | https://agentclientprotocol.github.io/python-sdk/ |
45+
| Quickstart | https://agentclientprotocol.github.io/python-sdk/quickstart/ |
46+
| Use cases | https://agentclientprotocol.github.io/python-sdk/use-cases/ |
47+
| Contrib helpers | https://agentclientprotocol.github.io/python-sdk/experimental-contrib/ |
48+
| Releasing workflow | https://agentclientprotocol.github.io/python-sdk/releasing/ |
49+
| Examples | https://github.com/agentclientprotocol/python-sdk/tree/main/examples |
50+
| Tests | https://github.com/agentclientprotocol/python-sdk/tree/main/tests |
51+
| PyPI | https://pypi.org/project/agent-client-protocol/ |
5052

51-
## Repository tour
53+
## Project layout
5254

5355
- `src/acp/`: runtime package (agents, clients, transports, helpers, schema bindings, contrib utilities)
5456
- `schema/`: upstream JSON schema sources (regenerate via `make gen-all`)
5557
- `docs/`: MkDocs content backing the published documentation
5658
- `examples/`: runnable scripts covering stdio orchestration patterns
5759
- `tests/`: pytest suite with golden fixtures and optional Gemini coverage
5860

59-
## Development workflow
61+
## Developer commands
6062

6163
- `make install` provisions the `uv` virtualenv and installs pre-commit hooks.
6264
- `make check` runs Ruff formatting/linting, type analysis, dependency hygiene, and lock verification.

0 commit comments

Comments
 (0)