新專案中優先自動化甚麼,以及為甚麼它從來不是最重要的部分
What I Automate First in a New Project, and Why It Is Never the Important Part
新專案應先自動化環境概況、每次變更後的檢查,以及向他人求助前的驗證,而非先自動化核心任務。這三項執行頻率最高,能讓後續工作更省力,也讓 Agent 承接更多任務時更安全。
When I start working in a new repo or a new environment, there is a temptation to automate the interesting thing first. I have learned to resist it, and the order I use instead looks almost backwards.
The order
- The thing I run to find out where I am. Branch, dirty files, running services, last commit, what changed yesterday. This is not work, it is orientation, and I run it five times a day.
- The thing I run after every change. The build, the tests, the linter, whatever is fast enough to run constantly.
- The thing I run before I ask a human. The check that tells me whether my change does what I think.
- Only then the actual task that made me open the project.
The first three are not the interesting part of the project. They are also the three that run most often, which is exactly why automating them pays back within days rather than weeks.
Why this order is better than it looks
Automating the interesting task first feels productive and produces one saved task. Automating the orientation and the checks produces something else: it makes every later task cheaper, including the interesting one, including the ones the agent runs and the ones I run myself.
There is a second effect that I did not expect. Once the checks are automated, the agent can be given tasks I would never have trusted it with, because the check catches the failures I was worried about. The tooling is what made the delegation safe, not the model.
The trap
The trap is that steps one to three feel like overhead. They are not part of the deliverable, nobody thanks you for them, and they are invisible in the demo.
They are also the only part of the setup that keeps working after the demo, which is the entire point.
A concrete test
If a new person joined the project tomorrow, what would you tell them to run first? Not what to read - what to run. That command, or that script, is step one. If the answer is "ask someone", that is the work.
I am aware this is unglamorous advice. It is also the difference between a setup that survives three months and one that gets abandoned in week two, which is where most of the abandoned ones sit.
來源:DEV Community · dev.to