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
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.
Persis isi unduhannya. Baca dulu, lalu salin atau unduh.
---
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.
# 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
```
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Jawaban singkat sebelum Anda mengunduhnya.
Pelajaran dan artikel gratis di situs ini yang menjelaskan gagasan di baliknya.
Sumber primer yang diperiksa pada tanggal riset. Ikuti tautannya untuk versi terbaru.
SKILL.md beranotasi yang tinggal diisi, plus file referensi yang menunjukkan cara menjaga file utama tetap pendek.
2 file3.2 KB.zip
Membaca staged diff lalu menulis commit message yang menjelaskan apa yang berubah dan kenapa. Tidak pernah meng-commit untuk Anda.
2 file5.7 KB.zip
CLAUDE.md awal 70 baris: proyek, stack, perintah, aturan keras, cara memverifikasi pekerjaan, dan yang tidak boleh dilakukan.
1 file2.1 KB.md