5.1
Manage tasks, not chats管任務,不管對話管任务,不管对话
This chapter assumes you have used an AI coding agent, and that you know a hook is code the platform runs before a tool call (Hooks).
這一章假設你用過 AI 程式 agent,並且知道 hook 是平台在工具呼叫之前執行的程式碼(Hooks:每次呼叫都會經過的執行點)。
读这一章,你要用过 AI 编程 agent,还要知道 hook 是平台在工具调用之前运行的代码(见 Hook:每次调用都会经过的执行点)。
The Knowledge經驗分享经验分享
In one sentence
Manage tasks, not chats: one folder per task. What the work could break decides which gates it passes; its kind decides what counts as done.
一句話
管任務,不管對話:一個任務一個資料夾。這份工作可能弄壞什麼,決定它要過哪些門;它的種類,決定怎樣才算做完。
一句话
管任务,不管对话:一个任务一个文件夹。工作可能弄坏什么,决定它要过哪些关卡;工作的类型,决定怎样才算做完。
For leaders
- The decision: approve the job, not the chat, as the unit of work: one folder per task, with a handover file, and care that follows what a mistake could break.
- The risk: a chat gets shortened or ends, and a new one knows nothing. The other trap is process that is too heavy: my first design had a heavy level with a team of role agents, which in a small test cost about 4.5 times the usage and 6 times the time with no gain on tasks with a clear request (four tasks, one run each, so read the direction, not the ratio).
- The cost of doing it right: the first step is only a folder per task with one handover file. More files are added only when the task earns them, and quick questions open nothing. The agent must keep the files true, and a person has to read them when it matters.
- Ask the team: "If the agent's chat disappeared tonight, could someone pick the job up tomorrow from files alone?"
給主管
- 要做的決定:批准以工作、而不是對話,作為工作的單位:一個任務一個資料夾,附一份交接檔,照顧的程度跟著出錯可能弄壞什麼走。
- 風險:對話會被縮短或結束,新的對話什麼也不知道。另一個陷阱是流程太重:我的第一版設計有一個重的等級,帶一組分角色的 agent,在一個小測試裡花了約 4.5 倍的用量和 6 倍的時間,在需求明確的任務上沒有任何好處(四個任務,各跑一次,所以讀方向,不要讀倍數)。
- 做對的成本:第一步只是每個任務一個資料夾,裡面一份交接檔。任務值得時才加更多檔案,隨口問的問題什麼都不開。agent 必須讓檔案保持真實,要緊的時候人得去讀它們。
- 可以問團隊:「如果 agent 的對話今晚消失了,明天有人能只靠檔案接手這份工作嗎?」
写给管理者
- 要拍板的事:批准把任务,而不是对话,当作工作的单位:一个任务一个文件夹,带一份交接文件,谨慎的程度跟着“出错可能弄坏什么”走。
- 风险:对话会被压缩,会结束,新开的对话什么都不知道。另一个陷阱是流程太重:我最初的设计里有一个重的级别,用一组按岗位分工的 agent,在一次小测试里多花了约 4.5 倍的用量和 6 倍的时间,而在需求清楚的任务上没有任何收益(四个任务,每个只跑了一次,所以看方向,别看倍数)。
- 做对的代价:第一步只是每个任务一个文件夹、里面一份交接文件。任务值得的时候才加更多文件,随口一问不开任何东西。agent 必须让这些文件保持真实,要紧的时候人得去读它们。
- 可以问团队:“如果今晚 agent 的对话没了,明天有人只靠文件就能把这件事接着做下去吗?”
The problem
You ask an agent to change a pipeline. It reads, plans, edits, and the chat grows. The next morning you open a new chat to ask a follow-up. The new agent has never seen the first one. Or the first chat was shortened by the tool, and it has forgotten why it chose what it chose (Long chats get worse).
A chat is the wrong thing to manage. It gets compressed, it ends, and one chat can hold three unrelated jobs. What you actually care about is the job: what was asked, what was decided, how far it has got, whether it was checked.
So I stopped treating the chat as the unit of work. The unit is a task: one job, with one task folder. The requirement, the plan, the progress and the results are all files in that folder. Any session, today or next week, picks the task up by reading the folder.
That solves where the work lives. A second question follows: not every job needs the same care. Fixing a typo in a note and writing to a shared repository are different. How do you decide how much process each one gets?
You can start with the first step alone: one folder per task, with one handover file in it. Everything below is what I added on top of that, and you can add it one piece at a time.
問題
你請一個 agent 改一條 pipeline。它讀、規劃、編輯,對話越來越長。第二天早上你開了一個新對話,問一個後續問題。新的 agent 從沒見過第一個對話。或者第一個對話被工具縮短了,它忘了自己為什麼做了那些選擇(長對話會變差)。
對話是錯的管理對象。它會被壓縮,會結束,而且一個對話裡可能放著三件毫不相干的工作。你真正在乎的是工作:被要求做什麼、決定了什麼、做到哪裡了、有沒有被檢查過。
所以我不再把對話當成工作的單位。單位是任務:一份工作,一個任務資料夾。需求、計劃、進度和結果,都是這個資料夾裡的檔案。任何會話,今天或下週,讀這個資料夾就能接手這個任務。
這解決了工作放在哪裡的問題。接著出現第二個問題:不是每份工作都需要同樣的照顧。改筆記裡的一個錯字,和寫進共用的倉庫,是不同的事。你怎麼決定每一份工作要有多少流程?
你可以只從第一步開始:每個任務一個資料夾,裡面一份交接檔。下面的一切,都是我在這個基礎上加的,你可以一次加一塊。
问题
你让 agent 改一条 pipeline。它读、计划、编辑,对话越来越长。第二天早上,你开一个新对话问个后续问题。新的 agent 从没见过第一个对话。或者第一个对话被工具压缩了,它已经忘了当初为什么那样选(见长对话会变差)。
对话是管错了的东西。它会被压缩,会结束,一个对话里还可能装着三件毫不相干的事。你真正在乎的是这件事:被要求做什么、决定了什么、做到了哪一步、检查过没有。
所以我不再把对话当作工作的单位。单位是任务:一件事,对应一个任务文件夹。需求、计划、进度和结果,都是这个文件夹里的文件。任何一个会话,不管是今天的还是下周的,读一读文件夹就能接手这个任务。
这解决了工作放在哪里的问题。接着有第二个问题:不是每件事都需要同样的谨慎。改笔记里的一个错别字,和往共享仓库里写东西,是两回事。怎么决定每件事该走多少流程?
你可以只从第一步开始:每个任务一个文件夹,里面一份交接文件。下面的一切,都是我在这个基础上加的,你可以一块一块地加。
How it works
My first answer was levels, and it was wrong
My first design had three levels. Level 1 was light, level 3 was heavy with a team of role agents (Use subagents sparingly). You picked a level at the start of every job.
After some use, three things were clear:
- Only the middle level got used. The other two sat idle most of the time.
- The heavy level was no better than one agent on tasks with a clear request, and it cost about 4.5 times the usage and 6 times the time. That test was small (four tasks, one run each), so read only the direction, not the ratio (Use subagents sparingly).
- Choosing first was one more step every time. Worse, with two sets of rules side by side the agent got unsure, and gave wrong explanations of which applied.
There is also a deeper problem. How hard a job is cannot be known before you start. A level asks you to guess it up front.
So I removed the levels. Care is now decided by two other things, neither of which asks you to guess difficulty.
Care follows what a mistake costs
The first thing is what the action can break. Code makes a rough judgment of this from the paths and commands, so nobody picks it. It is a heuristic, not a proof; the section on the folder below says where it can be fooled.
| What the work does | Example | How it is guarded |
|---|---|---|
| Reads only | A question, a look-up in notes | Nothing stops it |
| Changes the task folder | Writing an analysis, a design, a plan | Nothing stops it |
| Changes a real repository | Code, a knowledge base (A knowledge base: an honest index of the code) | It is written in the folder first. Writing it back needs a person to approve (Two gates) |
| Touches git history or production | Commit, push, switch branch | Stopped by a hook; a person approves, and some commands are always refused |
This is the same idea as the grading in Ask or refuse: the more a mistake costs, the harder the stop. Such a stop is a gate: a point the task cannot pass until a person approves (Two gates).
The kind sets the standard for done
The second thing is the kind of task. A question and a code change are not finished in the same way, so the kind says what counts as done.
| Kind | Done when |
|---|---|
| Question | The answer has a source |
| Root-cause analysis | There is a chain of evidence: what was seen, the logs, the cause, how it was verified |
| Design or plan | There are options and a reason for the choice |
| Development | The change matches the approved plan, and there is a record of testing it |
| Testing | The cases and their results are on disk |
| Knowledge update | The source is clear, and it goes through the same write-back gate (Two gates) |
Without this, "done" is whatever the agent feels like saying. With it, a reader and a checker know what to look for (Counted checks).
The size sets how many files the folder has
A question does not need a requirement file, a plan and a to-do list. A development task does. So each task also has a size, which only decides which files its folder holds.
- Light: one handover file: how far it is, the next step, what is decided.
- Medium: adds the requirement and its source documents, reference material, and a log.
- Full: adds a to-do list, a working copy of the code, and test results.
Each kind has a default size. A task that grows can be raised, and the missing files are added. It never goes down. So the cheap path stays cheap, and the heavy path is there when the task earns it. This is not the old level coming back: nobody guesses the size at the start, the kind sets it, and it only moves up when the work shows it needs more.
The folder is the workspace
For a task that changes a real repository, the folder is also the place where the work is done. The files to change are copied in, the changes are made there, and only after approval do they go back. The real repository is not touched until then.
- A request arrives in a session. Quick questions that write nothing need no task.
- Work that changes things gets a task folder. Its kind sets what counts as done; its size sets which files it has.
- The work is done inside the folder first. The folder holds the requirement, the plan and the progress.
- Only a gate lets the result leave the folder and reach the real repository.
- Closing the task writes a report a person can read.
- Any session can pick the task up later by reading the folder. The task, not the chat, is the unit.
I want to be honest about how strong this is. The folder is held by rules in the gate, not by the operating system. A command spelled in an indirect way may get past it, as Hooks explains: a hook sees calls, not effects. It keeps a careful agent in its place. It does not contain a determined one. For things that must never be touched, see Least privilege.
Why files are the handover
The state of a task is kept in files, not in the conversation:
- A handover file says how far the task is and what comes next. A fresh session reads only this to pick up.
- A requirement file holds what was agreed (The agent writes the requirement).
- A state file for programs. A list of tasks and what each waits for is read from this, not from the Markdown. Progress that an agent writes by hand in prose misses ticks and gets things wrong; progress a program records does not.
When the written record and the disk disagree, the disk wins. This is the same idea as the progress file in Anthropic's long-running agent work: state lives in files outside the chat (Long work across sessions). What I add is the kind, the size and the gates.
A session holds one task; a task can have many sessions
These are separate on purpose.
- A session holds one task at a time. It can switch to another without closing the first. While it holds a task, the edit tools can write only that task's folder.
- A task outlives its sessions. Closing a task only changes its state; the folder stays, and it can be opened again.
- At the start of each prompt a hook tells the agent how far its task is, or which tasks are still open if it has none.
One cost: a task can be left without any session, if the session moved on to another task or its record was lost. Nothing then notes that the agent stopped. My board of tasks (Ten things at once: parallel tasks) shows these as having no session, with how long nobody has touched them, so a person can see them.
Not every chat needs a task. Quick questions that write nothing do not open one; that would slow them down for nothing.
Try it without any setup
At the end of a long chat, ask the agent to write what was asked, what was decided, how far it got and what comes next into one file. Open a new chat and tell it to read only that file and carry on. If the second chat goes wrong, the file was missing something; that tells you what the handover file must hold.
原理
我的第一個答案是分等級,而且是錯的
我的第一版設計有三個等級。等級 1 輕,等級 3 重,帶一組分角色的 agent(慎用子 agent)。每份工作開始時你要選一個等級。
用了一陣子,有三件事很清楚:
- 只有中間那一級被用到。另外兩級大部分時間閒著。
- 在需求明確的任務上,重的那一級不比一個 agent 好,卻花了約 4.5 倍的用量和 6 倍的時間。那個測試很小(四個任務,各跑一次),所以只讀方向,不要讀倍數(慎用子 agent)。
- 先選等級,每次都多一步。更糟的是,兩套規則並排放著,agent 會拿不準,還會錯誤地解釋哪一套適用。
還有一個更深的問題。一份工作有多難,開始之前是不知道的。等級卻要你事先猜。
所以我拿掉了等級。現在照顧的程度由另外兩件事決定,兩件都不要你猜難度。
照顧的程度跟著出錯的代價走
第一件事是這個動作可能弄壞什麼。程式根據路徑和指令做一個粗略的判斷,所以沒有人去選。這是一種啟發式,不是證明;下面講資料夾的那一節會說它哪裡會被騙。
| 這份工作做什麼 | 例子 | 怎麼守 |
|---|---|---|
| 只讀 | 一個問題、在筆記裡查東西 | 什麼都不攔 |
| 改任務資料夾 | 寫分析、設計、計劃 | 什麼都不攔 |
| 改真正的倉庫 | 程式碼、知識庫(知識庫:程式碼的誠實索引) | 先寫在資料夾裡。寫回去需要人批准(兩道門:人在哪裡批准) |
| 碰到 git 歷史或正式環境 | commit、push、切換分支 | 由 hook 攔住;人批准,有些指令永遠拒絕 |
這和詢問不是限制裡的分級是同一個想法:出錯的代價越大,攔得越硬。這樣的攔截是一道門:任務在人批准之前過不去的一個點(兩道門:人在哪裡批准)。
種類決定怎樣才算做完
第二件事是任務的種類。一個問題和一次程式碼修改,做完的方式不一樣,所以由種類來說什麼算做完。
| 種類 | 什麼時候算做完 |
|---|---|
| 問題 | 答案有來源 |
| 根因分析 | 有一條證據鏈:看到了什麼、日誌、原因、怎麼驗證的 |
| 設計或計劃 | 有幾個選項,和選擇的理由 |
| 開發 | 修改符合批准的計劃,並有測試過的紀錄 |
| 測試 | 案例和結果都在磁碟上 |
| 知識更新 | 來源清楚,並且過同一道寫回的門(兩道門:人在哪裡批准) |
沒有這張表,「做完了」就是 agent 想怎麼說就怎麼說。有了它,讀的人和檢查的人就知道要找什麼(讓「通過」可信)。
大小決定資料夾裡有幾個檔案
一個問題不需要需求檔、計劃和待辦清單。開發任務需要。所以每個任務還有一個大小,它只決定資料夾裡放哪些檔案。
- 輕:一份交接檔:做到哪裡、下一步、決定了什麼。
- 中:加上需求和它的來源文件、參考資料,和一份日誌。
- 完整:再加上待辦清單、程式碼的工作副本,和測試結果。
每種類都有預設的大小。長大的任務可以調高,缺的檔案補上。它不會往下調。所以便宜的路保持便宜,任務值得時重的路就在那裡。這不是舊的等級回來了:沒有人在開始時猜大小,由種類來定,而且只有工作顯示需要更多時才往上走。
資料夾就是工作區
對改真正倉庫的任務,這個資料夾也是做事的地方。要改的檔案複製進來,在這裡改,批准之後才送回去。在那之前,真正的倉庫不會被碰。
- 請求在某個會話裡出現。只問答、不寫東西的,不用開任務。
- 要改東西的工作開一個任務資料夾。種類決定怎樣才算完成,檔位決定它有哪些檔案。
- 工作先在資料夾裡做。資料夾裡有需求、計畫和進度。
- 結果要離開資料夾、進到真正的倉庫,必須過一道門。
- 結案時寫一份人讀得懂的報告。
- 之後任何會話讀資料夾就能接手。工作單位是任務,不是聊天。
我想誠實說明這有多強。資料夾是由門裡的規則守著的,不是由作業系統。用間接寫法寫的指令可能漏過去,就像Hooks:每次呼叫都會經過的執行點解釋的:hook 看到的是呼叫,不是效果。它把謹慎的 agent 留在原位。它關不住一個鐵了心的。對絕對不能碰的東西,見有些東西根本不給。
為什麼用檔案交接
任務的狀態存在檔案裡,不存在對話裡:
- 交接檔說任務做到哪裡、接下來是什麼。新的會話只讀它就能接手。
- 需求檔存放達成的共識(需求由 agent 寫,人確認)。
- 給程式用的狀態檔。任務清單和每個任務在等什麼,是從這裡讀的,不是從 Markdown 讀的。agent 用文字手寫的進度會漏掉打勾、會寫錯;程式記錄的進度不會。
文字紀錄和磁碟不一致時,以磁碟為準。這和 Anthropic 長時間運行的 agent 工作裡的進度檔是同一個想法:狀態放在對話之外的檔案裡(跨會話的長任務)。我加的是種類、大小和門。
一個會話管一個任務;一個任務可以有很多會話
這兩者是故意分開的。
- 一個會話一次管一個任務。它可以切換到另一個,不用關掉第一個。管著一個任務時,編輯工具只能寫那個任務的資料夾。
- 任務比它的會話活得久。關閉一個任務只改它的狀態;資料夾還在,可以再打開。
- 每次 prompt 開始時,hook 會告訴 agent 它的任務做到哪裡了;如果它沒有任務,就告訴它還有哪些任務開著。
有一個代價:任務可能沒有任何會話,如果會話換去做別的任務,或它的紀錄丟了。那時沒有任何東西記下 agent 停了。我的任務看板(同時管十件事:並行的是任務)把這些顯示成沒有會話,並顯示沒人碰它多久了,這樣人看得到。
不是每個對話都需要一個任務。不寫任何東西的隨口提問不開任務;那只會平白拖慢它們。
不用任何設定就能試
在一個長對話的結尾,請 agent 把被要求做什麼、決定了什麼、做到哪裡、接下來是什麼,寫進一個檔案。開一個新對話,叫它只讀那個檔案然後接著做。第二個對話如果出錯,就是那個檔案缺了東西;這告訴你交接檔必須放什麼。
原理
我最初的答案是分级,而且错了
我最初的设计有三个级别。级别 1 轻,级别 3 重,带一组按岗位分工的 agent(见慎用子 agent)。每件事开始时,你要选一个级别。
用了一阵之后,三件事很清楚:
- 只有中间那一级被用到。另外两级大部分时间闲着。
- 重的那一级,在需求清楚的任务上并不比一个 agent 单干好,却要多花约 4.5 倍的用量和 6 倍的时间。那个测试很小(四个任务,每个只跑一次),所以只看方向,别看倍数(见慎用子 agent)。
- 先选级别,每次都多一步。更糟的是,两套规则并排放着,agent 会拿不准,还会错误地解释哪一套在起作用。
还有一个更深的问题。一件事有多难,开始之前是没法知道的。分级要你一开始就去猜。
所以我把级别删了。现在谨慎的程度由另外两样东西决定,这两样都不要求你去猜难度。
谨慎的程度,跟着出错的代价走
第一样是这个动作可能弄坏什么。代码根据路径和命令做一个粗略的判断,所以没人要去选。这是个经验性的判断,不是证明;下面讲文件夹的那一节会说它在哪里可能被骗过去。
| 工作在做什么 | 例子 | 怎么守着 |
|---|---|---|
| 只读 | 一个问题,在笔记里查一下 | 什么都不拦 |
| 改任务文件夹 | 写分析、设计、计划 | 什么都不拦 |
| 改真实的仓库 | 代码、知识库(见知识库:代码的诚实索引) | 先写在文件夹里。写回去要人审批(见两道门:人在哪里审批) |
| 碰 git 历史或生产环境 | 提交、push、切换分支 | 由 hook 拦住;人审批,有些命令永远拒绝 |
这和询问不是限制里的分级是同一个思路:出错的代价越大,拦得越狠。这样的拦截就是一道关卡:任务在人批准之前过不去的一个点(见两道门:人在哪里审批)。
类型决定“做完”的标准
第二样是任务的类型。一个问题和一次代码改动,做完的方式不一样,所以由类型来说怎样才算做完。
| 类型 | 什么时候算做完 |
|---|---|
| 问题 | 答案有来源 |
| 根因分析 | 有一条证据链:看到了什么、日志、原因、怎么验证的 |
| 设计或计划 | 有几个方案,选择有理由 |
| 开发 | 改动和批准的计划一致,并且有测试它的记录 |
| 测试 | 用例和结果都落在磁盘上 |
| 知识更新 | 来源清楚,并且走同一道写回关卡(见两道门:人在哪里审批) |
没有这个,“做完了”就是 agent 想怎么说就怎么说。有了它,读的人和检查的人知道该看什么(见让“通过”可信)。
规模决定文件夹里有几个文件
一个问题用不着需求文件、计划和待办清单。一个开发任务就需要。所以每个任务还有一个规模,它只决定文件夹里放哪些文件。
- 轻量:一份交接文件:做到哪一步、下一步是什么、决定了什么。
- 中等:加上需求和它的来源文档、参考资料,以及一份日志。
- 完整:再加一份待办清单、代码的工作副本和测试结果。
每种类型有默认的规模。任务变大了,可以升上去,缺的文件补上。只升不降。这样,便宜的路径一直便宜,任务值得的时候,重的路径也在那里。这不是旧的级别又回来了:没人在开始时去猜规模,由类型来定,只有当工作表明需要更多时才往上升。
文件夹就是工作区
对于要改真实仓库的任务,文件夹也是干活的地方。要改的文件复制进来,改动在这里做,批准之后才写回去。在那之前,真实的仓库不会被碰。
- 请求在某个会话里出现。只问答、不写东西的,不用开任务。
- 要改东西的工作开一个任务文件夹。类型决定怎样才算做完,规模决定它有哪些文件。
- 工作先在文件夹里做。文件夹里有需求、计划和进度。
- 结果要离开文件夹、进到真正的仓库,必须过一道关卡。
- 关闭任务时写一份人读得懂的报告。
- 之后任何会话读文件夹就能接手。工作的单位是任务,不是对话。
我想老实说一下这有多牢靠。文件夹是靠关卡里的规则守住的,不是靠操作系统。一条换了间接写法的命令,可能绕过去,正如 Hook:每次调用都会经过的执行点所讲:hook 看到的是调用,不是效果。它能让一个小心的 agent 守本分,管不住一个铁了心的 agent。对绝不能碰的东西,见有些东西根本不给。
为什么用文件做交接
任务的状态保存在文件里,不在对话里:
- 交接文件说明任务做到了哪一步、接下来是什么。新的会话只读这个就能接手。
- 需求文件记录达成一致的内容(见需求由 agent 写,人确认)。
- 给程序读的状态文件。任务清单,以及每个任务在等什么,是从这里读的,不是从 Markdown 里读。agent 手写在文字里的进度,会漏勾、会写错;程序记录的进度不会。
书面记录和磁盘上的实际情况对不上时,以磁盘为准。这和 Anthropic 长时间运行的 agent 工作里的进度文件是同一个思路:状态放在对话之外的文件里(见跨会话的长任务)。我加的是类型、规模和关卡。
一个会话只持有一个任务;一个任务可以有多个会话
这两者是有意分开的。
- 一个会话一次持有一个任务。它可以切换到另一个,不用关掉第一个。持有任务期间,编辑工具只能写那个任务的文件夹。
- 任务比它的会话活得长。关闭任务只改变它的状态;文件夹还在,还可以重新打开。
- 每条 prompt 开始时,hook 会告诉 agent 它的任务做到了哪一步;如果它没有任务,就告诉它还有哪些任务没关。
有一个代价:一个任务可能没有任何会话,比如会话转去做另一个任务了,或者它的记录丢了。这时没有任何东西注明 agent 停下了。我的任务看板(见同时管十件事:并行的是任务)把这些显示为没有会话,并标出多久没人碰了,这样人看得到。
不是每个对话都需要任务。随口一问、不写任何东西的,不开任务;开了只会白白拖慢它们。
不用任何配置,就能试
在一个长对话的最后,让 agent 把被要求做什么、决定了什么、做到了哪一步、接下来是什么,写进一个文件。开一个新对话,让它只读这个文件,接着干。如果第二个对话做偏了,就说明文件里缺了什么;这就告诉你交接文件必须放什么。
Costs and traps
- The agent must keep the files up to date. A folder is useful only if the handover file is true. A reminder when the agent stops helps; it does not guarantee it. I read the files, not the agent's word, when it matters.
- A task folder adds steps. Opening one, writing the requirement, and waiting at gates is slower than just doing a small change in a chat. That is why light tasks exist, and why a question opens nothing.
- Kinds are a guess too. A job often starts as a question and turns into a change. The kind can change, and the size can only go up. I have not measured how often people pick the wrong kind.
- The folder is not a sandbox in the security sense. See above.
代價和陷阱
- agent 必須讓檔案保持最新。資料夾只有在交接檔是真的時才有用。agent 停下來時的提醒有幫助;不保證。要緊的時候,我讀檔案,不信 agent 的話。
- 任務資料夾會多出一些步驟。開一個、寫需求、在門前等待,比在對話裡直接做一個小修改慢。所以才有輕的任務,也所以一個問題什麼都不開。
- 種類也是一種猜測。一份工作常常一開始是問題,後來變成修改。種類可以變,大小只能往上。人多常選錯種類,我沒有量過。
- 這個資料夾不是安全意義上的沙箱。見上面。
代价和坑
- agent 必须让这些文件保持最新。只有交接文件是真实的,文件夹才有用。agent 停下来时给它一个提醒有帮助,但不能保证。要紧的时候,我读文件,不信 agent 的话。
- 任务文件夹会多出一些步骤。开一个、写需求、在关卡处等,比在对话里直接做一个小改动慢。这就是为什么有轻量任务,也是为什么一个问题不开任何东西。
- 类型也是一种猜测。一件事常常一开始是个问题,后来变成一次改动。类型可以改,规模只能往上升。人们选错类型的频率有多高,我没有测过。
- 从安全的意义上说,文件夹不是沙箱。见上文。
When to delete it
Two parts of this are scaffolding for today's platform.
- The handover file and the reminder at each prompt. They exist because chats are compressed and sessions end. If the platform keeps memory of its own that survives both and that a person can read, drop my files and keep the idea.
- Kind-specific playbooks. As models need written-out steps less, shorten them. Keep the lists of what counts as done: they say what you want, not how to get it.
What does not retire is the unit itself. Whatever the platform does, a job has a requirement, a plan and a result, and a person wants to find them.
什麼時候可以刪掉
這裡有兩部分是為今天的平台搭的鷹架。
- 交接檔和每次 prompt 的提醒。它們存在,是因為對話會被壓縮、會話會結束。如果平台有自己的記憶,能撐過這兩件事,而且人讀得到,就丟掉我的檔案,留下這個想法。
- 各種類專屬的操作手冊。模型越來越不需要寫出來的步驟時,就把它們縮短。「什麼算做完」的清單要留著:它們說的是你要什麼,不是怎麼得到。
不會退場的是單位本身。不管平台怎麼做,一份工作都有需求、計劃和結果,而人想找得到它們。
什么时候可以删掉
这里有两部分是为今天的平台搭的脚手架。
- 交接文件和每条 prompt 处的提醒。它们存在,是因为对话会被压缩、会话会结束。如果平台自己有能挺过这两者、而且人能读的记忆,就把我的文件去掉,保留这个想法。
- 按类型写的操作手册。模型越来越不需要写明的步骤时,就把它们缩短。保留“怎样才算做完”的清单:它们说的是你要什么,不是怎么得到。
不会退役的是单位本身。不管平台怎么做,一件事都有需求、计划和结果,而人想找得到它们。
Go deeper
- Long chats get worse: why a chat is a poor place to keep state.
- Two gates: what happens at write-back.
- Long work across sessions: when one task is too big.
延伸閱讀
- 長對話會變差:為什麼對話是存放狀態的壞地方。
- 兩道門:人在哪裡批准:寫回的時候會發生什麼。
- 跨會話的長任務:一個任務太大的時候。
延伸阅读
- 长对话会变差:为什么对话是个不好的存状态的地方。
- 两道门:人在哪里审批:写回时发生什么。
- 跨会话的长任务:一个任务太大的时候。
You can stop here: that is the whole idea. The next part shows where it runs, so you can look inside.讀到這裡就夠了,這就是整個想法。下一部分告訴你它在哪裡運行,可以進去看看。读到这里就够了,核心思路就是这些。下一部分告诉你它在哪里跑,可以进去看看。
In my practice (Copilot Harness)實作实战
Copilot Harness is my open-source harness for VS Code Copilot.
Repository: https://github.com/Smars-Bin-Hu/copilot-agentic-harness
Get started: clone it, open it in VS Code, and type /harness-rookie-get-me-ready in Copilot Chat. You need Python 3.9 or later and git.
Copilot Harness 是我開源的 VS Code Copilot harness。
倉庫: https://github.com/Smars-Bin-Hu/copilot-agentic-harness
開始:clone 下來,用 VS Code 打開,在 Copilot Chat 裡輸入 /harness-rookie-get-me-ready。需要 Python 3.9 以上和 git。
Copilot Harness 是我开源的 VS Code Copilot harness。
仓库: https://github.com/Smars-Bin-Hu/copilot-agentic-harness
上手:把仓库 clone 下来,用 VS Code 打开,在 Copilot Chat 里输入 /harness-rookie-get-me-ready。需要 Python 3.9 及以上版本和 git。
Explore it in the harness
Everything here runs in Copilot Harness: the task folder, kinds and sizes, the handover file, and the board of tasks. The harness can teach it to you from the inside, with the real files. After the setup above, type:
/harness-rookie-wondering I have read the chapter "Manage tasks, not chats". Teach me how this harness builds what it describes: the task folder, the kinds and tiers, and why sessions and tasks are separate (topic 9). Open a real task's files with me and draw how they fit together.It teaches one small piece at a time, stops to ask if you are following, and opens the files with you.
在 harness 裡探索
這裡的一切都在 Copilot Harness 裡運行:任務資料夾、種類和大小、交接檔,和任務看板。harness 可以從裡面教你,帶著真實的檔案。照上面的說明準備好之後,輸入:
/harness-rookie-wondering 我讀完了「管任務,不管對話」這一章。請教我這個 harness 怎麼建出章裡描述的東西:任務資料夾、種類和等級,以及為什麼會話和任務是分開的(主題 9)。和我一起打開一個真實任務的檔案,畫出它們怎麼接在一起。它一次教一小塊,停下來確認你跟得上,然後和你一起打開檔案。
在 harness 里探索
这里的一切都在 Copilot Harness 里跑着:任务文件夹、类型和规模、交接文件,以及任务看板。harness 可以从内部教你,配上真实的文件。按上面的说明准备好之后,输入:
/harness-rookie-wondering 我读完了“管任务,不管对话”这一章。请教我这个 harness 是怎么搭出章里讲的东西的:任务文件夹、类型和规模,以及为什么会话和任务是分开的(主题 9)。带我打开一个真实任务的文件,并画出它们是怎么配合的。它一次只教一小块,停下来确认你跟上了,再和你一起打开文件。