Skip to main content

คลังคำสั่ง (Prompt Library)

คำสั่งสำหรับคัดลอก-วางสำหรับ Claude Code จัดกลุ่มตามงานและบทบาท

คลังคำสั่งนี้รวบรวม prompt ที่พร้อมใช้งานสำหรับงานพัฒนาซอฟต์แวร์ต่างๆ แบ่งตามขั้นตอนในวงจรพัฒนาซอฟต์แวร์ (SDLC)

การค้นพบ (Discover)

เริ่มต้นทำความเข้าใจ Codebase

give me an overview of this codebase: architecture, key directories, and how the pieces connect

อธิบายโค้ดที่ไม่คุ้นเคย

explain what {path} does and how data flows through it. write it up as {format}

ตัวอย่าง: path = src/scheduler/queue.ts, format = an HTML page with a diagram, then open it in my browser

ค้นหาว่าบางอย่างเกิดขึ้นที่ไหน

where do we {behavior}?

ตัวอย่าง: behavior = validate uploaded file types

ดูว่าอะไรขึ้นอยู่กับอะไร

what would break if I deleted {target}?

ตัวอย่าง: target = the retryWithBackoff helper

ติดตามวิวัฒนาการของโค้ด

look through the commit history of {path} and summarize how it evolved and why

ตัวอย่าง: path = internal/auth/session.go

กำหนดขอบเขตการเปลี่ยนแปลง

which files would I need to touch to {change}?

ตัวอย่าง: change = add a dark mode toggle to settings

ถาม Codebase

I am a {role}. walk me through what happens when a user {action}, from the UI down to the result

ตัวอย่าง: role = PM, action = clicks Export to PDF

การออกแบบ (Design)

วางแผนการเปลี่ยนแปลงหลายไฟล์

plan how to refactor the {target} to {goal}. list the files you would change, but don't edit anything yet

ตัวอย่าง: target = payment module, goal = support multiple currencies

ร่าง Spec โดยการสัมภาษณ์

I want to build {feature}. interview me about implementation, UX, edge cases, and tradeoffs until we have covered everything, then write the spec to SPEC.md

ตัวอย่าง: feature = per-workspace rate limits

แปลงการประชุมเป็นงาน

read {input} and write up the action items, then create a {tracker} ticket for each with acceptance criteria

ตัวอย่าง: input = @meeting-notes.md, tracker = Linear

แสดงรายการ Edge Cases

list the error states, empty states, and edge cases for {feature} that the design needs to cover

ตัวอย่าง: feature = the file upload flow

แปลง Mockup เป็น Prototype

here is a mockup. build a working prototype I can click through, matching the layout and states shown

พัฒนาจาก Screenshot

implement this design, then take a screenshot of the result, compare it to the original, and fix any differences

การสร้าง (Build)

ใช้ Pattern ที่มีอยู่แล้ว

look at how {example} is implemented to understand the pattern, then build {new} the same way

ตัวอย่าง: example = the GitHub webhook handler, new = a Stripe webhook handler

สร้าง Docs สำหรับโค้ด

find {scope} without {format} comments and add them, matching the style already used in the file

ตัวอย่าง: scope = the public functions in src/auth/, format = JSDoc

เพิ่ม Endpoint เล็กๆ

add a {endpoint} endpoint that returns {payload}

ตัวอย่าง: endpoint = /health, payload = the app version and uptime

สร้างเครื่องมือภายใน

create a {tool} using HTML, CSS, and vanilla JavaScript, then open it in my browser

ตัวอย่าง: tool = drag-and-drop Kanban board with three columns

ทำงาน Issue แบบ End-to-End

read issue #{issue}, implement the fix, and run the tests

ตัวอย่าง: issue = 312

ค้นหาและอัปเดต Copy

find every place we say "{copy}" or a close variant, show me each one in context, then update them all to "{new}". leave tests and the changelog alone

ตัวอย่าง: copy = Sign up free, new = Start free trial

ร่างจากตัวอย่างที่ผ่านมา

read the {examples} in {folder} to learn the structure and voice, then draft a new one for {topic}

ตัวอย่าง: examples = privacy impact assessments, folder = legal/pia/, topic = the new analytics integration

การทดสอบ (Test)

เขียนและรัน Tests

write tests for {path}, run them, and fix any failures

ตัวอย่าง: path = app/parsers/feed.py

พัฒนาจาก Tests ก่อน (TDD)

write tests for {feature} first, then implement it until they pass

ตัวอย่าง: feature = the password reset flow

เพิ่ม Coverage

read {report} and add tests for the lowest-covered files until each is above {target}%

ตัวอย่าง: report = coverage/coverage-summary.json, target = 80

การ Refactor

ย้าย Pattern ข้าม Codebase

migrate everything from {from} to {to}: identify every place that needs to change, then make the changes

ตัวอย่าง: from = the old logging API, to = the structured logger

แปลงโค้ดข้ามภาษา

port {source} to {target}, keeping the same {keep}

ตัวอย่าง: source = this Python module, target = Rust, keep = public API and test behavior

Optimize ตามตัวชี้วัด

optimize {target} to bring {metric} from {current} down to under {goal}

ตัวอย่าง: target = the search query, metric = p95 latency, current = 2s, goal = 500ms

แก้ไขปัญหา Visual

the {element} extends {amount} beyond the {container} on {viewport}. fix it.

ตัวอย่าง: element = login button, amount = 20px, container = card border, viewport = mobile

การ Review

ตรวจสอบการเปลี่ยนแปลงก่อน Commit

review my uncommitted changes and flag anything that looks risky before I commit

Review Pull Request

review PR #{pr} and summarize what changed, then list any concerns

ตัวอย่าง: pr = 247

Review การเปลี่ยนแปลง Infrastructure

here is my Terraform plan output. what is this going to do, and is anything here going to cause problems?

ทำ Security Review

use a subagent to review {path} for security issues and report what it finds

ตัวอย่าง: path = src/api/

Review เนื้อหาก่อนส่ง

review {file} for {concerns} and list anything I should fix before it goes to {reviewer}

ตัวอย่าง: file = launch-post.md, concerns = unsupported claims, missing attributions, and brand-guideline issues, reviewer = legal

การควบคุมทิศทาง (Steer)

แก้ไขแนวทางที่ผิด

that is not right: {feedback}. try a different approach

ตัวอย่าง: feedback = the function signature needs to stay backward-compatible

จำกัดขอบเขต

that is too much. keep only the changes to {scope} and undo your other edits

ตัวอย่าง: scope = the validation logic in src/forms/

บันทึกบทเรียนใน CLAUDE.md

you keep {mistake}. add a rule to CLAUDE.md so this stops happening

ตัวอย่าง: mistake = using default exports when this project uses named exports

Git

แก้ Merge Conflicts

resolve the merge conflicts in this branch and explain what you kept from each side

Commit พร้อมข้อความที่สร้างขึ้น

commit these changes with a message that summarizes what I did

เปิด Pull Request

find the {tracker} ticket about {topic} and open a PR that implements it

ตัวอย่าง: tracker = Linear, topic = the login timeout

การ Release

ร่าง Release Notes

compare {from} to {to} and draft release notes grouped by feature, fix, and breaking change

ตัวอย่าง: from = v2.3.0, to = v2.4.0

เขียน CI Workflow

write a GitHub Actions workflow that {steps} on every push to {branch}

ตัวอย่าง: steps = runs the tests and deploys to staging, branch = main

การ Debug

ค้นหาและแก้ไข Test ที่ล้มเหลว

the {test} test is failing, find out why and fix it

ตัวอย่าง: test = UserAuth

สืบสวนข้อผิดพลาดที่รายงาน

users are seeing {symptom} on {where}. investigate and tell me what is going on

ตัวอย่าง: symptom = 500 errors, where = /api/settings

แก้ไข Build Error

here is a build error. fix the root cause and verify the build succeeds

การจัดการ Incident

สืบสวน Production Incident

{symptom}. check the logs, recent deploys, and config changes, then tell me the most likely cause

ตัวอย่าง: symptom = the checkout endpoint started returning 500s an hour ago

วินิจฉัยจาก Console Screenshot

here is a screenshot of {console}. walk me through why {resource} is failing and give me the exact commands to fix it

ตัวอย่าง: console = the GCP Kubernetes dashboard, resource = this pod

Query Logs ด้วยภาษาธรรมดา

show me all {events} for {scope} over {timeframe}. write the query, run it, and tell me what stands out

ตัวอย่าง: events = failed logins, scope = the auth service, timeframe = the past 24 hours

ข้อมูล (Data)

วิเคราะห์ไฟล์ข้อมูล

read {file}, summarize the key patterns, and write the results to {output}

ตัวอย่าง: file = @reports/q1-signups.csv, output = an HTML page with charts, then open it in my browser

สร้างตัวแปรจากข้อมูลประสิทธิภาพ

read {file}, find the underperforming {items}, and generate {n} new variations that stay under {limit} characters

ตัวอย่าง: file = @ads-performance.csv, items = headlines, n = 20, limit = 90

การ Automate

สร้าง Skill จากงานซ้ำๆ

create a /{name} skill for this project that {steps}

ตัวอย่าง: name = ship, steps = runs the linter and tests, then drafts a commit message

เพิ่ม Hook

write a hook that {action} after every {event}

ตัวอย่าง: action = runs prettier, event = edit to a .ts or .tsx file

เชื่อมต่อเครื่องมือด้วย MCP

set up the {server} MCP server so you can read my {data} directly

ตัวอย่าง: server = Sentry, data = error reports

บันทึกสิ่งที่ควรจำ

summarize what we did this session and suggest what to add to CLAUDE.md