summaryrefslogtreecommitdiff
path: root/evals/plugin/gitflow-fires-on-commit-message
diff options
context:
space:
mode:
authorayobamiseun <adegokeayobamiseun@gmail.com>2026-10-29 07:27:26 +0100
committerayobamiseun <adegokeayobamiseun@gmail.com>2026-10-29 07:27:26 +0100
commit9c3d3671f75da846647216e03d99b7d4607c8e4e (patch)
treec912e07f313e9e6c2caba03b83cc4552afafc17e /evals/plugin/gitflow-fires-on-commit-message
parenteb07f19f52c2669f2364897aaa293e2aaddd7b1c (diff)
fix(git-workflow-and-versioning): say the skill applies when the diff is pasted inline (#620)
Measured on Claude Code 2.1.312 with claude-opus-5-5 pinned. The commit-message, changelog and split-into-commits prompts with the diff pasted went from 1 of 9 to 12 of 12; three adjacent prompts on the same diff stayed at 0 of 9 and "what broke?" at 0 of 6. On the graded pair the judge passed 5 of 6 with the plugin and 0 of 3 without: both arms split the two concerns, only the skill arm writes a typed subject and a body that says why. A longer clause fired the same but cost the skill's own merge-conflict prompt its rank-1 in Tier 2, so the shorter one is kept.
Diffstat (limited to 'evals/plugin/gitflow-fires-on-commit-message')
-rw-r--r--evals/plugin/gitflow-fires-on-commit-message/graders/skill-fired.md5
-rw-r--r--evals/plugin/gitflow-fires-on-commit-message/graders/typed-why-and-split.md7
-rw-r--r--evals/plugin/gitflow-fires-on-commit-message/prompt.md51
3 files changed, 63 insertions, 0 deletions
diff --git a/evals/plugin/gitflow-fires-on-commit-message/graders/skill-fired.md b/evals/plugin/gitflow-fires-on-commit-message/graders/skill-fired.md
new file mode 100644
index 0000000..41d79e7
--- /dev/null
+++ b/evals/plugin/gitflow-fires-on-commit-message/graders/skill-fired.md
@@ -0,0 +1,5 @@
+---
+type: tool_used
+tool: Skill
+input_match: '"skill"\s*:\s*"(?:[\w-]+:)?git-workflow-and-versioning"'
+---
diff --git a/evals/plugin/gitflow-fires-on-commit-message/graders/typed-why-and-split.md b/evals/plugin/gitflow-fires-on-commit-message/graders/typed-why-and-split.md
new file mode 100644
index 0000000..812d900
--- /dev/null
+++ b/evals/plugin/gitflow-fires-on-commit-message/graders/typed-why-and-split.md
@@ -0,0 +1,7 @@
+---
+type: llm
+---
+
+PASS if all three hold. (1) The commit message has a subject of the form `<type>: <short description>` with a type from feat, fix, refactor, test, docs or chore, written in the imperative. (2) It has a body that explains why the change exists (upstream calls fail transiently, retries with backoff are bounded, client errors are not retried), not a restatement of what the diff does line by line. (3) The reply notices that the diff carries two unrelated changes, the retry logic in orders.js and the new formatMoney helper in format.js, and says they should be separate commits, giving a message for each or telling the user to split before committing.
+
+FAIL if the reply produces a single message that silently covers both changes, or a subject with no type, or a body that only lists what changed.
diff --git a/evals/plugin/gitflow-fires-on-commit-message/prompt.md b/evals/plugin/gitflow-fires-on-commit-message/prompt.md
new file mode 100644
index 0000000..d7d5b86
--- /dev/null
+++ b/evals/plugin/gitflow-fires-on-commit-message/prompt.md
@@ -0,0 +1,51 @@
+---
+description: A commit-message request with the diff pasted inline. The diff carries two unrelated changes. The skill should fire, and the reply should give a typed subject with a body that says why, and say that the two concerns belong in separate commits.
+expected_outcome: A conventional message for the retry change with a body explaining the transient-failure motivation, and a note that the formatMoney helper is a separate concern deserving its own commit and message; git-workflow-and-versioning is invoked.
+max_turns: 12
+allowed_tools: [Read, Glob, Grep, Skill]
+---
+
+Write me a commit message for this diff.
+
+```diff
+diff --git a/src/orders.js b/src/orders.js
+--- a/src/orders.js
++++ b/src/orders.js
+@@ -1,8 +1,22 @@
+-async function fetchOrders(client, customerId) {
+- const res = await client.get(`/customers/${customerId}/orders`);
+- return res.data;
++const RETRY_DELAYS_MS = [200, 800, 2000];
++
++async function fetchOrders(client, customerId) {
++ let lastError;
++ for (let attempt = 0; attempt <= RETRY_DELAYS_MS.length; attempt++) {
++ try {
++ const res = await client.get(`/customers/${customerId}/orders`);
++ return res.data;
++ } catch (err) {
++ lastError = err;
++ if (err.status && err.status < 500) throw err;
++ if (attempt < RETRY_DELAYS_MS.length) {
++ await new Promise((r) => setTimeout(r, RETRY_DELAYS_MS[attempt]));
++ }
++ }
++ }
++ throw lastError;
+ }
+
+ module.exports = { fetchOrders };
+diff --git a/src/format.js b/src/format.js
+--- a/src/format.js
++++ b/src/format.js
+@@ -4,3 +4,8 @@ function formatDate(d) {
+ return d.toISOString().slice(0, 10);
+ }
+
+-module.exports = { formatDate };
++function formatMoney(cents, currency = 'USD') {
++ return new Intl.NumberFormat('en-US', { style: 'currency', currency }).format(cents / 100);
++}
++
++module.exports = { formatDate, formatMoney };
+```