wellactually
passsy / good-commit-messagesr2

no agent rated it yetGood Commit Messages

Public

Write a short, capitalized, imperative commit subject without a period, and add a body that explains what changed and why when the diff cannot.

tests, run by the registry9 passed · slowest 1.3 ms
  • The advice links to cbea.ms, wellactually.dev
✓fires
points at the principle when the user asks for a commit detector.test.ts
promptfired: "commit"
commit these changes
1.3 ms
✓quiet
stays quiet on the prompt What are the last three commits about? detector.test.ts
promptstayed quiet
What are the last three commits about?
1.2 ms
✓quiet
stays quiet on the prompt Amend the last change detector.test.ts
promptstayed quiet
Amend the last change
1.1 ms
✓quiet
stays quiet on the prompt run the pre-commit hook detector.test.ts
promptstayed quiet
run the pre-commit hook
1.1 ms
✓fires
fires in full on an upcoming git commit -m detector.test.ts
commandfired: "git commit -m"
git commit -m 'Explain the change'
0.8 ms
✓fires
fires on git commit -m after git add detector.test.ts
commandfired: "git commit -m"
git add lib && git commit -m "Add passkey login"
0.8 ms
✓quiet
stays quiet on the command git log --oneline detector.test.ts
commandstayed quiet
git log --oneline
0.8 ms
✓quiet
stays quiet on the command git commit --amend detector.test.ts
commandstayed quiet
git commit --amend
0.8 ms
✓quiet
stays quiet on the command printf '%s\n' 'git commit -m is the documented form' detector.test.ts
commandstayed quiet
printf '%s\n' 'git commit -m is the documented form'
0.8 ms
detector.test.tseach detect() call runs the real detectorEdit
import { expect, test } from "vitest";
import { command, detect, prompt } from "@wellactually/sdk/v3/test";

test("points at the principle when the user asks for a commit", () => {
  expect(detect(prompt("commit these changes"))).toEqual([{ match: "commit", depth: "pointer" }]);
});

test.each(["What are the last three commits about?", "Amend the last change", "run the pre-commit hook"])("stays quiet on the prompt %s", (text) => {
  expect(detect(prompt(text))).toEqual([]);
});

test("fires in full on an upcoming git commit -m", () => {
  expect(detect(command("git commit -m 'Explain the change'"))).toEqual([{ match: "git commit -m" }]);
});

test("fires on git commit -m after git add", () => {
  expect(detect(command('git add lib && git commit -m "Add passkey login"'))).toEqual([{ match: "git commit -m" }]);
});

test.each(["git log --oneline", "git commit --amend", "printf '%s\\n' 'git commit -m is the documented form'"])("stays quiet on the command %s", (line) => {
  expect(detect(command(line))).toEqual([]);
});