Skip to main content
Skill Claude

Skill Deskripsi Pull Request untuk Claude Code

Membaca diff branch lalu mengisi template PR: kenapa, apa yang berubah, hasil tes nyata, risiko, dan rollback.

Oleh Matthews WongDiperbarui Dicek dengan Claude Code 2.1.323 docs

Poin utama

Masukkan folder ini ke direktori skills Anda dan Claude menulis deskripsi pull request dari branch itu sendiri. Skill ini membaca commit dan diff terhadap base branch, lalu mengisi template tetap: ringkasan, alasan, apa yang berubah, cara pengujian, risiko dan rollback, serta catatan untuk reviewer. Ia hanya mencantumkan tes yang benar-benar dijalankan, dan tidak push atau membuka pull request kecuali Anda minta.

2 file

File-filenya

Persis isi unduhannya. Baca dulu, lalu salin atau unduh.

pr-description/SKILL.md3.4 KB
pr-description/SKILL.md
---
name: pr-description
description: Writes a pull request description from the branch diff, covering summary, why, what changed, how it was tested, risks and rollback, and notes for the reviewer. Use when the user asks to write a PR description, describe this branch, summarize changes for review, or prepare a pull request or merge request.
allowed-tools: Bash(git status *) Bash(git diff *) Bash(git log *)
---

# Pull request description

Write the description for a pull request from this branch into its base
branch. Every statement must trace to the diff, the commit log or something
the user said in this conversation.

## Steps

1. Find the base branch. Use the one the user named. Otherwise check
   `git branch --list main master develop` and ask if more than one could
   be the target.
2. Run `git status --short`. If there are uncommitted changes, tell the
   user they are not part of the pull request.
3. Run `git log --oneline <base>..HEAD` to list the commits on the branch.
4. Run `git diff --stat <base>...HEAD`, then `git diff <base>...HEAD`, and
   read the diff. For a large diff, read it file by file, most changed
   first.
5. If the branch has no commits ahead of the base, say so and stop.
6. Read [template.md](template.md) and fill every section, following the
   rules below.
7. Show the finished description in one Markdown code block, with a
   suggested title above it.

## Rules for each section

- **Title**: imperative mood, 72 characters or fewer, names the outcome.
- **Summary**: two or three sentences a reviewer can read in ten seconds.
- **Why**: the problem or the request behind the change. Use only reasons
  found in the commits, the code comments, a linked issue or the user's
  words. If the reason is not known, write `[reason needed]` and ask.
- **What changed**: grouped by area or behavior, not a list of files. Call
  out schema changes, new dependencies, config or environment changes and
  anything removed.
- **How it was tested**: list only checks that were actually run in this
  conversation, each with its command and its result. If you ran nothing
  and the user reported nothing, write "Not tested yet" and list what
  should be run. Never write that tests pass without the output.
- **Risks and rollback**: what could break, who is affected, and how to
  undo it (revert the merge, run a down migration, turn off a flag). Say
  so plainly when a rollback is not clean, such as after a data migration.
- **For the reviewer**: the two or three places that deserve the closest
  read, decisions you are unsure about and anything left out on purpose.

## Rules

- Describe only what `git diff <base>...HEAD` contains. Do not describe
  planned work as done.
- Do not invent issue numbers, ticket links, benchmark figures or
  screenshots. Leave a bracketed placeholder for anything the user must
  supply.
- Do not run `git push`, open the pull request or change any file unless
  the user asks for that action in plain words. Writing the description is
  the whole job.
- If the diff contains something that looks like a secret, a key or a
  password, stop and tell the user first.
- Plain words. No praise for the change and no filler such as "this PR
  aims to".

## What to report

1. A suggested title.
2. The description, in a Markdown code block, ready to paste.
3. A short list of open items: placeholders to fill, checks not run, and
   uncommitted changes that were left out.
pr-description/template.md2.2 KB
pr-description/template.md
# Pull request body template

Fill every section. Keep the headings. Replace each bracketed part, and
delete a bullet that does not apply instead of leaving it empty.

```markdown
## Summary

[Two or three sentences: what this pull request does and the result for
the user or the system.]

## Why

[The problem or request behind the change. Link the issue if the user gave
one. Write "[reason needed]" if it is not known.]

## What changed

- [Area or behavior]: [what is different now]
- [Area or behavior]: [what is different now]
- Schema, config or dependencies: [changes, or "none"]

## How it was tested

- `[command that was run]`: [result, with the numbers from the output]
- Manual check: [steps taken and what was seen]
- Not run: [checks that still need to be run, or "none"]

## Risks and rollback

- Risk: [what could break and who would notice]
- Rollback: [how to undo it, and anything that makes the undo unclean]

## For the reviewer

- Look closely at: [file or function, and why]
- Unsure about: [a decision that needs a second opinion]
- Left out on purpose: [related work that is not in this pull request]
```

## A filled example

```markdown
## Summary

Adds a CSV export to the orders table. The export respects the active
filters and streams rows, so large result sets do not load into memory.

## Why

Support staff copy orders into spreadsheets by hand. Requested in the
linked issue.

## What changed

- Orders API: new `GET /orders/export` endpoint that streams CSV
- Orders page: an Export button that passes the current filters
- Schema, config or dependencies: none

## How it was tested

- `npm test -- orders-export`: 6 passed, 0 failed
- Manual check: exported 3 filtered orders and opened the file in a
  spreadsheet; columns and totals matched the table
- Not run: the full end-to-end suite

## Risks and rollback

- Risk: an export with no filters reads the whole table; the endpoint is
  limited to signed-in staff
- Rollback: revert the merge commit; no data changes to undo

## For the reviewer

- Look closely at: the stream handling in `export-orders.ts`
- Unsure about: whether the row cap should be configurable
- Left out on purpose: Excel format, tracked separately
```
Cara memakainya

Dari unduh sampai jalan

Pakai saat

  • Branch Anda siap di-review dan kolom deskripsinya masih kosong.
  • Reviewer terus bertanya bagaimana perubahan diuji atau bagaimana cara rollback-nya.
  • Anda ingin semua pull request di repository punya bagian yang sama.
  • Deskripsi buatan AI pernah mengklaim tes lolos padahal tidak ada yang menjalankannya, dan Anda ingin itu tidak terulang.
  1. Ekstrak ke folder skills Anda

    Arsipnya berisi satu folder, pr-description. Ekstrak ke .claude/skills/ di proyek Anda sehingga filenya berada di .claude/skills/pr-description/SKILL.md, atau ke ~/.claude/skills/ untuk memakainya di semua proyek di mesin Anda.

  2. Periksa apakah terdaftar

    Di Claude Code, tanyakan What skills are available? atau buka /skills dan cari pr-description. Bila folder skills belum ada saat sesi dimulai, jalankan /reload-skills lebih dulu.

  3. Commit pekerjaan Anda, lalu minta

    Commit semua yang termasuk dalam pull request, karena perubahan yang belum di-commit tidak ikut. Lalu ketik /pr-description, atau minta Claude menulis deskripsi PR, dan sebutkan base branch-nya bila tidak jelas.

  4. Jalankan tes di sesi yang sama

    Bagian pengujian hanya memuat pemeriksaan yang output-nya ada di percakapan. Jalankan perintah tes Anda di sana, atau tempel hasilnya, sebelum meminta. Bila tidak, bagian itu berbunyi Not tested yet, disertai daftar yang perlu dijalankan.

  5. Isi placeholder lalu tempel

    Anda mendapat usulan judul, deskripsi dalam blok Markdown, dan daftar hal yang masih terbuka seperti alasan yang kurang atau tautan issue. Lengkapi, lalu tempel hasilnya ke pull request Anda.

  6. Jadikan template-nya milik Anda

    Sunting template.md agar sesuai dengan bagian yang dipakai tim Anda saat review. Skill mengisi heading apa pun yang ada di sana, jadi Anda mengubah hasilnya tanpa menyentuh instruksinya.

Isinya

Kenapa ditulis seperti ini

Membaca branch, bukan percakapan

Langkah-langkahnya menjalankan git log dan git diff terhadap base branch lalu membaca hasilnya sebelum menulis. Setiap pernyataan harus bisa ditelusuri ke diff, log commit, atau ucapan Anda.

Tes hanya dicantumkan bersama output-nya

Bagian pengujian menerima perintah beserta hasilnya, atau tulisan Not tested yet. Inilah aturan yang mencegah deskripsi menyebut semua tes lolos padahal tidak ada yang dijalankan.

Risiko dan rollback wajib diisi

Template menanyakan apa yang bisa rusak, siapa yang akan menyadarinya, dan cara membatalkan perubahan. Template juga meminta skill berterus terang bila pembatalannya tidak bersih, misalnya setelah migrasi data.

Template-nya berupa file terpisah

SKILL.md memuat prosedurnya dan template.md memuat isi PR, lengkap dengan satu contoh terisi. Claude membaca template saat sampai di langkah itu, dan Anda bisa mengubah bagiannya tanpa menulis ulang aturannya.

Placeholder, bukan tebakan

Alasan, tautan issue, atau screenshot yang tidak ditemukan skill menjadi placeholder dalam kurung siku dan satu butir di daftar terbuka. Anda melihat apa yang kurang, bukan membaca jawaban karangan.

Perhatikan

Yang sering salah

  • Perubahan yang belum di-commit tidak ada di diff branch. Skill memperingatkannya, tetapi tidak akan menjelaskannya.
  • Base branch yang salah menghasilkan deskripsi yang salah. Sebutkan targetnya bila repository Anda punya lebih dari satu branch jangka panjang.
  • Pada diff yang sangat besar, deskripsinya menjadi umum. Pull request yang lebih kecil menghasilkan deskripsi dan review yang lebih baik.
  • Skill adalah panduan, bukan kunci. Untuk benar-benar memblokir push, pakai aturan deny pada permission atau hook.
Pertanyaan

Yang sering ditanyakan

Jawaban singkat sebelum Anda mengunduhnya.

Apakah skill ini membuka pull request untuk saya?

Tidak. Instruksinya meminta Claude tidak push, tidak membuka pull request, dan tidak mengubah file kecuali Anda memintanya secara jelas. Skill mengembalikan judul dan deskripsi untuk Anda tempel, dan baris allowed-tools hanya menyetujui git status, git diff, dan git log.

Bagaimana skill tahu tes mana yang dijalankan?

Skill hanya menghitung pemeriksaan yang perintah dan output-nya muncul di percakapan saat ini, atau hasil yang Anda laporkan di sana. Bila tidak ada, ia menulis Not tested yet dan mendaftar apa yang perlu dijalankan. Ia diminta tidak pernah menulis tes lolos tanpa output-nya.

Apakah bisa dipakai dengan GitLab atau Bitbucket?

Bisa. Skill hanya memakai perintah git pada branch lokal Anda dan mengembalikan teks Markdown, jadi tidak bergantung pada layanan hosting mana pun. Tempel hasilnya ke pull request atau merge request di mana pun repository Anda berada.

Bisakah saya memakai template pull request tim saya sendiri?

Bisa. Ganti blok Markdown di template.md dengan heading milik tim Anda. Skill membaca file itu dan mengisi bagian yang ditemukannya. Bila Anda mengganti nama bagian pengujian atau rollback, perbarui aturan yang sesuai di SKILL.md agar kedua file sejalan.

Pelajari lebih dalam

Pelajari apa yang dikemas file ini

Pelajaran dan artikel gratis di situs ini yang menjelaskan gagasan di baliknya.

Sumber

Sumber primer yang diperiksa pada tanggal riset. Ikuti tautannya untuk versi terbaru.

Lainnya dari toolkit

Ambil ini juga

Skill ClaudeGratis

Template Skill Claude (SKILL.md)

SKILL.md beranotasi yang tinggal diisi, plus file referensi yang menunjukkan cara menjaga file utama tetap pendek.

  • Claude Code
  • Agent Skills format

2 file3.2 KB.zip

Skill ClaudeGratis

Skill Commit Message untuk Claude Code

Membaca staged diff lalu menulis commit message yang menjelaskan apa yang berubah dan kenapa. Tidak pernah meng-commit untuk Anda.

  • Claude Code
  • Git

2 file5.7 KB.zip

TemplateGratis

Template CLAUDE.md untuk Repository Apa Pun

CLAUDE.md awal 70 baris: proyek, stack, perintah, aturan keras, cara memverifikasi pekerjaan, dan yang tidak boleh dilakukan.

  • Claude Code

1 file2.1 KB.md

Semua item toolkit