Skip to content

docs: add CONTRIBUTING.md with review priorities and LLM guidance#9662

Merged
maliberty merged 3 commits intoThe-OpenROAD-Project:masterfrom
Pinata-Consulting:contributing-docs
Mar 6, 2026
Merged

docs: add CONTRIBUTING.md with review priorities and LLM guidance#9662
maliberty merged 3 commits intoThe-OpenROAD-Project:masterfrom
Pinata-Consulting:contributing-docs

Conversation

@oharboe
Copy link
Collaborator

@oharboe oharboe commented Mar 6, 2026

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.

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>
@oharboe oharboe requested a review from maliberty March 6, 2026 06:22
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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`.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
- 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;`).

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

clang-tidy review says "All clean, LGTM! 👍"

@maliberty
Copy link
Member

Claude doesn't read it and when asked says which LLMs do:

The short answer: none of the major ones do automatically. The industry has converged on dedicated agent instruction files instead of repurposing CONTRIBUTING.md. 

@oharboe
Copy link
Collaborator Author

oharboe commented Mar 6, 2026

Claude doesn't read it and when asked says which LLMs do:

The short answer: none of the major ones do automatically. The industry has converged on dedicated agent instruction files instead of repurposing CONTRIBUTING.md. 

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?

@maliberty
Copy link
Member

I'm not clear what you don't have access to. You state "for AI/LLM code review tools assisting with pull
request reviews" which I don't think is true as the LLMs won't read this file.

@oharboe
Copy link
Collaborator Author

oharboe commented Mar 6, 2026

@vvbandeira @maliberty unrelated CI network outage.

@oharboe
Copy link
Collaborator Author

oharboe commented Mar 6, 2026

I'm not clear what you don't have access to. You state "for AI/LLM code review tools assisting with pull request reviews" which I don't think is true as the LLMs won't read this file.

I should be able to point the gemini instructions to read this file when reviewing, no?

@oharboe
Copy link
Collaborator Author

oharboe commented Mar 6, 2026

LLMs aside, are these instructions helpful or just spam?

@maliberty
Copy link
Member

You could manually tell your LLM to read the file but it isn't somehow automatic LLM guidance (cf CLAUDE.md)

@oharboe
Copy link
Collaborator Author

oharboe commented Mar 6, 2026

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.
Copy link
Member

Choose a reason for hiding this comment

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

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`.
Copy link
Member

Choose a reason for hiding this comment

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

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.
Copy link
Member

Choose a reason for hiding this comment

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

confusing

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.
Copy link
Member

Choose a reason for hiding this comment

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

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.
Copy link
Member

Choose a reason for hiding this comment

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

Henner has been pushing in the opposite direction.

CONTRIBUTING.md Outdated
Comment on lines +97 to +98
- Log messages must use the OpenROAD logger (`utl::info`, `utl::warn`,
`utl::error`), not `printf` or `std::cout`. Use `utl::report`
Copy link
Member

Choose a reason for hiding this comment

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

utl::info (etc) are for TCL and Logger::info (etc) for C++. It would be good to clarify.

@maliberty
Copy link
Member

This somewhat duplicates the other files. We should remove anything duplicative. This should appear in the read the docs

oharboe and others added 2 commits March 6, 2026 15:26
- 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>
@oharboe
Copy link
Collaborator Author

oharboe commented Mar 6, 2026

Had Claude update and DRY

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

clang-tidy review says "All clean, LGTM! 👍"

@maliberty maliberty enabled auto-merge March 6, 2026 15:52
@maliberty maliberty merged commit 4b3404b into The-OpenROAD-Project:master Mar 6, 2026
13 of 14 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.

2 participants