From 7c8d6daca9be7422b328448c6892bd3d55a18521 Mon Sep 17 00:00:00 2001 From: Jacob Dahl <37091262+dakejahl@users.noreply.github.com> Date: Fri, 25 Sep 2026 21:41:55 -0800 Subject: [PATCH] docs(agents): move the shared driver code rule to drivers.instructions.md (#28853) It only matters when working under src/drivers/, which the scoped file already covers, and AGENTS.md is loaded for every task. The section was also not wrapped like the rest of AGENTS.md. Assisted-by: Claude:claude-opus-5-5 --- .github/instructions/drivers.instructions.md | 1 + AGENTS.md | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/instructions/drivers.instructions.md b/.github/instructions/drivers.instructions.md index 9fd6f630f73..527f88727b1 100644 --- a/.github/instructions/drivers.instructions.md +++ b/.github/instructions/drivers.instructions.md @@ -11,3 +11,4 @@ In addition to the core code review guidelines: - ESC hardware quirks: 4-in-1 ESCs may report current on only one channel - Verify device_id correctness and I2CSPIDriver patterns - Time representation: prefer `hrt_abstime` over iteration counts +- Code shared by several drivers of one type goes in `src/lib//` (e.g. `src/lib/rc/`); `src/drivers//` holds only per-driver directories, no loose `.cpp`/`.h` diff --git a/AGENTS.md b/AGENTS.md index 596ad09d74a..3f32755ccd9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -18,8 +18,3 @@ simulation and Python tooling. - **Scoped guidance:** before editing or reviewing, read only the `.github/instructions/*.instructions.md` files whose `applyTo` patterns match the affected paths, plus any nested `AGENTS.md` along those paths. - -## Drivers - -- Code shared by several drivers of the same type (a protocol decoder, UART setup, a common filter) goes in `src/lib//`, e.g. `src/lib/rc/` for the RC drivers. -- `src/drivers//` (e.g. `src/drivers/rc/`, `src/drivers/distance_sensor/`) holds one directory per driver; do not put `.cpp`/`.h` files at that level.