Skip to content

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

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

docs: add AGENTS.md and model-selection guidance#31
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 comprehensive AGENTS.md at the repo root that documents the

crate layout, module responsibilities, Cargo features, MSRV, coding

conventions, CI commands, commit/PR rules, and the fork/branch/push

workflow for AI coding agents working in this repository.

Prepend a short pointer note to .github/copilot-instructions.md so

agents that read it first are directed to AGENTS.md for everything

beyond 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 by introducing a new AGENTS.md at the repo root and linking to it from the existing Copilot instructions, with an additional section on model selection/cost discipline.

Changes:

  • Add AGENTS.md documenting repo layout, CI commands, constraints (MSRV/no_std/no-unsafe), and contribution workflow for agents.
  • Update .github/copilot-instructions.md to point to AGENTS.md as the broader operational reference.
  • Include model-selection and cost-discipline guidance aimed at reducing unnecessary premium-model usage.

Reviewed changes

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

File Description
AGENTS.md New comprehensive operational guide for AI agents (commands, constraints, conventions, workflow, model selection).
.github/copilot-instructions.md Adds a pointer to AGENTS.md while keeping commit-message/attribution rules here authoritative.

Comment thread AGENTS.md

| Module | Purpose | Key types |
|---|---|---|
| `lib.rs` | Crate entry, `CfuImage` trait, `read_from_exact` helper, `DataChunk` alias, re-export of `CfuProtocolError`. Declares `#![no_std]`. | `CfuImage`, `DataChunk` |
Comment thread AGENTS.md
Comment on lines +270 to +272
- The crate-wide error enum is `protocol_definitions::CfuProtocolError`,
re-exported at the crate root with `pub use CfuProtocolError::*;`. Prefer
adding a variant there over inventing a new error type.
Comment thread AGENTS.md
Comment on lines +320 to +323
- The crate currently ships **no unit tests** (the `test` CI job exists to
catch resolution/feature issues and to make adding tests trivial later).
- When you add new logic, prefer adding `#[cfg(test)] mod tests { … }` at
the bottom of the relevant module. Keep tests `no_std`-compatible where
Comment thread AGENTS.md
Comment on lines +265 to +266
- Doc comments on every public item. The crate's published rustdoc is the
primary reference for downstream firmware authors.
Comment thread AGENTS.md
Comment on lines +409 to +410
git -c user.name="Felipe Balbi" \
-c user.email="felipe.balbi@microsoft.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.

3 participants