Files
ayobamiseun 9c3d3671f7 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.
2026-10-29 07:27:26 +01:00

1.8 KiB

description, expected_outcome, max_turns, allowed_tools
description expected_outcome max_turns allowed_tools
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. 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. 12
Read
Glob
Grep
Skill

Write me a commit message for this 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 };