Skip to content

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

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

docs: add AGENTS.md and model-selection guidance#117
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 repository-root AGENTS.md following the agents.md

convention. It documents the project layout, toolchain, exact CI

commands (build/test/lint/doc/no-std/examples/MSRV/supply-chain),

register regeneration workflow, coding conventions (no_std, panic-

free, defmt/log shim, async drop safety), testing patterns, commit

conventions including the Assisted-by trailer, and PR-review focus

areas.

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

tools that look there are redirected to AGENTS.md while preserving

the existing PR-review guidance for backward compatibility.

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:57
@felipebalbi felipebalbi requested a review from a team as a code owner May 26, 2026 19:57
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 an AGENTS.md repository guide intended to centralize repo-specific conventions for AI agents (and humans), and updates Copilot’s instruction file to point to it as the authoritative reference.

Changes:

  • Introduces AGENTS.md with project overview, repo layout, CI-equivalent commands, coding/review conventions, and commit/AI attribution guidance.
  • Updates .github/copilot-instructions.md to direct agents to AGENTS.md as the source of truth.
  • Adds a “Model selection & cost discipline” section to guide cost-aware model usage by agents.

Reviewed changes

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

File Description
AGENTS.md New comprehensive repo guide for agents covering workflows, conventions, and review focus areas.
.github/copilot-instructions.md Adds a top-of-file pointer directing readers/tools to AGENTS.md.

Comment thread AGENTS.md
# AGENTS.md — tps6699x

> Operational guide for AI coding agents working on
> [`openDevicePartnership/tps6699x`](https://github.com/openDevicePartnership/tps6699x).
Comment thread AGENTS.md
- License: MIT.
- Cargo features:
- `defmt` — `defmt` logging via the `fmt` macros.
- `log` — `log` crate logging via the `fmt` macros (mutually compatible with `defmt`; one or the other typically).
Comment thread AGENTS.md
Comment on lines +102 to +104
The list below mirrors `.github/workflows/check.yml`,
`.github/workflows/nostd.yml`, and `.github/workflows/device-driver.yml`
exactly. Run these before pushing.
Comment thread AGENTS.md
Comment on lines +295 to +304
From `.github/copilot-instructions.md` and `CONTRIBUTING.md`:

- **Subject**: capitalized, ≤ 50 characters, imperative mood ("Fix bug", not
"Fixed bug"). No trailing period.
- **Blank line** between subject and body.
- **Body**: wrap at 72 characters; explain *what* and *why*, not *how*.
- Each commit must build cleanly without warnings; squash typo/format fixups
before pushing.
- **Do not** force-push to shared branches.

Comment on lines +1 to +8
# NOTE FOR AI AGENTS
#
# The authoritative guide for working in this repository is `AGENTS.md` at the
# repository root. It is a strict superset of this file (project overview,
# build/test/lint commands, coding conventions, async/panic safety, commit
# conventions including the `Assisted-by` trailer, and PR-review focus areas).
# Read `AGENTS.md` first; this file is preserved for backward compatibility
# with tools that still look for `.github/copilot-instructions.md`.
Comment thread AGENTS.md
- Missing or stale `.github/copilot-instructions.md` — re-add the pointer
block described in §11 rather than removing the file.

## Model selection & cost discipline
@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