@tea-agent/loop-agent 0.4.0 → 0.5.0
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.
- package/AGENTS.md +142 -142
- package/CHANGELOG.md +98 -106
- package/README.md +195 -195
- package/bin/agent-worker.js +22 -22
- package/bin/loop-agent.js +21 -21
- package/dist/application/dag/validate-dag.js +14 -1
- package/dist/commands/init.js +677 -489
- package/dist/commands/loop-benchmark.js +11 -11
- package/dist/commands/pi-reuse-benchmark.js +16 -16
- package/dist/executors/config-core.js +3 -2
- package/dist/executors/cursor-executor.js +1 -1
- package/dist/executors/model-routing.js +43 -0
- package/dist/governance/manifest-types.js +9 -1
- package/dist/task/runtime.js +27 -27
- package/dist/worker/pool/run-store.js +9 -1
- package/dist/workflows/dag/canvas-observer.js +275 -275
- package/dist/workflows/dag/init-hybrid.js +4 -13
- package/dist/workflows/dag/skill-instructions.js +4 -0
- package/dist/workflows/dag/types.js +1 -1
- package/dist/workflows/dag/validate.js +3 -2
- package/docs/README.md +72 -72
- package/docs/agent-dag-recovery-playbook.md +184 -184
- package/docs/agent-dag-runner.md +42 -42
- package/docs/architecture/runtime-boundaries.md +147 -147
- package/docs/cursor-executor-usage.md +25 -25
- package/docs/decisions/README.md +3 -3
- package/docs/design/README.md +36 -36
- package/docs/development-principles.md +73 -73
- package/docs/dynamic-workflow-dag-engine-roadmap.md +1749 -1749
- package/docs/exec-plans/README.md +6 -6
- package/docs/exec-plans/active/README.md +7 -7
- package/docs/exec-plans/completed/README.md +19 -19
- package/docs/feature-workflow.md +186 -186
- package/docs/harness-methodology-debugging.md +153 -153
- package/docs/harness-methodology-tdd.md +130 -130
- package/docs/harness-methodology-verification.md +27 -27
- package/docs/init-surface.manifest.json +199 -175
- package/docs/loop-agent-harness.md +42 -42
- package/docs/production-readiness.md +96 -96
- package/docs/progress/README.md +3 -3
- package/docs/reports/README.md +5 -5
- package/docs/skills/README.md +6 -6
- package/docs/skills/vetted-skill-registry.md +26 -26
- package/docs/templates/adr.md +60 -60
- package/docs/templates/agent-dag-authority-surface-audit.prompt.md +94 -94
- package/docs/templates/agent-dag-decision-envelope.schema.json +213 -213
- package/docs/templates/agent-dag-decision-gate-dogfood-report.md +117 -117
- package/docs/templates/agent-dag-decision-gate.prompt.md +246 -246
- package/docs/templates/agent-dag-process-supervisor.prompt.md +98 -98
- package/docs/templates/agent-dag-report.schema.json +454 -454
- package/docs/templates/agent-dag-review-verdict.prompt.md +68 -68
- package/docs/templates/agent-dag.base.json +195 -195
- package/docs/templates/agent-dag.final-verification.json +190 -190
- package/docs/templates/agent-dag.schema.json +316 -316
- package/docs/templates/agent-dag.supervised-implementation.json +500 -500
- package/docs/templates/exec-plan.md +64 -64
- package/docs/templates/feature-spec.md +53 -53
- package/docs/templates/hybrid-dag.json +193 -193
- package/docs/templates/init-evolution-review.md +33 -33
- package/docs/templates/production-readiness-checklist.md +57 -57
- package/docs/templates/progress-log.md +17 -17
- package/docs/templates/project-start-checklist.md +9 -9
- package/docs/templates/qa-report.md +48 -48
- package/docs/templates/sprint-contract.md +29 -29
- package/docs/verification-matrix.md +41 -41
- package/examples/decision-gate-agent-dag.json +123 -123
- package/examples/example-dag.json +51 -51
- package/examples/hybrid-loop-agent-dag.json +194 -194
- package/harness.json +69 -94
- package/package.json +66 -66
- package/skills/ai-engineering-context/SKILL.md +48 -48
- package/skills/code-review-core/SKILL.md +20 -20
- package/skills/codebase-scout/SKILL.md +19 -19
- package/skills/init-capability-evolution/SKILL.md +69 -69
- package/skills/loop-agent/SKILL.md +147 -147
- package/skills/loop-agent/references/README.md +67 -67
- package/skills/loop-agent/references/command-reference.md +403 -403
- package/skills/loop-agent/references/harness-policy.md +259 -259
- package/skills/loop-agent/references/hybrid-dag.md +216 -216
- package/skills/loop-agent/references/learned/README.md +21 -21
- package/skills/loop-agent/references/long-running-loop.md +59 -59
- package/skills/loop-agent/references/model-routing.md +36 -36
- package/skills/loop-agent/references/multi-worktree.md +54 -54
- package/skills/loop-agent/references/one-shot-runs.md +85 -85
- package/skills/loop-agent/references/orchestrator-and-interventions.md +169 -169
- package/skills/loop-agent/references/pi-prompt.md +23 -23
- package/skills/loop-agent/references/pi-subagent-assisted-mode.md +81 -81
- package/skills/loop-agent/references/post-implementation-and-patterns.md +44 -44
- package/skills/loop-agent/references/task-workflow.md +84 -84
- package/skills/loop-agent/references/verification-and-failure-handling.md +128 -128
- package/skills/requesting-code-review/SKILL.md +101 -101
- package/skills/requesting-code-review/code-reviewer.md +168 -168
- package/skills/systematic-debugging/CREATION-LOG.md +119 -119
- package/skills/systematic-debugging/SKILL.md +296 -296
- package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -158
- package/skills/systematic-debugging/condition-based-waiting.md +115 -115
- package/skills/systematic-debugging/defense-in-depth.md +122 -122
- package/skills/systematic-debugging/find-polluter.sh +63 -63
- package/skills/systematic-debugging/root-cause-tracing.md +169 -169
- package/skills/systematic-debugging/test-academic.md +14 -14
- package/skills/systematic-debugging/test-pressure-1.md +58 -58
- package/skills/systematic-debugging/test-pressure-2.md +68 -68
- package/skills/systematic-debugging/test-pressure-3.md +69 -69
- package/skills/test-driven-development/SKILL.md +20 -20
- package/skills/verification-before-completion/SKILL.md +154 -154
- package/skills/webapp-testing/SKILL.md +19 -19
|
@@ -1,147 +1,147 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: loop-agent
|
|
3
|
-
description: >-
|
|
4
|
-
Use when implementing features, processing PRDs or requirements, running structured loop-agent workflows, creating harness tasks, using Agent DAG, run-dag, pi-prompt planning/review, or Cursor bounded implementation in loop-agent. Triggers: loop-agent, workflow, structured development, harness task, Agent DAG, 结构化开发, 工作流, 需求实现, PRD 实现.
|
|
5
|
-
references:
|
|
6
|
-
- path: references/harness-policy.md
|
|
7
|
-
required: true
|
|
8
|
-
- path: references/hybrid-dag.md
|
|
9
|
-
required: true
|
|
10
|
-
- path: references/verification-and-failure-handling.md
|
|
11
|
-
required: true
|
|
12
|
-
- path: references/command-reference.md
|
|
13
|
-
required: true
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
# loop-agent Workflow
|
|
17
|
-
|
|
18
|
-
这是 `loop-agent` 的入口文档,只负责 trigger、routing 和硬规则。较长的 command details、workflow 细节与失败处理放在 `references/`,按需加载。
|
|
19
|
-
|
|
20
|
-
## Canonical Harness Policy
|
|
21
|
-
|
|
22
|
-
Shared loop-agent harness workflow 规则见 `references/harness-policy.md`。Repo-local `docs/loop-agent-harness.md` / `specs/loop-agent-harness.md` 应保持为 local runtime path、governance root、verification commands 的 thin adapters。
|
|
23
|
-
|
|
24
|
-
## 默认立场
|
|
25
|
-
|
|
26
|
-
- 主入口是 **Agent DAG**。
|
|
27
|
-
- 主会话负责编排、审 writeSet、复核验证与 handoff。
|
|
28
|
-
- DAG `pi` executor 默认用于 read-only planning / review / diagnosis;当节点声明 `toolProfile: "write"` 时用于 bounded implementation / repair;Pi 模型矩阵保持 LOW=`gpt-5.3-codex-spark`、MED=`glm-5.2`、HIGH=`gpt-5.5`。
|
|
29
|
-
- `pi-prompt` 与 `cursor-prompt` 都是一次性 full-capability helper;用作 sidecar 时必须在 prompt 和 tool/model 参数里显式收窄。
|
|
30
|
-
- Cursor 是显式启用的可选 bounded write backend;默认 no-Cursor DAG 使用 `executor: "pi"` + `toolProfile: "write"`,必须给出 allowed / forbidden paths。
|
|
31
|
-
- Shell verification 是事实源;任何完成声明都必须有本轮命令输出。
|
|
32
|
-
- 长期结论写回 `docs/exec-plans/`、`docs/reports/`、`docs/progress/` 或 `./skill/`。
|
|
33
|
-
|
|
34
|
-
## 唯一推荐执行路径
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
loop-agent new-task <task-id> "Task Title"
|
|
38
|
-
# write <repo-root>/.harness/tasks/<task-id>/source/需求.md
|
|
39
|
-
# write <repo-root>/.harness/tasks/<task-id>/source/执行约束.md
|
|
40
|
-
|
|
41
|
-
loop-agent dag run-task <task-id> --profile auto --strict-models --output <temp-dir>/<task-id>-dag.json
|
|
42
|
-
loop-agent dag validate --dag <temp-dir>/<task-id>-dag.json --strict-models --strict-governance
|
|
43
|
-
loop-agent run-dag --dag <temp-dir>/<task-id>-dag.json --cwd <repo-root>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
`loop-agent` 默认指 npm 上已发布的全局 CLI。自举迭代 loop-agent 本仓库时,首次安装或有意升级可用 `npm install -g @tea-agent/loop-agent@latest`,但一次自举任务启动后不要中途升级控制器,并记录 `npm list -g @tea-agent/loop-agent --depth=0` 显示的实际版本。不要用当前工作区的 `npm link` 或 `npm run dev` 控制可能改动 CLI、DAG runtime、executor、package metadata 或 build output 的任务。`npm run dev -- <args>` 只用于源码调试和聚焦 CLI 开发。
|
|
47
|
-
|
|
48
|
-
`<temp-dir>` 表示平台原生临时目录。macOS 和 Windows 都应使用实际平台路径;`/` 只用于 repo refs、JSON/Markdown 证据 refs 和 glob 约定。
|
|
49
|
-
|
|
50
|
-
执行前必须审阅:
|
|
51
|
-
|
|
52
|
-
- `profileRouting`
|
|
53
|
-
- `governanceProfile`
|
|
54
|
-
- writer `writeSet`
|
|
55
|
-
- writer `forbiddenPaths`
|
|
56
|
-
- shell verification commands
|
|
57
|
-
- decision gate mode
|
|
58
|
-
|
|
59
|
-
## Pi Sidecar 入口规则
|
|
60
|
-
|
|
61
|
-
短时规划、审查、失败归因可使用 full-capability `pi-prompt`,默认模型是 `glm-5.2`:
|
|
62
|
-
|
|
63
|
-
- 只读 sidecar 必须显式传 `--tools read,grep,find,ls`,并在 prompt 中写明不编辑文件。
|
|
64
|
-
- 高复杂度 one-shot 诊断可显式加 `--model gpt-5.5`。
|
|
65
|
-
- 输出是 advisory,不能替代 deterministic verification;发现必须写回 task source、report、progress 或 exec plan。
|
|
66
|
-
|
|
67
|
-
## Bounded Write Execution
|
|
68
|
-
|
|
69
|
-
需要写代码时,默认使用 DAG `pi` executor 的 write tool profile。Pi writer 节点必须包含 task id、目标、allowed paths、forbidden paths、writeSet、硬约束和预期验证,并在执行后由主会话独立运行 shell verification。
|
|
70
|
-
|
|
71
|
-
Cursor 只作为显式启用的可选 bounded write backend。调用示例与细节见 `references/pi-prompt.md`、`references/harness-policy.md` 和 `references/verification-and-failure-handling.md`。
|
|
72
|
-
|
|
73
|
-
Pi writer prompt 与 Cursor prompt 都必须包含:
|
|
74
|
-
|
|
75
|
-
- task id
|
|
76
|
-
- exact objective
|
|
77
|
-
- allowed paths
|
|
78
|
-
- forbidden paths
|
|
79
|
-
- hard constraints
|
|
80
|
-
- expected verification
|
|
81
|
-
- instruction to preserve unrelated files
|
|
82
|
-
|
|
83
|
-
bounded writer 完成后,主会话必须独立复核;命令清单见 `references/verification-and-failure-handling.md` 的 "Cursor bounded write 后的独立复核"。
|
|
84
|
-
|
|
85
|
-
## 进阶主题路由
|
|
86
|
-
|
|
87
|
-
以下主题只在 references 中维护细节,不在本文展开:
|
|
88
|
-
|
|
89
|
-
| 主题 | Reference |
|
|
90
|
-
|---|---|
|
|
91
|
-
| Long-Running Loop(`loop` init/status/run/record-round/add-signal/closeout、auto mode、signals) | `references/long-running-loop.md` |
|
|
92
|
-
| Three-Pass Convergence、repair artifact、spine audit、knowledge curate、SePO-lite prompt evolution | `references/harness-policy.md` |
|
|
93
|
-
| Operator commands(status/doctor/report/closeout/promote/inspect/spine/knowledge/docs/handoff) | `references/command-reference.md` |
|
|
94
|
-
| 伴生 CLI `agent-worker`(TaskSpec / Task Pool / batch / morning report) | `references/command-reference.md` |
|
|
95
|
-
| Post-Cursor 独立验证、verify knobs、failure handling、closeout | `references/verification-and-failure-handling.md` |
|
|
96
|
-
|
|
97
|
-
## Source Layout
|
|
98
|
-
|
|
99
|
-
新代码优先从这些目录进入:
|
|
100
|
-
|
|
101
|
-
| Area | Entry |
|
|
102
|
-
|---|---|
|
|
103
|
-
| CLI command tree / help / commander program | `src/cli/` |
|
|
104
|
-
| DAG workflow | `src/workflows/dag/` |
|
|
105
|
-
| Long-running loop workflow | `src/workflows/loop/` |
|
|
106
|
-
| Task runtime | `src/task/` |
|
|
107
|
-
| Executors | `src/executors/` |
|
|
108
|
-
| Worker TaskSpec pipeline(伴生 CLI `agent-worker`) | `src/worker/` |
|
|
109
|
-
| Run records / promotion / closeout | `src/records/` |
|
|
110
|
-
| Governance | `src/governance/` |
|
|
111
|
-
| Shared helpers | `src/shared/` |
|
|
112
|
-
| Repo adapters | `src/adapters/` |
|
|
113
|
-
|
|
114
|
-
不要新增平行兼容入口。CLI public export 的唯一入口是 `src/cli/index.ts`;commander command tree 和 help 实现在 `src/cli/program.ts`。
|
|
115
|
-
|
|
116
|
-
## Hard Rules
|
|
117
|
-
|
|
118
|
-
1. One task = one bounded work chunk.
|
|
119
|
-
2. Source materials are mandatory: `source/需求.md` and `source/执行约束.md`.
|
|
120
|
-
3. Agent DAG is the implementation workflow.
|
|
121
|
-
4. DAG `pi` executor stays read-only unless the node sets `toolProfile: "write"`; `pi-prompt` / `cursor-prompt` are full-capability one-shot helpers and must be bounded per call.
|
|
122
|
-
5. Pi writer nodes and optional Cursor write execution must be bounded by explicit allowed / forbidden paths.
|
|
123
|
-
6. Completed DAG and one-shot run facts are read-only.
|
|
124
|
-
7. Do not write root `artifacts/` from read-only DAG or sidecar steps.
|
|
125
|
-
8. Do not keep hidden workflow state in chat only; write durable conclusions to repo artifacts.
|
|
126
|
-
9. Verify before completion.
|
|
127
|
-
|
|
128
|
-
## References
|
|
129
|
-
|
|
130
|
-
Required(frontmatter 已声明):
|
|
131
|
-
|
|
132
|
-
- `references/harness-policy.md`
|
|
133
|
-
- `references/hybrid-dag.md`
|
|
134
|
-
- `references/verification-and-failure-handling.md`
|
|
135
|
-
- `references/command-reference.md`
|
|
136
|
-
|
|
137
|
-
Optional(按需加载):
|
|
138
|
-
|
|
139
|
-
- `references/orchestrator-and-interventions.md`
|
|
140
|
-
- `references/long-running-loop.md`
|
|
141
|
-
- `references/task-workflow.md`
|
|
142
|
-
- `references/pi-prompt.md`
|
|
143
|
-
- `references/one-shot-runs.md`
|
|
144
|
-
- `references/pi-subagent-assisted-mode.md`
|
|
145
|
-
- `references/model-routing.md`
|
|
146
|
-
- `references/multi-worktree.md`
|
|
147
|
-
- `references/post-implementation-and-patterns.md`
|
|
1
|
+
---
|
|
2
|
+
name: loop-agent
|
|
3
|
+
description: >-
|
|
4
|
+
Use when implementing features, processing PRDs or requirements, running structured loop-agent workflows, creating harness tasks, using Agent DAG, run-dag, pi-prompt planning/review, or Cursor bounded implementation in loop-agent. Triggers: loop-agent, workflow, structured development, harness task, Agent DAG, 结构化开发, 工作流, 需求实现, PRD 实现.
|
|
5
|
+
references:
|
|
6
|
+
- path: references/harness-policy.md
|
|
7
|
+
required: true
|
|
8
|
+
- path: references/hybrid-dag.md
|
|
9
|
+
required: true
|
|
10
|
+
- path: references/verification-and-failure-handling.md
|
|
11
|
+
required: true
|
|
12
|
+
- path: references/command-reference.md
|
|
13
|
+
required: true
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# loop-agent Workflow
|
|
17
|
+
|
|
18
|
+
这是 `loop-agent` 的入口文档,只负责 trigger、routing 和硬规则。较长的 command details、workflow 细节与失败处理放在 `references/`,按需加载。
|
|
19
|
+
|
|
20
|
+
## Canonical Harness Policy
|
|
21
|
+
|
|
22
|
+
Shared loop-agent harness workflow 规则见 `references/harness-policy.md`。Repo-local `docs/loop-agent-harness.md` / `specs/loop-agent-harness.md` 应保持为 local runtime path、governance root、verification commands 的 thin adapters。
|
|
23
|
+
|
|
24
|
+
## 默认立场
|
|
25
|
+
|
|
26
|
+
- 主入口是 **Agent DAG**。
|
|
27
|
+
- 主会话负责编排、审 writeSet、复核验证与 handoff。
|
|
28
|
+
- DAG `pi` executor 默认用于 read-only planning / review / diagnosis;当节点声明 `toolProfile: "write"` 时用于 bounded implementation / repair;Pi 模型矩阵保持 LOW=`gpt-5.3-codex-spark`、MED=`glm-5.2`、HIGH=`gpt-5.5`。
|
|
29
|
+
- `pi-prompt` 与 `cursor-prompt` 都是一次性 full-capability helper;用作 sidecar 时必须在 prompt 和 tool/model 参数里显式收窄。
|
|
30
|
+
- Cursor 是显式启用的可选 bounded write backend;默认 no-Cursor DAG 使用 `executor: "pi"` + `toolProfile: "write"`,必须给出 allowed / forbidden paths。
|
|
31
|
+
- Shell verification 是事实源;任何完成声明都必须有本轮命令输出。
|
|
32
|
+
- 长期结论写回 `docs/exec-plans/`、`docs/reports/`、`docs/progress/` 或 `./skill/`。
|
|
33
|
+
|
|
34
|
+
## 唯一推荐执行路径
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
loop-agent new-task <task-id> "Task Title"
|
|
38
|
+
# write <repo-root>/.harness/tasks/<task-id>/source/需求.md
|
|
39
|
+
# write <repo-root>/.harness/tasks/<task-id>/source/执行约束.md
|
|
40
|
+
|
|
41
|
+
loop-agent dag run-task <task-id> --profile auto --strict-models --output <temp-dir>/<task-id>-dag.json
|
|
42
|
+
loop-agent dag validate --dag <temp-dir>/<task-id>-dag.json --strict-models --strict-governance
|
|
43
|
+
loop-agent run-dag --dag <temp-dir>/<task-id>-dag.json --cwd <repo-root>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`loop-agent` 默认指 npm 上已发布的全局 CLI。自举迭代 loop-agent 本仓库时,首次安装或有意升级可用 `npm install -g @tea-agent/loop-agent@latest`,但一次自举任务启动后不要中途升级控制器,并记录 `npm list -g @tea-agent/loop-agent --depth=0` 显示的实际版本。不要用当前工作区的 `npm link` 或 `npm run dev` 控制可能改动 CLI、DAG runtime、executor、package metadata 或 build output 的任务。`npm run dev -- <args>` 只用于源码调试和聚焦 CLI 开发。
|
|
47
|
+
|
|
48
|
+
`<temp-dir>` 表示平台原生临时目录。macOS 和 Windows 都应使用实际平台路径;`/` 只用于 repo refs、JSON/Markdown 证据 refs 和 glob 约定。
|
|
49
|
+
|
|
50
|
+
执行前必须审阅:
|
|
51
|
+
|
|
52
|
+
- `profileRouting`
|
|
53
|
+
- `governanceProfile`
|
|
54
|
+
- writer `writeSet`
|
|
55
|
+
- writer `forbiddenPaths`
|
|
56
|
+
- shell verification commands
|
|
57
|
+
- decision gate mode
|
|
58
|
+
|
|
59
|
+
## Pi Sidecar 入口规则
|
|
60
|
+
|
|
61
|
+
短时规划、审查、失败归因可使用 full-capability `pi-prompt`,默认模型是 `glm-5.2`:
|
|
62
|
+
|
|
63
|
+
- 只读 sidecar 必须显式传 `--tools read,grep,find,ls`,并在 prompt 中写明不编辑文件。
|
|
64
|
+
- 高复杂度 one-shot 诊断可显式加 `--model gpt-5.5`。
|
|
65
|
+
- 输出是 advisory,不能替代 deterministic verification;发现必须写回 task source、report、progress 或 exec plan。
|
|
66
|
+
|
|
67
|
+
## Bounded Write Execution
|
|
68
|
+
|
|
69
|
+
需要写代码时,默认使用 DAG `pi` executor 的 write tool profile。Pi writer 节点必须包含 task id、目标、allowed paths、forbidden paths、writeSet、硬约束和预期验证,并在执行后由主会话独立运行 shell verification。
|
|
70
|
+
|
|
71
|
+
Cursor 只作为显式启用的可选 bounded write backend。调用示例与细节见 `references/pi-prompt.md`、`references/harness-policy.md` 和 `references/verification-and-failure-handling.md`。
|
|
72
|
+
|
|
73
|
+
Pi writer prompt 与 Cursor prompt 都必须包含:
|
|
74
|
+
|
|
75
|
+
- task id
|
|
76
|
+
- exact objective
|
|
77
|
+
- allowed paths
|
|
78
|
+
- forbidden paths
|
|
79
|
+
- hard constraints
|
|
80
|
+
- expected verification
|
|
81
|
+
- instruction to preserve unrelated files
|
|
82
|
+
|
|
83
|
+
bounded writer 完成后,主会话必须独立复核;命令清单见 `references/verification-and-failure-handling.md` 的 "Cursor bounded write 后的独立复核"。
|
|
84
|
+
|
|
85
|
+
## 进阶主题路由
|
|
86
|
+
|
|
87
|
+
以下主题只在 references 中维护细节,不在本文展开:
|
|
88
|
+
|
|
89
|
+
| 主题 | Reference |
|
|
90
|
+
|---|---|
|
|
91
|
+
| Long-Running Loop(`loop` init/status/run/record-round/add-signal/closeout、auto mode、signals) | `references/long-running-loop.md` |
|
|
92
|
+
| Three-Pass Convergence、repair artifact、spine audit、knowledge curate、SePO-lite prompt evolution | `references/harness-policy.md` |
|
|
93
|
+
| Operator commands(status/doctor/report/closeout/promote/inspect/spine/knowledge/docs/handoff) | `references/command-reference.md` |
|
|
94
|
+
| 伴生 CLI `agent-worker`(TaskSpec / Task Pool / batch / morning report) | `references/command-reference.md` |
|
|
95
|
+
| Post-Cursor 独立验证、verify knobs、failure handling、closeout | `references/verification-and-failure-handling.md` |
|
|
96
|
+
|
|
97
|
+
## Source Layout
|
|
98
|
+
|
|
99
|
+
新代码优先从这些目录进入:
|
|
100
|
+
|
|
101
|
+
| Area | Entry |
|
|
102
|
+
|---|---|
|
|
103
|
+
| CLI command tree / help / commander program | `src/cli/` |
|
|
104
|
+
| DAG workflow | `src/workflows/dag/` |
|
|
105
|
+
| Long-running loop workflow | `src/workflows/loop/` |
|
|
106
|
+
| Task runtime | `src/task/` |
|
|
107
|
+
| Executors | `src/executors/` |
|
|
108
|
+
| Worker TaskSpec pipeline(伴生 CLI `agent-worker`) | `src/worker/` |
|
|
109
|
+
| Run records / promotion / closeout | `src/records/` |
|
|
110
|
+
| Governance | `src/governance/` |
|
|
111
|
+
| Shared helpers | `src/shared/` |
|
|
112
|
+
| Repo adapters | `src/adapters/` |
|
|
113
|
+
|
|
114
|
+
不要新增平行兼容入口。CLI public export 的唯一入口是 `src/cli/index.ts`;commander command tree 和 help 实现在 `src/cli/program.ts`。
|
|
115
|
+
|
|
116
|
+
## Hard Rules
|
|
117
|
+
|
|
118
|
+
1. One task = one bounded work chunk.
|
|
119
|
+
2. Source materials are mandatory: `source/需求.md` and `source/执行约束.md`.
|
|
120
|
+
3. Agent DAG is the implementation workflow.
|
|
121
|
+
4. DAG `pi` executor stays read-only unless the node sets `toolProfile: "write"`; `pi-prompt` / `cursor-prompt` are full-capability one-shot helpers and must be bounded per call.
|
|
122
|
+
5. Pi writer nodes and optional Cursor write execution must be bounded by explicit allowed / forbidden paths.
|
|
123
|
+
6. Completed DAG and one-shot run facts are read-only.
|
|
124
|
+
7. Do not write root `artifacts/` from read-only DAG or sidecar steps.
|
|
125
|
+
8. Do not keep hidden workflow state in chat only; write durable conclusions to repo artifacts.
|
|
126
|
+
9. Verify before completion.
|
|
127
|
+
|
|
128
|
+
## References
|
|
129
|
+
|
|
130
|
+
Required(frontmatter 已声明):
|
|
131
|
+
|
|
132
|
+
- `references/harness-policy.md`
|
|
133
|
+
- `references/hybrid-dag.md`
|
|
134
|
+
- `references/verification-and-failure-handling.md`
|
|
135
|
+
- `references/command-reference.md`
|
|
136
|
+
|
|
137
|
+
Optional(按需加载):
|
|
138
|
+
|
|
139
|
+
- `references/orchestrator-and-interventions.md`
|
|
140
|
+
- `references/long-running-loop.md`
|
|
141
|
+
- `references/task-workflow.md`
|
|
142
|
+
- `references/pi-prompt.md`
|
|
143
|
+
- `references/one-shot-runs.md`
|
|
144
|
+
- `references/pi-subagent-assisted-mode.md`
|
|
145
|
+
- `references/model-routing.md`
|
|
146
|
+
- `references/multi-worktree.md`
|
|
147
|
+
- `references/post-implementation-and-patterns.md`
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
# loop-agent Skill References
|
|
2
|
-
|
|
3
|
-
本目录是 `../SKILL.md` 的 progressive-disclosure reference layer。`SKILL.md`
|
|
4
|
-
只负责 trigger、入口选择和硬规则;较长的 command details、operational procedures、
|
|
5
|
-
failure handling 与 workflow 细节放在这里,避免主 skill 变成百科。
|
|
6
|
-
|
|
7
|
-
## 使用方式
|
|
8
|
-
|
|
9
|
-
1. 先读 `../SKILL.md`,确认当前任务是否真的需要 `loop-agent`。
|
|
10
|
-
2. 根据任务类型只打开相关 reference,不要一次加载整个目录。
|
|
11
|
-
3. 执行时遵循 Agent DAG 路径;历史顺序式 `run ...` workflow 已移除。
|
|
12
|
-
4. 如果 reference 与 `harness.json` 或 repo-local `docs/loop-agent-harness.md` / `specs/loop-agent-harness.md` 冲突,以
|
|
13
|
-
`harness.json` 的机器可读 policy 和本目录的 shared policy 为准,并回头修正文档漂移。
|
|
14
|
-
|
|
15
|
-
## 快速路由
|
|
16
|
-
|
|
17
|
-
| 场景 | 优先读取 |
|
|
18
|
-
|---|---|
|
|
19
|
-
| 通用 loop-agent harness workflow policy、跨 repo 共同规则 | `harness-policy.md` |
|
|
20
|
-
| 中大型 autonomous implementation、harness-governed work | `harness-policy.md`、`hybrid-dag.md`、`orchestrator-and-interventions.md`、`verification-and-failure-handling.md` |
|
|
21
|
-
| 需要查精确 CLI 用法、setup、goal、docs helper、stats | `command-reference.md` |
|
|
22
|
-
| 低风险 micro task、旧任务目录兼容、DAG runtime 修复 | `task-workflow.md`、`verification-and-failure-handling.md` |
|
|
23
|
-
| DAG 运行中要判断 main session 是否能手术式补丁、是否需要 sidecar prompt | `orchestrator-and-interventions.md` |
|
|
24
|
-
| 短时 one-shot Pi SDK 调用,不创建 `.harness/tasks/` | `pi-prompt.md` |
|
|
25
|
-
| 解释 `.harness/runs/`、one-shot evidence、active 残留或 promotion | `one-shot-runs.md` |
|
|
26
|
-
| 多 worktree 并行委派、delegate/harvest | `multi-worktree.md` |
|
|
27
|
-
| 模型、provider、profile、fallback routing | `model-routing.md` |
|
|
28
|
-
| Long-running `loop` 命令、action 规则、auto mode、signals、loop closeout | `long-running-loop.md` |
|
|
29
|
-
| Three-pass convergence、repair artifact / spine audit / knowledge curate、SePO-lite prompt evolution | `harness-policy.md` |
|
|
30
|
-
| Cursor bounded write 后的独立复核、verify knobs、failure handling | `verification-and-failure-handling.md` |
|
|
31
|
-
|
|
32
|
-
## Reference 索引
|
|
33
|
-
|
|
34
|
-
| Reference | 使用场景 |
|
|
35
|
-
|---|---|
|
|
36
|
-
| `harness-policy.md` | 通用 loop-agent harness policy:DAG、命令分层、source materials、loop/sidecar 边界、facts/verification/handoff 规则;repo-local harness docs 应引用它而不是复制规则 |
|
|
37
|
-
| `orchestrator-and-interventions.md` | 协调长时间 autonomous DAG work;判断 main session 是否可以 edit;使用 one-shot Pi/Cursor sidecar;恢复 in-flight workflow |
|
|
38
|
-
| `command-reference.md` | 需要 `.` 的精确 CLI 命令、setup、goal lifecycle、docs helper、stats |
|
|
39
|
-
| `task-workflow.md` | 处理 task source material、task config、repo adapter 或 legacy task 目录布局 |
|
|
40
|
-
| `pi-prompt.md` | 运行短时 one-shot Pi SDK task,且不创建 `.harness/tasks/` |
|
|
41
|
-
| `one-shot-runs.md` | 解释 `.harness/runs/{active,completed,failed}` 的创建条件、生命周期、治理清理与 `promote-run` 关系 |
|
|
42
|
-
| `hybrid-dag.md` | 使用 Agent DAG Level 2 `dag validate` / `run-dag`,Level 3 `dag init-hybrid` / `dag run-task`,或查看 write policy、DAG source-of-truth 规则 |
|
|
43
|
-
| `pi-subagent-assisted-mode.md` | 启用 `piSubagentMode`,或在 Pi step 内配置 read-only scout / planner / reviewer subagent |
|
|
44
|
-
| `model-routing.md` | 查看或修改 model/provider 默认、profile、routing 或 fallback 行为 |
|
|
45
|
-
| `post-implementation-and-patterns.md` | 处理 post-verify handoff、PRD item 拆分、fast bounded task、quick status 或 Pi timeout |
|
|
46
|
-
| `multi-worktree.md` | 用 isolated worktree、`delegate` 与 `harvest` 并发执行互不重叠的 independent task |
|
|
47
|
-
| `verification-and-failure-handling.md` | 选择 verify knob、Cursor bounded write 后的独立复核、解释 failure mode、执行 completion audit 与 closeout |
|
|
48
|
-
| `long-running-loop.md` | 使用 experimental long-running `loop` outer state:命令入口、action 规则、auto mode 写入边界、signals 与 loop closeout |
|
|
49
|
-
|
|
50
|
-
## 边界与状态源
|
|
51
|
-
|
|
52
|
-
- `references/harness-policy.md` 是 shared workflow policy source,供多个 repo 的 thin adapter docs 引用。
|
|
53
|
-
- `../SKILL.md` 是 skill trigger 与 routing source,不承载长流程细节。
|
|
54
|
-
- `docs/loop-agent-harness.md` / repo-local `specs/loop-agent-harness.md` 是本仓库或目标仓库的 adapter 文档:只描述 runtime 位置、governance root、验证入口和本地边界。
|
|
55
|
-
- `harness.json` 是 workflowPolicy、script entrypoints、artifacts 目录与 model routing 的机器可读 source of truth。
|
|
56
|
-
- `.harness/tasks/<task-id>/` 是 task 运行态状态;不要把运行态事实写进本目录。
|
|
57
|
-
- `.harness/runs/completed/<run-id>/` 是 one-shot tool run evidence;reference 文档只能解释如何读取和 promotion,不应复制 run facts。
|
|
58
|
-
- `.harness/dag-runs/completed/<run-id>/` 是单次 DAG run 的不可变 facts;reference 文档只能解释如何读取和收口,不应复制 run facts。
|
|
59
|
-
|
|
60
|
-
## 维护规则
|
|
61
|
-
|
|
62
|
-
- 不要把长段落复制回 `SKILL.md`;需要新增细节时,在本目录新增或更新 reference,并在 `SKILL.md` 添加 routing row。
|
|
63
|
-
- 让 `SKILL.md` 保持 120-180 行以内;reference 文件承担细节。
|
|
64
|
-
- 新 reference 应有清晰标题、触发场景、最小步骤、失败处理和维护边界。
|
|
65
|
-
- 如果某个 reference 变成可独立触发、跨项目通用且不再依赖本仓库上下文,再考虑拆成独立 skill。
|
|
66
|
-
- 更新 command、workflow policy 或 verification 规则时,同步核对 `harness.json`、`references/harness-policy.md`、repo-local harness adapter docs 和 verification matrix。
|
|
67
|
-
- `~/.pi/agent/skills/loop-agent` 是指向本目录的 symlink,所以仓库内 edits 会直接更新 Pi skill。
|
|
1
|
+
# loop-agent Skill References
|
|
2
|
+
|
|
3
|
+
本目录是 `../SKILL.md` 的 progressive-disclosure reference layer。`SKILL.md`
|
|
4
|
+
只负责 trigger、入口选择和硬规则;较长的 command details、operational procedures、
|
|
5
|
+
failure handling 与 workflow 细节放在这里,避免主 skill 变成百科。
|
|
6
|
+
|
|
7
|
+
## 使用方式
|
|
8
|
+
|
|
9
|
+
1. 先读 `../SKILL.md`,确认当前任务是否真的需要 `loop-agent`。
|
|
10
|
+
2. 根据任务类型只打开相关 reference,不要一次加载整个目录。
|
|
11
|
+
3. 执行时遵循 Agent DAG 路径;历史顺序式 `run ...` workflow 已移除。
|
|
12
|
+
4. 如果 reference 与 `harness.json` 或 repo-local `docs/loop-agent-harness.md` / `specs/loop-agent-harness.md` 冲突,以
|
|
13
|
+
`harness.json` 的机器可读 policy 和本目录的 shared policy 为准,并回头修正文档漂移。
|
|
14
|
+
|
|
15
|
+
## 快速路由
|
|
16
|
+
|
|
17
|
+
| 场景 | 优先读取 |
|
|
18
|
+
|---|---|
|
|
19
|
+
| 通用 loop-agent harness workflow policy、跨 repo 共同规则 | `harness-policy.md` |
|
|
20
|
+
| 中大型 autonomous implementation、harness-governed work | `harness-policy.md`、`hybrid-dag.md`、`orchestrator-and-interventions.md`、`verification-and-failure-handling.md` |
|
|
21
|
+
| 需要查精确 CLI 用法、setup、goal、docs helper、stats | `command-reference.md` |
|
|
22
|
+
| 低风险 micro task、旧任务目录兼容、DAG runtime 修复 | `task-workflow.md`、`verification-and-failure-handling.md` |
|
|
23
|
+
| DAG 运行中要判断 main session 是否能手术式补丁、是否需要 sidecar prompt | `orchestrator-and-interventions.md` |
|
|
24
|
+
| 短时 one-shot Pi SDK 调用,不创建 `.harness/tasks/` | `pi-prompt.md` |
|
|
25
|
+
| 解释 `.harness/runs/`、one-shot evidence、active 残留或 promotion | `one-shot-runs.md` |
|
|
26
|
+
| 多 worktree 并行委派、delegate/harvest | `multi-worktree.md` |
|
|
27
|
+
| 模型、provider、profile、fallback routing | `model-routing.md` |
|
|
28
|
+
| Long-running `loop` 命令、action 规则、auto mode、signals、loop closeout | `long-running-loop.md` |
|
|
29
|
+
| Three-pass convergence、repair artifact / spine audit / knowledge curate、SePO-lite prompt evolution | `harness-policy.md` |
|
|
30
|
+
| Cursor bounded write 后的独立复核、verify knobs、failure handling | `verification-and-failure-handling.md` |
|
|
31
|
+
|
|
32
|
+
## Reference 索引
|
|
33
|
+
|
|
34
|
+
| Reference | 使用场景 |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `harness-policy.md` | 通用 loop-agent harness policy:DAG、命令分层、source materials、loop/sidecar 边界、facts/verification/handoff 规则;repo-local harness docs 应引用它而不是复制规则 |
|
|
37
|
+
| `orchestrator-and-interventions.md` | 协调长时间 autonomous DAG work;判断 main session 是否可以 edit;使用 one-shot Pi/Cursor sidecar;恢复 in-flight workflow |
|
|
38
|
+
| `command-reference.md` | 需要 `.` 的精确 CLI 命令、setup、goal lifecycle、docs helper、stats |
|
|
39
|
+
| `task-workflow.md` | 处理 task source material、task config、repo adapter 或 legacy task 目录布局 |
|
|
40
|
+
| `pi-prompt.md` | 运行短时 one-shot Pi SDK task,且不创建 `.harness/tasks/` |
|
|
41
|
+
| `one-shot-runs.md` | 解释 `.harness/runs/{active,completed,failed}` 的创建条件、生命周期、治理清理与 `promote-run` 关系 |
|
|
42
|
+
| `hybrid-dag.md` | 使用 Agent DAG Level 2 `dag validate` / `run-dag`,Level 3 `dag init-hybrid` / `dag run-task`,或查看 write policy、DAG source-of-truth 规则 |
|
|
43
|
+
| `pi-subagent-assisted-mode.md` | 启用 `piSubagentMode`,或在 Pi step 内配置 read-only scout / planner / reviewer subagent |
|
|
44
|
+
| `model-routing.md` | 查看或修改 model/provider 默认、profile、routing 或 fallback 行为 |
|
|
45
|
+
| `post-implementation-and-patterns.md` | 处理 post-verify handoff、PRD item 拆分、fast bounded task、quick status 或 Pi timeout |
|
|
46
|
+
| `multi-worktree.md` | 用 isolated worktree、`delegate` 与 `harvest` 并发执行互不重叠的 independent task |
|
|
47
|
+
| `verification-and-failure-handling.md` | 选择 verify knob、Cursor bounded write 后的独立复核、解释 failure mode、执行 completion audit 与 closeout |
|
|
48
|
+
| `long-running-loop.md` | 使用 experimental long-running `loop` outer state:命令入口、action 规则、auto mode 写入边界、signals 与 loop closeout |
|
|
49
|
+
|
|
50
|
+
## 边界与状态源
|
|
51
|
+
|
|
52
|
+
- `references/harness-policy.md` 是 shared workflow policy source,供多个 repo 的 thin adapter docs 引用。
|
|
53
|
+
- `../SKILL.md` 是 skill trigger 与 routing source,不承载长流程细节。
|
|
54
|
+
- `docs/loop-agent-harness.md` / repo-local `specs/loop-agent-harness.md` 是本仓库或目标仓库的 adapter 文档:只描述 runtime 位置、governance root、验证入口和本地边界。
|
|
55
|
+
- `harness.json` 是 workflowPolicy、script entrypoints、artifacts 目录与 model routing 的机器可读 source of truth。
|
|
56
|
+
- `.harness/tasks/<task-id>/` 是 task 运行态状态;不要把运行态事实写进本目录。
|
|
57
|
+
- `.harness/runs/completed/<run-id>/` 是 one-shot tool run evidence;reference 文档只能解释如何读取和 promotion,不应复制 run facts。
|
|
58
|
+
- `.harness/dag-runs/completed/<run-id>/` 是单次 DAG run 的不可变 facts;reference 文档只能解释如何读取和收口,不应复制 run facts。
|
|
59
|
+
|
|
60
|
+
## 维护规则
|
|
61
|
+
|
|
62
|
+
- 不要把长段落复制回 `SKILL.md`;需要新增细节时,在本目录新增或更新 reference,并在 `SKILL.md` 添加 routing row。
|
|
63
|
+
- 让 `SKILL.md` 保持 120-180 行以内;reference 文件承担细节。
|
|
64
|
+
- 新 reference 应有清晰标题、触发场景、最小步骤、失败处理和维护边界。
|
|
65
|
+
- 如果某个 reference 变成可独立触发、跨项目通用且不再依赖本仓库上下文,再考虑拆成独立 skill。
|
|
66
|
+
- 更新 command、workflow policy 或 verification 规则时,同步核对 `harness.json`、`references/harness-policy.md`、repo-local harness adapter docs 和 verification matrix。
|
|
67
|
+
- `~/.pi/agent/skills/loop-agent` 是指向本目录的 symlink,所以仓库内 edits 会直接更新 Pi skill。
|