developing-agent-forge 2.0.1 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +25 -25
  2. package/README.zh-CN.md +30 -30
  3. package/dist/agents/developer.d.ts +6 -6
  4. package/dist/agents/developer.d.ts.map +1 -1
  5. package/dist/agents/developer.js +52 -30
  6. package/dist/agents/developer.js.map +1 -1
  7. package/dist/agents/index.d.ts +2 -2
  8. package/dist/agents/index.d.ts.map +1 -1
  9. package/dist/agents/index.js +1 -1
  10. package/dist/agents/index.js.map +1 -1
  11. package/dist/agents/manager.d.ts +8 -6
  12. package/dist/agents/manager.d.ts.map +1 -1
  13. package/dist/agents/manager.js +99 -23
  14. package/dist/agents/manager.js.map +1 -1
  15. package/dist/agents/polytail.d.ts +3 -0
  16. package/dist/agents/polytail.d.ts.map +1 -0
  17. package/dist/agents/polytail.js +161 -0
  18. package/dist/agents/polytail.js.map +1 -0
  19. package/dist/agents/reviewer.d.ts +6 -2
  20. package/dist/agents/reviewer.d.ts.map +1 -1
  21. package/dist/agents/reviewer.js +72 -9
  22. package/dist/agents/reviewer.js.map +1 -1
  23. package/dist/agents/trajectory-optimizer.d.ts +3 -3
  24. package/dist/agents/trajectory-optimizer.d.ts.map +1 -1
  25. package/dist/agents/trajectory-optimizer.js +28 -17
  26. package/dist/agents/trajectory-optimizer.js.map +1 -1
  27. package/dist/pipeline/index.d.ts +1 -1
  28. package/dist/pipeline/index.d.ts.map +1 -1
  29. package/dist/pipeline/index.js +1 -1
  30. package/dist/pipeline/index.js.map +1 -1
  31. package/dist/pipeline/pipelineskill.d.ts.map +1 -1
  32. package/dist/pipeline/pipelineskill.js +5 -6
  33. package/dist/pipeline/pipelineskill.js.map +1 -1
  34. package/dist/pipeline/project-devloop.d.ts +3 -3
  35. package/dist/pipeline/project-devloop.d.ts.map +1 -1
  36. package/dist/pipeline/project-devloop.js +19 -21
  37. package/dist/pipeline/project-devloop.js.map +1 -1
  38. package/dist/pipeline/task-devloop.d.ts +8 -2
  39. package/dist/pipeline/task-devloop.d.ts.map +1 -1
  40. package/dist/pipeline/task-devloop.js +44 -23
  41. package/dist/pipeline/task-devloop.js.map +1 -1
  42. package/package.json +1 -1
package/README.md CHANGED
@@ -21,11 +21,11 @@ The package exposes a TypeScript API from [`src/index.ts`](src/index.ts) and a C
21
21
 
22
22
  ## Core Idea: Developing And Coding Style
23
23
 
24
- `src` turns the current goal into a repeatable code-writing trajectory. `coding-manager` reads the current repository, the goal, and remembered context, chooses one concrete developing task, `developer` edits the target repository, and `code-reviewer` either returns `ACCEPT` or sends task feedback back into the same task.
24
+ `src` turns the current goal into a repeatable code-writing trajectory. `coding-manager` reads the current repository, the goal, and remembered context, writes one bounded Task Brief or `FINISHED`, `developer` edits the target repository, and `code-reviewer` returns `ACCEPT`, `REVISE`, or `REDIRECT`.
25
25
 
26
26
  The coding-style skill is [`skills/coding-style/SKILL.md`](skills/coding-style/SKILL.md). Its job is to control the code-writing agent's code structure and style. The upstream user task decides what to implement; this skill decides how to keep the implementation readable, local, low-coupling, and consistent with the current framework.
27
27
 
28
- Every developer run loads the configured coding-style skill through `--coding-style-skill-path`. [`agents/developer.ts`](src/agents/developer.ts) prepends the instruction from [`agents/prompts.ts`](src/agents/prompts.ts): load and follow that skill before reading the repository, current goal, context documents named by the goal, and current task. That makes the writing agent use the same code-structure and style preferences across features, refactors, harness/test work, exports, and framework docs.
28
+ Every developer run loads the configured coding-style skill through `--coding-style-skill-path`. [`agents/developer.ts`](src/agents/developer.ts) prepends the instruction from [`agents/prompts.ts`](src/agents/prompts.ts): load and follow that skill before reading the repository, current goal, context documents named by the goal, and Task Brief. That makes the writing agent use the same code-structure and style preferences across features, refactors, harness/test work, exports, and framework docs.
29
29
 
30
30
  `coding-style` is generic for code-writing tasks. It does not decide task priority or repository template initialization. It only keeps code concise, readable, low-friction, easy to modify, and aligned with the existing repository structure.
31
31
 
@@ -105,7 +105,7 @@ The current CLI option name is `--achive-dir`.
105
105
  | `--coding-style-skill-path` | Configured coding-style skill. |
106
106
  | `--goal-path` | Markdown file containing the current objective and task context. |
107
107
  | `--max-iterations` | Stops the outer loop if `coding-manager` has not returned `FINISHED`. |
108
- | `--max-task-devloop-iterations` | Limits developer/reviewer attempts for each selected task. |
108
+ | `--max-task-devloop-iterations` | Limits developer/reviewer attempts for each selected task. |
109
109
  | `--max-memory-rounds` | Limits memory recall and remember refinement rounds. |
110
110
 
111
111
  ## Main Flow
@@ -114,11 +114,11 @@ The current CLI option name is `--achive-dir`.
114
114
 
115
115
  Each iteration does the following:
116
116
 
117
- 1. `coding-manager` decides what should be recalled, the pipeline recalls the matching memory, then `coding-manager` scans the current repository, the goal from `--goal-path`, and remembered context before choosing one developing task.
117
+ 1. `coding-manager` decides what should be recalled, the pipeline recalls the matching memory, then `coding-manager` scans the current repository, the goal from `--goal-path`, and remembered context before writing one Markdown Task Brief or `FINISHED`. If its select output does not start with `FINISHED` or `# Task Brief`, the manager agent asks the same thread to correct the format.
118
118
  2. `developer` loads the configured coding-style skill, edits the repository, and reports what changed for review.
119
- 3. `code-reviewer` reads the code and developer report, then returns exactly `ACCEPT` or task feedback.
120
- 4. If the reviewer returns feedback, `developer` fixes the same task and `code-reviewer` reviews again.
121
- 5. After the review loop ends, the pipeline archives the task and reports, asks `coding-manager` to output what should be remembered, and stores that content through `memory-agent-forge`.
119
+ 3. `code-reviewer` reads the Task Brief, Developer report, and recalled code-design memory, then returns `ACCEPT`, `REVISE`, or `REDIRECT`. If its output does not start with one of those decisions, the reviewer agent asks the same thread to correct the format.
120
+ 4. `REVISE` sends feedback back to `developer`; `REDIRECT` returns control to `coding-manager`; `ACCEPT` finishes the task.
121
+ 5. After the review loop ends, the pipeline archives the full transcript, writes `task_round_summary.md` with the Task Brief, final decision, and Developer/Reviewer report text, asks the memory update prompts what should be remembered, and stores that content through `memory-agent-forge`.
122
122
  6. The pipeline stops when `coding-manager` returns `FINISHED` or `--max-iterations` is reached.
123
123
 
124
124
  ## Developing-Skill And Trajectory Feedback
@@ -127,7 +127,7 @@ Each iteration does the following:
127
127
 
128
128
  The first `trajectory-optimizer` call runs in `scan` mode before the developer starts. It reads the target repository, the current coding-style skill, and the goal context so the optimizer has the same project context as the code-writing loop.
129
129
 
130
- The second `trajectory-optimizer` call runs in `optimize` mode after the iteration finishes. It reads the metaskill, target repository, goal context, current task, and the Developer reports and Reviewer feedback; evaluates whether the skill produced a good modification trajectory; then edits the coding-style skill directly. The prompt focuses the optimizer on missing, misleading, or redundant guidance that affected task selection, coding, or review.
130
+ The second `trajectory-optimizer` call runs in `optimize` mode after the iteration finishes. It reads the metaskill, target repository, goal context, Task Brief, and task round summary; evaluates whether the skill produced a good modification trajectory; then edits the coding-style skill directly. The prompt focuses the optimizer on missing, misleading, or redundant guidance that affected task selection, coding, or review.
131
131
 
132
132
  The intended loop is:
133
133
 
@@ -142,31 +142,31 @@ This is the coding-style version of skill self-improvement: the metaskill states
142
142
 
143
143
  The pipeline maintains:
144
144
 
145
- | Artifact | Where it lives |
146
- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
147
- | Memory files | Under the configured project progress and code design memory directories; maintained by `memory-agent-forge`. |
148
- | Timestamped archive folders | Under the configured archive directory; contains each selected task, memory recall guidance, recalled memory, Developer reports, Reviewer feedback, and things to remember. |
145
+ | Artifact | Where it lives |
146
+ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
147
+ | Memory files | Under the configured project progress and code design memory directories; maintained by `memory-agent-forge`. |
148
+ | Timestamped archive folders | Under the configured archive directory; contains each Task Brief, memory recall guidance, recalled memory, Developer reports, Reviewer feedback, summaries, and things to remember. |
149
149
 
150
150
  ## Important Files
151
151
 
152
- | Path | Purpose |
153
- | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
154
- | [`pipeline/pipeline.ts`](src/pipeline/pipeline.ts) | CLI argument parsing and the base `developing` pipeline wrapper. |
155
- | [`pipeline/project-devloop.ts`](src/pipeline/project-devloop.ts) | Outer project workflow, archive creation, memory recall/update, and per-agent handoff. |
156
- | [`pipeline/task-devloop.ts`](src/pipeline/task-devloop.ts) | Inner developer/reviewer loop for one selected task. |
157
- | [`pipeline/pipelineskill.ts`](src/pipeline/pipelineskill.ts) | `developing-skill` wrapper that adds trajectory optimization callbacks around the base loop. |
158
- | [`agents/factory.ts`](src/agents/factory.ts) | Registers the developing coding manager, developer, and reviewer agents. |
159
- | [`agents/types.ts`](src/agents/types.ts) | Shared workspace-aware base class and variables. |
160
- | [`agents/manager.ts`](src/agents/manager.ts) | Decides what to recall, selects outer-loop tasks, and outputs what should be remembered. |
161
- | [`agents/developer.ts`](src/agents/developer.ts) | Edits the target repository using the shared coding-style skill. |
162
- | [`agents/reviewer.ts`](src/agents/reviewer.ts) | Performs the read-only code review gate. |
163
- | [`agents/trajectory-optimizer.ts`](src/agents/trajectory-optimizer.ts) | Scans the trajectory and proposes coding-style skill improvements for `developing-skill`. |
152
+ | Path | Purpose |
153
+ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
154
+ | [`pipeline/pipeline.ts`](src/pipeline/pipeline.ts) | CLI argument parsing and the base `developing` pipeline wrapper. |
155
+ | [`pipeline/project-devloop.ts`](src/pipeline/project-devloop.ts) | Outer project workflow, archive creation, memory recall/update, and per-agent handoff. |
156
+ | [`pipeline/task-devloop.ts`](src/pipeline/task-devloop.ts) | Inner developer/reviewer loop for one selected task. |
157
+ | [`pipeline/pipelineskill.ts`](src/pipeline/pipelineskill.ts) | `developing-skill` wrapper that adds trajectory optimization callbacks around the base loop. |
158
+ | [`agents/factory.ts`](src/agents/factory.ts) | Registers the developing coding manager, developer, and reviewer agents. |
159
+ | [`agents/types.ts`](src/agents/types.ts) | Shared workspace-aware base class and variables. |
160
+ | [`agents/manager.ts`](src/agents/manager.ts) | Decides what to recall, selects outer-loop tasks, validates select output format, and outputs what should be remembered. |
161
+ | [`agents/developer.ts`](src/agents/developer.ts) | Edits the target repository using the shared coding-style skill. |
162
+ | [`agents/reviewer.ts`](src/agents/reviewer.ts) | Performs the read-only code review gate, validates review output format, and returns `ACCEPT`, `REVISE`, or `REDIRECT`. |
163
+ | [`agents/trajectory-optimizer.ts`](src/agents/trajectory-optimizer.ts) | Scans the trajectory and proposes coding-style skill improvements for `developing-skill`. |
164
164
 
165
165
  ## Troubleshooting
166
166
 
167
167
  | Problem | Likely cause | Fix |
168
168
  | --------------------------------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
169
169
  | The loop stops with `FINISHED` | `coding-manager` decided no further developing task is needed. | Inspect the memory directory and the latest archive. |
170
- | A task keeps returning task feedback | The inner developer/reviewer loop has not reached `ACCEPT`. | Read the Developer reports and Reviewer feedback in the timestamped archive folder. |
170
+ | A task keeps returning `REVISE` | The inner developer/reviewer loop has not reached `ACCEPT`. | Read the Developer reports and Reviewer feedback in the timestamped archive folder. |
171
171
  | A new goal keeps inheriting old context | One of the memory directories still contains old task state. | Update `--goal-path`; if needed, edit or delete stale memory files before rerunning the wrapper. |
172
172
  | The archive option looks misspelled | The current CLI option name is `--achive-dir`. | Use the current option name until the CLI changes. |
package/README.zh-CN.md CHANGED
@@ -21,11 +21,11 @@ TypeScript API 从 [`src/index.ts`](src/index.ts) 导出,CLI 入口在 [`src/c
21
21
 
22
22
  ## 核心思想:Developing 和 Coding Style
23
23
 
24
- `src` 会把当前 goal 变成一条可重复执行的代码编写 trajectory。`coding-manager` 读取当前 repo、goal 和记下来的上下文,选择一个具体 developing task;`developer` 修改目标 repo;`code-reviewer` 返回严格的 `ACCEPT`,或者把 task feedback 送回同一个 task。
24
+ `src` 会把当前 goal 变成一条可重复执行的代码编写 trajectory。`coding-manager` 读取当前 repo、goal 和记下来的上下文,写出一个有边界的 Task Brief 或 `FINISHED`;`developer` 修改目标 repo;`code-reviewer` 返回 `ACCEPT`、`REVISE` `REDIRECT`。
25
25
 
26
26
  coding-style skill 是 [`skills/coding-style/SKILL.md`](skills/coding-style/SKILL.md)。它的功能是控制写代码 agent 的代码结构和代码风格。上游用户任务决定要实现什么;这个 skill 决定如何让实现保持 readable、local、low-coupling,并和当前 framework 保持一致。
27
27
 
28
- 每次 developer run 都会通过 `--coding-style-skill-path` 加载配置的 coding-style skill。[`agents/developer.ts`](src/agents/developer.ts) 会把 [`agents/prompts.ts`](src/agents/prompts.ts) 里的说明放到 developer prompt 前面:先 load and follow 这个 skill,再读取 repo、current goal、goal 中提到的上下文文档和 current task。这样负责写代码的 agent 在 feature、refactor、harness/test work、result exports 和 framework docs 等各种任务里,都会用同一套代码结构和风格偏好,保证输出的代码结构和风格统一。
28
+ 每次 developer run 都会通过 `--coding-style-skill-path` 加载配置的 coding-style skill。[`agents/developer.ts`](src/agents/developer.ts) 会把 [`agents/prompts.ts`](src/agents/prompts.ts) 里的说明放到 developer prompt 前面:先 load and follow 这个 skill,再读取 repo、current goal、goal 中提到的上下文文档和 Task Brief。这样负责写代码的 agent 在 feature、refactor、harness/test work、result exports 和 framework docs 等各种任务里,都会用同一套代码结构和风格偏好,保证输出的代码结构和风格统一。
29
29
 
30
30
  `coding-style` 对代码编写任务是通用的。它不决定 task priority 或 repository template initialization;它只关心代码结构和风格,让代码 concise、readable、low-friction、easy to modify,并贴合现有 repo 结构。
31
31
 
@@ -105,7 +105,7 @@ npm run developing -- \
105
105
  | `--coding-style-skill-path` | 配置的 coding-style skill。 |
106
106
  | `--goal-path` | 包含当前 high-level objective 和 task context 的 Markdown 文件。 |
107
107
  | `--max-iterations` | 当 `coding-manager` 尚未返回 `FINISHED` 时限制外层循环。 |
108
- | `--max-task-devloop-iterations` | 限制每个 selected task 的 developer/reviewer 尝试次数。 |
108
+ | `--max-task-devloop-iterations` | 限制每个 selected task 的 developer/reviewer 尝试次数。 |
109
109
  | `--max-memory-rounds` | 限制 memory recall 和 remember 的 refinement 轮数。 |
110
110
 
111
111
  ## 主流程
@@ -114,11 +114,11 @@ npm run developing -- \
114
114
 
115
115
  每轮迭代执行以下步骤:
116
116
 
117
- 1. `coding-manager` 先判断需要回忆什么,pipeline 再召回匹配的记忆,然后 `coding-manager` 扫描当前 repo、`--goal-path` 中的 goal 和记下来的上下文,选择一个 developing task。
117
+ 1. `coding-manager` 先判断需要回忆什么,pipeline 再召回匹配的记忆,然后 `coding-manager` 扫描当前 repo、`--goal-path` 中的 goal 和记下来的上下文,写出一个 Markdown Task Brief 或 `FINISHED`。如果 select 输出不是以 `FINISHED` 或 `# Task Brief` 开头,manager agent 会要求同一个 thread 修正格式。
118
118
  2. `developer` 加载配置的 coding-style skill,修改 repo,并报告自己改了哪些内容给 reviewer。
119
- 3. `code-reviewer` 阅读代码和 developer report,返回严格的 `ACCEPT` 或 task feedback。
120
- 4. 如果 reviewer 返回 feedback,`developer` 继续修同一个任务,然后 `code-reviewer` 再审。
121
- 5. review 循环结束后,pipeline 归档 task reports,让 `coding-manager` 输出有什么需要记下,并通过 `memory-agent-forge` 写入记忆。
119
+ 3. `code-reviewer` 阅读 Task Brief、Developer report 和召回的 code-design memory,返回 `ACCEPT`、`REVISE` 或 `REDIRECT`。如果输出不是以这三个决策之一开头,reviewer agent 会要求同一个 thread 修正格式。
120
+ 4. `REVISE` 会把反馈送回 `developer`;`REDIRECT` 会把控制权交回 `coding-manager`;`ACCEPT` 表示当前 task 完成。
121
+ 5. review 循环结束后,pipeline 归档完整 transcript,写出包含 Task Brief、最终决策和 Developer/Reviewer report 正文的 `task_round_summary.md`,让 memory update prompts 输出有什么需要记下,并通过 `memory-agent-forge` 写入记忆。
122
122
  6. 当 `coding-manager` 返回 `FINISHED` 或达到 `--max-iterations` 时停止。
123
123
 
124
124
  ## developing-skill 和 Trajectory Feedback
@@ -127,7 +127,7 @@ npm run developing -- \
127
127
 
128
128
  第一次 `trajectory-optimizer` 调用发生在 developer 开始前,使用 `scan` 模式。它会读取目标 repo、当前 coding-style skill 和 goal context,让 optimizer 拿到和代码编写循环相同的项目上下文。
129
129
 
130
- 第二次 `trajectory-optimizer` 调用发生在迭代结束后,使用 `optimize` 模式。它会读取 metaskill、target repo、goal context、current task、Developer reports Reviewer feedback;根据 [`metaskills/coding-style/METASKILL.md`](metaskills/coding-style/METASKILL.md) 中写的偏好评估这次修改 trajectory 的质量;然后直接修改 coding-style skill。这个 prompt 会重点检查哪些 guidance 缺失、误导或冗余,并看这些问题是否影响 task selection、coding 或 review。
130
+ 第二次 `trajectory-optimizer` 调用发生在迭代结束后,使用 `optimize` 模式。它会读取 metaskill、target repo、goal context、Task Brieftask round summary;根据 [`metaskills/coding-style/METASKILL.md`](metaskills/coding-style/METASKILL.md) 中写的偏好评估这次修改 trajectory 的质量;然后直接修改 coding-style skill。这个 prompt 会重点检查哪些 guidance 缺失、误导或冗余,并看这些问题是否影响 task selection、coding 或 review。
131
131
 
132
132
  推荐的使用循环是:
133
133
 
@@ -142,31 +142,31 @@ npm run developing -- \
142
142
 
143
143
  pipeline 会维护:
144
144
 
145
- | Artifact | 位置 |
146
- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
147
- | Memory files | 配置的 project progress 和 code design memory 目录下,由 `memory-agent-forge` 维护。 |
148
- | 按时间戳归档的文件夹 | 配置的 archive 目录下,保存 selected task、memory recall guidance、recalled memory、Developer reports、Reviewer feedback 和 things to remember。 |
145
+ | Artifact | 位置 |
146
+ | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
147
+ | Memory files | 配置的 project progress 和 code design memory 目录下,由 `memory-agent-forge` 维护。 |
148
+ | 按时间戳归档的文件夹 | 配置的 archive 目录下,保存 Task Brief、memory recall guidance、recalled memory、Developer reports、Reviewer feedback、summaries 和 things to remember。 |
149
149
 
150
150
  ## 重要文件
151
151
 
152
- | 路径 | 作用 |
153
- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
154
- | [`pipeline/pipeline.ts`](src/pipeline/pipeline.ts) | CLI 参数解析和基础 `developing` pipeline 包装。 |
155
- | [`pipeline/project-devloop.ts`](src/pipeline/project-devloop.ts) | 外层 project workflow、archive 创建、memory recall/update 和各 agent 之间的交接。 |
156
- | [`pipeline/task-devloop.ts`](src/pipeline/task-devloop.ts) | 针对一个 selected task 的内层 developer/reviewer 循环。 |
157
- | [`pipeline/pipelineskill.ts`](src/pipeline/pipelineskill.ts) | 给基础开发循环增加 trajectory optimization callbacks 的 `developing-skill` 包装。 |
158
- | [`agents/factory.ts`](src/agents/factory.ts) | 注册 developing coding manager、developer 和 reviewer agents。 |
159
- | [`agents/types.ts`](src/agents/types.ts) | 共享的 workspace-aware base class 和变量定义。 |
160
- | [`agents/manager.ts`](src/agents/manager.ts) | 判断需要回忆什么、选择外层任务,并输出有什么需要记下。 |
161
- | [`agents/developer.ts`](src/agents/developer.ts) | 使用共享 coding-style skill 修改目标 repo。 |
162
- | [`agents/reviewer.ts`](src/agents/reviewer.ts) | 执行只读代码审阅 gate|
163
- | [`agents/trajectory-optimizer.ts`](src/agents/trajectory-optimizer.ts) | 扫描开发轨迹,并为 `developing-skill` 提出 coding-style skill 优化建议。 |
152
+ | 路径 | 作用 |
153
+ | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
154
+ | [`pipeline/pipeline.ts`](src/pipeline/pipeline.ts) | CLI 参数解析和基础 `developing` pipeline 包装。 |
155
+ | [`pipeline/project-devloop.ts`](src/pipeline/project-devloop.ts) | 外层 project workflow、archive 创建、memory recall/update 和各 agent 之间的交接。 |
156
+ | [`pipeline/task-devloop.ts`](src/pipeline/task-devloop.ts) | 针对一个 selected task 的内层 developer/reviewer 循环。 |
157
+ | [`pipeline/pipelineskill.ts`](src/pipeline/pipelineskill.ts) | 给基础开发循环增加 trajectory optimization callbacks 的 `developing-skill` 包装。 |
158
+ | [`agents/factory.ts`](src/agents/factory.ts) | 注册 developing coding manager、developer 和 reviewer agents。 |
159
+ | [`agents/types.ts`](src/agents/types.ts) | 共享的 workspace-aware base class 和变量定义。 |
160
+ | [`agents/manager.ts`](src/agents/manager.ts) | 判断需要回忆什么、选择外层任务、校验 select 输出格式,并输出有什么需要记下。 |
161
+ | [`agents/developer.ts`](src/agents/developer.ts) | 使用共享 coding-style skill 修改目标 repo。 |
162
+ | [`agents/reviewer.ts`](src/agents/reviewer.ts) | 执行只读代码审阅 gate、校验 review 输出格式,并返回 `ACCEPT`、`REVISE` 或 `REDIRECT`。 |
163
+ | [`agents/trajectory-optimizer.ts`](src/agents/trajectory-optimizer.ts) | 扫描开发轨迹,并为 `developing-skill` 提出 coding-style skill 优化建议。 |
164
164
 
165
165
  ## 常见问题
166
166
 
167
- | 问题 | 常见原因 | 解决办法 |
168
- | ------------------------------ | ----------------------------------------------------- | -------------------------------------------------------------------------- |
169
- | Loop 以 `FINISHED` 停止 | `coding-manager` 判断不需要继续选择 developing task。 | 检查 memory 目录和最新 archive。 |
170
- | 某个任务持续返回 task feedback | 内层 developer/reviewer 循环尚未达到 `ACCEPT`。 | 阅读按时间戳归档的 Developer reports 和 Reviewer feedback。 |
171
- | 新 goal 仍然继承旧上下文 | 某个 memory 目录里还保留旧任务状态。 | 更新 `--goal-path`;必要时编辑或删除过时 memory 文件,再重新运行 wrapper。 |
172
- | Archive 参数看起来拼错 | 当前 CLI 参数名就是 `--achive-dir`。 | 在 CLI 改名前继续使用当前参数名。 |
167
+ | 问题 | 常见原因 | 解决办法 |
168
+ | ------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------- |
169
+ | Loop 以 `FINISHED` 停止 | `coding-manager` 判断不需要继续选择 developing task。 | 检查 memory 目录和最新 archive。 |
170
+ | 某个任务持续返回 `REVISE` | 内层 developer/reviewer 循环尚未达到 `ACCEPT`。 | 阅读按时间戳归档的 Developer reports 和 Reviewer feedback。 |
171
+ | 新 goal 仍然继承旧上下文 | 某个 memory 目录里还保留旧任务状态。 | 更新 `--goal-path`;必要时编辑或删除过时 memory 文件,再重新运行 wrapper。 |
172
+ | Archive 参数看起来拼错 | 当前 CLI 参数名就是 `--achive-dir`。 | 在 CLI 改名前继续使用当前参数名。 |
@@ -1,19 +1,19 @@
1
1
  import { DevelopingAgent, type DevelopingAgentVariables } from "./types.js";
2
2
  type RecallDeveloperVariables = DevelopingAgentVariables & {
3
- currentTask: string;
3
+ taskBrief: string;
4
4
  phase: "recall";
5
5
  };
6
6
  type DevelopDeveloperVariables = DevelopingAgentVariables & {
7
- currentTask: string;
8
- memory: string;
7
+ taskBrief: string;
8
+ codeDesignMemory: string;
9
9
  phase: "develop";
10
10
  reviewerReport?: string;
11
11
  };
12
12
  type UpdateDeveloperVariables = DevelopingAgentVariables & {
13
- currentTask: string;
14
- memory: string;
13
+ taskBrief: string;
14
+ codeDesignMemory: string;
15
15
  phase: "update";
16
- taskDevReport: string;
16
+ taskRoundSummary: string;
17
17
  };
18
18
  export type DeveloperVariables = RecallDeveloperVariables | DevelopDeveloperVariables | UpdateDeveloperVariables;
19
19
  export declare class DeveloperAgent extends DevelopingAgent<DeveloperVariables> {
@@ -1 +1 @@
1
- {"version":3,"file":"developer.d.ts","sourceRoot":"","sources":["../../src/agents/developer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,KAAK,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE5E,KAAK,wBAAwB,GAAG,wBAAwB,GAAG;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,QAAQ,CAAC;CACjB,CAAC;AAEF,KAAK,yBAAyB,GAAG,wBAAwB,GAAG;IAC1D,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,SAAS,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,KAAK,wBAAwB,GAAG,wBAAwB,GAAG;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,QAAQ,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAC1B,wBAAwB,GACxB,yBAAyB,GACzB,wBAAwB,CAAC;AAE7B,qBAAa,cAAe,SAAQ,eAAe,CAAC,kBAAkB,CAAC;IACrE,SAAS,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GAAG,MAAM;CAgEvE"}
1
+ {"version":3,"file":"developer.d.ts","sourceRoot":"","sources":["../../src/agents/developer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,KAAK,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE5E,KAAK,wBAAwB,GAAG,wBAAwB,GAAG;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,QAAQ,CAAC;CACjB,CAAC;AAEF,KAAK,yBAAyB,GAAG,wBAAwB,GAAG;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,KAAK,wBAAwB,GAAG,wBAAwB,GAAG;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,QAAQ,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAC1B,wBAAwB,GACxB,yBAAyB,GACzB,wBAAwB,CAAC;AAE7B,qBAAa,cAAe,SAAQ,eAAe,CAAC,kBAAkB,CAAC;IACrE,SAAS,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GAAG,MAAM;CAoCvE"}
@@ -1,3 +1,4 @@
1
+ import { ponytailSkillPrompt } from "./polytail.js";
1
2
  import { codingStyleSkillInstruction, goalInstruction } from "./prompts.js";
2
3
  import { DevelopingAgent } from "./types.js";
3
4
  export class DeveloperAgent extends DevelopingAgent {
@@ -6,61 +7,82 @@ export class DeveloperAgent extends DevelopingAgent {
6
7
  const targetPath = this.workspaceRelativePath(variables.targetPath);
7
8
  const codingStyleSkillInstructionText = codingStyleSkillInstruction(codingStyleSkillPath);
8
9
  const goalInstructionText = goalInstruction(variables.goal);
9
- if (variables.phase === "recall") {
10
- return `
10
+ switch (variables.phase) {
11
+ case "recall":
12
+ return buildRecallPrompt(codingStyleSkillInstructionText, goalInstructionText, targetPath, variables.taskBrief);
13
+ case "develop": {
14
+ const reviewerReport = variables.reviewerReport ?? "(none)";
15
+ return buildDevelopPrompt(codingStyleSkillInstructionText, goalInstructionText, targetPath, variables.taskBrief, variables.codeDesignMemory, reviewerReport);
16
+ }
17
+ case "update":
18
+ return buildUpdatePrompt(codingStyleSkillInstructionText, goalInstructionText, targetPath, variables.taskBrief, variables.codeDesignMemory, variables.taskRoundSummary);
19
+ }
20
+ }
21
+ }
22
+ function buildRecallPrompt(codingStyleSkillInstructionText, goalInstructionText, targetPath, taskBrief) {
23
+ return `
11
24
  ${codingStyleSkillInstructionText}
12
25
 
13
26
  ${goalInstructionText}
14
27
 
15
- Current task:
16
- ${variables.currentTask}
28
+ Task Brief:
29
+ ${taskBrief}
17
30
 
18
- Scan the target repository at ${targetPath}/ and decide what code design memory helps complete the current task.
31
+ Scan the target repository at ${targetPath}/ and decide what code design memory helps complete the Task Brief.
19
32
 
20
33
  Output concise code design memory recall guidance.
21
34
  `;
22
- }
23
- if (variables.phase === "update") {
24
- return `
35
+ }
36
+ function buildDevelopPrompt(codingStyleSkillInstructionText, goalInstructionText, targetPath, taskBrief, codeDesignMemory, reviewerReport) {
37
+ return `
38
+ ${ponytailSkillPrompt}
39
+
25
40
  ${codingStyleSkillInstructionText}
26
41
 
27
42
  ${goalInstructionText}
28
43
 
29
- Current task:
30
- ${variables.currentTask}
44
+ Related code design memory:
45
+ ${codeDesignMemory}
46
+
47
+ Work in the target repository at ${targetPath}/.
48
+
49
+ Task Brief:
50
+ ${taskBrief}
31
51
 
32
- Related code design memory before the current task:
33
- ${variables.memory}
52
+ Reviewer report:
53
+ ${reviewerReport}
34
54
 
35
- Revision process for completing the current task:
36
- ${variables.taskDevReport}
55
+ Improve the repository according to the Task Brief. If a reviewer report is present, update the code according to that report.
37
56
 
38
- Scan the target repository at ${targetPath}/ and consider what code logic relationships and design reasons should be remembered after the current task.
57
+ Use your own judgment to inspect, edit, and verify. If you make no changes, explain why no change is appropriate on disk.
39
58
 
40
- Remember code logic relationships and why the current design matches the repository.
59
+ Output a concise developer report with:
60
+ - what you changed
61
+ - what you inspected
62
+ - what commands you ran
63
+ - why the result addresses the Objective
64
+ - any blockers or uncertainty
65
+ - any code relationships or design lessons that should be remembered
41
66
  `;
42
- }
43
- const reviewerReport = variables.reviewerReport ?? "(none)";
44
- return `
67
+ }
68
+ function buildUpdatePrompt(codingStyleSkillInstructionText, goalInstructionText, targetPath, taskBrief, codeDesignMemory, taskRoundSummary) {
69
+ return `
45
70
  ${codingStyleSkillInstructionText}
46
71
 
47
72
  ${goalInstructionText}
48
73
 
49
- Related code design memory:
50
- ${variables.memory}
51
-
52
- Work in the target repository at ${targetPath}/.
74
+ Task Brief:
75
+ ${taskBrief}
53
76
 
54
- Current task:
55
- ${variables.currentTask}
77
+ Related code design memory before the task:
78
+ ${codeDesignMemory}
56
79
 
57
- Reviewer report:
58
- ${reviewerReport}
80
+ Reality-aware task round summary:
81
+ ${taskRoundSummary}
59
82
 
60
- Modify the target repository code for the current task. If a reviewer report is present, update the code according to that report.
83
+ Scan the target repository at ${targetPath}/ and consider what reusable code logic relationships and design reasons should be remembered after this task.
61
84
 
62
- Output a concise developer report with the main changes.
85
+ Remember only reusable code/design memory: module relationships, architecture constraints, invariants, interface design, review rules, and pitfalls. Do not store long transcripts, one-off command output, runtime noise, or project progress state.
63
86
  `;
64
- }
65
87
  }
66
88
  //# sourceMappingURL=developer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"developer.js","sourceRoot":"","sources":["../../src/agents/developer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,eAAe,EAAE,MAA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BAA2B,EAC3B,UAAkB,EAClB,SAAiB,EACjB,gBAAwB,EACxB,cAAsB;IAEtB,OAAO;EACP,mBAAmB;;EAEnB,+BAA+B;;EAE/B,mBAAmB;;;EAGnB,gBAAgB;;mCAEiB,UAAU;;;EAG3C,SAAS;;;EAGT,cAAc;;;;;;;;;;;;;CAaf,CAAC;AACF,CAAC;AAED,SAAS,iBAAiB,CACxB,+BAAuC,EACvC,mBAA2B,EAC3B,UAAkB,EAClB,SAAiB,EACjB,gBAAwB,EACxB,gBAAwB;IAExB,OAAO;EACP,+BAA+B;;EAE/B,mBAAmB;;;EAGnB,SAAS;;;EAGT,gBAAgB;;;EAGhB,gBAAgB;;gCAEc,UAAU;;;CAGzC,CAAC;AACF,CAAC"}
@@ -1,6 +1,6 @@
1
- export { CodingManagerAgent, type CodingManagerVariables } from "./manager.js";
1
+ export { CodingManagerAgent, type CodingManagerDecision, type CodingManagerVariables, } from "./manager.js";
2
2
  export { DeveloperAgent, type DeveloperVariables } from "./developer.js";
3
- export { CodeReviewerAgent, type CodeReviewerVariables } from "./reviewer.js";
3
+ export { CodeReviewerAgent, type CodeReviewerVariables, type ReviewDecision } from "./reviewer.js";
4
4
  export { TrajectoryOptimizerAgent, type TrajectoryOptimizerVariables, } from "./trajectory-optimizer.js";
5
5
  export { DevelopingAgent, type DevelopingAgentConstants, type DevelopingAgentVariables, } from "./types.js";
6
6
  export { agentFactories } from "./factory.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EACL,wBAAwB,EACxB,KAAK,4BAA4B,GAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,eAAe,EACf,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,GAC9B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,KAAK,qBAAqB,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EACL,wBAAwB,EACxB,KAAK,4BAA4B,GAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,eAAe,EACf,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,GAC9B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
@@ -1,4 +1,4 @@
1
- export { CodingManagerAgent } from "./manager.js";
1
+ export { CodingManagerAgent, } from "./manager.js";
2
2
  export { DeveloperAgent } from "./developer.js";
3
3
  export { CodeReviewerAgent } from "./reviewer.js";
4
4
  export { TrajectoryOptimizerAgent, } from "./trajectory-optimizer.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA+B,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,cAAc,EAA2B,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAA8B,MAAM,eAAe,CAAC;AAC9E,OAAO,EACL,wBAAwB,GAEzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,eAAe,GAGhB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,GAGnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAA2B,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAmD,MAAM,eAAe,CAAC;AACnG,OAAO,EACL,wBAAwB,GAEzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,eAAe,GAGhB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
@@ -1,21 +1,23 @@
1
+ import type { RecordCallback } from "coding-agent-forge";
1
2
  import { DevelopingAgent, type DevelopingAgentVariables } from "./types.js";
2
3
  type RecallCodingManagerVariables = DevelopingAgentVariables & {
3
4
  phase: "recall";
4
5
  };
5
6
  type SelectCodingManagerVariables = DevelopingAgentVariables & {
6
- memory: string;
7
- finishMark: string;
7
+ projectProgressMemory: string;
8
8
  phase: "select";
9
9
  };
10
10
  type UpdateCodingManagerVariables = DevelopingAgentVariables & {
11
- memory: string;
12
- finishMark: string;
11
+ projectProgressMemory: string;
13
12
  phase: "update";
14
- currentTask: string;
15
- taskDevReport: string;
13
+ taskBrief: string;
14
+ taskRoundSummary: string;
16
15
  };
17
16
  export type CodingManagerVariables = RecallCodingManagerVariables | SelectCodingManagerVariables | UpdateCodingManagerVariables;
17
+ export type CodingManagerDecision = "FINISHED" | "TASK_BRIEF";
18
18
  export declare class CodingManagerAgent extends DevelopingAgent<CodingManagerVariables> {
19
+ runStreamed(variables: CodingManagerVariables, onRecord?: RecordCallback): Promise<string>;
20
+ parseDecision(managerOutput: string): CodingManagerDecision;
19
21
  protected buildPrompt(variables: Readonly<CodingManagerVariables>): string;
20
22
  }
21
23
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/agents/manager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AC9B,KAAK,EAAE,QAAQ,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAC9B,4BAA4B,GAC5B,4BAA4B,GAC5B,4BAA4B,CAAC;AAEjC,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,YAAY,CAAC;AAI9D,qBAAa,kBAAmB,SAAQ,eAAe,CAAC,sBAAsB,CAAC;IAC9D,WAAW,CACxB,SAAS,EAAE,sBAAsB,EACjC,QAAQ,CAAC,EAAE,cAAc,GACxB,OAAO,CAAC,MAAM,CAAC;IA0ClB,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,qBAAqB;IAQ3D,SAAS,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,sBAAsB,CAAC,GAAG,MAAM;CA2B3E"}
@@ -1,13 +1,67 @@
1
1
  import { codingStyleSkillInstruction, goalInstruction } from "./prompts.js";
2
2
  import { DevelopingAgent } from "./types.js";
3
+ const MANAGER_DECISION_PATTERN = /^(FINISHED|# Task Brief)/;
4
+ const MAX_FORMAT_CORRECTION_ATTEMPTS = 8;
3
5
  export class CodingManagerAgent extends DevelopingAgent {
6
+ async runStreamed(variables, onRecord) {
7
+ let managerOutput = await super.runStreamed(variables, onRecord);
8
+ if (variables.phase !== "select") {
9
+ return managerOutput;
10
+ }
11
+ try {
12
+ this.parseDecision(managerOutput);
13
+ return managerOutput;
14
+ }
15
+ catch {
16
+ for (let attempt = 1; attempt <= MAX_FORMAT_CORRECTION_ATTEMPTS; attempt++) {
17
+ managerOutput = (await this.thread.runStreamed(`
18
+ Previous manager output did not follow the required format.
19
+ The output must start with exactly one of:
20
+ FINISHED
21
+ # Task Brief
22
+
23
+ Previous output:
24
+ ${managerOutput}
25
+
26
+ Please correct it.
27
+ `, onRecord)).trim();
28
+ try {
29
+ this.parseDecision(managerOutput);
30
+ return managerOutput;
31
+ }
32
+ catch {
33
+ if (attempt === MAX_FORMAT_CORRECTION_ATTEMPTS) {
34
+ throw new Error(`coding-manager did not output a valid select decision after ${String(MAX_FORMAT_CORRECTION_ATTEMPTS)} correction attempts.`);
35
+ }
36
+ }
37
+ }
38
+ }
39
+ throw new Error("Unreachable coding-manager format correction state.");
40
+ }
41
+ parseDecision(managerOutput) {
42
+ const match = MANAGER_DECISION_PATTERN.exec(managerOutput.trimStart());
43
+ if (match === null) {
44
+ throw new Error("Coding manager output must start with FINISHED or # Task Brief.");
45
+ }
46
+ return match[1] === "FINISHED" ? "FINISHED" : "TASK_BRIEF";
47
+ }
4
48
  buildPrompt(variables) {
5
49
  const codingStyleSkillPath = this.workspaceRelativePath(variables.codingStyleSkillPath);
6
50
  const targetPath = this.workspaceRelativePath(variables.targetPath);
7
51
  const codingStyleSkillInstructionText = codingStyleSkillInstruction(codingStyleSkillPath);
8
52
  const goalInstructionText = goalInstruction(variables.goal);
9
- if (variables.phase === "recall") {
10
- return `
53
+ switch (variables.phase) {
54
+ case "recall":
55
+ return buildRecallPrompt(codingStyleSkillInstructionText, goalInstructionText, targetPath);
56
+ case "select":
57
+ return buildSelectPrompt(codingStyleSkillInstructionText, goalInstructionText, targetPath, variables.projectProgressMemory);
58
+ case "update":
59
+ return buildUpdatePrompt(codingStyleSkillInstructionText, goalInstructionText, targetPath, variables.projectProgressMemory, variables.taskBrief, variables.taskRoundSummary);
60
+ }
61
+ }
62
+ }
63
+ function buildRecallPrompt(codingStyleSkillInstructionText, goalInstructionText, targetPath) {
64
+ return `
11
65
  ${codingStyleSkillInstructionText}
12
66
 
13
67
  ${goalInstructionText}
@@ -16,43 +70,65 @@ Scan the target repository at ${targetPath}/ and decide what project progress me
16
70
 
17
71
  Output concise project progress memory recall guidance.
18
72
  `;
19
- }
20
- if (variables.phase === "update") {
21
- return `
73
+ }
74
+ function buildSelectPrompt(codingStyleSkillInstructionText, goalInstructionText, targetPath, projectProgressMemory) {
75
+ return `
22
76
  ${codingStyleSkillInstructionText}
23
77
 
24
78
  ${goalInstructionText}
25
79
 
26
- Developing task:
27
- ${variables.currentTask}
80
+ Related project progress memory:
81
+ ${projectProgressMemory}
28
82
 
29
- Related project progress memory before the developing task:
30
- ${variables.memory}
83
+ Scan the target repository at ${targetPath}/ and read the project progress memory related to the current goal.
84
+ Select the next developing task for the target repository.
31
85
 
32
- Revision process for completing the developing task:
33
- ${variables.taskDevReport}
86
+ Choose exactly one new bounded task for the Developer.
34
87
 
35
- Scan the target repository at ${targetPath}/ and consider what project progress should be remembered after the developing task.
88
+ Output the task as Markdown with this shape:
89
+
90
+ # Task Brief
91
+
92
+ ## Objective
36
93
 
37
- Remember completed work and current project progress.
94
+ What should become better in the repository.
95
+
96
+ ## Context
97
+
98
+ Relevant project state or memory that explains why this task is useful now.
99
+
100
+ ## Boundaries
101
+
102
+ Known constraints, scope limits, risks, or paths to pay attention to. Leave empty if unknown.
103
+
104
+ ## Reviewer Focus
105
+
106
+ What the reviewer should pay attention to.
107
+
108
+ Keep the brief bounded enough for one Developer attempt. Use natural language; do not introduce task-type schemas, check schemas, or mode enums unless they are simply part of the prose.
109
+
110
+ When no further developing task is needed, return exactly:
111
+ FINISHED
38
112
  `;
39
- }
40
- return `
113
+ }
114
+ function buildUpdatePrompt(codingStyleSkillInstructionText, goalInstructionText, targetPath, projectProgressMemory, taskBrief, taskRoundSummary) {
115
+ return `
41
116
  ${codingStyleSkillInstructionText}
42
117
 
43
118
  ${goalInstructionText}
44
119
 
45
- Related project progress memory:
46
- ${variables.memory}
120
+ Task Brief:
121
+ ${taskBrief}
47
122
 
48
- Scan the target repository at ${targetPath}/ and read the project progress memory related to the current goal.
49
- Select the next developing task for the target repository.
123
+ Related project progress memory before the developing task:
124
+ ${projectProgressMemory}
50
125
 
51
- Choose exactly one new bounded task for the Developer.
126
+ Reality-aware task round summary:
127
+ ${taskRoundSummary}
52
128
 
53
- When no further developing task is needed, return exactly:
54
- ${variables.finishMark}
129
+ Scan the target repository at ${targetPath}/ and consider what project progress should be remembered after the developing task.
130
+
131
+ Remember only reusable project state: current goal progress, completed direction, blockers or redirect reasons, and useful next-step context. Do not store long transcripts, one-off runtime noise, or code-design details that belong in code design memory.
55
132
  `;
56
- }
57
133
  }
58
134
  //# sourceMappingURL=manager.js.map