I’ve been digging through the Graphite Diamond doc...
# how-do-i
t
I’ve been digging through the Graphite Diamond docs to better understand how to customize code review hygiene rules, and I could use some clarification. From the docs, I see that Diamond supports: • Exclusions (ignoring generated code, specific paths, etc.) • Custom rules via prompts (UI) and file-based rules • Prebuilt templates (e.g. OWASP, Airbnb JS, PEP) What I haven’t been able to find is: a. What exactly do file-based rules look like? Is there a schema (YAML, JSON, Markdown, etc.) and can these rules live inside the repo under version control? b. Can Diamond directly ingest a repo’s STYLE_GUIDE.md (or similar markdown doc) as rules, or do those need to be re-expressed in custom prompts? c. How much control do we have over severity / enforcement — e.g. marking a rule as blocking vs. just a suggestion? d. Are there examples of repos using custom/file-based rules that I could review? I’ve gone through the Diamond customization and review comments sections, but these specific details weren’t clear. Would love any guidance or examples others here can share 🙏
p
(If applicable) To help us more clearly understand what you're trying to do, please provide additional details about: - Screenshots / debug logs / list of commands you've tried to run so far - Your workflow - Current state
Hey Tianzhen! A) There is no schema, any text-file works (i.e. YAML, JSON, Markdown are all good). File based rules reference files within the codebase, based on a glob path — for example, a file based rule could be defined as
.cursor/rules
and we will pass all files within
.cusor/rules
as context to diamond B) It can! We can ingest any text-file in a repo (though there are file/character limits that we enforce). C) We don't have severity enforcement rules currently, but the team is curious to learn more about what types of rules you'd like to create? D) No examples handy currently, but this is something we'll consider making in the future!