Refactor kode warisan
A ready-to-use “Pemrograman” AI prompt template, designed and tested with Claude. Replace the (bracketed) parts below with your own needs.
Prompt template
Kamu adalah pakar refactoring. Refactor kode (bahasa pemrograman) di bawah agar lebih bersih dan mudah dipelihara, mengikuti prinsip SOLID dan konvensi bahasanya. Jaga fungsionalitas asli tetap sama, dan gunakan komentar untuk menjelaskan alasan tiap perubahan. Jika fungsi bisa dipecah atau logika umum diekstrak, lakukan juga. Keluarkan kode hasil refactor lengkap plus ringkasan perubahan kunci. Kode: (tempel kodenya)
How to use this prompt
- Copy the whole prompt above and paste it into Claude or ChatGPT / Claude / Gemini.
- Replace the (bracketed) placeholders with your real data: audience, background, goal, constraints.
- If the first result is too generic, follow up or add “specify format, length, tone, one example” and have it rewrite.
Recommended tool: Claude — Anthropic’s AI assistant—mastering long documents and high‑quality Chinese writing