Skip to content

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

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

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

Introduce a top-level AGENTS.md as the canonical, agent-agnostic
briefing for AI coding tools working in this workspace. The file
mirrors and extends the existing Copilot instructions with:

  * a project snapshot (targets, MSRV, runtime),
  * a tour of the ~30 workspace member crates,
  * the full set of build, test, lint, and doc commands that CI
    runs in .github/workflows/check.yml,
  * the Service<'hw> pattern, IPC primitives, and core utilities,
  * coding conventions (no_std, mutually exclusive logging features,
    workspace clippy lints, error handling, formatting),
  * contribution rules including the mandatory Assisted-by trailer,
  * a pre-commit checklist for agents.

Prepend a pointer note to .github/copilot-instructions.md so the
two documents stay discoverable from each other.

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:02
@felipebalbi felipebalbi requested a review from a team as a code owner May 26, 2026 20:02
Copy link
Copy Markdown
Contributor

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 a repository-specific AGENTS.md briefing intended to let AI coding agents (and humans) quickly align with the workspace’s build/test commands, architecture patterns, and contribution rules, and updates Copilot instructions to point to that guidance.

Changes:

  • Introduce AGENTS.md with workspace snapshot, common commands, architecture/coding conventions, and contribution/CI notes.
  • Add a “Model selection & cost discipline” section to AGENTS.md.
  • Update .github/copilot-instructions.md with a pointer to AGENTS.md.

Reviewed changes

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

File Description
AGENTS.md New agent briefing document with commands, conventions, CI/workflow references, and model-selection guidance.
.github/copilot-instructions.md Adds an upfront note linking to AGENTS.md as a canonical briefing.

Comment thread AGENTS.md
Comment on lines +12 to +13
> the authoritative behavioural contract; it is loaded into the GitHub
> Copilot context automatically. This file mirrors and extends it.
Comment thread AGENTS.md

| Crate | Role |
|---|---|
| `embedded-service` | Core utilities: intrusive list, IPC primitives (`ipc::deferred`, `broadcaster`, `relay`), `GlobalRawMutex`, `SyncCell`, `fmt` macros. Re-exported as `embedded_services`. |
Comment thread AGENTS.md
Comment on lines +145 to +151
The required helpers (`cargo-hack`, `cargo-deny`, `cargo-machete`,
`cargo-vet`, `grcov`) are installed in CI via `taiki-e/install-action` and
`EmbarkStudios/cargo-deny-action`. Locally:

```shell
cargo install cargo-hack cargo-deny cargo-machete cargo-vet
```
Comment thread AGENTS.md
- CI workflows (see `.github/workflows/`):
- `check.yml` — fmt, doc, hack-clippy (stable + beta × two targets),
deny, test (+ coverage), msrv, example workspaces, machete.
- `rolling.yml` — periodic refresh against newer toolchains.
Comment on lines +1 to +4
> **Note:** See [`AGENTS.md`](../AGENTS.md) at the repository root for the
> canonical, agent-agnostic briefing (workspace layout, commands,
> conventions, and contribution rules). This file mirrors and extends it
> with Copilot-specific guidance; keep the two in sync when updating either.
@felipebalbi felipebalbi enabled auto-merge (squash) May 26, 2026 20:10
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