Skip to content

chore: document the comment and commit message rules - #2706

Open
balzss wants to merge 2 commits into
masterfrom
chore/commit-comment-wording
Open

balzss wants to merge 2 commits into
masterfrom
chore/commit-comment-wording

Conversation

@balzss

@balzss balzss commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add a Code comments section to CLAUDE.md, with a human-facing version in the
    contributor docs: explain why not what, one line, never reference the change itself.
  • Fix commitlint.config.js's parserOpts.headerPattern, which couldn't match a scoped
    subject like fix(ui-button): ..., so the conventional parser never ran and
    subject-max-length applied to nothing. Cap the subject at 100.
  • Tighten /commit's guidance on commit bodies, and drop the robot attribution line
    from commit messages.
  • Remove ToMESSKa from the /pr reviewer roster — no longer on the team.

Test Plan

  • subject-max-length: 100 checked against history: 78 of the last 2000 subjects exceed
    it, and they're the ones enumerating every package touched instead of naming the change.
  • Verified the remaining rules still fire — a 120-char subject, a 120-char body line (from
    the preset's body-max-line-length) — and that comma scopes like
    fix(ui-drawer-layout,ui-a11y-utils): still parse.

Fixes INSTUI-5174

🤖 Generated with Claude Code

@balzss balzss self-assigned this Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://instructure.design/pr-preview/pr-2706/

Built to branch gh-pages at 2026-09-30 12:51 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Visual regression report

Cypress suite: ✅ Passing

Visual diff: ⚠️ Changes detected.

Status Count
Unchanged 98
Changed 1
New 0
Removed 0

Accessibility (axe): ✅ No violations.

📊 View full report — click a screenshot's ⚠ badge to see each violation boxed on the image, with the offending element named and contrast failures shown as color swatches.

Diff images (1)

tooltip-light.png — 956 pixels differ

Baselines come from the visual-baselines branch. They refresh on every merge to master. The Cypress suite line covers the a11y and console-error assertions — a ❌ there means the suite found real issues even if the visual diff is clean.

github-actions Bot pushed a commit that referenced this pull request Sep 3, 2026
github-actions Bot pushed a commit that referenced this pull request Sep 4, 2026
@balzss
balzss force-pushed the chore/commit-comment-wording branch from 9d02c38 to 196c515 Compare September 7, 2026 07:49
github-actions Bot pushed a commit that referenced this pull request Sep 7, 2026
@balzss
balzss force-pushed the chore/commit-comment-wording branch from 196c515 to f03ab99 Compare September 14, 2026 16:20
github-actions Bot pushed a commit that referenced this pull request Sep 14, 2026
@balzss balzss changed the title chore: document comment rules and enforce commit message shape chore: document the comment and commit message rules Sep 16, 2026

@matyasf matyasf left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What about using the rules here for both commit and PR messages? https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md#rules (do not copy it literally, some rules are irrelevant here)

Comment thread .claude/commands/commit.md Outdated
Comment thread CLAUDE.md Outdated
- **Never narrate the diff** (`// added onKeyDown handler`, `// updated to support X`) — that's what `git log` is for.
- No commented-out code, no banner or separator comments, and **don't add comments to code you didn't change**.
- Lowercase `//` on its own line above what it explains, never trailing. Ticket ids only on a real external blocker: `// TODO INSTUI-1234: <what unblocks it>`.
- Leave the MIT license header alone — `notice/notice` in `eslint.config.mjs` enforces it.

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.

eslint.config.mjs does not exist, the repo uses .oxlintrc.json

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct. deed11cc24 replaced ESLint with oxlint. The rule name is the same, only the file changed. Fixed to .oxlintrc.json.

Comment thread CLAUDE.md Outdated
Comment on lines +43 to +44
Prop docs are a JSDoc block with **one prose sentence** and no `@param`/`@type` — types come from TypeScript and `react-docgen`. See `packages/ui-alerts/src/Alert/props.ts`.

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.

Alert/props.ts — broken reference, missing v1/v2

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The real paths are Alert/v1/props.ts and Alert/v2/props.ts, but neither fits. Several v2 props have multi-paragraph JSDoc. I removed the example and kept the rule.

@balzss
balzss force-pushed the chore/commit-comment-wording branch from f03ab99 to 2df4178 Compare September 24, 2026 13:49
github-actions Bot pushed a commit that referenced this pull request Sep 24, 2026
@balzss

balzss commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

@matyasf That skill is about chat responses. Four of its 10 rules are already here, five do not apply to commits, and "number multi-step tasks" conflicts — that is the changelog body this PR removes.


🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

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.

In the PR description you claim drop the robot attribution line from commit messages.

I may consider removing the Co-Authored-By line too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i wanted to keep it for transparancy's sake, we can discuss later if we want to get rid of it completely


### Body

**Omit the body when the subject says it all.** When you do write one, it explains **why** — the constraint, the cause, the thing the diff cannot show. Never restate what changed.

@joyenjoyer joyenjoyer Sep 25, 2026 •

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.

I am not sure that any model is smart enough to understand the first sentence, how do they interpret "the subject says it all"? I think this is too abstract.

I would add two real life examples that help Claude's pattern recognition:

  1. if the commit message title is straightforward
  2. if it does not and therefore further explanation is needed in commit body

Claude derives patterns from examples easier than from general statements.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added some examples

Comment thread CLAUDE.md Outdated
- **Never reference the change itself.** `now`, `new`, `previously`, `used to`, `this change`, `the fix`, `as discussed`, `per review`, `we decided`, `recently` — these only mean something next to the diff. Name the constraint instead.
- **Never narrate the diff** (`// added onKeyDown handler`, `// updated to support X`) — that's what `git log` is for.
- No commented-out code, no banner or separator comments, and **don't add comments to code you didn't change**.
- Lowercase `//` on its own line above what it explains, never trailing. Ticket ids only on a real external blocker: `// TODO INSTUI-1234: <what unblocks it>`.

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.

I saw Claude adding ticket references for other products' tickets from their JIRA board, I believe we should not allow this, it should only reference our tickets.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good call, added guardrails

balzss and others added 2 commits September 30, 2026 14:47
The rules live in two places so they hold whichever way someone arrives:
CLAUDE.md for an agent session, docs/contributing for a human contributor.

commitlint's headerPattern could not match a scoped subject like
`fix(ui-button): ...`, so the conventional parser never ran and
subject-max-length applied to nothing. Dropping the pattern lets the parser
work, and the cap drops from 150 to 100 - 78 of the last 2000 subjects were
over 100, and those are the ones listing every package touched instead of
naming the change.

Co-Authored-By: Claude <noreply@anthropic.com>
No longer on the team, so /pr should stop offering them as a reviewer.

Co-Authored-By: Claude <noreply@anthropic.com>
@balzss
balzss force-pushed the chore/commit-comment-wording branch from 2df4178 to 1502609 Compare September 30, 2026 12:49
github-actions Bot pushed a commit that referenced this pull request Sep 30, 2026
@balzss
balzss requested a review from joyenjoyer September 30, 2026 14:10

This branch has not been deployed

No deployments
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.

4 participants