Skip to content

docs: add AGENTS.md and model-selection guidance - #12

Open
felipebalbi wants to merge 2 commits into
OpenDevicePartnership:mainfrom
felipebalbi:improve-agentic-workflow
Open

docs: add AGENTS.md and model-selection guidance#12
felipebalbi wants to merge 2 commits into
OpenDevicePartnership:mainfrom
felipebalbi:improve-agentic-workflow

Conversation

@felipebalbi

Copy link
Copy Markdown
Contributor

This PR adds an AGENTS.md file (see agents.md) tailored to this repository, distilled from the project's CI workflows, configuration, source layout, and conventions. The goal is to give any AI coding agent (Copilot, Claude, Cursor, etc.) enough repo-specific context to be immediately productive without re-deriving conventions from scratch.

Commit 1 — docs: add AGENTS.md ...

  • New AGENTS.md with project overview, build/test/lint/fmt commands, code layout, contribution patterns, and any quirks observed (e.g., defmt feature constraints, nightly-only rustfmt.toml options, workspace layout).
  • .github/copilot-instructions.md updated to point at AGENTS.md as the authoritative source, so Copilot-specific configuration does not drift out of sync with the broader agent guidance. Where no copilot-instructions.md existed, a minimal pointer file was added.

Commit 2 — docs(AGENTS.md): add model selection & cost discipline section

  • Adds a "Model selection & cost discipline" section covering when to use premium vs. cheap models, escalation/de-escalation triggers, sub-agent routing defaults, /fleet rules, and session-hygiene tips. The aim is to keep premium reasoning for genuinely hard work and route mechanical edits to cheaper models, reducing wasted spend without sacrificing quality.

No source code, dependencies, or CI behavior is changed by this PR — it is documentation only.

Marked as draft for review; happy to iterate on tone, scope, or any repo-specific detail that should be tightened up.


Assisted by GitHub Copilot (Claude Opus 4.7).

Adds a comprehensive AGENTS.md at the repo root with project conventions, build/test commands, and code-style guidance distilled from CI workflows and existing source. Updates copilot-instructions.md with a leading note directing agents to AGENTS.md as the canonical source, avoiding drift between the two files.

Assisted-by: GitHub Copilot:claude-opus-4.7
Adds guidance on choosing between premium and cheap models for code-assistant work, including escalation/de-escalation triggers, sub-agent routing defaults, /fleet rules, and session-hygiene tips. Keeps premium reasoning for genuinely hard problems and routes mechanical work to cheaper models.

Assisted-by: GitHub Copilot:claude-opus-4.7
Copilot AI review requested due to automatic review settings May 26, 2026 19:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds repository-specific agent guidance intended to help AI coding assistants (and humans) work effectively in this bq25723 Rust driver repo without rediscovering conventions from CI/config/layout each time.

Changes:

  • Introduces AGENTS.md with project overview, repo layout, CI-mirrored commands, and coding/contribution conventions.
  • Adds a “Model selection & cost discipline” section to guide when to use premium vs. cheaper models and how to route sub-agent work.
  • Adds .github/copilot-instructions.md as a minimal pointer directing Copilot to AGENTS.md as the canonical guidance.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
AGENTS.md New comprehensive agent guidance covering build/test commands, repo conventions, and model-selection discipline.
.github/copilot-instructions.md Minimal Copilot entrypoint that redirects to AGENTS.md as the canonical source.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AGENTS.md
Comment on lines +117 to +122
- `unsafe_code = "deny"` and `missing_docs = "deny"` at crate level
(`Cargo.toml:24-26`). The single allowed pocket of `unsafe`/missing‑docs
is the generated `mod device`, which is gated with
`#[allow(unsafe_code)]` and `#![allow(missing_docs)]`
(`src/lib.rs:13`, `src/lib.rs:17-20`). Do not add `unsafe` elsewhere and
do not add `#![allow(missing_docs)]` to new modules.
Comment thread AGENTS.md
Comment on lines +102 to +105
- `rustfmt.toml` enables nightly‑only options (`group_imports`,
`imports_granularity`); on stable, `cargo fmt --check` prints warnings
about them but still exits 0. Do not remove these options — running
`rustfmt` under nightly enforces them.
Comment thread AGENTS.md
│ │ ├── device-driver.yml # verifies device.rs matches regenerated output
│ │ ├── cargo-vet.yml
│ │ └── cargo-vet-pr-comment.yml
│ └── (no copilot-instructions.md as of writing)
Comment thread AGENTS.md
Comment on lines +226 to +228
- No `copilot-instructions.md` exists anywhere in the tree; this AGENTS.md
is the first authoritative agent‑guidance file. A pointer file is being
added under `.github/copilot-instructions.md` referring back to here.
Comment thread AGENTS.md
toolchain, except where CI uses nightly (`doc`) or the MSRV (`check`).

All commands below are run from the repository root and are mirrored from
`.github/workflows/*.yml`. They are verified on Windows with stable Rust.
@felipebalbi
felipebalbi marked this pull request as ready for review May 26, 2026 20:05
@felipebalbi
felipebalbi requested a review from a team as a code owner May 26, 2026 20:05
@felipebalbi
felipebalbi enabled auto-merge (squash) May 26, 2026 20:11
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.

2 participants