Skip to content

docs(readme): document dev setup, local checks, and PR conventions#967

Open
aregmii wants to merge 2 commits into
anthropics:mainfrom
aregmii:docs/readme-hooks-link
Open

docs(readme): document dev setup, local checks, and PR conventions#967
aregmii wants to merge 2 commits into
anthropics:mainfrom
aregmii:docs/readme-hooks-link

Conversation

@aregmii
Copy link
Copy Markdown

@aregmii aregmii commented May 18, 2026

Summary

Closes #966.

Expands the ## Development section so external contributors can find the dev workflow without reverse-engineering it from CLAUDE.md, pyproject.toml, and merged PR history.

Added (addresses every bullet from #966):

  • pip install -e ".[dev]" for the dev dependencies (pytest, pytest-asyncio, pytest-cov, mypy, ruff)
  • The manual ruff / mypy / pytest commands that the pre-push hook wraps
  • The Conventional Commits PR title convention used by recent merged PRs

Also kept (the original commit on this branch):

  • The examples/hooks.py reference now uses a markdown link, matching the format of every other example reference in the README

Diff (README only, +36 / -3)

 ## Development

-If you're contributing to this project, run the initial setup script to install git hooks:
+### Setting up a development environment
+
+Install the SDK in editable mode along with the dev dependencies (`pytest`, `pytest-asyncio`, `pytest-cov`, `mypy`, `ruff`):
+
+```bash
+pip install -e ".[dev]"
+```
+
+Then install the pre-push git hook so lint checks run before each push (matching CI):

 ```bash
 ./scripts/initial-setup.sh
 ```

-This installs a pre-push hook that runs lint checks before pushing, matching the CI workflow. To skip the hook temporarily, use `git push --no-verify`.
+To skip the hook for a single push, use `git push --no-verify`.
+
+### Running checks locally
+
+The pre-push hook wraps the same commands you can run directly:
+
+```bash
+# Lint and auto-fix
+python -m ruff check src/ tests/ --fix
+
+# Format
+python -m ruff format src/ tests/
+
+# Type-check
+python -m mypy src/
+
+# Tests (all)
+python -m pytest tests/
+
+# Tests (single file)
+python -m pytest tests/test_client.py
+```
+
+### Pull request conventions
+
+PR titles follow [Conventional Commits](https://www.conventionalcommits.org/), e.g. `fix(transport): handle CancelledError`, `docs: update changelog`, `feat(hooks): add SubagentStartHookInput`. Recent merged PRs are good references for tone and scope.

 ### Building Wheels Locally

And the smaller pre-existing change on the same branch:

-For more examples, see examples/hooks.py.
+For more examples, see [examples/hooks.py](examples/hooks.py).

Verification

All four documented commands run cleanly on a fresh venv against current main (Python 3.11.7):

$ python -m venv .venv-verify && source .venv-verify/bin/activate
$ pip install -e ".[dev]"
Successfully installed claude-agent-sdk-0.2.82 mypy-2.1.0 pytest-9.0.3
  pytest-asyncio-1.3.0 pytest-cov-7.1.0 ruff-0.15.13 ... (and transitive deps)

$ python -m ruff check src/ tests/
All checks passed!

$ python -m ruff format --check src/ tests/
54 files already formatted

$ python -m mypy src/
Success: no issues found in 24 source files

$ python -m pytest tests/
750 passed, 5 skipped in 6.40s

Conventional Commits convention verified against the last 8 merged PRs: 7 of 8 follow <type>(scope): subject or <type>: subject (PRs #956, #955, #933, #932, #931, #927, #924, plus #951 as the one outlier).

The PR title format itself follows the convention (docs(readme): ...).

Test plan

Documentation-only change; no source code or behavior modified. The added commands match what CLAUDE.md documents and what pyproject.toml's [dev] extras group declares. Verification log above shows each command succeeds on a clean checkout.

aregmii added 2 commits May 17, 2026 21:36
Expands the Development section with the dev-deps install (pip install -e ".[dev]"), the manual ruff/mypy/pytest commands documented in CLAUDE.md, and the Conventional Commits PR title convention used by recent merged PRs. Addresses anthropics#966 by consolidating the workflow information where human contributors will find it.
@aregmii aregmii changed the title docs: use markdown link for examples/hooks.py reference docs(readme): document dev setup, local checks, and PR conventions May 20, 2026
@aregmii aregmii marked this pull request as draft May 20, 2026 23:25
@aregmii aregmii marked this pull request as ready for review May 20, 2026 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs] Surface dev-deps install + test/lint commands in README (or add CONTRIBUTING.md)

1 participant