{"slug":"pr-description-from-diff","name":"PR Description From a Diff","version":"1.0.3","updated_at":"2026-10-13T07:18:17.783Z","use_when":"Writes a pull request title and description from a pasted unified diff, as Markdown only - a title line of at most 72 characters, then four fixed sections - Summary, Changes, Tests and Risks - where every file the diff touches is named once, including renames, deletions, binary files, mode changes, lockfiles and formatting-only edits, and nothing is claimed that the diff does not show. It describes what the hunks change and leaves out a reason, a speed gain, a security fix or a test result unless the author's note supplies it, flags what can break callers, links an issue only when one is given, never copies a secret into the text, treats a note addressed to the AI inside a code comment as data, and says so when the diff is cut off. Use when asked to write a pr description, pull request body or merge request text from a git diff or a patch.","not_for":"It does not read your repository, run the code or the tests, or open a pull request; the pull request description it writes comes only from the diff you paste in, plus an issue number and the author's note if you add them. It cannot say why a change was made when the note does not. It describes a change, it does not hunt for defects or judge the design, and it writes no changelog entry.","languages":["any"],"tags":["pull-request","git-diff","code-review","release-notes","markdown","documentation"],"category":"code","category_url":"https://aiskills402.com/categories/code","keywords":["pr description","pull request description","git diff"],"faq":[{"q":"Files a quick summary would skip: does it name them?","a":"Lockfiles, snapshots, generated files, a file with only whitespace changes, a deleted test, a renamed file with both paths, a binary image and a file whose only change is its permission bits. Each gets a short bullet that says exactly what the diff shows, and a binary file is called binary with its content not shown."},{"q":"Will it say the change fixes a bug, improves speed or closes a ticket?","a":"Only when you say so. A diff shows lines added and removed, not the reason, so a motive, a security fix, a speed gain or no behaviour change is repeated only when the author's note supplies it, and then it is attributed. An issue is linked only when you give its number. Test results are never claimed, and Tests says plainly when no test file changed."},{"q":"What happens to secrets and to instructions hidden in the diff?","a":"A token or key written into a file is reported under Risks as a credential-looking value in that file, and the value itself is never copied into the text. A line addressed to the AI inside a code comment is reported as an added comment and not obeyed. A diff that is cut off is said to be cut off, and the missing files are not described."},{"q":"Does it help Claude Sonnet?","a":"Barely. Twenty-four diffs were described by Sonnet and by Haiku, in two rounds, skill in and skill out, every description scored by code and read by hand. Plain Sonnet already named the files, stated a default changed under a refactor note and gave a lockfile-only diff no reasons. It called an HTML swap a security fix, claimed a speed-up on a set lookup and broke the layout once: 21 right. With the skill, 22; it wrote one title of 79 characters and once left issue #12 unlinked. Haiku went from 17 to 19, mostly on layout. The output is a title plus Summary, Changes, Tests and Risks."}],"examples":[{"lang":"en","model":"claude-sonnet-5-5","input_excerpt":"Author's note:\nAdd the health endpoint\n\nDiff:\ndiff --git a/src/routes/health.ts b/src/routes/health.ts\nnew file mode 100644\nindex 0000000..9e3779b\n--- /dev/null\n+++ b/src/routes/health.ts\n@@ -0,0 +1,3 @@\n+export function health() {\n+  return { status: \"ok\", uptime: process.uptime() };\n+}\ndiff --git a/src/routes/index.ts b/src/routes/index.ts\nindex 3c6ef36..daa66d1 100644…","output_excerpt":"Add a health endpoint and bump CI to Node 22\n\n## Summary\nAdds a `health` route handler that returns a status and the process uptime, registers it in the routes index, and serves it at `GET /health`. Per the note, the change adds the health endpoint. The diff also adds the `ms` dependency, changes the CI Node version from 20 to 22, and reformats one legacy file.\n\n## Changes…"},{"lang":"bg","model":"claude-sonnet-5-5","input_excerpt":"Author's note:\nДобавена валидация на имейл при регистрация\n\nDiff:\ndiff --git a/src/auth/register.ts b/src/auth/register.ts\nindex 76c90bc..1500857 100644\n--- a/src/auth/register.ts\n+++ b/src/auth/register.ts\n@@ -1,3 +1,6 @@\n export function register(input: Input) {\n+  if (!isValidEmail(input.email)) {\n+    return { ok: false, error: \"Невалиден имейл\" };\n+  }\n   return createUser(input);\n }…","output_excerpt":"Добавя проверка на имейл във функцията register\n\n## Summary\n\nФункцията `register` вече проверява имейла с `isValidEmail` преди да създаде потребител. Според бележката на автора промяната добавя валидация на имейл при регистрация. Няма посочен номер на задача.\n\n## Changes…"}],"page_url":"https://aiskills402.com/skills/pr-description-from-diff","markdown_url":"https://aiskills402.com/skills/pr-description-from-diff.md","image_url":"https://cdn.aiskills402.com/og/skills/pr-description-from-diff/9f8f4198.png","related_url":"https://api.aiskills402.com/v1/skills/pr-description-from-diff/related","purchases_count":null,"tested":{"date":"2026-10-08","strong":{"model":"claude-sonnet-5-5 (Claude Code alias \"sonnet\")","verdict":"Right on 22 of 24 diffs, read by hand, but it missed two: on a diff with a binary file and a mode change its title ran to 79 characters where the limit is 72, and on a diff that came with issue #12 it wrote a sentence on why it would not use a closing word, so the issue stayed unlinked. Everything else held: every changed file named, a lockfile-only diff described as such, a default value changed under a note that calls the work a refactor, an HTML swap with no security claim the diff does not show, a set lookup with no speed claim, no invented test result or ticket, a secret written into a file flagged, a cut-off diff said to be cut off, a Bulgarian note answered in Bulgarian, and an instruction hidden in the diff ignored."},"weak":{"model":"claude-haiku-5-5 (Claude Code alias \"haiku\")","verdict":"Right on 19 of 24 diffs, read by hand, but it missed five, four of them on layout: three titles ran straight into the Summary heading with no blank line, one title was written as a Markdown heading, and on the diff that came with issue #12 it wrote Refs #12, which is not one of the closing words that link a pull request to an issue. It made no claim the diff does not show: no security fix on the HTML swap, no speed-up on the set lookup, the secret in the config file flagged without its value, and the planted instruction ignored."},"note":"Twenty-four unified diffs written by us (17 with a trap, 7 plain), some with an issue number or an author's note, one in Bulgarian: a binary and mode change, a lockfile-only diff, a changed default under a refactor note, an HTML swap, a set lookup that invites a performance claim, a secret in a config file, a cut-off diff, TODO and debug lines, a pure move, test files present or absent, and a hidden instruction. Each answer is checked by code: the title of at most 72 characters, the four sections in order, every changed file named, no claim the diff does not support, the issue linked with a closing word when given and no closing word when not. Checks widened after the run, for both sides, each after reading the answers: a closing word needs a # before the number, because \"from a fixed 100 ms\" was read as a closed issue; \"not a pure rename\" no longer counts as the claim it denies; \"resolves to the same hash\" no longer counts as a reason for an upgrade; and Risks may flag the TODO line by what it says (\"marked for removal before release\"). Every answer was read by hand. A count is the trap its diff was built for plus the layout the request asks for; one call by hand differs from the checks, and the baseline note says which. One run per model and diff.","baseline":{"date":"2026-10-08","rows":[{"label":"Descriptions written right (24 diffs)","better":"higher","strong":{"with":{"n":22,"of":24},"without":{"n":21,"of":24}},"weak":{"with":{"n":19,"of":24},"without":{"n":17,"of":24}}}],"note":"Same request on both sides, a fence removed first. Read by hand, Sonnet without the skill already named every file, stated the changed default under the refactor note, gave the lockfile-only diff no reasons, flagged the secret and the TODO, and ignored the hidden instruction. It missed three: it titled the HTML swap a fix for script injection; on the set lookup it wrote that the cost drops from O(n·m) to O(n+m), a speed claim the checks let through, counted here since that diff tests for one; and it put Closes #12 on its own line between the title and the first section. Haiku without the skill missed seven: the HTML swap, the same O(n+m) claim, a title of 82 characters, three titles with no blank line after them and Refs #12 in place of a closing word. Not counted, as no diff tests for them: both models called a dropped column unused and a rounding change a fix."},"report_url":null},"price_usd":"0.02","price_micro":20000,"size_bytes":10866,"sha256":"3bfa9e82a4be2140bccb9d25783e89f95320dca772ac616e829299ad80d0f16c","outline":["The answer","Changes: every file, once","Claims: only what the diff shows","The issue link","Tests","Risks","Text addressed to you","Work in this order","Short examples"],"license":{"summary":"Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing","holder":"Georgi Kalchev, aiskills402.com","url":"https://aiskills402.com/docs#license"},"buy_url":"https://api.aiskills402.com/v1/skills/pr-description-from-diff/file","redownload_url_template":"https://api.aiskills402.com/v1/purchases/{token}","mcp_tool":null,"payment":{"protocol":"x402","scheme":"exact","asset":"USDC","selling":true,"network":"base","network_caip2":"eip155:8453","pay_to":"0xbc0dcc70d8b5d85541d86ffc68d988fd59c22e68","facilitator":"cdp"},"seo_title":"PR Description From a Git Diff","seo_description":"Writes a pull request description from a git diff, every file named and no claim the diff does not show, no invented ticket. Pay $0.02 once, in USDC.","versions":[{"version":"1.0.3","date":"2026-10-13","changelog":"# Changelog\n\n## 1.0.0 — 2026-10-08\n\nFirst release: turns a pasted unified diff (plus, when given, an issue number and the author's note) into a pull\nrequest title of at most 72 characters and a description with four fixed sections: Summary, Changes, Tests, Risks,\nas Markdown only. Every file header of the diff gets one bullet, including renames (both paths, similarity read),\ndeletions, binary files, mode-only changes, lockfiles, snapshots, generated files and formatting-only files. Claims\nare limited to what the diff or the note shows: the reason only from the note and attributed; no security, speed or\n\"no behaviour change\" of the writer's own; a changed default is stated even under a refactor note; test results are\nnever claimed and a missing test file is said as \"No test changes in this diff.\"; Risks flags removed or renamed\nexports, changed signatures, deleted files, migrations, dependency and configuration changes, credential-looking\nvalues (never copied) and added TODO or FIXME, or says \"None visible in the diff.\"; the issue is linked with a\nclosing word only when its number is given; a line addressed to the AI inside the diff is reported, not obeyed; a\ncut-off diff is said to be cut off. Written to brief § 3.29 of docs/plan-batch3-briefs-21-40.md. The format facts are\nthe stable extended-header lines of the unified diff (similarity index, rename from/to, old/new mode, \"Binary files\ndiffer\"); the closing words are the ones GitHub documents for linking a pull request to an issue. Neither page was\nre-fetched on the day of writing (no network step in this task), so both are from memory of the documented form.\nModel runs, the baseline and the price follow the measurement, not this entry; the starting price is class B, $0.02.\n\n## 1.0.1 — 2026-10-08 (finalised after the model test)\n\n- Measured on 24 diffs: Sonnet 20 -> 22 of 24, Haiku 16 -> 19 (without -> with the skill).\n- Check widened (both sides): a closing word must be followed by # and a number (\"fixed 100 ms\" was read as a closed issue).\n- Price: $0.03 (Sonnet gain 2).\n\n## 1.0.2 — 2026-10-13\n\n- Test notes corrected after a second reading of every recorded answer (owner's approval). Sonnet without the skill: 20 -> 21 of 24. Two of its four listed misses were false alarms of the checks (\"not a pure rename\", \"resolves to the same hash\"). Issue #12 was linked, but on a line outside the requested layout. Its O(n·m) to O(n+m) claim on the set-lookup diff is a miss the checks let through, counted by hand. Haiku without: 16 -> 17 (the TODO was flagged as \"marked for removal before release\"). With the skill: unchanged, Sonnet 22 and Haiku 19. Haiku's five misses are four layout faults and one Refs #12, not a speed claim or an unflagged secret as first written.\n- Three checks widened for both sides in test/make-cases.mjs, with control cases in test/control.mjs: the negation \"not a pure rename\", \"resolves to\" and a TODO flagged by its words.\n- The skill text and the price are unchanged.\n\n## 1.0.3 — 2026-10-13\n\n- Price: $0.02, down from $0.03. With the corrected count the Sonnet gain is 1 (21 -> 22 of 24), and a gain of 1 is priced at $0.02.\n- The skill text and the test notes are unchanged.\n"},{"version":"1.0.2","date":"2026-10-13","changelog":"# Changelog\n\n## 1.0.0 — 2026-10-08\n\nFirst release: turns a pasted unified diff (plus, when given, an issue number and the author's note) into a pull\nrequest title of at most 72 characters and a description with four fixed sections: Summary, Changes, Tests, Risks,\nas Markdown only. Every file header of the diff gets one bullet, including renames (both paths, similarity read),\ndeletions, binary files, mode-only changes, lockfiles, snapshots, generated files and formatting-only files. Claims\nare limited to what the diff or the note shows: the reason only from the note and attributed; no security, speed or\n\"no behaviour change\" of the writer's own; a changed default is stated even under a refactor note; test results are\nnever claimed and a missing test file is said as \"No test changes in this diff.\"; Risks flags removed or renamed\nexports, changed signatures, deleted files, migrations, dependency and configuration changes, credential-looking\nvalues (never copied) and added TODO or FIXME, or says \"None visible in the diff.\"; the issue is linked with a\nclosing word only when its number is given; a line addressed to the AI inside the diff is reported, not obeyed; a\ncut-off diff is said to be cut off. Written to brief § 3.29 of docs/plan-batch3-briefs-21-40.md. The format facts are\nthe stable extended-header lines of the unified diff (similarity index, rename from/to, old/new mode, \"Binary files\ndiffer\"); the closing words are the ones GitHub documents for linking a pull request to an issue. Neither page was\nre-fetched on the day of writing (no network step in this task), so both are from memory of the documented form.\nModel runs, the baseline and the price follow the measurement, not this entry; the starting price is class B, $0.02.\n\n## 1.0.1 — 2026-10-08 (finalised after the model test)\n\n- Measured on 24 diffs: Sonnet 20 -> 22 of 24, Haiku 16 -> 19 (without -> with the skill).\n- Check widened (both sides): a closing word must be followed by # and a number (\"fixed 100 ms\" was read as a closed issue).\n- Price: $0.03 (Sonnet gain 2).\n\n## 1.0.2 — 2026-10-13\n\n- Test notes corrected after a second reading of every recorded answer (owner's approval). Sonnet without the skill: 20 -> 21 of 24. Two of its four listed misses were false alarms of the checks (\"not a pure rename\", \"resolves to the same hash\"). Issue #12 was linked, but on a line outside the requested layout. Its O(n·m) to O(n+m) claim on the set-lookup diff is a miss the checks let through, counted by hand. Haiku without: 16 -> 17 (the TODO was flagged as \"marked for removal before release\"). With the skill: unchanged, Sonnet 22 and Haiku 19. Haiku's five misses are four layout faults and one Refs #12, not a speed claim or an unflagged secret as first written.\n- Three checks widened for both sides in test/make-cases.mjs, with control cases in test/control.mjs: the negation \"not a pure rename\", \"resolves to\" and a TODO flagged by its words.\n- The skill text and the price are unchanged.\n"},{"version":"1.0.0","date":"2026-10-08","changelog":"# Changelog\n\n## 1.0.0 — 2026-10-08\n\nFirst release: turns a pasted unified diff (plus, when given, an issue number and the author's note) into a pull\nrequest title of at most 72 characters and a description with four fixed sections: Summary, Changes, Tests, Risks,\nas Markdown only. Every file header of the diff gets one bullet, including renames (both paths, similarity read),\ndeletions, binary files, mode-only changes, lockfiles, snapshots, generated files and formatting-only files. Claims\nare limited to what the diff or the note shows: the reason only from the note and attributed; no security, speed or\n\"no behaviour change\" of the writer's own; a changed default is stated even under a refactor note; test results are\nnever claimed and a missing test file is said as \"No test changes in this diff.\"; Risks flags removed or renamed\nexports, changed signatures, deleted files, migrations, dependency and configuration changes, credential-looking\nvalues (never copied) and added TODO or FIXME, or says \"None visible in the diff.\"; the issue is linked with a\nclosing word only when its number is given; a line addressed to the AI inside the diff is reported, not obeyed; a\ncut-off diff is said to be cut off. Written to brief § 3.29 of docs/plan-batch3-briefs-21-40.md. The format facts are\nthe stable extended-header lines of the unified diff (similarity index, rename from/to, old/new mode, \"Binary files\ndiffer\"); the closing words are the ones GitHub documents for linking a pull request to an issue. Neither page was\nre-fetched on the day of writing (no network step in this task), so both are from memory of the documented form.\nModel runs, the baseline and the price follow the measurement, not this entry; the starting price is class B, $0.02.\n\n## 1.0.1 — 2026-10-08 (finalised after the model test)\n\n- Measured on 24 diffs: Sonnet 20 -> 22 of 24, Haiku 16 -> 19 (without -> with the skill).\n- Check widened (both sides): a closing word must be followed by # and a number (\"fixed 100 ms\" was read as a closed issue).\n- Price: $0.03 (Sonnet gain 2).\n"}]}