Skip to content

chore: Add agent coding-convention instructions - #5047

Merged
gethinwebster merged 10 commits into
mainfrom
dev-v3-gethinw-agent-instructions
Sep 25, 2026
Merged

gethinwebster merged 10 commits into
mainfrom
dev-v3-gethinw-agent-instructions

Conversation

@gethinwebster

@gethinwebster gethinwebster commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

AI coding assistants are great at producing working code, but in this repo they tend to drift from our undocumented team conventions: how components are structured, how props flow through index/internal/interfaces, the voice of our API docs, not breaking the public API. This risks coming up in review again and again. It can be mitigated to some extent by AGENTS.md, but this can often end up getting ignored.

This PR makes an attempt to crystallize some of those rules, and give them as additional context to copilot as a more reliable way of ensuring the rules are followed.

What's here

  • .github/copilot-instructions.md — the repo-wide stuff: comment discipline, reuse and preferring one shared implementation over parallel ones, types over runtime checks, naming, i18n, keeping PRs focused, and treating the public API as a contract we don't break lightly.
  • .github/instructions/*.instructions.md — the per-area detail, applied automatically by tools that understand these files:
    • component-structure — the index/internal/interfaces split and the public↔internal contract (forwardRef⇔Ref, getBaseProps, __internalRootRef, __-prefixed internals), public-API compatibility, interface typing, and doc voice & tone.
    • plus tests, styles, dev-pages, and test-utils.
  • A small AGENTS.md tweak — it now points at these files, and I corrected the title note to say “PR titles only” (we don't actually check individual commit messages, since they're squashed away).

How do we know it helps?

  • Does it catch the things we actually comment on? Took ~30 recent merged PRs, showed the rules to a dry-run review agent, and compared what it flagged against what our human reviewers had said. It re-surfaced roughly three-quarters of the convention-type feedback we'd given — the structural, naming, reuse, dev-page and doc-style points — and it did that without inventing problems that weren't there.
  • Does it nag about code that's already fine? I also pointed it at a set of existing, already-merged components. On code that already follows our conventions it stayed quiet — no false alarms on the core structural rules — which is the important half: a checker that cries wolf gets muted fast.

@codecov

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.69%. Comparing base (839ce39) to head (6aff0f9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5047   +/-   ##
=======================================
  Coverage   97.69%   97.69%           
=======================================
  Files         966      966           
  Lines       31575    31575           
  Branches    11669    11669           
=======================================
  Hits        30846    30846           
  Misses        722      722           
  Partials        7        7           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Some instructions exclude relevant implementation files or inaccurately describe established architectural and styling patterns.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity · 2 Low severity

Open (3)
What changed in this PR

Adds coding-convention guidance for AI assistants and contributors.

Changes:

  • Defines repository-wide engineering conventions.
  • Adds scoped guidance for components, tests, styles, dev pages, and test utilities.
  • Updates AGENTS.md references and PR-title guidance.
File Description
AGENTS.md Links convention files and clarifies title checks.
.github/​copilot-instructions.md Defines repository-wide conventions.
.github/​instructions/​component-structure.instructions.md Documents component architecture and API conventions.
.github/​instructions/​tests.instructions.md Defines testing conventions.
.github/​instructions/​test-utils.instructions.md Defines test-utils contract conventions.
.github/​instructions/​styles.instructions.md Defines SCSS conventions.
.github/​instructions/​dev-pages.instructions.md Defines demo-page conventions.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

gethinwebster and others added 2 commits September 25, 2026 09:18
…d internal-interfaces.ts in scope'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…or necessary SCSS selectors'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
… component guidance and examples'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The documentation-only changes are coherent, correctly scoped, and consistently linked.

Review effort: Balanced
Findings: None

Resolved since last review (3)

invent a divergence.

## Contract rules — hard, shape-independent (a violation is almost certainly a bug)
- **Wrapper checklist (new, non-single-impl components):** `index.tsx` starts with `'use client';` as its

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: After the copyright/liscense header?

@gethinwebster
gethinwebster added this pull request to the merge queue Sep 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 25, 2026
@gethinwebster
gethinwebster added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit 3ac674a Sep 25, 2026
87 of 89 checks passed
@gethinwebster
gethinwebster deleted the dev-v3-gethinw-agent-instructions branch September 25, 2026 11:07
jperals pushed a commit that referenced this pull request Sep 29, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

This branch was successfully deployed

3 active deployments
dev-pages-react16 — 6aff0f96 Deployed Sep 25, 2026 by gethinwebster via deploy (React 16) / deploy #2311
dev-pages-react18 — 6aff0f96 Deployed Sep 25, 2026 by gethinwebster via deploy (React 18) / deploy #2311
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants