@buaa_smat/hometrans 26.0.6 → 26.0.8
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/README.md +6 -3
- package/agents/a2h-executor.md +37 -0
- package/dist/cli/editors.json +13 -0
- package/dist/platform/compose.js +4 -0
- package/dist/platform/registry.js +3 -1
- package/dist/platform/transform.js +37 -3
- package/env-requirements.json +15 -1
- package/i18n/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +2 -2
- package/i18n/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +1 -1
- package/i18n/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +13 -6
- package/i18n/skills/a2h-app-migrate/SKILL.md +2 -2
- package/i18n/skills/a2h-app-migrate/references/workflow.yaml +27 -4
- package/i18n/skills/a2h-app-migrate/scripts/opencode_depth.mjs +418 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -0
- package/i18n/skills/a2h-batch-ui-align/SKILL.md +7 -7
- package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/state.md +20 -2
- package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +2 -2
- package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +3 -3
- package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +3 -1
- package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +2 -2
- package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +10 -6
- package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +13 -9
- package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +59 -7
- package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +3 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/interactions.mjs +186 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +33 -7
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +83 -22
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +39 -5
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_padding_raster.test.mjs +25 -1
- package/i18n/skills/a2h-page-specgen/SKILL.md +1 -1
- package/i18n/skills/a2h-page-specgen/references/gates.md +3 -1
- package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +11 -11
- package/i18n/skills/a2h-page-specgen/references/spec-template.md +3 -3
- package/i18n/skills/a2h-page-specgen/scripts/contract-calls.mjs +40 -3
- package/i18n/skills/a2h-page-specgen/scripts/entry-evidence.mjs +73 -5
- package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +144 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +11 -11
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +11 -11
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +11 -11
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +11 -11
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +10 -10
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +1 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +11 -11
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +11 -11
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +11 -11
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +11 -11
- package/i18n/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +45 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +100 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +132 -3
- package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +36 -1
- package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +1 -1
- package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +16 -0
- package/i18n/skills/a2h-utg-static/SKILL.md +2 -0
- package/package.json +1 -1
- package/platforms/atomcode/agents/a2h-executor.frontmatter.md +6 -0
- package/platforms/codebuddy/agents/a2h-executor.frontmatter.md +5 -0
- package/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +2 -2
- package/platforms/deveco/agents/a2h-executor.frontmatter.md +7 -0
- package/platforms/deveco/agents/build-fixer.frontmatter.md +0 -2
- package/platforms/deveco/agents/code-reviewer.frontmatter.md +0 -2
- package/platforms/deveco/agents/model-render-worker.frontmatter.md +0 -2
- package/platforms/deveco/agents/model-worker.frontmatter.md +0 -2
- package/platforms/deveco/agents/specgen-worker.frontmatter.md +0 -2
- package/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +1 -1
- package/platforms/opencode/agents/a2h-executor.frontmatter.md +7 -0
- package/platforms/opencode/agents/build-fixer.frontmatter.md +0 -2
- package/platforms/opencode/agents/code-reviewer.frontmatter.md +0 -2
- package/platforms/opencode/agents/model-render-worker.frontmatter.md +0 -2
- package/platforms/opencode/agents/model-worker.frontmatter.md +0 -2
- package/platforms/opencode/agents/specgen-worker.frontmatter.md +0 -2
- package/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +13 -6
- package/skills/a2h-app-migrate/SKILL.md +29 -3
- package/skills/a2h-app-migrate/references/host-rules.md +33 -0
- package/skills/a2h-app-migrate/references/workflow.yaml +24 -4
- package/skills/a2h-app-migrate/scripts/opencode_depth.mjs +418 -0
- package/skills/a2h-app-migrate/test/test_executor_header_sync.mjs +78 -0
- package/skills/a2h-app-migrate/test/test_opencode_depth.mjs +312 -0
- package/skills/a2h-app-migrate/tools/dag.mjs +267 -0
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -0
- package/skills/a2h-batch-ui-align/SKILL.md +7 -7
- package/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -1
- package/skills/a2h-batch-ui-align/references/cards/state.md +20 -2
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +2 -2
- package/skills/a2h-batch-ui-align/references/checker-rules.md +3 -3
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +3 -1
- package/skills/a2h-batch-ui-align/references/host-dispatch.md +5 -5
- package/skills/a2h-batch-ui-align/references/incremental-scope.md +2 -2
- package/skills/a2h-batch-ui-align/references/step3-capture.md +10 -6
- package/skills/a2h-batch-ui-align/references/step5-convert.md +13 -9
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +59 -7
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +3 -0
- package/skills/a2h-batch-ui-align/scripts/group_pass.mjs +3 -2
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +139 -23
- package/skills/a2h-batch-ui-align/scripts/host_env.mjs +32 -8
- package/skills/a2h-batch-ui-align/scripts/interactions.mjs +186 -0
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +33 -7
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +83 -22
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +39 -5
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +82 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_padding_raster.test.mjs +25 -1
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +184 -2
- package/skills/a2h-batch-ui-align/scripts/tests/host_env.test.mjs +33 -0
- package/skills/a2h-batch-ui-align/scripts/tests/interactions.test.mjs +258 -0
- package/skills/a2h-page-specgen/SKILL.md +1 -1
- package/skills/a2h-page-specgen/references/evidence.md +15 -0
- package/skills/a2h-page-specgen/references/gates.md +3 -1
- package/skills/a2h-page-specgen/references/scenario-authoring.md +10 -10
- package/skills/a2h-page-specgen/references/spec-template.md +2 -2
- package/skills/a2h-page-specgen/scripts/contract-calls.mjs +40 -3
- package/skills/a2h-page-specgen/scripts/entry-evidence.mjs +73 -5
- package/skills/a2h-page-specgen/scripts/gate.mjs +141 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +10 -10
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +10 -10
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +10 -10
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +10 -10
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +10 -10
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +1 -1
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +10 -10
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +10 -10
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +10 -10
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +10 -10
- package/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +45 -1
- package/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +100 -0
- package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +104 -3
- package/skills/a2h-resource-convert/references/conversion-rules.md +2 -0
- package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +36 -1
- package/skills/a2h-resource-convert/scripts/tests/adaptive_icon.test.mjs +42 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +1 -1
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +16 -0
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +2 -2
- package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +5 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +5 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +4 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +2 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +3 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-v2-observation-cn.md +105 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-v2-observation-en.md +122 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +4 -4
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIV2ObservationCheck.js +1862 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +2 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +15 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +20 -4
- package/skills/a2h-spec-design-pipeline/scripts/test_arkui_v2_observation.ts +284 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +32 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +22 -1
- package/skills/a2h-utg-static/SKILL.md +2 -0
- package/skills/a2h-utg-static/references/extractors.md +16 -0
- package/skills/a2h-utg-static/scripts/run_pipeline.mjs +22 -1
- package/skills/a2h-utg-static/scripts/tests/regression_matrix.mjs +4 -0
- package/skills/a2h-utg-static/scripts/tests/test_pr169_review_fixes.mjs +15 -0
- package/skills/a2h-utg-static/scripts/tests/test_view_attachments.mjs +330 -0
- package/skills/a2h-utg-static/scripts/view_attachments.mjs +465 -0
- package/platforms/codebuddy/agents/build-fixer.frontmatter.md +0 -5
- package/platforms/codebuddy/agents/code-reviewer.frontmatter.md +0 -5
- package/platforms/codebuddy/agents/model-render-worker.frontmatter.md +0 -5
- package/platforms/codebuddy/agents/model-worker.frontmatter.md +0 -5
- package/platforms/codebuddy/agents/specgen-worker.frontmatter.md +0 -5
package/README.md
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
[](#选择本地editor)
|
|
21
21
|
[](#选择本地editor)
|
|
22
22
|
[](#选择本地editor)
|
|
23
|
+
[](#选择本地editor)
|
|
23
24
|
[](#选择本地editor)
|
|
24
25
|
[](#选择本地editor)
|
|
25
26
|
[](#选择本地editor)
|
|
@@ -84,6 +85,8 @@ npm install -g @buaa_smat/hometrans
|
|
|
84
85
|
> 若一个 editor 都不选择,`ht init` 不会中断:仍会执行后续全部配置流程,并把 skills / agents / commands 原样拷贝到共享目录 `~/.agents/skills`、`~/.agents/agents` 与 `~/.agents/commands`(`ht uninstall` 也会清理这些目录)。
|
|
85
86
|
>
|
|
86
87
|
> Codex 与 AtomCode 没有命令目录,`/hometrans` 会安装为名为 `hometrans` 的 skill(Codex 中用 `$hometrans` 调用)。
|
|
88
|
+
>
|
|
89
|
+
> GitHub Copilot 的 commands 会安装为 skill(`~/.copilot/skills/<命令名>/SKILL.md`),保留原有字段,仅补充必需的 `name`;skills / agents 原样安装到 `~/.copilot/skills` 与 `~/.copilot/agents`。
|
|
87
90
|
|
|
88
91
|
#### 配置鸿蒙SDK
|
|
89
92
|

|
|
@@ -400,11 +403,11 @@ devecocli plugin uninstall hometrans [--agent <name>] [--project <project_dir>]
|
|
|
400
403
|
|
|
401
404
|
**支持的智能体**
|
|
402
405
|
|
|
403
|
-
`opencode`、`trae`、`trae-cn`、`deveco`、`cursor`、`codebuddy`、`qoder`、`qoder-cn`、`claude-code`、`codex`、`atomcode`
|
|
406
|
+
`opencode`、`trae`、`trae-cn`、`deveco`、`cursor`、`codebuddy`、`github-copilot`、`qoder`、`qoder-cn`、`claude-code`、`codex`、`atomcode`
|
|
404
407
|
|
|
405
408
|
**参数说明**
|
|
406
409
|
|
|
407
410
|
| 参数 | 说明 |
|
|
408
411
|
|------|------|
|
|
409
|
-
| `--agent <name>` |
|
|
410
|
-
| `--project <project_dir>` | 工程级安装,内容写入 `<project_dir>/<智能体工程目录>/{skills,agents,commands}`<br>目录名默认为 `.<agent>`(claude-code 为 `.claude`;由 DevEco CLI 调用时以 CLI 解析出的工程级 skills 目录为准)<br>不指定时为全局安装,写入各智能体的用户级目录 |
|
|
412
|
+
| `--agent <name>` | 目标智能体,取上述规范名;不指定时处理本机已安装的全部受支持智能体 |
|
|
413
|
+
| `--project <project_dir>` | 工程级安装,内容写入 `<project_dir>/<智能体工程目录>/{skills,agents,commands}`<br>目录名默认为 `.<agent>`(claude-code 为 `.claude`,github-copilot 为 `.github`;由 DevEco CLI 调用时以 CLI 解析出的工程级 skills 目录为准)<br>不指定时为全局安装,写入各智能体的用户级目录 |
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: a2h-executor
|
|
3
|
+
description: Generic node executor for HomeTrans orchestration. Loads the skill named in the task, runs the given invoke to the node's terminal state, dispatches that skill's own sub-agents the way the skill describes, and replies only with the JSON the invoke asks for. a2h-app-migrate dispatches it for its task_subagent skill nodes instead of the host's general-purpose agent.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# A2H Executor
|
|
7
|
+
|
|
8
|
+
You are the executor that a HomeTrans orchestrator (the primary session running `a2h-app-migrate`) dispatches to run **one workflow node**. The task names the skill to load and carries the node's `invoke`; you carry the node to its terminal state and report back.
|
|
9
|
+
|
|
10
|
+
You exist so that the node level can be configured separately from the host's built-in general-purpose agent: the rules below hold for every node you are dispatched for, on every host that dispatches you (a host with nesting depth 1 runs its nodes inline and never dispatches you).
|
|
11
|
+
|
|
12
|
+
These rules repeat the common task-prompt header in `skills/a2h-app-migrate/references/workflow.yaml` (`policy.dispatch`), which stays in force for a host that falls back to its general agent. Change both together; `skills/a2h-app-migrate/test/test_executor_header_sync.mjs` checks the shared parts.
|
|
13
|
+
|
|
14
|
+
## Rules
|
|
15
|
+
|
|
16
|
+
1. **Load the skill first.** Use the skill tool to load the skill the task names and read its `SKILL.md` completely, then follow it together with the invoke. The invoke fixes the inputs, the parameters and the success criteria; the skill fixes how the work is done. Never improvise a procedure the skill already defines.
|
|
17
|
+
|
|
18
|
+
2. **Dispatch what the skill dispatches.** When the skill asks for sub-agents, dispatch them with the host's task tool:
|
|
19
|
+
- use the agent type the skill names; when it names none, use the host's general-purpose agent;
|
|
20
|
+
- never do a worker's job yourself instead of dispatching it, and never add dispatch levels the skill does not describe;
|
|
21
|
+
- the skill's concurrency limits and dispatch order are binding.
|
|
22
|
+
|
|
23
|
+
3. **Write self-contained prompts.** A sub-agent starts with a fresh context and sees nothing of this session. Its prompt carries the full task, the inputs, the output paths and the acceptance criteria — use the skill's prompt templates, filled in, never a summary of them.
|
|
24
|
+
|
|
25
|
+
4. **Never end your turn to wait.** Ending the turn returns you to your caller with the work unfinished, and nothing can wake you again. While background sub-agents run, block in the skill's own wait command (for example `dispatch.mjs wait`, `group_queue.mjs wait`, the page-specgen waker), then go back to the skill's loop.
|
|
26
|
+
- Run the wait command exactly as the skill gives it. While a shell call runs, the host queues every completion notification, so each call must stay short.
|
|
27
|
+
- Never write your own wait, poll or sleep script, never `sleep`, and never loop several waits inside one shell call.
|
|
28
|
+
|
|
29
|
+
5. **State belongs to the scripts.** Never hand-edit a ledger, state, queue or plan file that the skill's scripts own, and never mark work done ahead of the evidence the skill checks. Record progress only through the commands the skill documents.
|
|
30
|
+
|
|
31
|
+
6. **Context is not a reason to stop.** Context budget, window size, remaining tokens, a long session or an approaching compaction never justify ending early.
|
|
32
|
+
|
|
33
|
+
7. **Do not ask the user.** Where the invoke says `interactive → needs_input`, save the work done so far and reply `{ "ok": false, "needs_input": { "question": "...", "options": [...], "context": "..." } }`; your caller asks the user and dispatches you again. Under `auto`, take the default branch the invoke documents.
|
|
34
|
+
|
|
35
|
+
8. **Stay inside the node.** Ledger entries, gate checkpoints and `before_run` / `after_run` belong to the orchestrator's Runner, not to you. Do not touch files outside the node's scope and do nothing the task did not ask for.
|
|
36
|
+
|
|
37
|
+
9. **Report truthfully.** Your last message is only the JSON the invoke asks for: the outcome of each sub-task (success or failure), the key artifact paths and the failure reasons. Never claim work that a sub-agent did not finish, and never leave out a failure.
|
package/dist/cli/editors.json
CHANGED
|
@@ -78,6 +78,19 @@
|
|
|
78
78
|
"disable-model-invocation"
|
|
79
79
|
]
|
|
80
80
|
},
|
|
81
|
+
{
|
|
82
|
+
"name": "github-copilot",
|
|
83
|
+
"displayName": "GitHub Copilot",
|
|
84
|
+
"markerDir": "~/.copilot",
|
|
85
|
+
"rootEnvVar": "COPILOT_HOME",
|
|
86
|
+
"skillsDir": "~/.copilot/skills",
|
|
87
|
+
"agentsDir": "~/.copilot/agents",
|
|
88
|
+
"commandsDir": null,
|
|
89
|
+
"agentFormat": "passthrough",
|
|
90
|
+
"verbatim": true,
|
|
91
|
+
"commandsAsSkills": true,
|
|
92
|
+
"commandKeepKeys": []
|
|
93
|
+
},
|
|
81
94
|
{
|
|
82
95
|
"name": "trae-cn",
|
|
83
96
|
"displayName": "Trae CN",
|
package/dist/platform/compose.js
CHANGED
|
@@ -198,6 +198,10 @@ export async function buildCommandContent(platform, fileName, rootRaw, platforms
|
|
|
198
198
|
};
|
|
199
199
|
}
|
|
200
200
|
export async function buildCommandSkill(platform, fileName, rootRaw, platformsRoot) {
|
|
201
|
+
if (platform.verbatim) {
|
|
202
|
+
const t = commandToSkillMd(platform, fileName, rootRaw);
|
|
203
|
+
return { ...t, notes: [...t.notes] };
|
|
204
|
+
}
|
|
201
205
|
const c = await composeDoc(platform, 'command', fileName, rootRaw, platformsRoot);
|
|
202
206
|
const t = commandToSkillMd(platform, fileName, c.legacyRaw);
|
|
203
207
|
return { ...t, notes: [...sourceNotes(c), ...t.notes] };
|
|
@@ -45,7 +45,6 @@ export function sharedAgentsTarget() {
|
|
|
45
45
|
* replaces it.
|
|
46
46
|
*/
|
|
47
47
|
export const OBSOLETE_EDITOR_NAMES = new Set([
|
|
48
|
-
'GitHub Copilot',
|
|
49
48
|
'TraeCode',
|
|
50
49
|
'Trae CLI',
|
|
51
50
|
]);
|
|
@@ -64,6 +63,7 @@ export const EDITOR_NAME_ALIASES = {
|
|
|
64
63
|
AtomCode: 'atomcode',
|
|
65
64
|
Trae: 'trae',
|
|
66
65
|
'Trae CN': 'trae-cn',
|
|
66
|
+
'GitHub Copilot': 'github-copilot',
|
|
67
67
|
};
|
|
68
68
|
/** Strip a UTF-8 BOM (PowerShell 5.1 / legacy Notepad writes one). */
|
|
69
69
|
export function stripBom(raw) {
|
|
@@ -227,6 +227,7 @@ function loadTable() {
|
|
|
227
227
|
skillDescriptionLimit: limit,
|
|
228
228
|
commandKeepKeys: optionalStringArray(rec, 'commandKeepKeys', i),
|
|
229
229
|
commandsAsSkills: optionalBool(rec, 'commandsAsSkills', i, false),
|
|
230
|
+
verbatim: optionalBool(rec, 'verbatim', i, false),
|
|
230
231
|
legacyDirs: optionalLegacyDirs(rec, i),
|
|
231
232
|
};
|
|
232
233
|
return record;
|
|
@@ -325,6 +326,7 @@ export function platformForEditor(editor) {
|
|
|
325
326
|
skillDescriptionLimit: rec.skillDescriptionLimit ?? null,
|
|
326
327
|
commandKeepKeys: [...rec.commandKeepKeys],
|
|
327
328
|
commandsAsSkills: rec.commandsAsSkills === true,
|
|
329
|
+
verbatim: rec.verbatim === true,
|
|
328
330
|
legacyDirs: (rec.legacyDirs ?? []).map((legacy) => {
|
|
329
331
|
const out = {};
|
|
330
332
|
for (const key of LEGACY_DIR_KEYS) {
|
|
@@ -18,7 +18,9 @@ const SKILL_STANDARD_KEYS = new Set([
|
|
|
18
18
|
'allowed-tools',
|
|
19
19
|
'argument-hint',
|
|
20
20
|
]);
|
|
21
|
-
export function transformSkillMd(
|
|
21
|
+
export function transformSkillMd(platform, raw) {
|
|
22
|
+
if (platform.verbatim)
|
|
23
|
+
return { content: raw, rawCopy: true, notes: [] };
|
|
22
24
|
const { fm, body, hasFrontmatter } = parseFrontmatter(raw);
|
|
23
25
|
if (!hasFrontmatter)
|
|
24
26
|
return { content: raw, rawCopy: true, notes: [] };
|
|
@@ -101,6 +103,8 @@ function droppedModeNote(mode, platform) {
|
|
|
101
103
|
export function transformAgentMd(platform, fileName, raw) {
|
|
102
104
|
if (platform.agentFormat === 'none')
|
|
103
105
|
return null;
|
|
106
|
+
if (platform.verbatim)
|
|
107
|
+
return { fileName, content: raw, rawCopy: true, notes: [] };
|
|
104
108
|
if (platform.agentFormat === 'passthrough') {
|
|
105
109
|
// OpenCode family: mode / permission are native — copy as-is.
|
|
106
110
|
return { fileName, content: raw, rawCopy: true, notes: [] };
|
|
@@ -247,7 +251,7 @@ export function transformAgentMd(platform, fileName, raw) {
|
|
|
247
251
|
* Claude Code maps `subtask: true` to `context: fork`. Body templates are kept.
|
|
248
252
|
*/
|
|
249
253
|
export function transformCommandMd(platform, raw) {
|
|
250
|
-
if (platform.commandsDir === null) {
|
|
254
|
+
if (platform.verbatim || platform.commandsDir === null) {
|
|
251
255
|
return { content: raw, rawCopy: true, notes: [] };
|
|
252
256
|
}
|
|
253
257
|
const { fm, body, hasFrontmatter } = parseFrontmatter(raw);
|
|
@@ -284,8 +288,38 @@ export function transformCommandMd(platform, raw) {
|
|
|
284
288
|
* DSH / AtomCode have no file-based commands).
|
|
285
289
|
*/
|
|
286
290
|
export function commandToSkillMd(platform, fileName, raw) {
|
|
287
|
-
const { fm, body } = parseFrontmatter(raw);
|
|
288
291
|
const skillName = fileName.replace(/\.md$/, '');
|
|
292
|
+
if (platform.verbatim) {
|
|
293
|
+
// Commands are relocated into skills/ with their fields untouched; only the
|
|
294
|
+
// SKILL.md-required `name` field is added when it is missing.
|
|
295
|
+
const { fm, hasFrontmatter } = parseFrontmatter(raw);
|
|
296
|
+
if (!hasFrontmatter) {
|
|
297
|
+
return {
|
|
298
|
+
skillName,
|
|
299
|
+
content: `---\nname: ${skillName}\n---\n\n${raw}`,
|
|
300
|
+
openaiYaml: null,
|
|
301
|
+
notes: ['installed command as a skill (frontmatter added: name)'],
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
if (asString(fm.name)) {
|
|
305
|
+
return {
|
|
306
|
+
skillName,
|
|
307
|
+
content: raw,
|
|
308
|
+
openaiYaml: null,
|
|
309
|
+
notes: ['installed command as a skill (fields kept as-is)'],
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
const m = /^---(?:\r?\n)/.exec(raw);
|
|
313
|
+
return {
|
|
314
|
+
skillName,
|
|
315
|
+
content: m
|
|
316
|
+
? raw.slice(0, m[0].length) + `name: ${skillName}\n` + raw.slice(m[0].length)
|
|
317
|
+
: `---\nname: ${skillName}\n---\n\n${raw}`,
|
|
318
|
+
openaiYaml: null,
|
|
319
|
+
notes: ['installed command as a skill (fields kept; name added)'],
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
const { fm, body } = parseFrontmatter(raw);
|
|
289
323
|
const notes = [];
|
|
290
324
|
const out = { name: skillName };
|
|
291
325
|
const description = asString(fm.description);
|
package/env-requirements.json
CHANGED
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
{ "tool": "homegraph", "level": "required" },
|
|
232
232
|
{ "tool": "adb", "level": "required" }
|
|
233
233
|
],
|
|
234
|
-
"note": "Step 2: UI migration. Full mode is Node-only: a2h-utg-static (homegraph) + a2h-utg-explorer (adb, one device), then converts every static UTG node — uncaptured ones source-only. Sub-agents (resources, reviewers, conversion groups) are background sub-agents of the host session, scheduled by group_queue.mjs; no separate agent CLI is needed. opencode
|
|
234
|
+
"note": "Step 2: UI migration. Full mode is Node-only: a2h-utg-static (homegraph) + a2h-utg-explorer (adb, one device), then converts every static UTG node — uncaptured ones source-only. Sub-agents (resources, reviewers, conversion groups) are background sub-agents of the host session, scheduled by group_queue.mjs; no separate agent CLI is needed. opencode v1 needs OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true for non-blocking dispatch (opencode v2 is native; DevEco Code has DEVECO_EXPERIMENTAL_BACKGROUND_SUBAGENTS on by default, only an explicit false turns it off). Incremental mode's targeted capture (I5) runs the same explorer limited to the scope (plan.mjs --scope), so neither mode needs Python."
|
|
235
235
|
},
|
|
236
236
|
{
|
|
237
237
|
"name": "a2h-spec-generate",
|
|
@@ -444,6 +444,20 @@
|
|
|
444
444
|
],
|
|
445
445
|
"note": "Called by a2h-spec-design-pipeline (I3 baseline + wave B5). Scanner and state committer are self-contained Node .mjs scripts (no npm dependencies). homegraph optional (auto engine mode degrades to local analysis)."
|
|
446
446
|
},
|
|
447
|
+
{
|
|
448
|
+
"name": "a2h-executor",
|
|
449
|
+
"kind": "agent",
|
|
450
|
+
"dependencies": [
|
|
451
|
+
{
|
|
452
|
+
"tool": "node",
|
|
453
|
+
"level": "required",
|
|
454
|
+
"version": {
|
|
455
|
+
"min": "22.18.0"
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
],
|
|
459
|
+
"note": "Node executor a2h-app-migrate dispatches for every skill node: loads the node's skill and runs it; the skill's own requirements apply on top."
|
|
460
|
+
},
|
|
447
461
|
{
|
|
448
462
|
"name": "build-fixer",
|
|
449
463
|
"kind": "agent",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Before Step #
|
|
2
2
|
|
|
3
|
-
This platform is codebuddy (CodeBuddy; IDE and CLI share `~/.codebuddy`). The install layer already declares `tools: Agent` in
|
|
3
|
+
This platform is codebuddy (CodeBuddy; IDE and CLI share `~/.codebuddy`). The install layer already declares `tools: Agent` in the frontmatter of the node executor agent `a2h-executor` (verified: it only adds dispatch capability and narrows no other tools; only it dispatches, at depth 1 — leaf workers do not dispatch and declare nothing). Distinguish by host form:
|
|
4
4
|
|
|
5
5
|
- **CodeBuddy CLI (>= v2.187.0, verified)**: nesting depth >= 2 is supported — nodes still dispatch one sub-agent at a time per policy.dispatch (only one node sub-agent runs at any moment), and a node sub-agent can dispatch workers itself.
|
|
6
6
|
- **CodeBuddy IDE (v4.12.4, verified unsupported)**: nesting depth is 1 by default — run every skill node with primary_skill_inline and never dispatch a node sub-agent.
|
|
7
7
|
|
|
8
|
-
Do not probe the depth configuration, do not stop and wait, do not explain scheduling to the user, and do not ask about serial or parallel.
|
|
8
|
+
Do not probe the depth configuration, do not stop and wait, do not explain scheduling to the user, and do not ask about serial or parallel. On the CLI, if dispatching `a2h-executor` fails with an unknown agent type, do **not** fall back to the host's built-in general sub-agent per policy.dispatch (it has no dispatch grant, so the leaf's internal workers cannot be dispatched); run that node with primary_skill_inline instead and say so in the final report.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
# Before Step #
|
|
2
2
|
|
|
3
|
-
This platform is deveco (DevEco Code, semantically equivalent to opencode). The install layer already declares `permission: task: allow` in
|
|
3
|
+
This platform is deveco (DevEco Code, semantically equivalent to opencode). The install layer already declares `permission: task: allow` in the frontmatter of the node executor agent `a2h-executor` (verified on v0.2.6: granting the task permission on the dispatching agent is all dispatch needs; only it dispatches, at depth 1 — leaf workers do not dispatch and get no grant), and the default nesting depth is already >= 2 — no depth probing, no blocking prompt: nodes still dispatch one sub-agent at a time per policy.dispatch (only one node sub-agent runs at any moment), and a node sub-agent can dispatch workers itself; do not explain scheduling to the user, do not ask about serial or parallel. If dispatching `a2h-executor` fails with an unknown agent type, do **not** fall back to the host's built-in general sub-agent per policy.dispatch (it has no dispatch grant, so the leaf's internal workers cannot be dispatched); run that node with primary_skill_inline instead and say so in the final report.
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
# Before Step #
|
|
2
2
|
|
|
3
|
-
This platform is opencode. Before the formal migration workflow starts, run
|
|
3
|
+
This platform is opencode. The migration workflow needs a sub-agent nesting depth of >= 2, while opencode defaults to 1. Before the formal migration workflow starts, run this in the user's current working directory (the directory opencode was started from) — do not explain scheduling to the user, do not ask about serial or parallel:
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
If the depth is already >= 2, go straight on to the subsequent workflow.
|
|
5
|
+
```bash
|
|
6
|
+
node <directory of this SKILL.md>/scripts/opencode_depth.mjs
|
|
7
|
+
```
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
The script determines the opencode version itself and computes the effective depth in opencode's load order (global config, `OPENCODE_CONFIG`, `opencode.json` / `opencode.jsonc` from the git root down to the current directory, `.opencode/` directories, the system-managed directory, `OPENCODE_CONFIG_CONTENT`; later ones override earlier ones); when it is not >= 2, it declares only `"experimental": { "subagent_depth": 2 }` in the project-level configuration of the current working directory (if the file already exists, only that entry is changed). A file the script creates that sits in a git worktree and is untracked is added to `.git/info/exclude`, so the migration's commits never carry it into the user's repository. Act on `next` in the output JSON:
|
|
10
|
+
|
|
11
|
+
- `continue` (exit code 0): the depth is already satisfied, or v2 has just written the project-level configuration (hot-reloaded, effective immediately) → go straight on to the subsequent workflow without interrupting the user.
|
|
12
|
+
- `restart` (exit code 2): v1 has just written the project-level configuration and v1 does not hot-reload → relay `message` to the user (which file was written, and that they must restart the opencode session in that directory and re-enter the original command); **do not run any subsequent step this round**.
|
|
13
|
+
- `manual` (exit code 2): nothing was rewritten automatically (a configuration loaded later pins the depth below 2, the project-level file contains comments, or `OPENCODE_DISABLE_PROJECT_CONFIG` is set) → relay `message` so the user edits the place it names; **do not run any subsequent step this round**.
|
|
14
|
+
|
|
15
|
+
When the output carries `report: true` (this workflow wrote a configuration file — including a v1 rerun after the restart whose effective value comes from the file written in the previous round), the final report states `message` whatever `next` is: which file was written, whether it was added to `.git/info/exclude`, or that the file was the user's own and the change is left in the worktree.
|
|
16
|
+
|
|
17
|
+
v1 additionally requires the dispatching agent to carry the task grant — the install layer already declares `permission: task: allow` in the frontmatter of the node executor agent `a2h-executor` (only it dispatches, at depth 1; leaf workers do not dispatch and get no grant), so the user has nothing to do; v2 has no such requirement (the declaration is harmless there). If dispatching `a2h-executor` fails with an unknown agent type, do **not** fall back to the host's built-in general sub-agent per policy.dispatch (it has no dispatch grant, so the leaf's internal workers cannot be dispatched); run that node with primary_skill_inline instead and say so in the final report.
|
|
@@ -35,7 +35,7 @@ Every `run` / `continue` / `complete` / `confirm` / `rewind` stdout includes `pr
|
|
|
35
35
|
|
|
36
36
|
When `run` / `continue` returns `waiting_external`, read `wait.kind` from the current attempt's `<file_id>.request.json`:
|
|
37
37
|
|
|
38
|
-
- `skill`: execute according to `wait.dispatch`. `task_subagent` → **dispatch one sub-agent
|
|
38
|
+
- `skill`: execute according to `wait.dispatch`. `task_subagent` → **dispatch one `a2h-executor` sub-agent** (on an unknown-agent-type dispatch error, redispatch the same prompt to the built-in general sub-agent, note starting with `fallback: general agent`), which loads `wait.skill` and executes `wait.invoke` (task prompt per `policy.dispatch`); the main session does not load the leaf skill. `primary_skill_inline` → the primary session loads `wait.skill` and executes `wait.invoke` inline. A host that cannot dispatch sub-agents or has a nesting depth of 1 falls back to inline (`policy.dispatch`). The sub-agent never calls the executor / Runner; callbacks are issued only by the main session. Never substitute a shell worker for the Skill.
|
|
39
39
|
- `host_action`: the current host performs signing adoption, the final report or another host action.
|
|
40
40
|
- `config`: collect startup configuration from the user. `image_read`: strictly follow `wait.instructions` and launch a one-shot foreground sub-agent to read images. These two use the executor's `answer` callback; the others use `complete`.
|
|
41
41
|
|
|
@@ -168,7 +168,7 @@ The full text lives only in `workflow.yaml` → `policy.*`. The executor must co
|
|
|
168
168
|
1. **Single authority** — topology / invoke / gates come only from the yaml; before changing an invoke, read the leaf skill's Invocation (contract table in stage-map.md).
|
|
169
169
|
2. **scaffold_new** — `discover.arch` must be the first to touch `${HMOS}` (`create_project`'s emptiness check ignores only `.git`) → `policy.parallel_rule`.
|
|
170
170
|
3. **post_utg** — fixed serial: `ui.batch` → `enrich.spec_gen`; spec_gen always reads only `${UTG_SNAPSHOT}` → `policy.parallel_rule`.
|
|
171
|
-
4. **Dispatch** — the main session loads only this skill and orchestrates; it **loads no leaf skill**. The Runner's skill wait carries `wait.dispatch`: the 6 skill nodes (arch / utg_static / ui.batch / spec_gen / module_docs / spec_pipeline) are `task_subagent` and each run in one dispatched sub-agent (depth 1; the leaves' internal workers are at depth 2), one at a time, in fixed serial order. task prompt = the `policy.dispatch` common header + `wait.invoke`. A sub-agent must not end its turn to wait for background notifications: page-specgen gets `wait_mode=foreground` and spec_pipeline gets `WAIT_MODE=foreground`. The return value is not trusted: the main session only writes it as the outcome callback, and the Runner judges completion by the node's success checks; a reply that is not JSON → continue the same session, at most 2 times. The only exception: with `SPEC_ENGINE=spec-generate` enrich.spec_gen is `primary_skill_inline` and runs inline in the main session → `policy.dispatch`.
|
|
171
|
+
4. **Dispatch** — the main session loads only this skill and orchestrates; it **loads no leaf skill**. The Runner's skill wait carries `wait.dispatch`: the 6 skill nodes (arch / utg_static / ui.batch / spec_gen / module_docs / spec_pipeline) are `task_subagent` and each run in one dispatched `a2h-executor` sub-agent (the host's built-in general sub-agent when it has none; depth 1; the leaves' internal workers are at depth 2), one at a time, in fixed serial order. task prompt = the `policy.dispatch` common header + `wait.invoke`. A sub-agent must not end its turn to wait for background notifications: page-specgen gets `wait_mode=foreground` and spec_pipeline gets `WAIT_MODE=foreground`. The return value is not trusted: the main session only writes it as the outcome callback, and the Runner judges completion by the node's success checks; a reply that is not JSON → continue the same session, at most 2 times. The only exception: with `SPEC_ENGINE=spec-generate` enrich.spec_gen is `primary_skill_inline` and runs inline in the main session → `policy.dispatch`.
|
|
172
172
|
5. **Gates** — do not skip a node because of an `auto` confirmation (otherwise nobody writes the checkpoint); `auto` or the gate not in `INTERACTIVE_GATES` → `--write-confirmed --confirmed-by auto`; on the whitelist, stop and wait, and after the user confirms, `--write-confirmed --confirmed-by user` → `policy.human_interaction`. `review.arch` does **not** `skip_if` on `REUSE_DISCOVER_ARCH` (reusing the docs ≠ confirmation; a missing checkpoint must be rewritten / re-asked — see `policy.human_gate_protocol`). Producer nodes (`discover.arch` / `enrich.spec_gen` / `ui.batch`) must run their `before_run` **before actually executing** (`--clear-checkpoint` invalidates the corresponding gate); when reusing artifacts or skipping, clearing is **forbidden**. The production executor commits the before_run cursor item by item before returning the Skill wait; for a node with `after_run`, the executor runs it first after the host callback, then the Runner judges success.
|
|
173
173
|
6. **spec boundary** — `specs.json` is written only by enrich.spec_gen's leaf picked by `SPEC_ENGINE` (`spec-generate` → a2h-spec-generate's `publish-specs`; `page-specgen` → a2h-page-specgen's `finalize`); do not expand the leaf's internals; do not change the `${RUN_DIR}` layout → `policy.spec_order_boundary`. When semantics are incomplete, publish with gaps per the **deveco-cli contract**: the three steps use `--allow-incomplete`, specs.json records `completeness: "incomplete-known"` + `incomplete{...}`, the node still succeeds, downstream consumes as usual, and the gaps stay in specs.json incomplete; they are not written into the final report (see enrich.spec_gen's invoke); the one exception: on an incremental run, scope pages that got no SPEC (`incomplete.scopeUnmatched` / `scope.unmatched`) are the outcome of the incremental scope, not a SPEC quality gap, and logic.finalize's "Incremental scope" section (`scope_report.mjs`) lists them under "what was skipped". `page-specgen` publishes with holes the same way: `finalize` exits 0 whenever it published a `specs.json`; a partial or gate-failed run writes `incomplete{areas,pages,failedShards,...}` into the manifest and the ledger, not the final report, and downstream consumes it as usual; only "no SPEC published at all" fails the node. Switching engines = a new run.
|
|
174
174
|
|
|
@@ -37,7 +37,8 @@ policy:
|
|
|
37
37
|
# SPEC_CONCURRENCY is passed to a2h-spec-generate as concurrency= (the number of concurrent fused per-Area workers),
|
|
38
38
|
# and **must be clamped to this cap**: values above 8 become 8, non-positive integers become the default 8.
|
|
39
39
|
max_spec_generate_concurrency: 8
|
|
40
|
-
|
|
40
|
+
# The node sub-agent type; when the host has none, fall back to its built-in general sub-agent (see policy.dispatch).
|
|
41
|
+
default_task_type: a2h-executor
|
|
41
42
|
# Context length is compacted by the host. The model must not treat it as a stop condition.
|
|
42
43
|
context_budget: |
|
|
43
44
|
The model must not end the run on its own because of the context budget.
|
|
@@ -181,22 +182,31 @@ policy:
|
|
|
181
182
|
calling results back, the progress checklist and talking to the user; before_run / after_run, success checks and the ledger belong to the Runner / production executor. It **loads no** leaf skill, does not read a leaf SKILL.md, and does not expand a leaf's internal Stages / waves.
|
|
182
183
|
· Every type: skill node uses dispatch: task_subagent: one dispatched sub-agent runs the whole node:
|
|
183
184
|
discover.arch, discover.utg_static, ui.batch, enrich.spec_gen, enrich.module_docs, logic.spec_pipeline.
|
|
185
|
+
The agent type is always this plugin's a2h-executor (agents/a2h-executor.md: loads the leaf skill, runs to the node's terminal state,
|
|
186
|
+
waits in the foreground, replies only with JSON), never the host's built-in general agent, so the node level can be configured on its own
|
|
187
|
+
and the host's own agents stay untouched.
|
|
188
|
+
How to tell: dispatch a2h-executor directly (if the host prefixes plugin agents with a namespace, use the full name it lists, e.g.
|
|
189
|
+
<plugin>:a2h-executor). A dispatch error saying the agent type is unknown / does not exist is not a node failure: immediately redispatch
|
|
190
|
+
once to the host's built-in general sub-agent with the same task prompt; the Runner callback's note is "fallback: general agent; <original note>".
|
|
191
|
+
A host that silently swaps an unknown agent type for its default agent cannot be detected here and records no fallback.
|
|
192
|
+
The note is stored with the outcome in <DAG_RUN_DIR>/attempts/<file_id>.result.json (the Runner does not write it to the ledger);
|
|
193
|
+
logic.finalize collects it from there, so the final report does not rely on the primary's memory.
|
|
184
194
|
The only exception: enrich.spec_gen with SPEC_ENGINE=spec-generate is primary_skill_inline (a2h-spec-generate marks a worker done when its
|
|
185
195
|
completion notification arrives and has no foreground wait mode; inside a sub-agent it would return as soon as it ends the round).
|
|
186
196
|
· Scheduling stays serial; only one node sub-agent runs at a time:
|
|
187
197
|
discover.arch -> discover.utg_static (discover legs 1 and 2);
|
|
188
198
|
ui.batch -> review.ui_batch -> enrich.spec_gen -> enrich.module_docs; logic.spec_pipeline after adopt.
|
|
189
199
|
· Depth: node sub-agents are at depth 1; the leaves' internal workers (arch module evidence, utg_static reviewers, ui.batch conversion,
|
|
190
|
-
page-specgen group workers, spec_pipeline chunk / resolver / review) are at depth 2. The host must allow depth ≥ 2 (configuring
|
|
200
|
+
page-specgen group workers, spec_pipeline chunk / resolver / review) are at depth 2. The host must allow depth ≥ 2 (hosts that need configuring are handled by the platform adaptation layer's Before Step, e.g. opencode writes a project-level config).
|
|
191
201
|
If the primary cannot dispatch sub-agents -> that node falls back to primary_skill_inline and runs inline as before; the final report says so.
|
|
192
|
-
· Host nesting depth 1 (e.g. atomcode / trae, CodeBuddy IDE, Qoder CLI): every type: skill node runs
|
|
202
|
+
· Host nesting depth 1 (e.g. atomcode / trae / trae-cn, CodeBuddy IDE, Qoder CN CLI, Qoder international): every type: skill node runs
|
|
193
203
|
primary_skill_inline; never dispatch a node sub-agent — a node sub-agent cannot dispatch further sub-agents, so the leaf's internal workers cannot be dispatched.
|
|
194
204
|
· A sub-agent must not end its round to wait for background notifications (ending it returns to the primary with the work unfinished):
|
|
195
205
|
a2h-page-specgen gets wait_mode=foreground and a2h-spec-design-pipeline gets WAIT_MODE=foreground (block in the foreground on the waker / wait);
|
|
196
206
|
a2h-batch-ui-align (group_queue.mjs wait), a2h-utg-static (reviewers waited on in the foreground by the same protocol), arch and module_docs already wait in the foreground.
|
|
197
207
|
task prompt = the common header below + the node's whole invoke. Substitute the variables with real values in the primary first, evaluate
|
|
198
208
|
[... only when ...] and drop entries that do not apply; never hand ${...} to the sub-agent verbatim. Common header:
|
|
199
|
-
You are a node executor dispatched by a2h-app-migrate, node <id>. First load <leaf skill> with the skill tool (read its SKILL.md in full),
|
|
209
|
+
You are a node executor (a2h-executor) dispatched by a2h-app-migrate, node <id>. First load <leaf skill> with the skill tool (read its SKILL.md in full),
|
|
200
210
|
then follow the invoke below until the node reaches a terminal state.
|
|
201
211
|
· Context budget, context window, remaining tokens, a growing session or imminent compaction are not reasons to finish.
|
|
202
212
|
· Never ask the user directly. For questions the invoke marks "interactive -> needs_input", this run's INTERACTION_MODE=<value>:
|
|
@@ -213,6 +223,7 @@ policy:
|
|
|
213
223
|
a background notification is not an answer); once answered, redispatch the same node with "The user's answer to "<question>": <verbatim>" appended to the task prompt.
|
|
214
224
|
At most 3 round trips per node; after that continue on the auto default branch.
|
|
215
225
|
3) Calls back to the Runner — **never trust the return value**: the outcome is always ok:true, with the sub-agent's own ok / reason copied verbatim into note
|
|
226
|
+
(after a fallback to the general sub-agent, the note is "fallback: general agent; <original note>")
|
|
216
227
|
(executor complete -> Runner complete, see SKILL.md "Host handling of waits and callbacks"). The executor runs after_run and the Runner judges
|
|
217
228
|
completion by the node's success: success fails -> failed; the sub-agent reported ok:false but success passes -> success wins.
|
|
218
229
|
The sub-agent itself never calls the executor / Runner.
|
|
@@ -2010,6 +2021,12 @@ nodes:
|
|
|
2010
2021
|
Depth: the pipeline itself is at depth 1 (a sub-agent dispatched by migrate); the design / coding / review / conflict-resolution sub-agents it dispatches are at depth 2.
|
|
2011
2022
|
Event loop (WAIT_MODE=foreground, references/coding-loop.md "Foreground wait mode"): after B1/B2 dispatch background chunks it
|
|
2012
2023
|
does **not** end the round; it blocks in the foreground on dispatch.mjs wait and returns to step 1 of the event loop afterwards; no waker sub-agent is dispatched.
|
|
2024
|
+
Copy the wait command verbatim, one call at a time (shell timeout 600000 ms):
|
|
2025
|
+
node ${SKILLS_ROOT}/a2h-spec-design-pipeline/scripts/dispatch.mjs ${HMOS} wait --max-wait 300 --poll 5 --baseline ${HMOS}/.hometrans/dispatch/snapshots/orch.snapshot.json --event-file ${HMOS}/.hometrans/dispatch/orch.event.json
|
|
2026
|
+
It returns at the first new evidence, otherwise after about 300 s (--max-wait above 300 is clamped to 300, --poll above 30 to 30): while it runs the host cannot
|
|
2027
|
+
deliver sub-agent completion notifications, so every call must be short. Never write your own wait / poll / sleep script, never loop inside one shell call;
|
|
2028
|
+
every chunk / resolver goes through the ledger (claim → intent → confirm), and spec_pipeline_state.json is never hand-edited ahead of the ledger:
|
|
2029
|
+
wait only sees ledger units.
|
|
2013
2030
|
It returns only after the pipeline has completed all waves + the smoke gate + Finalization (outputting the final report), or at a hard stop it names.
|
|
2014
2031
|
Interaction (subject to ${INTERACTION_MODE}):
|
|
2015
2032
|
· I4 announcement: announce only, never wait (both modes; I4 is an announcement with nothing for the user to decide). Put the announcement text into
|
|
@@ -2121,6 +2138,12 @@ nodes:
|
|
|
2121
2138
|
node ${SKILLS_ROOT}/a2h-app-migrate/scripts/scope_report.mjs --hmos ${HMOS} --scope-json ${SCOPE_JSON}
|
|
2122
2139
|
--specs-json ${SPECS_JSON} --android ${ANDROID} --utg <the same page graph> --work ${WORK} --lang en
|
|
2123
2140
|
It never fails this node; a missing input only drops its part.
|
|
2141
|
+
Node dispatch (write it after everything else in step 4 — the ledger line and the "Incremental scope" section — as the
|
|
2142
|
+
report's last line; never inside the scope_report output): look only at this control directory <DAG_RUN_DIR> (after a resume that switched control directories, the old
|
|
2143
|
+
directory's records do not count). For each skill node take the attempt in attempts/*.attempt.json with the highest index whose
|
|
2144
|
+
status is done or failed, and read its result.json: if evidence.host.note (details.note when ok:false) starts with
|
|
2145
|
+
"fallback: general agent", that node fell back. When any node fell back, end the report with one line "These stages did not use a2h-executor and fell back to the host's built-in general sub-agent:
|
|
2146
|
+
<each stage's user_facing.name>"; write nothing when there are none.
|
|
2124
2147
|
5. After writing the report, return only ok|fail and the report path; do not append your own logic.finalize terminal record or run_end.
|
|
2125
2148
|
The Runner verifies the report and commits the only logic.finalize done, then enforces full-DAG completion and writes the single run_end.
|
|
2126
2149
|
If an assertion exits non-zero or evidence is incomplete, the Runner blocks certification; the host must not present the stage report as a completion certificate.
|