Konrad Komorowski
08/10/2025, 4:06 PMpytest file which contains Python service fixtures, instantiate dependent services from scratch (using a shared DB session), instead of using their global fixtures.
2. If the content of an external-facing docs page changes significantly, review the frontmatter description: property of the relevant .mdx file.
Solution I'm hypothesising
Wanted to create a custom file-based Diamond ruleset for these gotchas, based on globbing a pattern like *.diamondrules .
I wanted to start with a /.root.diamondrules file like this:
# What are `.diamondrules` files?
Files with the `.diamondrules` extension are used to define "localized gotchas" to pay careful attention to.
As an AI code reviewer:
1. Diligently follow the procedures described by these rules.
2. Apply these rules to files in the same directory as the `*.diamondrules` file, especially if it references a specific relative file.
And then we'd put write extra .*.diamondrules files as needed in each dir, for example:
# Maintaining consistent `description` Frontmatter property
Whenever an `*.mdx` file in this directory is modified, review that the `description` Frontmatter property matches the updated content of the file.
Some Qs:
1. Do you think this would work?
2. When you concatenate the globbed files, does the resulting prompt / tool call output also give diamond the location of each file?
3. Can Diamond look over the whole file when doing code review? In these gotchas sometimes context more than a few hundred lines away from the diff is important.
CC @Alyssa Baum for thoughtsKonrad Komorowski
08/10/2025, 4:12 PMJacob Gold
08/10/2025, 4:21 PMJacob Gold
08/10/2025, 4:22 PMKonrad Komorowski
08/10/2025, 4:24 PMJacob Gold
08/10/2025, 4:25 PMJacob Gold
08/10/2025, 4:25 PMKonrad Komorowski
08/10/2025, 4:30 PMJacob Gold
08/10/2025, 4:30 PMJacob Gold
08/10/2025, 4:30 PMJacob Gold
08/10/2025, 4:31 PMCan Diamond look over the whole file when doing code review? In these gotchas sometimes context more than a few hundred lines away from the diff is important.this is rolling out slowly, you may get some reviews with full file context
Konrad Komorowski
08/10/2025, 4:32 PMKonrad Komorowski
08/10/2025, 4:40 PM---
ruleLocation: /
ruleTitle: What are `.diamondrules` files?
---
Files with the `.diamondrules` extension are used to define "localized gotchas" to pay careful attention to.
As an AI code reviewer:
1. Diligently follow the procedures described by these rules.
2. Apply these rules to files in the same directory as the `*.diamondrules` file, especially if it references a specific relative file.
---
ruleLocation: /python/services/backend/api-docs/
ruleTitle: Maintain consistent `description` Frontmatter property
---
Whenever an `*.mdx` file in this directory is modified, review that the `description` Frontmatter property matches the updated content of the file.
and add a CI check that ruleLocation is correct
the frontmatter block should also make them nicely distinct, regardless of how you concatenate them