Skip to content

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

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

docs: add AGENTS.md and model-selection guidance#75
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 toolchain, build/lint/test commands, workspace layout, and
agent-relevant conventions for AI assistants working in this repo.
Mirrors what the .husky/pre-commit hook and check.yml CI workflow run,
plus the no_std and CODEOWNERS constraints.

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 19:59
Copilot AI review requested due to automatic review settings May 26, 2026 19:59
@felipebalbi felipebalbi requested a review from a team as a code owner May 26, 2026 19:59
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 by introducing a root AGENTS.md and pointing GitHub Copilot’s configuration at it, with additional “model selection & cost discipline” guidance intended to reduce unnecessary premium-model usage.

Changes:

  • Add AGENTS.md documenting workspace layout, toolchain prerequisites, canonical build/test/lint commands, and contribution workflow.
  • Add .github/copilot-instructions.md that links to AGENTS.md as the authoritative agent guidance source.
  • Add a “Model selection & cost discipline” section to AGENTS.md.

Reviewed changes

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

File Description
AGENTS.md New agent guide covering repo overview, commands, conventions, workflow, and model-selection guidance.
.github/copilot-instructions.md New Copilot instructions pointing to AGENTS.md, with a short repo summary.

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

Comment thread AGENTS.md
Comment on lines +25 to +28
| `espi-device` | eSPI device abstraction used by the EC service. |
| `espi-device-stub` | Stub eSPI device for host-side testing. |
| `hafnium` | Rust bindings for Hafnium hypervisor APIs. |
| `odp-ffa` | Rust bindings for the Arm Firmware Framework (FF-A). |
Comment thread AGENTS.md
Comment on lines +54 to +57
## 3. Build, test, lint — the canonical commands

These mirror `.husky/pre-commit` and `.github/workflows/check.yml`. **Run the
precommit script before considering any change done**:
Comment thread AGENTS.md
# Clippy on the rest of the workspace (host target)
cargo clippy -- -D warnings

# Host build / type-check across the feature powerset (excluding aarch64-only crates)
Comment thread AGENTS.md
( cd platform/qemu-sp && cargo build --target=aarch64-unknown-none )
( cd platform/ihv1-sp && cargo build --target=aarch64-unknown-none )

# Supply-chain checks
Comment thread AGENTS.md

## 4. Workspace conventions

- **Edition**: `2021`. Workspace `version = "0.1.0"`.
Comment thread AGENTS.md
- **Formatting**: rustfmt with `max_width = 120` (see `rustfmt.toml`).
- **Line endings**: LF. Do not introduce CRLF.
- **Dependencies**: prefer adding to `[workspace.dependencies]` and referencing
them from member crates with `dep = { workspace = true }`. Match existing

Short version:

- Cargo workspace, `resolver = "2"`, edition `2021`, MSRV **1.85**.
(set in the workspace `Cargo.toml`); do not relax it.
- `rustfmt.toml` sets `max_width = 120`. Use LF line endings.
- Prefer `[workspace.dependencies]` entries with
`dep = { workspace = true }` in member crates.
Comment thread AGENTS.md

- The `platform/*-sp` binaries and the lower-level crates target
`aarch64-unknown-none[-softfloat]` and are `#![no_std]`. They must not gain a
transitive dependency on `std`. The `no-std.yml` workflow guards this with
@felipebalbi felipebalbi enabled auto-merge (squash) May 27, 2026 01:03
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