docs: add CONTRIBUTING.md with review priorities and LLM guidance#9662
Conversation
CONTRIBUTING.md is the standard location that LLMs and github will pick up on. Consolidate project review priorities derived from existing developer docs and maintainer review patterns into a standard CONTRIBUTING.md. Includes a section for AI/LLM code reviewers (e.g., Gemini Code Assist) to align automated reviews with project standards. These guidelines for LLM and humans were extracted based upon review history in git. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a CONTRIBUTING.md file, which consolidates contribution guidelines, review priorities, and instructions for both human and AI reviewers. This is a valuable addition for improving the contribution process. My review found a minor issue with an incorrect C++ syntax example in the C++ Style section, for which I've provided a correction.
Note: Security Review has been skipped due to the limited scope of the PR.
CONTRIBUTING.md
Outdated
| - Use `""` for project headers, `<>` only for system headers. | ||
| - Use range-based for loops, not iterator loops. | ||
| - Use forward declarations instead of includes where possible. | ||
| - Don't use `using namespace std`. Prefer `using namespace::symbol`. |
There was a problem hiding this comment.
The syntax using namespace::symbol is not valid C++. The likely intent is to recommend using declarations for specific symbols.
This seems to be copied from docs/contrib/CodingPractices.md which has the same issue. You may want to correct it there as well.
I suggest clarifying this point for better readability and correctness.
| - Don't use `using namespace std`. Prefer `using namespace::symbol`. | |
| - Don't use `using namespace std;`. Prefer `using` declarations for specific symbols (e.g., `using std::vector;`). |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
Claude doesn't read it and when asked says which LLMs do: |
I don't think I have access to those instructions. Can you update the instructions to read CONTRIBUTING.md as part of the review process? |
|
I'm not clear what you don't have access to. You state "for AI/LLM code review tools assisting with pull |
|
@vvbandeira @maliberty unrelated CI network outage. |
I should be able to point the gemini instructions to read this file when reviewing, no? |
|
LLMs aside, are these instructions helpful or just spam? |
|
You could manually tell your LLM to read the file but it isn't somehow automatic LLM guidance (cf CLAUDE.md) |
Quite, so locally I can say "review my code to be consistent with best practices" and Bob's your uncle, but no CI Gemini support without directing Gemini to it. Are these practices helpful/accurate or just noise? |
CONTRIBUTING.md
Outdated
| physical design metrics must be validated. | ||
|
|
||
| - Ask: "Does this have a QoR impact?" Changes affecting QoR require | ||
| secure-CI runs on real designs, not just unit tests. |
There was a problem hiding this comment.
Most users won't know what a secure-CI run is (nor can they run it). Perhaps this needs its own section.
CONTRIBUTING.md
Outdated
| - Regression tests must be runnable from any directory and must | ||
| not leave the source tree dirty. | ||
| - Regression output should be concise -- not thousands of lines. | ||
| - Tests should pass `-no_init` to `openroad`. |
There was a problem hiding this comment.
Usually this is handled by the test runner
CONTRIBUTING.md
Outdated
| `TritonCTS`). | ||
| - No global variables. All state in classes. | ||
| - No magic numbers. Use named constants with documented units. | ||
| - No `continue` -- wrap the body in an `if` instead. |
CONTRIBUTING.md
Outdated
| - No global variables. All state in classes. | ||
| - No magic numbers. Use named constants with documented units. | ||
| - No `continue` -- wrap the body in an `if` instead. | ||
| - No `== true` / `== false`. Use the boolean directly. |
There was a problem hiding this comment.
I see varying opinions on this. Probably something to discuss further before adding (and possibly automate with clang-tidy).
CONTRIBUTING.md
Outdated
| - Use `#pragma once` not `#ifndef` guards. | ||
| - Use `""` for project headers, `<>` only for system headers. | ||
| - Use range-based for loops, not iterator loops. | ||
| - Use forward declarations instead of includes where possible. |
There was a problem hiding this comment.
Henner has been pushing in the opposite direction.
CONTRIBUTING.md
Outdated
| - Log messages must use the OpenROAD logger (`utl::info`, `utl::warn`, | ||
| `utl::error`), not `printf` or `std::cout`. Use `utl::report` |
There was a problem hiding this comment.
utl::info (etc) are for TCL and Logger::info (etc) for C++. It would be good to clarify.
|
This somewhat duplicates the other files. We should remove anything duplicative. This should appear in the read the docs |
- Replace "secure-CI" with user-friendly language about maintainer-run validation on real designs - Remove `-no_init` note (handled by test runner) - Remove contested style rules: `continue`, `== true`/`== false`, forward declarations - Fix invalid `using namespace::symbol` syntax - Clarify logger API: C++ (Logger::info) vs Tcl (utl::info) - Reframe intro as concise summary pointing to detailed docs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Replace duplicated C++ style, testing, architecture, and logging sections with references to the existing docs where this content already lives (CodingPractices.md, DeveloperGuide.md, Logger.md). Keep only the review priority ordering and AI reviewer guidance which are unique to this file. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
|
Had Claude update and DRY |
|
clang-tidy review says "All clean, LGTM! 👍" |
CONTRIBUTING.md is the standard location that LLMs and github and humans will pick up on.
Consolidate project review priorities derived from existing developer docs and maintainer review patterns into a standard CONTRIBUTING.md. Includes a section for AI/LLM code reviewers (e.g., Gemini Code Assist) to align automated reviews with project standards.
These guidelines for LLM and humans were extracted based upon review history in git.