Skip to content

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

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

docs: add AGENTS.md and model-selection guidance#563
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).

Document repository layout, the mutually-exclusive chip/time-driver feature model, the exact build/lint/doc/MSRV/no-std/feature-matrix commands used by .github/workflows and ci.sh, no_std and embedded-hal coding conventions, and the commit/branch/PR flow expected of AI coding agents working on embassy-imxrt.

Add a pointer from .github/copilot-instructions.md to AGENTS.md so agents discover the full guide; copilot-instructions.md is kept focused on 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
Copilot AI review requested due to automatic review settings May 26, 2026 19:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a repository-specific AGENTS.md to document project layout, feature/chip model, CI command equivalents, and contribution conventions for AI coding agents, and updates Copilot instructions to point to it as the authoritative repo guide.

Changes:

  • Add new AGENTS.md with repo overview, feature/CI guidance, and agent workflow conventions.
  • Extend AGENTS.md with model-selection and cost-discipline guidance for agents.
  • Update .github/copilot-instructions.md to reference AGENTS.md for non-Copilot-specific guidance.

Reviewed changes

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

File Description
AGENTS.md New agent operating guide for repo layout, CI commands, feature model, and contribution flow (plus model-selection guidance).
.github/copilot-instructions.md Adds a pointer to AGENTS.md as the authoritative full guide; keeps this file focused on commit/attribution rules.

Comment thread AGENTS.md
Comment on lines +65 to +68
*xor* `time-driver-rtc` (32 kHz RTC). Both imply the internal `_time-driver`
feature. `time-driver` is a deprecated alias for `time-driver-rtc`; do not
use it in new code. When `time-driver-rtc` is on, `pub mod rtc` is **not**
compiled (the RTC is owned by the driver).
Comment thread AGENTS.md
Comment on lines +103 to +107
# Repo root and each examples crate (matches the CI matrix)
cargo +nightly fmt --check
cd examples/rt633 ; cargo +nightly fmt --check ; cd ../..
cd examples/rt685s-evk ; cargo +nightly fmt --check ; cd ../..
```
Comment thread AGENTS.md
Comment on lines +92 to +94
All commands below match what runs in `.github/workflows/` and `ci.sh`.
Agents should run at least the relevant subset before declaring a change
done. Long compiles are expected (~5–10 min cold per feature combo).
Comment thread AGENTS.md

```powershell
cargo install --git https://github.com/embassy-rs/cargo-batch cargo --bin cargo-batch --locked
bash ./ci.sh # ~96 dev+release combos × 2 chips, plus the two clippy commands
Comment thread AGENTS.md
Comment on lines +337 to +340
| Sub-agent type | Default model | Override to |
|-------------------|---------------------------|-------------------------------------------------|
| `explore` | cheap | keep cheap (`claude-haiku-4.5` or `gpt-5-mini`) |
| `task` (run cmd) | cheap | keep cheap |
Comment thread AGENTS.md
Comment on lines +260 to +263
```powershell
git -c user.name="Felipe Balbi" -c user.email="felipe.balbi@microsoft.com" `
commit -m "Subject" -m "Body" -m "Assisted-by: GitHub Copilot:<model>"
```
@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
@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.

3 participants