A coding guide should help a teammate do the next change correctly. In a repository where people use AI to write or revise code, the most useful instructions explain where to start, which boundaries matter, and what evidence the maintainer expects before merging. The same guide should be readable by a person trying the repository for the first time.
Begin with two recent changes that took unnecessary review time. Find the assumptions that caused it. A tool may have changed generated output without finding the source file, or verified a helper while missing the route that actually serves customers. Those failures can tell you what belongs in the guide and what belongs in a test.
Start with five repository rules you can copy, then try them on one change your team needs to ship.
Write rules that change a decision
Name the source of truth when the reader could plausibly choose the wrong one. If rendered pages are built from content data, say where they are authored, how to regenerate them, and which generated files belong in the commit. If a generic component is shared by several surfaces, ask authors to find those callers before changing it.
State the boundaries that need explicit maintainer approval. Useful examples can include new production dependencies, changes to who can edit a record, or a one-off operation that modifies live data. A rule should identify the decision and who can authorize it. A contributor can make routine decisions within the approved change once those boundaries are clear.
Point to the exact checks that fit the work. A repository can have a full test suite and shorter checks for a particular package. Tell people where to find both. Record the evidence the reviewer needs, from a failing line to a screenshot of a user-facing layout, and ask the author to name what the check exercised.
Start with a copyable ruleset
- Read the entry point. Identify the route, command, or component the person uses, then find the tests and other callers.
- Keep the change bounded. Record the behavior being changed, the behavior users rely on today, and a concrete acceptance example.
- Respect the source. Edit owned data or source files and regenerate committed outputs with the project commands.
- Pause at designated boundaries. Get an explicit decision before changing access, adding production integrations, or writing live data.
- Show verification. Give the relevant commands, results, and any important behavior that still needs a check.
Keep each rule near the owner and evidence that support it. A rule about the API belongs beside its contract or beside a repository guide that points to it. A rule about a particular markup generator can link to its command instead of copying that command to several folders.
Agree where the guide applies. A general introduction can cover shared decisions, while a nested guide names the special concerns of one package. If two places give different answers, decide which is authoritative and update them together. Contributors should be able to tell whether a package needs an exception from the information in the repository.
Test the guidelines on an ordinary change
Suppose a team needs an order search to keep the selected store when a customer changes the date range. The owner links the support report and gives a reproducible case using an approved test account. The author opens the route and the shared filter component, then finds two other screens that use the component. The patch can stay in the search route if the other filters already behave correctly.
Ask the author to show the before and after with the same inputs. A focused test can open the search page, pick a store, change the date range, and check the request and the displayed result. The reviewer should see that the selected store remains in both places and that clearing the filter still works. A screenshot by itself shows only the visible state. A test or network record shows the request parameters.
Watch what the author or tool does when it reaches a boundary. If it proposes moving the state into a global store, ask which callers require that change. The guide should help the reviewer spot the extra scope quickly. If the contributor repeatedly edits a generated file, add the authoring path to the rule and verify on the next task that it is followed.
Keep the guide in the review loop
Review a few changes after the guide has been in use for a month. For each review comment that caused rework, record the decision, where the evidence was available, and what the author did. If people keep missing the same call site, add its location to the guide. If they keep submitting stale generated files, run the generation check in the review workflow so the author sees the mismatch before a reviewer does.
Ask reviewers to distinguish a missing rule from a missed rule. When the repository already states where the source lives, putting the instruction in a second file may add noise. A generation drift check can enforce a predictable condition more reliably. A judgement about whether a repository needs a new dependency still belongs to the maintainer.
When a review exposes an assumption that several contributors are likely to make, add a short example with the rule. Remove examples tied to an old route or command. Assign a maintainer to update the instructions when the build or ownership changes. In the pull request, retain the acceptance example and the result of the relevant check.
GitHub’s pull request guidance covers review and standardization options. For a walkthrough of an individual change, see Dialect’s AI coding workflow. Our software project brief shows how to write an acceptance example before implementation. AI-Enabled Development covers the scope, verification, and handover of software work.
Ask a Dialect developer a quick question about applying the guidelines to your repository or checking a change before it ships.