Skip to content

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

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

docs: add AGENTS.md and model-selection guidance#45
felipebalbi wants to merge 3 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).

Provide a single, agent-facing guide at the repository root that
documents the workspace layout, the verified build/test/clippy/doc
commands, the trait shape conventions used by both crates, the
&mut T-only blanket-impl rule, the defmt feature contract, ACPI
versus SBS scope, and the commit/PR conventions (including the
mandatory Assisted-by trailer).

Prepend a short pointer to .github/copilot-instructions.md so
Copilot-configured environments discover AGENTS.md, while keeping
copilot-instructions.md authoritative for commit-message and AI
attribution rules.

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
@felipebalbi felipebalbi marked this pull request as ready for review May 26, 2026 20:04
@felipebalbi felipebalbi requested a review from a team as a code owner May 26, 2026 20:04
Copy link
Copy Markdown

Copilot AI left a comment

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 guidance for AI coding agents and updates GitHub Copilot instructions to point to it, aiming to reduce repeated “repo re-discovery” and keep agent behavior aligned with existing CI/conventions.

Changes:

  • Add a new root-level AGENTS.md describing workspace layout, verified commands, conventions, and “what not to do”.
  • Update .github/copilot-instructions.md to reference AGENTS.md for non–commit-message guidance.
  • Add “Model selection & cost discipline” guidance for agent usage.

Reviewed changes

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

File Description
AGENTS.md Introduces a comprehensive agent guide (commands, conventions, constraints, model-selection guidance).
.github/copilot-instructions.md Adds a pointer to AGENTS.md while keeping commit-message/AI-attribution rules here.

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md

### Trait shape (mirrors `embedded-hal`)

Every functional trait family has the same five-piece anatomy:
Comment thread AGENTS.md
Comment on lines +119 to +123
On stable, `cargo fmt --check` prints warnings ("unstable features are
only available in nightly channel") **and still exits 0**. CI installs
the nightly toolchain solely to run `cargo fmt --check`. If you reformat
imports locally, use `cargo +nightly fmt` so the import grouping/granularity
options actually take effect.
Comment thread AGENTS.md
Comment on lines +246 to +248
- Don't break `cargo semver-checks`. Any change that alters a public
signature must be paired with a version bump in the corresponding
`Cargo.toml`; the CI semver job will fail otherwise.
Comment thread AGENTS.md
Comment on lines +350 to +352
- **Line endings:** repository convention is **LF**. The local clone
has `core.autocrlf=false`; do not re-enable autocrlf and do not let
your editor rewrite files with CRLF.
Comment thread AGENTS.md
Comment on lines +183 to +185
adding a new blanket impl. The macro is exported from both
`embedded-batteries::smart_battery` and
`embedded-batteries-async::smart_battery`.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@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