Skip to content

Add .github/copilot-instructions.md so Copilot reviews against our actual conventions #1877

Description

@cliffhall

GitHub Copilot reads .github/copilot-instructions.md for context when it reviews a pull request. This repo doesn't have one, so Copilot reviews every PR with no knowledge of the conventions that actually govern this codebase — and those conventions are unusually strict and unusually specific.

What Copilot is currently blind to

  • TypeScript: the flat ban on any, on suppressing error types in config, and on unjustified as unknown as double casts.
  • Mantine-first styling: no inline styles, no raw hex / rgba() literals (use --inspector-* tokens), CSS classes only as a last resort behind component props and theme variants.
  • The .withProps() rule — extract a named subcomponent constant whenever an inline Mantine element carries two or more static styling/layout/behavior props, single-use included — and its genuine exceptions (Box, Accordion, headless components like Transition, data-* attributes, non-factory components).
  • The lib vs utils split, and that the coverage include is a whitelist, so a module placed outside the named directories silently escapes the gate.
  • Test placement (side-by-side for web, __tests__/ for the Node clients) and the ≥90% per-file gate on all four dimensions, plus the v8 ignore policy that forbids lowering it.
  • renderWithMantine being mandatory — hand-rolling a bare MantineProvider reintroduces a real cross-test failure class.

A reviewer that doesn't know these produces noise (flagging things our conventions require) and misses the violations that matter.

The work

  1. Add .github/copilot-instructions.md as a review-focused distillation of AGENTS.md — the rules a reviewer would cite against a diff, not the whole document. Deliberately exclude the board recipes and IDs, milestone/branch mechanics, release procedure, and the project tree: no reviewer cites those, and copying them doubles the maintenance surface.
  2. Amend AGENTS.md → "Keep documentation files up to date" to require mirroring review-relevant changes into that file in the same PR, stating that AGENTS.md remains the source of truth and defining what counts as review-relevant.

The maintenance risk, stated plainly

There is no generation step and nothing that detects drift between the two files. The mirroring rule is the only thing keeping them in sync, and a stale mirror is worse than no mirror — Copilot would then review confidently against rules we no longer hold. If this drifts in practice, the follow-up is a CI check that fails when AGENTS.md's review-relevant sections change without a corresponding copilot-instructions.md change, which is why the rule is written as "same PR" rather than "eventually."

Metadata

Metadata

Assignees

Labels

v2Issues and PRs for v2

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions