Skip to content

docs: add agent guidance to reduce verbosity - #3337

Merged
blackmwk merged 10 commits into
apache:mainfrom
kevinjqliu:kevinjqliu-agent-comment-guidelines
Oct 8, 2026
Merged

blackmwk merged 10 commits into
apache:mainfrom
kevinjqliu:kevinjqliu-agent-comment-guidelines

Conversation

@kevinjqliu

@kevinjqliu kevinjqliu commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

  • N/A

What changes are included in this PR?

I find my agent not behaving the way I'd like to create PRs, write code, and documentation... Hopefully these rules are a helpful nudge towards the right direction. 😄

Coding agents tend to be verbose: comments that restate the code, docs explaining review history, tests narrating asserts, unrelated renames, new pub items nobody needs, and PR descriptions that restate the diff.

  • AGENTS.md: add guidance for coding agents. Default to no comment, keep docs to what callers need, keep diffs to the change, reuse before adding, use the narrowest visibility, keep PR descriptions short.
  • .github/copilot-instructions.md: have Copilot review flag comment churn, unrelated edits, duplication, API growth, and verbose PR descriptions instead of skipping them as trivialities.

Follows the Java repo's comment guidance (apache/iceberg AGENTS.md comment guidance, rewrite).

Are these changes tested?

Docs only.

AI Disclosure

Implemented with GitHub Copilot.

kevinjqliu and others added 5 commits October 4, 2026 08:19
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@@ -1,3 +1,3 @@
# Instructions

## Code review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

these instructions were copied over from iceberg-cpp, and can use some tuning

Comment thread AGENTS.md
under the License.
-->

# Apache Iceberg Rust — Agent Instructions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we only had "Security Model" in this file before

@kevinjqliu kevinjqliu changed the title docs: add agent guidance on code comments and API surface docs: add agent guidance to reduce verbosity Oct 4, 2026
@kevinjqliu
kevinjqliu marked this pull request as ready for review October 4, 2026 15:49
@kevinjqliu
kevinjqliu requested review from CTTY, blackmwk, comphead, laskoviymishka and mbutrovich and a balanced review from Copilot October 4, 2026 15:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The API-growth check can incorrectly classify legitimate downstream APIs as crate-internal.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Adds repository guidance to reduce verbose agent-generated code, documentation, reviews, and PR descriptions.

Changes:

  • Defines concise commenting, documentation, visibility, and diff-scope rules.
  • Extends Copilot review guidance to flag unnecessary churn and API growth.
File Description
AGENTS.md Adds coding-agent and PR guidance.
.github/​copilot-instructions.md Adds targeted review checks.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/copilot-instructions.md Outdated
Comment on lines +29 to +30
- API growth: New `pub` items with no use outside the crate (see
`public-api.txt`). Suggest `pub(crate)`.
@kevinjqliu

Copy link
Copy Markdown
Contributor Author

I'm still new at this coding agent / review agent thing, so not sure if this is the best. PTAL!
I asked my agent how to improve this, so it might be referential 😆 🤷

cc @blackmwk @CTTY @laskoviymishka @mbutrovich @dannycjones @comphead

kevinjqliu and others added 2 commits October 4, 2026 08:53
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
explicitly instruct them to "Please check and address all review
comments in this PR."

Also flag these, once per PR with the locations:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

note that these items that should be flagged

@comphead comphead left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @kevinjqliu looks good to me, my agent skill also includes below, maybe useful in this PR:

  • Reuse before adding: for every new object, method, helper, abstraction, etc., explicitly check whether an existing one can be reused, extended, or generalized.
  • Deduplicate tests: identify tests introduced by the PR that duplicate existing coverage and remove/merge them rather than increasing test count without adding coverage
  • Remove PR-created dead code: detect unused methods, structs, imports, fields, helpers, branches, feature flags, and test utilities introduced by the PR
  • Avoid abstraction for abstraction's sake: reuse/generalize only when it makes the code simpler; don't introduce a new abstraction merely to eliminate a few lines

@kevinjqliu

Copy link
Copy Markdown
Contributor Author

I like these, thanks @comphead! I’ll add them to the pr.

What are your thoughts on agent skill vs AGENTS.md? Do you think these changes are helpful in AGENTS.md?

kevinjqliu and others added 2 commits October 4, 2026 09:42
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@comphead

comphead commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

What are your thoughts on agent skill vs AGENTS.md? Do you think these changes are helpful in AGENTS.md?

AGENTS.md makes more sense to me as this is project wise skill for any agent. The good followup would also be to have a kinda precommit hooks to perform code analysis and fix it. Also run tests, to avoid spending ASF CI resources on partially ready PRs like https://github.com/apache/datafusion/blob/main/AGENTS.md#before-committing

@andygrove

Copy link
Copy Markdown
Member

I'd also recommend adding PR review skills to the repo so you can set expectations for reviews. Feel free to take inspiration from those in Comet

@andygrove

Copy link
Copy Markdown
Member

I'd also recommend adding PR review skills to the repo so you can set expectations for reviews. Feel free to take inspiration from those in Comet

https://github.com/apache/datafusion-comet/tree/main/.ai/skills

@dannycjones dannycjones 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.

Thanks Kevin, I think these are good improvements. Good to encode in AGENTS.md rather than continuing to argue with it 😄

AGENTS.md makes sense as a good general steer for the LLM. I'd hestitate to add skills for now except for very specific tasks (like code review which Andy suggested just now).

@dannycjones

Copy link
Copy Markdown
Contributor

I'd also recommend adding PR review skills to the repo so you can set expectations for reviews. Feel free to take inspiration from those in Comet

https://github.com/apache/datafusion-comet/tree/main/.ai/skills

I'm wondering if we can do this, and just point Copilot at it so people can use whichever model and harness with the same markdown.

@laskoviymishka laskoviymishka 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.

Thanks! This will make our life a bit better <3

🌬️ ⛵

@mbutrovich

Copy link
Copy Markdown
Collaborator

I'm taking a pass through this now.

@mbutrovich mbutrovich left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @kevinjqliu, this will save reviewers a lot of back and forth with agent-written PRs. The comments suggest a few additions drawn from feedback that comes up repeatedly in reviews here.

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Co-authored-by: Matt Butrovich <mbutrovich@users.noreply.github.com>

@blackmwk blackmwk 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.

Thanks @kevinjqliu for this pr, and @mbutrovich for review!

@blackmwk
blackmwk enabled auto-merge October 8, 2026 09:08
@blackmwk
blackmwk added this pull request to the merge queue Oct 8, 2026
Merged via the queue into apache:main with commit 776648b Oct 8, 2026
24 checks passed
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.

8 participants