Skip to content

Commit ba1fb32

Browse files
authored
docs: Add contributor engineering guidelines (#2750)
Adding some of my personal rules to the codebase that I've found to simplify coding agent interaction. --------- Signed-off-by: Kyle Felter <kfelter@nvidia.com>
1 parent 4acacdb commit ba1fb32

3 files changed

Lines changed: 78 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ directly as documented above.
147147

148148
## Coding Conventions
149149

150+
Follow the shared [Engineering Guidelines](CONTRIBUTING.md#engineering-guidelines)
151+
for scope control, reuse-before-new-code, evidence-backed assumptions, and
152+
verification expectations.
153+
150154
See [`STYLE_GUIDE.md`](STYLE_GUIDE.md) for detailed Rust coding conventions.
151155
Make sure to review it to ensure changes meet the expected style of the codebase.
152156

CONTRIBUTING.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ We welcome contributions of all sizes — from fixing a typo in the docs to addi
1717
- [Developer Certificate of Origin (DCO)](#developer-certificate-of-origin-dco)
1818
- [Fork and Setup](#fork-and-setup)
1919
- [Contribution Process](#contribution-process)
20+
- [Engineering Guidelines](#engineering-guidelines)
2021
- [Pull Request Guidelines](#pull-request-guidelines)
2122

2223
## Developer Certificate of Origin (DCO)
@@ -172,6 +173,75 @@ Use descriptive branch names like:
172173
3. **Sign off all your commits** using `git commit -s`.
173174
4. **Submit a pull request** with a clear description of your changes.
174175

176+
## Engineering Guidelines
177+
178+
Apply these guidelines to every code change, whether it is handwritten,
179+
generated, or produced with automation. They are intended to keep changes
180+
reviewable, low risk, and consistent with the existing codebase.
181+
182+
### Scope and ownership
183+
184+
- Make the smallest correct change that solves the problem. Avoid unrelated
185+
refactors, formatting churn, new configuration paths, compatibility layers,
186+
or feature flags unless the change requires them.
187+
- If requirements are unclear, ask before changing scope. Do not silently
188+
simplify, rename, collapse, or replace the requested behavior with an adjacent
189+
improvement or quick win.
190+
- Do not redefine success around an easier path. If the real workflow is
191+
blocked, report the concrete missing input, artifact, tool, permission, or
192+
configuration.
193+
- Work with the current tree. Do not discard, rewrite, or revert someone else's
194+
changes unless the owner explicitly asks for that.
195+
- Keep pull requests focused on one behavioral or documentation outcome. Remove
196+
unused code, temporary logging, skipped assertions, placeholders, and hidden
197+
TODOs before asking for review.
198+
- Do not commit secrets, credentials, local environment files, generated
199+
private keys, or machine-specific artifacts.
200+
201+
### Reuse before adding code
202+
203+
Before introducing code or dependencies, check in this order:
204+
205+
1. Does this code need to exist, or can the caller use an existing behavior?
206+
2. Does the standard library already solve it?
207+
3. Does Rust, Go, Kubernetes, SQL, the OS, or another platform feature solve it
208+
natively?
209+
4. Does an existing workspace dependency or local helper already solve it?
210+
5. Can the change be expressed clearly inline instead of adding an abstraction?
211+
212+
Only add a helper, abstraction, dependency, compatibility path, or migration
213+
when it removes real complexity, matches an established pattern, or is required
214+
for the requested behavior.
215+
216+
### Evidence and assumptions
217+
218+
- Treat implementation claims as assumptions until they are backed by code,
219+
generated types, route registration, service definitions, schema, tests,
220+
documentation, or runtime output.
221+
- Do not infer contracts from similar names or nearby code alone. Prove data
222+
flow, ownership, authorization, persistence, API shape, and deployment
223+
behavior before relying on them.
224+
- Back claims with concrete evidence: diffs, generated output, logs, test
225+
results, API responses, screenshots, or direct observations from the relevant
226+
system.
227+
- If an assumption cannot be checked cheaply, state it in the pull request or
228+
review notes instead of presenting it as fact. If new evidence contradicts an
229+
assumption, update the design before continuing.
230+
231+
### Verification
232+
233+
- Verification should exercise the behavior that changed. Do not claim a fix is
234+
covered by an unrelated build, a nearby test, generated examples, or a mocked
235+
path that avoids the real integration being changed.
236+
- Use the real service, repository, dataset, device, workflow, command, and
237+
integration path that the change affects whenever practical. Call out any
238+
lower-fidelity substitute instead of treating it as equivalent coverage.
239+
- Add or update focused tests for bug fixes, shared behavior, API contracts,
240+
migrations, and cross-module changes. For narrow documentation-only changes,
241+
a diff review is usually sufficient.
242+
- Keep OpenAPI specs, protobufs, database migrations, Helm manifests, generated
243+
code, and documentation in sync with the behavior they describe.
244+
175245
## Pull Request Guidelines
176246

177247
- Provide a clear description of the problem and solution.

rest-api/AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ make kind-down # tear down cluster
166166

167167
## Coding Conventions
168168

169+
Follow the shared [Engineering Guidelines](../CONTRIBUTING.md#engineering-guidelines)
170+
for scope control, reuse-before-new-code, evidence-backed assumptions, and
171+
verification expectations.
172+
169173
- Follow standard Go conventions; `go fmt` is enforced in CI.
170174
- Linting uses `golangci-lint` (v2 config in `.golangci.yml`) with most
171175
linters enabled, plus `revive` (config in `.revive.toml`).

0 commit comments

Comments
 (0)