docs: add repository engineering guidelines, review skill, and contributor standards (#953) - #954
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Address the unresolved documentation and review-guidance inaccuracies, including broken links and protocol-specific rules.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds repository-wide engineering standards, a portable review skill, and contributor guidance.
Changes:
- Adds
AGENTS.mdwith architecture, tooling, testing, and workflow standards. - Adds
.agents/skills/review/SKILL.md. - Updates
CONTRIBUTING.mdto reference the guidelines.
File summaries
| File | Summary | Final review comments |
|---|---|---|
CONTRIBUTING.md |
Links contributors to AGENTS.md. |
No comments. |
AGENTS.md |
Defines repository engineering standards. | Nit findings: missing CLAUDE.md symlink (3 votes); protocol-specific msg_id wording (1); overly broad VACUUM gating (1); invalid mirroring paths (1); unconditional exception rule needs a cleanup exception (1); nonexistent v1_simulator fixture (1). |
.agents/skills/review/SKILL.md |
Adds structured review guidance. | Nit findings: broken AGENTS.md link (3 votes); msg_id-only correlation rule should support protocol-specific IDs (1). |
Review details
Suppressed comments (8)
.agents/skills/review/SKILL.md:32
- The skill repeats the same
msg_id-only requirement, but V1 correlates responses withrequest_id(roborock/devices/rpc/v1_channel.py:123-143). Make this check protocol-neutral so the review skill does not flag the existing V1 pattern.
- **Concurrency**: Does 1:1 async command-response matching use `asyncio.Future` mapped by `msg_id`?
AGENTS.md:22
- This setup creates and syncs
.venvbut never activates it, while the commands below invoke barepytest,pre-commit,ruff, andmypy. Following this file alone can therefore run system tools or fail with command-not-found; add the activation step here (as CONTRIBUTING.md:25-28 does) or switch the commands touv run.
# Environment setup
uv venv
uv sync
AGENTS.md:29
- Neither example test path exists in this checkout: the trait suite is under
tests/devices/traits/v1/, and the protocol file istest_v1_protocol.py. As written, copying either command fails before running any tests; please point these examples at the canonical files.
pytest tests/devices/traits/test_battery.py
pytest tests/protocols/test_v1.py
AGENTS.md:52
- The overview hard-codes
msg_id, but the V1 RPC implementation correlates responses withrequest_id(roborock/devices/rpc/v1_channel.py:123-143), while B01 Q7 usesmsg_id. This wording would cause reviewers to reject a valid protocol-specific implementation; describe the correlation as using each protocol's request/sequence ID.
- **Concurrency**: Request/response matching across async push channels uses `asyncio.Future` mapped by message ID (`msg_id`).
AGENTS.md:86
- This makes
RoborockCategory.VACUUMthe universal category gate, but A01 traits are intentionally created forWET_DRY_VACandWASHING_MACHINE(roborock/devices/traits/a01/__init__.py:425-429). Following this rule would reject supported non-robot devices; scopeVACUUMto V1 vacuum traits and require the protocol-appropriate category for each family.
- **Compound Capability Gating**: Capability and trait availability MUST be gated by BOTH protocol version AND `RoborockCategory` using authentic codebase attributes: protocol version string `device.pv == "1.0"` (or `device.pv == DeviceVersion.V1`) and product category `product.category == RoborockCategory.VACUUM`. Never assume protocol V1 ("1.0") implies a vacuum robot; mowers and wet/dry vacuums also share protocol variants.
AGENTS.md:100
- The mirroring examples repeat the same nonexistent
battery.pypath, androborock/map/q10.pyis not the parser module here. This makes the canonical placement guidance point contributors at files they cannot run or extend; use the repository's versioned trait and B01 Q10 parser paths.
- **Test Mirroring & Module Colocation**: Place and maintain unit tests in the matching mirror path under `tests/` corresponding to the module under test (e.g. tests for `roborock/devices/traits/battery.py` belong in `tests/devices/traits/test_battery.py`; a new parser `roborock/map/q10.py` belongs in `tests/map/test_q10.py`). When extending existing functionality, augment the canonical test file rather than creating separate one-off test files.
AGENTS.md:95
Specific Exception Narrowingis stated as an unconditional ban on broad catches, butroborock/devices/device.py:216-223deliberately catchesExceptionto unsubscribe a leaked channel before re-raising. Enforcing this rule literally would reintroduce the resource leak the existing code guards against; document the cleanup exception.
- **Specific Exception Narrowing**: Catch only specific, expected exception classes (`RoborockTimeout`, `RoborockConnectionException`, `json.JSONDecodeError`).
AGENTS.md:102
v1_simulatoris not a pytest fixture in this repository; it is a simulator module/class used directly by tests (for example,tests/testing/test_v1_simulator.py). There is no fixture with that name to reuse, so this list gives contributors a nonexistent fixture; remove it or replace it with an actual fixture name.
- **Standard Fixture Reuse**: Reuse existing shared fixtures (`fake_channel`, `message_builder`, `device_fixture`, `v1_simulator`) in `tests/`.
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Lash-L
left a comment
There was a problem hiding this comment.
Very nice - could likely be trimmed in some areas but I don't think it is meaningful enough to matter. Good addition all around
I addressed the feedback, as well as took a pass to slim some areas (cut agents file by 40%) |
Summary
Codifies code quality standards and engineering conventions to help agents write higher quality code and improve automated code review across Google Antigravity, OpenAI Codex, GitHub Copilot, and Anthropic Claude Code.
Key Additions
AGENTS.md:RoborockBasedataclasses, consumer-agnostic, decoupled from transport/crypto).close(),asyncio.FutureRPC correlation).RoborockEnum/RoborockModeEnumfallback).RoborockBaseoverTypedDict, wire-containedAny, compound capability gating (pv+RoborockCategory), test mirroring and module colocation (no one-off test files).CLAUDE.md: Symlink pointing toAGENTS.mdfor Claude Code compatibility..agents/skills/review/SKILL.md: Portable review skill implementing the Agent Skills specification.CONTRIBUTING.md: Points contributors toAGENTS.mdunder Code Style & Architecture.Validation
uv run pre-commit run --all-filespassed cleanly (Ruff, Mypy withcheck_untyped_defs = true, Codespell, Commitlint).uv run pytestpassed cleanly (983 passed).Related issue #953