@tea-agent/loop-agent 0.35.0-beta.2 → 0.35.1-beta.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 +108 -108
- package/CHANGELOG.md +55 -4
- package/README.md +165 -165
- package/bin/agent-worker.js +0 -0
- package/bin/loop-agent.js +21 -21
- package/dist/application/task-lifecycle/advance.js +1 -0
- package/dist/commands/cursor-prompt.js +6 -6
- package/dist/commands/init-upgrade.js +351 -19
- package/dist/commands/init.js +14 -67
- package/dist/commands/loop-benchmark.js +11 -11
- package/dist/commands/pi-reuse-benchmark.js +16 -16
- package/dist/commands/run-dag-progress.js +14 -0
- package/dist/commands/task-advance.js +33 -3
- package/dist/shared/operator/capabilities.js +38 -1
- package/dist/sidecars/cursor-prompt/executor.js +1 -1
- package/dist/worker/console/chat/pi-runtime.js +41 -25
- package/dist/worker/console/chat/routes.js +27 -4
- package/dist/worker/console/operation-runner.js +24 -0
- package/dist/worker/console/operation-wait.js +241 -0
- package/dist/worker/console/operator-actions.js +58 -0
- package/dist/worker/console/static/assets/{index-hJqCPs_g.css → index-Dups4sSM.css} +1 -1
- package/dist/worker/console/static/assets/index-SjjjZnV3.js +56 -0
- package/dist/worker/console/static/index.html +2 -2
- package/dist/worker/console/static-src/operator-chat/slash-palette-nav.js +141 -0
- package/dist/worker/console/static-src/operator-chat/useChatSessions.js +13 -2
- package/dist/worker/console/static-src/operator-chat/useComposer.js +30 -7
- package/dist/worker/observe/static/copy.js +67 -67
- package/dist/worker/observe/static/dag-layout.d.ts +36 -36
- package/dist/worker/observe/static/dom.js +220 -220
- package/dist/worker/observe/static/relations.js +133 -133
- package/dist/worker/observe/static/run-processing.js +148 -148
- package/dist/worker/observe/static/views/batch.js +227 -227
- package/dist/worker/observe/static/views/failures.js +143 -143
- package/dist/worker/observe/static/views/feature.js +492 -492
- package/dist/worker/observe/static/views/run.js +453 -453
- package/dist/worker/observe/static/views/shell.js +7 -7
- package/dist/worker/observe/static/views/timeline.js +163 -163
- package/dist/workflows/dag/canvas-observer.js +275 -275
- package/dist/workflows/dag/frontend-prewrite-gate.js +9 -1
- package/dist/workflows/dag/init-hybrid.js +2 -0
- package/docs/architecture/evolution.md +73 -73
- package/docs/architecture/system-overview.md +100 -100
- package/docs/architecture/worker-and-feature.md +122 -122
- package/docs/skills/README.md +7 -7
- 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.prompt.md +246 -246
- package/docs/templates/agent-dag-process-supervisor.prompt.md +98 -98
- package/docs/templates/agent-dag-report.schema.json +473 -473
- package/docs/templates/agent-dag-review-verdict.prompt.md +68 -68
- package/docs/templates/backend-test-result.schema.json +99 -99
- package/docs/templates/evaluation/agents-map-slim-v1.md +87 -87
- package/docs/templates/evaluation/agents-map-verbose-v0.md +153 -153
- package/docs/templates/feature-spec.md +53 -53
- package/docs/templates/frontend-design-contract.md +42 -42
- package/docs/templates/frontend-eval/fixtures/failures/01-type-build-error.md +17 -17
- package/docs/templates/frontend-eval/fixtures/failures/02-unit-component-test-fail.md +16 -16
- package/docs/templates/frontend-eval/fixtures/failures/03-fixture-schema-drift.md +16 -16
- package/docs/templates/frontend-eval/fixtures/failures/04-missing-loading-empty-error-state.md +16 -16
- package/docs/templates/frontend-eval/fixtures/failures/05-forbidden-write-writeset-expansion.md +16 -16
- package/docs/templates/frontend-eval/fixtures/failures/06-unapproved-dependency-add.md +16 -16
- package/docs/templates/frontend-eval/fixtures/failures/07-mock-production-on.md +21 -21
- package/docs/templates/frontend-eval/fixtures/functional/01-simple-component-style.md +29 -29
- package/docs/templates/frontend-eval/fixtures/functional/02-form-validation.md +28 -28
- package/docs/templates/frontend-eval/fixtures/functional/03-list-detail-page.md +28 -28
- package/docs/templates/frontend-eval/fixtures/functional/04-api-mock.md +29 -29
- package/docs/templates/frontend-eval/fixtures/functional/05-permission-auth-gated-ui.md +27 -27
- package/docs/templates/frontend-eval/fixtures/functional/06-ssr-server-client-boundary.md +28 -28
- package/docs/templates/frontend-eval/fixtures/functional/07-shared-public-component-api.md +28 -28
- package/docs/templates/frontend-eval/fixtures/functional/08-pure-local-no-remote.md +27 -27
- package/docs/templates/frontend-eval/metrics.md +138 -138
- package/docs/templates/frontend-eval/smoke-targets.md +53 -53
- package/docs/templates/frontend-task-constraints.md +35 -35
- package/docs/templates/frontend-task-requirement.md +70 -70
- package/docs/templates/init-evolution-review.md +35 -35
- package/docs/templates/init-managed-agents.md +156 -154
- package/docs/templates/interactive-ui-round2-experiment.md +66 -66
- package/docs/templates/knowledge-graph-bootstrap-dag.json +118 -118
- package/docs/templates/knowledge-sync-dag.json +178 -178
- package/docs/templates/knowledge-sync-draft.schema.json +71 -71
- package/docs/templates/product-line/closeout.yaml +9 -9
- package/docs/templates/product-line/design.md +13 -13
- package/docs/templates/product-line/links.md +10 -10
- package/docs/templates/product-line/requirement.md +17 -17
- package/docs/templates/product-line/test-plan.md +7 -7
- 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/templates/worker-dogfood-evidence.md +80 -80
- package/docs/templates/worker-dogfood-setup.md +68 -68
- package/harness.json +5 -2
- package/package.json +1 -1
- package/scripts/kb-bootstrap-init-skeleton.sh +0 -0
- package/scripts/kb-graph-incremental-prepare.mjs +0 -0
- package/scripts/kb-graph-materialize.mjs +105 -105
- package/scripts/kb-graph-promote.mjs +164 -164
- package/scripts/kb-query.mjs +554 -554
- package/skills/agent-worker/SKILL.md +48 -48
- package/skills/agent-worker/references/agent-worker-operator.md +159 -159
- package/skills/ai-engineering-context/SKILL.md +48 -48
- package/skills/analyze-product-dependencies/scripts/test-validators.mjs +0 -0
- package/skills/analyze-product-dependencies/scripts/validate-api-documentation.mjs +0 -0
- package/skills/analyze-product-dependencies/scripts/validate-dependency-analysis.mjs +0 -0
- package/skills/analyze-product-dependencies/scripts/validate-product-requirement-input.mjs +0 -0
- package/skills/analyze-product-requirements/scripts/compute-source-identity.mjs +0 -0
- package/skills/analyze-product-requirements/scripts/test-validators.mjs +0 -0
- package/skills/analyze-product-requirements/scripts/validate-product-analysis.mjs +0 -0
- package/skills/analyze-product-requirements/scripts/validate-product-requirement.mjs +0 -0
- package/skills/analyze-product-requirements/scripts/validate-requirement-clarification.mjs +0 -0
- package/skills/browser-tools/browser-content.js +103 -103
- package/skills/browser-tools/browser-cookies.js +35 -35
- package/skills/browser-tools/browser-eval.js +53 -53
- package/skills/browser-tools/browser-hn-scraper.js +108 -108
- package/skills/browser-tools/browser-nav.js +44 -44
- package/skills/browser-tools/browser-pick.js +162 -162
- package/skills/browser-tools/browser-screenshot.js +34 -34
- package/skills/browser-tools/browser-start.js +86 -86
- package/skills/browser-tools/package-lock.json +2556 -2556
- package/skills/browser-tools/package.json +19 -19
- package/skills/code-review-core/SKILL.md +20 -20
- package/skills/codebase-scout/SKILL.md +19 -19
- package/skills/grill-me/SKILL.md +10 -10
- package/skills/local-jacoco-coverage/scripts/run-coverage-analysis.sh +0 -0
- package/skills/local-jacoco-coverage/scripts/start-jacoco-agent.sh +0 -0
- package/skills/loop-agent/SKILL.md +1 -0
- package/skills/loop-agent/references/command-reference.md +641 -639
- package/skills/loop-agent/references/docs-converge.md +126 -126
- package/skills/loop-agent/references/learned/README.md +21 -21
- package/skills/loop-agent/references/pi-prompt.md +23 -23
- package/skills/loop-agent/references/pi-subagent-assisted-mode.md +84 -84
- package/skills/playwright-cli/references/element-attributes.md +23 -23
- package/skills/playwright-cli/references/playwright-tests.md +39 -39
- package/skills/playwright-cli/references/request-mocking.md +87 -87
- package/skills/playwright-cli/references/running-code.md +241 -241
- package/skills/playwright-cli/references/session-management.md +225 -225
- package/skills/playwright-cli/references/storage-state.md +275 -275
- package/skills/playwright-cli/references/test-generation.md +433 -433
- 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/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/using-git-worktrees/SKILL.md +215 -215
- package/skills/verification-before-completion/SKILL.md +154 -154
- package/skills/webapp-testing/SKILL.md +19 -19
- package/dist/worker/console/static/assets/index-fsjzREob.js +0 -56
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
# Docs Converge(文档收敛)
|
|
2
|
-
|
|
3
|
-
本 reference 把会话协议中的 **Converge Docs** 落成可执行检查表。
|
|
4
|
-
定位是**收敛 / 同步**,不是「每次重新 invent 文档大纲」。
|
|
5
|
-
|
|
6
|
-
权威规划:`ai_workspace/loop-agent/exec-plans/completed/2026-07-14-website-docs-ia-and-converge.md`。
|
|
7
|
-
站与治理双树边界:`website/README.md`。
|
|
8
|
-
|
|
9
|
-
## 何时触发
|
|
10
|
-
|
|
11
|
-
在以下任一情况**加载本文件并跑检查表**:
|
|
12
|
-
|
|
13
|
-
- 用户可见行为变更(CLI 输出、默认工作流、init 投影、Observe/Worker 主路径)。
|
|
14
|
-
- 新增 / 修改 / 删除 CLI 命令或关键 flags。
|
|
15
|
-
- runtime / 架构边界变更(`ai_workspace/loop-agent/architecture/*`、executor 角色、Worker 边界)。
|
|
16
|
-
- active plan 创建、blocked、完成或归档。
|
|
17
|
-
- 准备发布或写 `CHANGELOG.md` 版本条目。
|
|
18
|
-
- 用户明确要求「文档收敛」「docs converge」「同步 website docs」。
|
|
19
|
-
- handoff 前需要声明「本轮是否更新了站上文档」。
|
|
20
|
-
|
|
21
|
-
**不要**在无关的纯内部重构(无用户可见行为、无命令面变化)上强制大改站上正文;此时 handoff 写明豁免理由即可。
|
|
22
|
-
|
|
23
|
-
## 受众矩阵
|
|
24
|
-
|
|
25
|
-
| 受众 | 主要入口 | 权威细节 |
|
|
26
|
-
| --- | --- | --- |
|
|
27
|
-
| 新贡献者 | `website/docs/intro.md` → `overview/architecture` → `overview/roadmap` → first-run | 根 `ai_workspace/loop-agent/architecture/*`、active plans |
|
|
28
|
-
| 使用者 | `overview/feature-map`、`quick-start/*`、`guides/*`、`reference/*` | CLI help、根 `CHANGELOG.md` |
|
|
29
|
-
| 维护者 / agent | 本检查表 + `AGENTS.md` Converge Docs | `ai_workspace/loop-agent/`、`.agents/skills/`、`scripts/check-*.sh` |
|
|
30
|
-
|
|
31
|
-
## 页面清单(站上活文档)
|
|
32
|
-
|
|
33
|
-
| 页面 | 职责 |
|
|
34
|
-
| --- | --- |
|
|
35
|
-
| `website/docs/intro.md` | 概念地图 + 30 分钟路径;非能力堆砌 |
|
|
36
|
-
| `website/docs/overview/feature-map.md` | 功能导览 → guide/CLI |
|
|
37
|
-
| `website/docs/overview/architecture.md` | 架构导读;链到 `ai_workspace/loop-agent/architecture/` |
|
|
38
|
-
| `website/docs/overview/roadmap.md` | 当前有效规划短索引 |
|
|
39
|
-
| `website/docs/quick-start/*` | 安装 / init / first-run |
|
|
40
|
-
| `website/docs/guides/*` | 主路径操作说明 |
|
|
41
|
-
| `website/docs/reference/cli.md` | 用户向 CLI 参考 |
|
|
42
|
-
| `website/docs/reference/config.md` | 配置参考 |
|
|
43
|
-
| `website/docs/changelog.md` | 读者摘要;完整版本以根 `CHANGELOG.md` 为准 |
|
|
44
|
-
|
|
45
|
-
治理全文、exec-plans、reports **不**搬进 Docusaurus。
|
|
46
|
-
|
|
47
|
-
## 变更 → 文档检查表
|
|
48
|
-
|
|
49
|
-
按本轮实际 diff 勾选(有则必须处理,无则跳过并记豁免):
|
|
50
|
-
|
|
51
|
-
| 若变更了… | 必须检查 / 更新 |
|
|
52
|
-
| --- | --- |
|
|
53
|
-
| 新/改 CLI 命令 | `website/docs/reference/cli.md` + `.agents/skills/loop-agent/references/command-reference.md`(及 agent-worker 相关 reference) |
|
|
54
|
-
| 用户可见行为 | 对应 `guides/*` 或 `quick-start/*`;根 `CHANGELOG.md`;必要时 `overview/feature-map.md` / `intro.md` |
|
|
55
|
-
| runtime / 边界 | 根 `ai_workspace/loop-agent/architecture/*`;站上 `overview/architecture.md` 导语与外链 |
|
|
56
|
-
| 默认工作流 | `intro.md` 流程图 + `guides/agent-dag.md` / `guides/harness-policy.md` |
|
|
57
|
-
| active plan 状态 | `overview/roadmap.md` 短索引 + `ai_workspace/loop-agent/exec-plans/active/README.md` |
|
|
58
|
-
| 发布 | 根 `CHANGELOG.md` 为版本事实源;`website/docs/changelog.md` 只写摘要与链接;roadmap 仅在规划状态变化时更新 |
|
|
59
|
-
| skill / init 投影 | `ai_workspace/loop-agent/init-surface.manifest.json`、相关测试、必要时 `ai_workspace/loop-agent/.agents/skills/*` |
|
|
60
|
-
|
|
61
|
-
跨树链接规则:
|
|
62
|
-
|
|
63
|
-
- 站内页面用 Docusaurus 相对文档链接。
|
|
64
|
-
- 链到根目录 `ai_workspace/loop-agent/`、`AGENTS.md`、`CHANGELOG.md` 等时,使用
|
|
65
|
-
`https://github.com/tea-agent/loop-agent/blob/main/<repo-path>`,
|
|
66
|
-
正文同时写出 repo-relative path;禁止伪造站内 `/ai_workspace/loop-agent/architecture/...` 作为根目录文档路由。
|
|
67
|
-
|
|
68
|
-
## 执行步骤(最小闭环)
|
|
69
|
-
|
|
70
|
-
1. **列出本轮用户可见 diff**(命令、行为、边界、计划状态)。
|
|
71
|
-
2. **对照上表**产出缺口清单(页面路径 + 要改的一句话)。
|
|
72
|
-
3. **最小补丁**:只改清单内页面;禁止顺手重写 practices 或迁移整个 `ai_workspace/loop-agent/`。
|
|
73
|
-
4. **验证**(见下节)。
|
|
74
|
-
5. **Handoff** 二选一:
|
|
75
|
-
- 已更新:列出改动页面与验证命令结果。
|
|
76
|
-
- 无需站上更新:写明「本轮无需站上更新,原因:…」。
|
|
77
|
-
|
|
78
|
-
## 验证命令
|
|
79
|
-
|
|
80
|
-
站上正文、侧栏或 `docusaurus.config.ts` 有改动时:
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
npm run docs:build
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
涉及治理文档、脚本、skill、init surface 时再跑:
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
bash scripts/check-repo.sh
|
|
90
|
-
# 或定向:
|
|
91
|
-
bash scripts/check-skill-entry.sh
|
|
92
|
-
bash scripts/check-command-registry-drift.sh
|
|
93
|
-
bash scripts/check-init-surface.sh
|
|
94
|
-
node bin/loop-agent.js docs audit --repo-root .
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
skill / package 投影相关:
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
npx vitest run test/init-command.test.ts test/package-surface.test.ts
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## 禁止事项
|
|
104
|
-
|
|
105
|
-
- 每次会话从头撰写全新文档大纲或「重新规划整个 docs 树」。
|
|
106
|
-
- 把 `ai_workspace/loop-agent/design/`、exec-plans、reports 全文复制进 `website/docs/`。
|
|
107
|
-
- 在站上建立第二套与 `ai_workspace/loop-agent/architecture/*` 冲突的架构真源。
|
|
108
|
-
- 未读 `website/README.md` 与相关 exec-plan 就扩大 scope。
|
|
109
|
-
- 用删测试、降 `onBrokenMarkdownLinks` 或忽略 `docs:build` 失败制造「完成」。
|
|
110
|
-
- 新增独立公共 skill 目录承载本检查表(应留在 `.agents/skills/loop-agent/references/`)。
|
|
111
|
-
|
|
112
|
-
## 与现有能力的关系
|
|
113
|
-
|
|
114
|
-
| 能力 | 关系 |
|
|
115
|
-
| --- | --- |
|
|
116
|
-
| `loop-agent docs audit` | L0 腐化检查(断链、计划状态等);**不**替代本表内容审计 |
|
|
117
|
-
| `npm run docs:build` | 站上改动硬门禁(含 Markdown 断链 fail-fast) |
|
|
118
|
-
| `grill-with-docs` | ADR / 术语;不替代本 reference |
|
|
119
|
-
| 历史 2026-07-05 docs governance dogfood | 仅经验输入;新 workflow 必须 Pi-only,不复用已退役原生 Cursor DAG |
|
|
120
|
-
|
|
121
|
-
## 快速自检(handoff 前 30 秒)
|
|
122
|
-
|
|
123
|
-
- [ ] 用户可见变更是否对照检查表处理或已豁免?
|
|
124
|
-
- [ ] intro 是否仍是概念地图(而非能力 bullet 堆砌)?
|
|
125
|
-
- [ ] roadmap 是否只含当前有效 active 项?
|
|
126
|
-
- [ ] 需要时 `docs:build` / `check-repo` 是否有新鲜输出?
|
|
1
|
+
# Docs Converge(文档收敛)
|
|
2
|
+
|
|
3
|
+
本 reference 把会话协议中的 **Converge Docs** 落成可执行检查表。
|
|
4
|
+
定位是**收敛 / 同步**,不是「每次重新 invent 文档大纲」。
|
|
5
|
+
|
|
6
|
+
权威规划:`ai_workspace/loop-agent/exec-plans/completed/2026-07-14-website-docs-ia-and-converge.md`。
|
|
7
|
+
站与治理双树边界:`website/README.md`。
|
|
8
|
+
|
|
9
|
+
## 何时触发
|
|
10
|
+
|
|
11
|
+
在以下任一情况**加载本文件并跑检查表**:
|
|
12
|
+
|
|
13
|
+
- 用户可见行为变更(CLI 输出、默认工作流、init 投影、Observe/Worker 主路径)。
|
|
14
|
+
- 新增 / 修改 / 删除 CLI 命令或关键 flags。
|
|
15
|
+
- runtime / 架构边界变更(`ai_workspace/loop-agent/architecture/*`、executor 角色、Worker 边界)。
|
|
16
|
+
- active plan 创建、blocked、完成或归档。
|
|
17
|
+
- 准备发布或写 `CHANGELOG.md` 版本条目。
|
|
18
|
+
- 用户明确要求「文档收敛」「docs converge」「同步 website docs」。
|
|
19
|
+
- handoff 前需要声明「本轮是否更新了站上文档」。
|
|
20
|
+
|
|
21
|
+
**不要**在无关的纯内部重构(无用户可见行为、无命令面变化)上强制大改站上正文;此时 handoff 写明豁免理由即可。
|
|
22
|
+
|
|
23
|
+
## 受众矩阵
|
|
24
|
+
|
|
25
|
+
| 受众 | 主要入口 | 权威细节 |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| 新贡献者 | `website/docs/intro.md` → `overview/architecture` → `overview/roadmap` → first-run | 根 `ai_workspace/loop-agent/architecture/*`、active plans |
|
|
28
|
+
| 使用者 | `overview/feature-map`、`quick-start/*`、`guides/*`、`reference/*` | CLI help、根 `CHANGELOG.md` |
|
|
29
|
+
| 维护者 / agent | 本检查表 + `AGENTS.md` Converge Docs | `ai_workspace/loop-agent/`、`.agents/skills/`、`scripts/check-*.sh` |
|
|
30
|
+
|
|
31
|
+
## 页面清单(站上活文档)
|
|
32
|
+
|
|
33
|
+
| 页面 | 职责 |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| `website/docs/intro.md` | 概念地图 + 30 分钟路径;非能力堆砌 |
|
|
36
|
+
| `website/docs/overview/feature-map.md` | 功能导览 → guide/CLI |
|
|
37
|
+
| `website/docs/overview/architecture.md` | 架构导读;链到 `ai_workspace/loop-agent/architecture/` |
|
|
38
|
+
| `website/docs/overview/roadmap.md` | 当前有效规划短索引 |
|
|
39
|
+
| `website/docs/quick-start/*` | 安装 / init / first-run |
|
|
40
|
+
| `website/docs/guides/*` | 主路径操作说明 |
|
|
41
|
+
| `website/docs/reference/cli.md` | 用户向 CLI 参考 |
|
|
42
|
+
| `website/docs/reference/config.md` | 配置参考 |
|
|
43
|
+
| `website/docs/changelog.md` | 读者摘要;完整版本以根 `CHANGELOG.md` 为准 |
|
|
44
|
+
|
|
45
|
+
治理全文、exec-plans、reports **不**搬进 Docusaurus。
|
|
46
|
+
|
|
47
|
+
## 变更 → 文档检查表
|
|
48
|
+
|
|
49
|
+
按本轮实际 diff 勾选(有则必须处理,无则跳过并记豁免):
|
|
50
|
+
|
|
51
|
+
| 若变更了… | 必须检查 / 更新 |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| 新/改 CLI 命令 | `website/docs/reference/cli.md` + `.agents/skills/loop-agent/references/command-reference.md`(及 agent-worker 相关 reference) |
|
|
54
|
+
| 用户可见行为 | 对应 `guides/*` 或 `quick-start/*`;根 `CHANGELOG.md`;必要时 `overview/feature-map.md` / `intro.md` |
|
|
55
|
+
| runtime / 边界 | 根 `ai_workspace/loop-agent/architecture/*`;站上 `overview/architecture.md` 导语与外链 |
|
|
56
|
+
| 默认工作流 | `intro.md` 流程图 + `guides/agent-dag.md` / `guides/harness-policy.md` |
|
|
57
|
+
| active plan 状态 | `overview/roadmap.md` 短索引 + `ai_workspace/loop-agent/exec-plans/active/README.md` |
|
|
58
|
+
| 发布 | 根 `CHANGELOG.md` 为版本事实源;`website/docs/changelog.md` 只写摘要与链接;roadmap 仅在规划状态变化时更新 |
|
|
59
|
+
| skill / init 投影 | `ai_workspace/loop-agent/init-surface.manifest.json`、相关测试、必要时 `ai_workspace/loop-agent/.agents/skills/*` |
|
|
60
|
+
|
|
61
|
+
跨树链接规则:
|
|
62
|
+
|
|
63
|
+
- 站内页面用 Docusaurus 相对文档链接。
|
|
64
|
+
- 链到根目录 `ai_workspace/loop-agent/`、`AGENTS.md`、`CHANGELOG.md` 等时,使用
|
|
65
|
+
`https://github.com/tea-agent/loop-agent/blob/main/<repo-path>`,
|
|
66
|
+
正文同时写出 repo-relative path;禁止伪造站内 `/ai_workspace/loop-agent/architecture/...` 作为根目录文档路由。
|
|
67
|
+
|
|
68
|
+
## 执行步骤(最小闭环)
|
|
69
|
+
|
|
70
|
+
1. **列出本轮用户可见 diff**(命令、行为、边界、计划状态)。
|
|
71
|
+
2. **对照上表**产出缺口清单(页面路径 + 要改的一句话)。
|
|
72
|
+
3. **最小补丁**:只改清单内页面;禁止顺手重写 practices 或迁移整个 `ai_workspace/loop-agent/`。
|
|
73
|
+
4. **验证**(见下节)。
|
|
74
|
+
5. **Handoff** 二选一:
|
|
75
|
+
- 已更新:列出改动页面与验证命令结果。
|
|
76
|
+
- 无需站上更新:写明「本轮无需站上更新,原因:…」。
|
|
77
|
+
|
|
78
|
+
## 验证命令
|
|
79
|
+
|
|
80
|
+
站上正文、侧栏或 `docusaurus.config.ts` 有改动时:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npm run docs:build
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
涉及治理文档、脚本、skill、init surface 时再跑:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
bash scripts/check-repo.sh
|
|
90
|
+
# 或定向:
|
|
91
|
+
bash scripts/check-skill-entry.sh
|
|
92
|
+
bash scripts/check-command-registry-drift.sh
|
|
93
|
+
bash scripts/check-init-surface.sh
|
|
94
|
+
node bin/loop-agent.js docs audit --repo-root .
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
skill / package 投影相关:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
npx vitest run test/init-command.test.ts test/package-surface.test.ts
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## 禁止事项
|
|
104
|
+
|
|
105
|
+
- 每次会话从头撰写全新文档大纲或「重新规划整个 docs 树」。
|
|
106
|
+
- 把 `ai_workspace/loop-agent/design/`、exec-plans、reports 全文复制进 `website/docs/`。
|
|
107
|
+
- 在站上建立第二套与 `ai_workspace/loop-agent/architecture/*` 冲突的架构真源。
|
|
108
|
+
- 未读 `website/README.md` 与相关 exec-plan 就扩大 scope。
|
|
109
|
+
- 用删测试、降 `onBrokenMarkdownLinks` 或忽略 `docs:build` 失败制造「完成」。
|
|
110
|
+
- 新增独立公共 skill 目录承载本检查表(应留在 `.agents/skills/loop-agent/references/`)。
|
|
111
|
+
|
|
112
|
+
## 与现有能力的关系
|
|
113
|
+
|
|
114
|
+
| 能力 | 关系 |
|
|
115
|
+
| --- | --- |
|
|
116
|
+
| `loop-agent docs audit` | L0 腐化检查(断链、计划状态等);**不**替代本表内容审计 |
|
|
117
|
+
| `npm run docs:build` | 站上改动硬门禁(含 Markdown 断链 fail-fast) |
|
|
118
|
+
| `grill-with-docs` | ADR / 术语;不替代本 reference |
|
|
119
|
+
| 历史 2026-07-05 docs governance dogfood | 仅经验输入;新 workflow 必须 Pi-only,不复用已退役原生 Cursor DAG |
|
|
120
|
+
|
|
121
|
+
## 快速自检(handoff 前 30 秒)
|
|
122
|
+
|
|
123
|
+
- [ ] 用户可见变更是否对照检查表处理或已豁免?
|
|
124
|
+
- [ ] intro 是否仍是概念地图(而非能力 bullet 堆砌)?
|
|
125
|
+
- [ ] roadmap 是否只含当前有效 active 项?
|
|
126
|
+
- [ ] 需要时 `docs:build` / `check-repo` 是否有新鲜输出?
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
# Learned loop-agent Patterns
|
|
2
|
-
|
|
3
|
-
本目录是 SePO-lite prompt evolution 的 human-gated target。
|
|
4
|
-
|
|
5
|
-
Rules:
|
|
6
|
-
|
|
7
|
-
- Files 仅为 Markdown guidance。
|
|
8
|
-
- `retrospective` 可 propose `.harness/tasks/<task-id>/source/prompt-delta.md`;不得自动 merge 到此。
|
|
9
|
-
- 不要添加 shell commands、credential handling、tool permission expansion 或 completion-authority bypass rules。
|
|
10
|
-
- DAG implementer prompts 在 node 已 request `loop-agent` skill 时,可将 repo-specific 文件 `<repo>.md` 或 `default.md` 作为 bounded inline guidance 加载。
|
|
11
|
-
- 保持条目 short 且 pattern-oriented:failure class、fix scope shape、invariant、verification evidence。
|
|
12
|
-
|
|
13
|
-
Acceptance checklist before merging a prompt delta:
|
|
14
|
-
|
|
15
|
-
- Proposal 仅为 Markdown-only process guidance。
|
|
16
|
-
- 不含 shell/runtime command lines 或 fenced command blocks。
|
|
17
|
-
- Credential material、tokens、passwords、secrets 与 API keys 保持不可触达。
|
|
18
|
-
- Tool permissions、path allowlists、`allowedPaths`、`forbiddenPaths` 与 `writeSet` 保持既有边界。
|
|
19
|
-
- Shell verification、tests、write guards、decision gates、human gates 与 completion evidence 均为保留门禁。
|
|
20
|
-
- Completed DAG 与 one-shot run facts 保持只读。
|
|
21
|
-
- Learned file 编辑后 `loop-agent docs audit` 须 pass。
|
|
1
|
+
# Learned loop-agent Patterns
|
|
2
|
+
|
|
3
|
+
本目录是 SePO-lite prompt evolution 的 human-gated target。
|
|
4
|
+
|
|
5
|
+
Rules:
|
|
6
|
+
|
|
7
|
+
- Files 仅为 Markdown guidance。
|
|
8
|
+
- `retrospective` 可 propose `.harness/tasks/<task-id>/source/prompt-delta.md`;不得自动 merge 到此。
|
|
9
|
+
- 不要添加 shell commands、credential handling、tool permission expansion 或 completion-authority bypass rules。
|
|
10
|
+
- DAG implementer prompts 在 node 已 request `loop-agent` skill 时,可将 repo-specific 文件 `<repo>.md` 或 `default.md` 作为 bounded inline guidance 加载。
|
|
11
|
+
- 保持条目 short 且 pattern-oriented:failure class、fix scope shape、invariant、verification evidence。
|
|
12
|
+
|
|
13
|
+
Acceptance checklist before merging a prompt delta:
|
|
14
|
+
|
|
15
|
+
- Proposal 仅为 Markdown-only process guidance。
|
|
16
|
+
- 不含 shell/runtime command lines 或 fenced command blocks。
|
|
17
|
+
- Credential material、tokens、passwords、secrets 与 API keys 保持不可触达。
|
|
18
|
+
- Tool permissions、path allowlists、`allowedPaths`、`forbiddenPaths` 与 `writeSet` 保持既有边界。
|
|
19
|
+
- Shell verification、tests、write guards、decision gates、human gates 与 completion evidence 均为保留门禁。
|
|
20
|
+
- Completed DAG 与 one-shot run facts 保持只读。
|
|
21
|
+
- Learned file 编辑后 `loop-agent docs audit` 须 pass。
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
# One-shot Pi SDK Prompt Helper(`pi-prompt`)
|
|
2
|
-
|
|
3
|
-
短时 Pi SDK task、不需要完整 `.harness/tasks/<id>` workflow 时使用本文。替代 ad-hoc 临时代码脚本导入 `executeSingleSdkAttempt` 的做法。
|
|
4
|
-
|
|
5
|
-
### One-shot Pi SDK prompt helper
|
|
6
|
-
|
|
7
|
-
短时 Pi SDK task、不需要完整 `.harness/tasks/<id>` workflow 时,用 `loop-agent pi-prompt`,勿创建 ad-hoc 临时代码脚本导入 `executeSingleSdkAttempt`。`pi-prompt` 是一次性 full-capability helper;是否只读由本次调用的 prompt 与 `--tools` 决定。
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
loop-agent pi-prompt "Reply with exactly OK."
|
|
11
|
-
loop-agent pi-prompt --stdin < <temp-dir>/task.md
|
|
12
|
-
loop-agent pi-prompt --file <temp-dir>/task.md
|
|
13
|
-
loop-agent pi-prompt --cwd ~/go/src/loop-agent --tools read,grep,find,ls "Review the current diff. Do not edit files."
|
|
14
|
-
loop-agent pi-prompt --cwd ~/go/src/loop-agent --tools subagent,read --timeout 2400000 "Use subagent exactly once ..."
|
|
15
|
-
loop-agent pi-prompt --model gpt-5.5 --cwd ~/go/src/loop-agent "Deeply diagnose this failure."
|
|
16
|
-
loop-agent pi-prompt "Reply with exactly OK."
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
`<temp-dir>` 表示平台原生临时目录;实际命令中使用本机路径。
|
|
20
|
-
|
|
21
|
-
默认:`--provider wizard-local --model glm-5.2`;高复杂度 one-shot 可显式 `--model gpt-5.5`。按需用 `--provider`、`--model`、`--thinking`、`--tools`、`--timeout` 覆盖。
|
|
22
|
-
|
|
23
|
-
`pi-prompt` 仅用于 quick one-shot SDK call。**不**创建 `.harness/tasks/`、不跑 verification、不写 handoff artifact、不保留 workflow state。须可恢复、可验证的 implementation work 用 DAG 路径;需要隔离写入时使用 bounded Cursor 或 `delegate`。
|
|
1
|
+
# One-shot Pi SDK Prompt Helper(`pi-prompt`)
|
|
2
|
+
|
|
3
|
+
短时 Pi SDK task、不需要完整 `.harness/tasks/<id>` workflow 时使用本文。替代 ad-hoc 临时代码脚本导入 `executeSingleSdkAttempt` 的做法。
|
|
4
|
+
|
|
5
|
+
### One-shot Pi SDK prompt helper
|
|
6
|
+
|
|
7
|
+
短时 Pi SDK task、不需要完整 `.harness/tasks/<id>` workflow 时,用 `loop-agent pi-prompt`,勿创建 ad-hoc 临时代码脚本导入 `executeSingleSdkAttempt`。`pi-prompt` 是一次性 full-capability helper;是否只读由本次调用的 prompt 与 `--tools` 决定。
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
loop-agent pi-prompt "Reply with exactly OK."
|
|
11
|
+
loop-agent pi-prompt --stdin < <temp-dir>/task.md
|
|
12
|
+
loop-agent pi-prompt --file <temp-dir>/task.md
|
|
13
|
+
loop-agent pi-prompt --cwd ~/go/src/loop-agent --tools read,grep,find,ls "Review the current diff. Do not edit files."
|
|
14
|
+
loop-agent pi-prompt --cwd ~/go/src/loop-agent --tools subagent,read --timeout 2400000 "Use subagent exactly once ..."
|
|
15
|
+
loop-agent pi-prompt --model gpt-5.5 --cwd ~/go/src/loop-agent "Deeply diagnose this failure."
|
|
16
|
+
loop-agent pi-prompt "Reply with exactly OK."
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`<temp-dir>` 表示平台原生临时目录;实际命令中使用本机路径。
|
|
20
|
+
|
|
21
|
+
默认:`--provider wizard-local --model glm-5.2`;高复杂度 one-shot 可显式 `--model gpt-5.5`。按需用 `--provider`、`--model`、`--thinking`、`--tools`、`--timeout` 覆盖。
|
|
22
|
+
|
|
23
|
+
`pi-prompt` 仅用于 quick one-shot SDK call。**不**创建 `.harness/tasks/`、不跑 verification、不写 handoff artifact、不保留 workflow state。须可恢复、可验证的 implementation work 用 DAG 路径;需要隔离写入时使用 bounded Cursor 或 `delegate`。
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
# Pi Subagent Assisted Mode
|
|
2
|
-
|
|
3
|
-
loop-agent task 启用 `piSubagentMode`、在 analyze/plan/spec/retrospective 内需要 read-only scout/planner/reviewer subagents,或配置 project-local agents/prompts 时使用本文。
|
|
4
|
-
|
|
5
|
-
`task.json` 支持可选字段 `piSubagentMode`,用于 step 级 `subagent` tool delegation:
|
|
6
|
-
|
|
7
|
-
| Mode | analyze | plan | spec | implement | retrospective | verify |
|
|
8
|
-
|------|---------|------|------|-----------|----------------|--------|
|
|
9
|
-
| `off`(默认) | read only | read only | read only | +write/edit/bash | read only | read only |
|
|
10
|
-
| `analyze-plan` | **+subagent** | **+subagent** | **+subagent** | 同 off | 同 off | 同 off |
|
|
11
|
-
| `full` | **+subagent** | **+subagent** | **+subagent** | 同 off | **+subagent** | 同 off |
|
|
12
|
-
|
|
13
|
-
### 何时启用
|
|
14
|
-
|
|
15
|
-
在 `task.json` 设 `piSubagentMode: "analyze-plan"` 或 `piSubagentMode: "full"` 当:
|
|
16
|
-
- task 涉及大规模 codebase 阅读,适合 parallel scout agents
|
|
17
|
-
- analysis 或 planning 需多角度调查(如跨模块比较实现)
|
|
18
|
-
- retrospective review 适合独立 reviewer subagent(`full` mode)
|
|
19
|
-
|
|
20
|
-
### step 内使用 `subagent` 的指引
|
|
21
|
-
|
|
22
|
-
subagent 可用时,**仅用于 read-only task**:
|
|
23
|
-
- **Parallel scout**:dispatch 多个 subagent 同时搜索/阅读不同区域
|
|
24
|
-
- **Chain**:一个 subagent scout,另一个基于发现 planning
|
|
25
|
-
- **Reviewer**:用 subagent 在定稿前 review analysis/plan
|
|
26
|
-
|
|
27
|
-
**不要**用 subagent 做 writing、editing 或执行命令。subagent 输出仅 advisory;务必 verify 并将发现并入自己的输出。**不要**把 subagent 结果当作权威 state 或 artifact source。
|
|
28
|
-
|
|
29
|
-
### 前置条件
|
|
30
|
-
|
|
31
|
-
- Pi runtime 环境须有 `subagent` tool(经 Pi subagent extension 加载)
|
|
32
|
-
- 推荐用 Pi 自带 example 文件安装:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
mkdir -p ~/.pi/agent/extensions/subagent ~/.pi/agent/agents ~/.pi/agent/prompts
|
|
36
|
-
|
|
37
|
-
ln -sf /usr/local/lib/node_modules/@earendil-works/pi-coding-agent/examples/extensions/subagent/index.ts ~/.pi/agent/extensions/subagent/index.ts
|
|
38
|
-
ln -sf /usr/local/lib/node_modules/@earendil-works/pi-coding-agent/examples/extensions/subagent/agents.ts ~/.pi/agent/extensions/subagent/agents.ts
|
|
39
|
-
|
|
40
|
-
for f in /usr/local/lib/node_modules/@earendil-works/pi-coding-agent/examples/extensions/subagent/agents/*.md; do
|
|
41
|
-
ln -sf "$f" ~/.pi/agent/agents/$(basename "$f")
|
|
42
|
-
done
|
|
43
|
-
|
|
44
|
-
for f in /usr/local/lib/node_modules/@earendil-works/pi-coding-agent/examples/extensions/subagent/prompts/*.md; do
|
|
45
|
-
ln -sf "$f" ~/.pi/agent/prompts/$(basename "$f")
|
|
46
|
-
done
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
- 最小 smoke check:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
pi -p --no-session --no-context-files --no-skills --tools subagent "Reply with exactly OK."
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
预期输出:`OK`
|
|
56
|
-
- mode 按 task opt-in;默认 `off` 保持向后兼容
|
|
57
|
-
- 任何 mode 下 `implement` 都不给 `subagent`(防止 nested multi-writer)
|
|
58
|
-
|
|
59
|
-
### 内置 Project-Local Agents 与 Prompts
|
|
60
|
-
|
|
61
|
-
本 repo 提供 `.pi/agents/` 与 `.pi/prompts/` 模板,供 `piSubagentMode` 使用:
|
|
62
|
-
|
|
63
|
-
**Agents**(`.pi/agents/`)
|
|
64
|
-
|
|
65
|
-
| Agent | Role | 对应阶段 |
|
|
66
|
-
|-------|------|----------|
|
|
67
|
-
| `loop-agent-scout` | 只读侦察:code、tests、docs、governance | Scout |
|
|
68
|
-
| `loop-agent-planner` | 最小可执行计划;强调验证与回退 | Plan |
|
|
69
|
-
| `loop-agent-reviewer` | 严格审查:范围漂移、验证缺口、契约破坏 | Verify / Review |
|
|
70
|
-
| `loop-agent-worker` | 有界实现与修补 | Implement |
|
|
71
|
-
|
|
72
|
-
另有通用 agents:`scout` / `planner` / `worker` / `reviewer`(中文提示,可被通用 prompt 模板调用)。模型以各 agent frontmatter 为准(当前仓库默认对齐 `harness.json` 的 Pi executor)。
|
|
73
|
-
|
|
74
|
-
**Prompt Templates**(`.pi/prompts/`):输入 `/loop-agent-*` 或通用模板名调用
|
|
75
|
-
|
|
76
|
-
| Template | Flow |
|
|
77
|
-
|----------|------|
|
|
78
|
-
| `loop-agent-scout-and-plan` | parallel scout → planner |
|
|
79
|
-
| `loop-agent-analyze-wide` | 3 parallel scouts → 结构化分析 |
|
|
80
|
-
| `loop-agent-review-only` | 独立审查计划/实现/验证 |
|
|
81
|
-
| `loop-agent-implement-and-review` | worker → reviewer → worker |
|
|
82
|
-
| `scout-and-plan` / `implement` / `implement-and-review` | 通用 chain(调用 `scout`/`planner`/`worker`/`reviewer`) |
|
|
83
|
-
|
|
84
|
-
传 `agentScope: "both"` + `confirmProjectAgents: false` 以访问 repo-local agents。
|
|
1
|
+
# Pi Subagent Assisted Mode
|
|
2
|
+
|
|
3
|
+
loop-agent task 启用 `piSubagentMode`、在 analyze/plan/spec/retrospective 内需要 read-only scout/planner/reviewer subagents,或配置 project-local agents/prompts 时使用本文。
|
|
4
|
+
|
|
5
|
+
`task.json` 支持可选字段 `piSubagentMode`,用于 step 级 `subagent` tool delegation:
|
|
6
|
+
|
|
7
|
+
| Mode | analyze | plan | spec | implement | retrospective | verify |
|
|
8
|
+
|------|---------|------|------|-----------|----------------|--------|
|
|
9
|
+
| `off`(默认) | read only | read only | read only | +write/edit/bash | read only | read only |
|
|
10
|
+
| `analyze-plan` | **+subagent** | **+subagent** | **+subagent** | 同 off | 同 off | 同 off |
|
|
11
|
+
| `full` | **+subagent** | **+subagent** | **+subagent** | 同 off | **+subagent** | 同 off |
|
|
12
|
+
|
|
13
|
+
### 何时启用
|
|
14
|
+
|
|
15
|
+
在 `task.json` 设 `piSubagentMode: "analyze-plan"` 或 `piSubagentMode: "full"` 当:
|
|
16
|
+
- task 涉及大规模 codebase 阅读,适合 parallel scout agents
|
|
17
|
+
- analysis 或 planning 需多角度调查(如跨模块比较实现)
|
|
18
|
+
- retrospective review 适合独立 reviewer subagent(`full` mode)
|
|
19
|
+
|
|
20
|
+
### step 内使用 `subagent` 的指引
|
|
21
|
+
|
|
22
|
+
subagent 可用时,**仅用于 read-only task**:
|
|
23
|
+
- **Parallel scout**:dispatch 多个 subagent 同时搜索/阅读不同区域
|
|
24
|
+
- **Chain**:一个 subagent scout,另一个基于发现 planning
|
|
25
|
+
- **Reviewer**:用 subagent 在定稿前 review analysis/plan
|
|
26
|
+
|
|
27
|
+
**不要**用 subagent 做 writing、editing 或执行命令。subagent 输出仅 advisory;务必 verify 并将发现并入自己的输出。**不要**把 subagent 结果当作权威 state 或 artifact source。
|
|
28
|
+
|
|
29
|
+
### 前置条件
|
|
30
|
+
|
|
31
|
+
- Pi runtime 环境须有 `subagent` tool(经 Pi subagent extension 加载)
|
|
32
|
+
- 推荐用 Pi 自带 example 文件安装:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
mkdir -p ~/.pi/agent/extensions/subagent ~/.pi/agent/agents ~/.pi/agent/prompts
|
|
36
|
+
|
|
37
|
+
ln -sf /usr/local/lib/node_modules/@earendil-works/pi-coding-agent/examples/extensions/subagent/index.ts ~/.pi/agent/extensions/subagent/index.ts
|
|
38
|
+
ln -sf /usr/local/lib/node_modules/@earendil-works/pi-coding-agent/examples/extensions/subagent/agents.ts ~/.pi/agent/extensions/subagent/agents.ts
|
|
39
|
+
|
|
40
|
+
for f in /usr/local/lib/node_modules/@earendil-works/pi-coding-agent/examples/extensions/subagent/agents/*.md; do
|
|
41
|
+
ln -sf "$f" ~/.pi/agent/agents/$(basename "$f")
|
|
42
|
+
done
|
|
43
|
+
|
|
44
|
+
for f in /usr/local/lib/node_modules/@earendil-works/pi-coding-agent/examples/extensions/subagent/prompts/*.md; do
|
|
45
|
+
ln -sf "$f" ~/.pi/agent/prompts/$(basename "$f")
|
|
46
|
+
done
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
- 最小 smoke check:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pi -p --no-session --no-context-files --no-skills --tools subagent "Reply with exactly OK."
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
预期输出:`OK`
|
|
56
|
+
- mode 按 task opt-in;默认 `off` 保持向后兼容
|
|
57
|
+
- 任何 mode 下 `implement` 都不给 `subagent`(防止 nested multi-writer)
|
|
58
|
+
|
|
59
|
+
### 内置 Project-Local Agents 与 Prompts
|
|
60
|
+
|
|
61
|
+
本 repo 提供 `.pi/agents/` 与 `.pi/prompts/` 模板,供 `piSubagentMode` 使用:
|
|
62
|
+
|
|
63
|
+
**Agents**(`.pi/agents/`)
|
|
64
|
+
|
|
65
|
+
| Agent | Role | 对应阶段 |
|
|
66
|
+
|-------|------|----------|
|
|
67
|
+
| `loop-agent-scout` | 只读侦察:code、tests、docs、governance | Scout |
|
|
68
|
+
| `loop-agent-planner` | 最小可执行计划;强调验证与回退 | Plan |
|
|
69
|
+
| `loop-agent-reviewer` | 严格审查:范围漂移、验证缺口、契约破坏 | Verify / Review |
|
|
70
|
+
| `loop-agent-worker` | 有界实现与修补 | Implement |
|
|
71
|
+
|
|
72
|
+
另有通用 agents:`scout` / `planner` / `worker` / `reviewer`(中文提示,可被通用 prompt 模板调用)。模型以各 agent frontmatter 为准(当前仓库默认对齐 `harness.json` 的 Pi executor)。
|
|
73
|
+
|
|
74
|
+
**Prompt Templates**(`.pi/prompts/`):输入 `/loop-agent-*` 或通用模板名调用
|
|
75
|
+
|
|
76
|
+
| Template | Flow |
|
|
77
|
+
|----------|------|
|
|
78
|
+
| `loop-agent-scout-and-plan` | parallel scout → planner |
|
|
79
|
+
| `loop-agent-analyze-wide` | 3 parallel scouts → 结构化分析 |
|
|
80
|
+
| `loop-agent-review-only` | 独立审查计划/实现/验证 |
|
|
81
|
+
| `loop-agent-implement-and-review` | worker → reviewer → worker |
|
|
82
|
+
| `scout-and-plan` / `implement` / `implement-and-review` | 通用 chain(调用 `scout`/`planner`/`worker`/`reviewer`) |
|
|
83
|
+
|
|
84
|
+
传 `agentScope: "both"` + `confirmProjectAgents: false` 以访问 repo-local agents。
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
# Inspecting Element Attributes
|
|
2
|
-
|
|
3
|
-
When the snapshot doesn't show an element's `id`, `class`, `data-*` attributes, or other DOM properties, use `eval` to inspect them.
|
|
4
|
-
|
|
5
|
-
## Examples
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
playwright-cli snapshot
|
|
9
|
-
# snapshot shows a button as e7 but doesn't reveal its id or data attributes
|
|
10
|
-
|
|
11
|
-
# get the element's id
|
|
12
|
-
playwright-cli eval "el => el.id" e7
|
|
13
|
-
|
|
14
|
-
# get all CSS classes
|
|
15
|
-
playwright-cli eval "el => el.className" e7
|
|
16
|
-
|
|
17
|
-
# get a specific attribute
|
|
18
|
-
playwright-cli eval "el => el.getAttribute('data-testid')" e7
|
|
19
|
-
playwright-cli eval "el => el.getAttribute('aria-label')" e7
|
|
20
|
-
|
|
21
|
-
# get a computed style property
|
|
22
|
-
playwright-cli eval "el => getComputedStyle(el).display" e7
|
|
23
|
-
```
|
|
1
|
+
# Inspecting Element Attributes
|
|
2
|
+
|
|
3
|
+
When the snapshot doesn't show an element's `id`, `class`, `data-*` attributes, or other DOM properties, use `eval` to inspect them.
|
|
4
|
+
|
|
5
|
+
## Examples
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
playwright-cli snapshot
|
|
9
|
+
# snapshot shows a button as e7 but doesn't reveal its id or data attributes
|
|
10
|
+
|
|
11
|
+
# get the element's id
|
|
12
|
+
playwright-cli eval "el => el.id" e7
|
|
13
|
+
|
|
14
|
+
# get all CSS classes
|
|
15
|
+
playwright-cli eval "el => el.className" e7
|
|
16
|
+
|
|
17
|
+
# get a specific attribute
|
|
18
|
+
playwright-cli eval "el => el.getAttribute('data-testid')" e7
|
|
19
|
+
playwright-cli eval "el => el.getAttribute('aria-label')" e7
|
|
20
|
+
|
|
21
|
+
# get a computed style property
|
|
22
|
+
playwright-cli eval "el => getComputedStyle(el).display" e7
|
|
23
|
+
```
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
# Running Playwright Tests
|
|
2
|
-
|
|
3
|
-
To run Playwright tests, use the `npx playwright test` command, or a package manager script. To avoid opening the interactive html report, use `PLAYWRIGHT_HTML_OPEN=never` environment variable.
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
# Run all tests
|
|
7
|
-
PLAYWRIGHT_HTML_OPEN=never npx playwright test
|
|
8
|
-
|
|
9
|
-
# Run all tests through a custom npm script
|
|
10
|
-
PLAYWRIGHT_HTML_OPEN=never npm run special-test-command
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
# Debugging Playwright Tests
|
|
14
|
-
|
|
15
|
-
To debug a failing Playwright test, run it with `--debug=cli` option. This command will pause the test at the start and print the debugging instructions.
|
|
16
|
-
|
|
17
|
-
**IMPORTANT**: run the command in the background and check the output until "Debugging Instructions" is printed. Make sure to stop the command after you have finished.
|
|
18
|
-
|
|
19
|
-
Once instructions containing a session name are printed, use `playwright-cli` to attach the session and explore the page.
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
# Run the test
|
|
23
|
-
PLAYWRIGHT_HTML_OPEN=never npx playwright test --debug=cli
|
|
24
|
-
# ...
|
|
25
|
-
# ... debugging instructions for "tw-abcdef" session ...
|
|
26
|
-
# ...
|
|
27
|
-
|
|
28
|
-
# Attach to the test
|
|
29
|
-
playwright-cli attach tw-abcdef
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Keep the test running in the background while you explore and look for a fix.
|
|
33
|
-
The test is paused at the start, so you should step over or pause at a particular location
|
|
34
|
-
where the problem is most likely to be.
|
|
35
|
-
|
|
36
|
-
Every action you perform with `playwright-cli` generates corresponding Playwright TypeScript code.
|
|
37
|
-
This code appears in the output and can be copied directly into the test. Most of the time, a specific locator or an expectation should be updated, but it could also be a bug in the app. Use your judgement.
|
|
38
|
-
|
|
39
|
-
After fixing the test, stop the background test run. Rerun to check that test passes.
|
|
1
|
+
# Running Playwright Tests
|
|
2
|
+
|
|
3
|
+
To run Playwright tests, use the `npx playwright test` command, or a package manager script. To avoid opening the interactive html report, use `PLAYWRIGHT_HTML_OPEN=never` environment variable.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
# Run all tests
|
|
7
|
+
PLAYWRIGHT_HTML_OPEN=never npx playwright test
|
|
8
|
+
|
|
9
|
+
# Run all tests through a custom npm script
|
|
10
|
+
PLAYWRIGHT_HTML_OPEN=never npm run special-test-command
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
# Debugging Playwright Tests
|
|
14
|
+
|
|
15
|
+
To debug a failing Playwright test, run it with `--debug=cli` option. This command will pause the test at the start and print the debugging instructions.
|
|
16
|
+
|
|
17
|
+
**IMPORTANT**: run the command in the background and check the output until "Debugging Instructions" is printed. Make sure to stop the command after you have finished.
|
|
18
|
+
|
|
19
|
+
Once instructions containing a session name are printed, use `playwright-cli` to attach the session and explore the page.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Run the test
|
|
23
|
+
PLAYWRIGHT_HTML_OPEN=never npx playwright test --debug=cli
|
|
24
|
+
# ...
|
|
25
|
+
# ... debugging instructions for "tw-abcdef" session ...
|
|
26
|
+
# ...
|
|
27
|
+
|
|
28
|
+
# Attach to the test
|
|
29
|
+
playwright-cli attach tw-abcdef
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Keep the test running in the background while you explore and look for a fix.
|
|
33
|
+
The test is paused at the start, so you should step over or pause at a particular location
|
|
34
|
+
where the problem is most likely to be.
|
|
35
|
+
|
|
36
|
+
Every action you perform with `playwright-cli` generates corresponding Playwright TypeScript code.
|
|
37
|
+
This code appears in the output and can be copied directly into the test. Most of the time, a specific locator or an expectation should be updated, but it could also be a bug in the app. Use your judgement.
|
|
38
|
+
|
|
39
|
+
After fixing the test, stop the background test run. Rerun to check that test passes.
|