@namewta/skills-hub 0.0.7 → 0.1.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/README.md +18 -5
- package/THIRD_PARTY_NOTICES.md +3 -0
- package/cli.mjs +56 -0
- package/install.mjs +9 -2
- package/licenses/herdr-Apache-2.0.txt +201 -0
- package/package.json +8 -1
- package/skills/system/system-herdr/SKILL.md +224 -0
package/README.md
CHANGED
|
@@ -9,12 +9,22 @@
|
|
|
9
9
|
需要 Node.js 22.14+。npm 包名为 `@namewta/skills-hub`,命令名为 `skills-hub`。可直接通过 npm 使用,无需预先克隆:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
|
|
13
|
-
npx @namewta/skills-hub@0.0
|
|
14
|
-
|
|
12
|
+
# 直接交互多选领域或技能
|
|
13
|
+
npx @namewta/skills-hub@0.1.0
|
|
14
|
+
|
|
15
|
+
# 或全局安装后运行
|
|
16
|
+
npm install -g @namewta/skills-hub@0.1.0
|
|
17
|
+
skills-hub
|
|
18
|
+
|
|
19
|
+
# 原有命令行安装方式继续保留
|
|
20
|
+
npx @namewta/skills-hub@0.1.0 list
|
|
21
|
+
npx @namewta/skills-hub@0.1.0 install --domain dev
|
|
22
|
+
npx @namewta/skills-hub@0.1.0 install --skill dev-grill dev-spec system-proxy
|
|
15
23
|
```
|
|
16
24
|
|
|
17
|
-
在目标项目根目录执行,按领域或技能选择;npm
|
|
25
|
+
在目标项目根目录执行,按领域或技能选择;npm 下载包不会自动安装技能。终端中不带参数运行 `skills-hub` 或 `skills-hub install` 会进入中文交互:空格多选,回车确认,Ctrl+C 取消。支持 `skills-hub install --dry-run` 交互预览;内容冲突需检查后显式运行 `skills-hub install --replace`,不会自动覆盖。非交互环境继续要求明确参数,不会等待输入。
|
|
26
|
+
|
|
27
|
+
交互界面使用 `@clack/prompts`、`picocolors`、`string-width` 和 `wrap-ansi`;npm 自动安装这些依赖。源码的显式参数安装器仍仅依赖 Node.js 标准库、可离线运行;源码交互模式先运行 `npm ci`。也可以克隆源码后离线运行安装器:
|
|
18
28
|
|
|
19
29
|
```bash
|
|
20
30
|
git clone https://github.com/NAMEWTA/skills-hub.git
|
|
@@ -54,7 +64,7 @@ node C:\tools\skills-hub\install.mjs install --domain dev
|
|
|
54
64
|
|
|
55
65
|
### 从 skills-wta 迁移
|
|
56
66
|
|
|
57
|
-
从旧包 `skills-wta@0.0.1` 切换到 `@namewta/skills-hub@0.0.
|
|
67
|
+
从旧包 `skills-wta@0.0.1` 切换到 `@namewta/skills-hub@0.0.8`,继续在同一项目运行上面的安装命令。新旧版本使用相同的 `.agents/skills/<技能名>/`,技能内容相同则不变,有差异时先检查再用 `--replace`;新的开发记录写入 `.agents/dev/`,系统维护记录写入 `.agents/system/`;已有项目记录按迁移说明处理,安装器不会自动搬迁。新版补齐 `.agents/skills-hub-licenses/`,新备份使用 `.agents/.skills-hub-backups/`;旧许可和备份保留。旧 GitHub 标签 `v0.0.1` 保留为原包历史;本次从已发布的 scoped npm `0.0.7` 递增 `+0.0.1` 发布 `0.0.8`,使用 `v0.0.8` 标签,不覆盖历史版本。详见[迁移说明](docs/installation.md#从-skills-wta-迁移)。
|
|
58
68
|
|
|
59
69
|
## dev:完整开发流程
|
|
60
70
|
|
|
@@ -134,6 +144,7 @@ node C:\tools\skills-hub\install.mjs install --domain dev
|
|
|
134
144
|
| [system-cleanup](skills/system/system-cleanup/SKILL.md) | 按实际占用选择可清理对象,执行后量测并验证 |
|
|
135
145
|
| [system-proxy](skills/system/system-proxy/SKILL.md) | 排查和配置代理、DNS、客户端与应用生效范围 |
|
|
136
146
|
| [system-config](skills/system/system-config/SKILL.md) | 调整已指定的软件或系统配置,保留备份并验证真实生效 |
|
|
147
|
+
| [system-herdr](skills/system/system-herdr/SKILL.md) | 在 Herdr 内查看与控制窗格、标签页、工作区、命令及 agent;仅在用户明确要求使用 Herdr 时启用 |
|
|
137
148
|
|
|
138
149
|
系统技能不会把“清缓存”扩展为删除业务数据,也不会把“应用代理”扩展为修改整机路由。主机文档按需放在 `.agents/system/<主机标识>/`;密码与订阅秘密只记录安全引用。
|
|
139
150
|
|
|
@@ -206,6 +217,8 @@ node scripts/install-hooks.mjs
|
|
|
206
217
|
| D · 3 份 | [Elaya AI Design Skills](https://github.com/elayadesign/ai-design-skills/tree/456d9e0d3e2d84c748bb143c6ca3d90c45e16213),完整落地页、Figma 设计技能与说明 | `456d9e0d3e2d84c748bb143c6ca3d90c45e16213` | [D 组索引](materials/README.md#d-组) |
|
|
207
218
|
| E · 8 份、F · 19 份 | [Speculo](https://github.com/NAMEWTA/Speculo/tree/9199c3bd0cf983c131efbc6340e44ac8b83a583d),所参考的知识、部署及系统维护资料;仅按需融合,未移植状态引擎 | `9199c3bd0cf983c131efbc6340e44ac8b83a583d` | [E 组索引](materials/README.md#e-组)、[F 组索引](materials/README.md#f-组) |
|
|
208
219
|
|
|
220
|
+
G 组新增 [Herdr 上游技能](https://github.com/herdrdev/herdr/blob/master/skills/herdr/SKILL.md),固定提交 `ee5bfb5041bb3e4a49d591c72308aae3c81ecdde`,固定文件见[该修订原文](https://github.com/herdrdev/herdr/blob/ee5bfb5041bb3e4a49d591c72308aae3c81ecdde/skills/herdr/SKILL.md),完整原件与中文译文见 [G 组索引](materials/README.md#g-组)。`system-herdr` 直接复制自本地 `/home/wta/projects/huhu/.agents/skills/herdr/SKILL.md`,仅更名并添加修改说明;保留本地追加的 Claude Code、Codex、Pi 启动示例,不将这些示例冒称上游内容。逐文件 Git blob、摘要及适配关系见清单 `g001`。Herdr 在运行内容中作为实际操作工具名称保留,不作为来源署名或外部文档依赖。
|
|
221
|
+
|
|
209
222
|
感谢这些内容的作者与贡献者。PR 视觉说明方法还通过上述资料引用了 [Dex Horthy](https://github.com/dexhorthy) 与 [HumanLayer show-me](https://github.com/humanlayer/humanlayer) 的贡献,对应 Apache 2.0 与 NOTICE 已一并附带。B 组完整镜像所固定的 `pstack/` 目录,逐文件与该提交的目录树核对,无遗漏;其余组按表中范围收录。运行包按主题整合为独立中文技能,原品牌图片、原插件配置、自动联网安装器和复杂计划准入工具仅保留作对照,不成为使用条件。
|
|
210
223
|
|
|
211
224
|
技能组织方式还参考 [Rethinking skills and prompts for GPT-6 Astra](https://developers.openai.com/blog/rethinking-skills-and-prompts-for-gpt-6-astra) 与 [Harness engineering](https://openai.com/index/harness-engineering/)。文章的组织原则已转化为本项目的本地编写与知识管理说明;未转载文章全文。代理配置字段的理解另参考 [MetaCubeX 文档](https://github.com/MetaCubeX/Meta-Docs/tree/2a6ba6b04a9eecdbe5c88c4e4a09776659c0878b),运行说明已写在技能本地,不要求使用者访问该文档。
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
| 权利人 | 许可原文 | 本项目使用范围 |
|
|
6
6
|
| --- | --- | --- |
|
|
7
7
|
| NAMEWTA | [项目 MIT](licenses/PROJECT-LICENSE.txt) | 本项目原创说明、整合与程序 |
|
|
8
|
+
| Herdr 贡献者 | [Apache 2.0](licenses/herdr-Apache-2.0.txt) | Herdr 技能完整原件、中文译文与 `system-herdr` 运行适配;已更名并保留本地追加的启动示例 |
|
|
8
9
|
| Copyright (c) 2026 DeepSeek | [MIT](licenses/deepseek-harness-MIT.txt) | 知识、归档、写作方法与笔记实例的中文译文及适配 |
|
|
9
10
|
| Copyright (c) 2026 Matt Pocock | [MIT](licenses/mattpocock-skills-MIT.txt) | 需求、架构、实施、诊断、审查与写作资料的中文译文及适配 |
|
|
10
11
|
| Copyright (c) 2026 Lauren Tan | [MIT](licenses/pstack-MIT.txt) | 限 pstack 目录内的方法、操作规程与实例 |
|
|
@@ -15,6 +16,8 @@
|
|
|
15
16
|
|
|
16
17
|
来源项目、固定修订和贡献者致谢集中见 [README](README.md#致谢与许可)。所有纳入对照的文件可在 [本地资料索引](materials/README.md) 中找到,原件与中文底稿均保留,不需要访问来源仓库才能核对。
|
|
17
18
|
|
|
19
|
+
Herdr 许可原文固定于提交 `ee5bfb5041bb3e4a49d591c72308aae3c81ecdde` 的根目录 `LICENSE`,Git blob 为 `261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64`;该修订无上游 `NOTICE` 文件。本次仅收录技能文档,不收录其程序或 vendor 组件。
|
|
20
|
+
|
|
18
21
|
许可原文保持原语言和原始版权声明,中文技能正文不能替代法律原文。对照资料中保留的署名和链接属于历史原件内容,不是运行时外部依赖。
|
|
19
22
|
|
|
20
23
|
仅参考写作或技术原理、未取得全文转载许可的文章不作全文转载。本项目提供自己的本地说明;来源致谢不表示取得来源仓库未授权目录的复制许可。
|
package/cli.mjs
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as prompts from '@clack/prompts';
|
|
2
|
+
import pc from 'picocolors';
|
|
3
|
+
import stringWidth from 'string-width';
|
|
4
|
+
import wrapAnsi from 'wrap-ansi';
|
|
5
|
+
import { createInstaller, select, main } from './install.mjs';
|
|
6
|
+
|
|
7
|
+
export function formatSummary(names, columns = process.stdout.columns ?? 80) {
|
|
8
|
+
const width = Math.max(20, Math.min(columns - 8, 100));
|
|
9
|
+
const label = '已选择';
|
|
10
|
+
return wrapAnsi(`${pc.bold(label)}${' '.repeat(Math.max(1, 8 - stringWidth(label)))}${names.join('、')}`, width, { hard: true });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export async function interactive({ argv = [], project = process.cwd(), ui = prompts } = {}) {
|
|
14
|
+
if (argv.some(value => !['install', '--replace', '--dry-run'].includes(value))) {
|
|
15
|
+
throw new Error('交互安装只接受 install、--replace 和 --dry-run。');
|
|
16
|
+
}
|
|
17
|
+
const ask = async promise => {
|
|
18
|
+
const value = await promise;
|
|
19
|
+
if (ui.isCancel(value)) { ui.cancel('已取消,未修改文件。'); throw new Cancelled(); }
|
|
20
|
+
return value;
|
|
21
|
+
};
|
|
22
|
+
try {
|
|
23
|
+
ui.intro(pc.cyan('skills-hub · 按需安装中文技能'));
|
|
24
|
+
ui.note(project, '目标项目(技能写入 .agents/skills/)');
|
|
25
|
+
const skills = createInstaller().catalog();
|
|
26
|
+
const mode = await ask(ui.select({ message: '如何选择?', options: [
|
|
27
|
+
{ value: 'domain', label: '按领域安装' },
|
|
28
|
+
{ value: 'skill', label: '选择特定技能' },
|
|
29
|
+
{ value: 'all', label: '安装全部技能' },
|
|
30
|
+
] }));
|
|
31
|
+
let domains = [], names = [];
|
|
32
|
+
if (mode === 'domain') domains = await ask(ui.multiselect({ message: '选择领域(空格勾选,回车继续)', required: true,
|
|
33
|
+
options: [...new Set(skills.map(skill => skill.domain))].map(domain => ({ value: domain, label: domain, hint: `${skills.filter(skill => skill.domain === domain).length} 个技能` })) }));
|
|
34
|
+
if (mode === 'skill') names = await ask(ui.multiselect({ message: '选择技能(空格勾选,回车继续)', required: true,
|
|
35
|
+
options: skills.map(skill => ({ value: skill.name, label: skill.name, hint: skill.domain })) }));
|
|
36
|
+
const selected = select(skills, domains, names, mode === 'all');
|
|
37
|
+
ui.note(formatSummary(selected.map(skill => skill.name)), `${selected.length} 个技能`);
|
|
38
|
+
const dryRun = argv.includes('--dry-run');
|
|
39
|
+
if (!await ask(ui.confirm({ message: dryRun ? '检查安装计划?(不写入文件)' : '安装以上技能?', initialValue: true }))) {
|
|
40
|
+
ui.cancel('已取消,未修改文件。'); return 0;
|
|
41
|
+
}
|
|
42
|
+
const command = ['install', '--skill', ...selected.map(skill => skill.name)];
|
|
43
|
+
if (argv.includes('--replace')) command.push('--replace');
|
|
44
|
+
if (dryRun) command.push('--dry-run');
|
|
45
|
+
const spinner = ui.spinner();
|
|
46
|
+
const output = [];
|
|
47
|
+
spinner.start(dryRun ? '正在检查计划' : '正在安装');
|
|
48
|
+
let code;
|
|
49
|
+
try { code = main(command, { project, stdout: line => output.push(line), stderr: line => output.push(pc.red(line)) }); }
|
|
50
|
+
finally { spinner.stop('检查与文件操作结束'); }
|
|
51
|
+
ui.note(output.join('\n'), '结果');
|
|
52
|
+
ui.outro(code === 0 ? pc.green(dryRun ? '预览完成,未写入文件。' : '安装完成。') : pc.red('安装失败;请检查以上错误,内容冲突需核对后显式使用 --replace。'));
|
|
53
|
+
return code;
|
|
54
|
+
} catch (error) { if (error instanceof Cancelled) return 0; throw error; }
|
|
55
|
+
}
|
|
56
|
+
class Cancelled extends Error {}
|
package/install.mjs
CHANGED
|
@@ -9,7 +9,7 @@ export const licenseBundleFiles = Object.freeze([
|
|
|
9
9
|
'PROJECT-LICENSE.txt', 'THIRD_PARTY_NOTICES.txt', 'deepseek-harness-MIT.txt',
|
|
10
10
|
'mattpocock-skills-MIT.txt', 'pstack-MIT.txt', 'ai-design-skills-MIT.txt',
|
|
11
11
|
'Speculo-MIT.txt', 'taste-skill-MIT.txt', 'humanlayer-Apache-2.0.txt',
|
|
12
|
-
'humanlayer-NOTICE.txt',
|
|
12
|
+
'humanlayer-NOTICE.txt', 'herdr-Apache-2.0.txt',
|
|
13
13
|
]);
|
|
14
14
|
const slug = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
15
15
|
export const frontmatterPattern = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/;
|
|
@@ -293,4 +293,11 @@ export function main(argv = process.argv.slice(2), { repository = repositoryRoot
|
|
|
293
293
|
} catch (error) { stderr(`Error: ${error.message}`); return 1; }
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
if (isMain(import.meta.url))
|
|
296
|
+
if (isMain(import.meta.url)) {
|
|
297
|
+
const argv = process.argv.slice(2);
|
|
298
|
+
const interactiveRequest = argv.length === 0 || (argv[0] === 'install' && argv.slice(1).every(value => ['--replace', '--dry-run'].includes(value)));
|
|
299
|
+
if (interactiveRequest && process.stdin.isTTY && process.stdout.isTTY) {
|
|
300
|
+
try { process.exitCode = await (await import('./cli.mjs')).interactive({ argv }); }
|
|
301
|
+
catch (error) { console.error(`Error: ${error.message}`); process.exitCode = 1; }
|
|
302
|
+
} else process.exitCode = main(argv);
|
|
303
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@namewta/skills-hub",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "独立中文 Agent Skills:按领域安装,覆盖开发交付、项目知识与系统维护。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"install.mjs",
|
|
11
|
+
"cli.mjs",
|
|
11
12
|
"skills/",
|
|
12
13
|
"licenses/",
|
|
13
14
|
"LICENSE",
|
|
@@ -46,5 +47,11 @@
|
|
|
46
47
|
"publishConfig": {
|
|
47
48
|
"access": "public",
|
|
48
49
|
"registry": "https://registry.npmjs.org/"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@clack/prompts": "1.8.1",
|
|
53
|
+
"picocolors": "1.1.1",
|
|
54
|
+
"string-width": "8.3.0",
|
|
55
|
+
"wrap-ansi": "10.0.2"
|
|
49
56
|
}
|
|
50
57
|
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: system-herdr
|
|
3
|
+
description: "控制 Herdr,一个面向编程 agent 的终端多路复用器。仅当用户明确提到 Herdr,或要求使用 Herdr 查看或控制窗格、标签页、工作区、命令或其他 agent 时使用。不要仅因任务可能受益于后台终端、委派或并行工作就使用。要求 HERDR_ENV=1。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Herdr
|
|
7
|
+
|
|
8
|
+
Herdr 将终端组织为工作区、标签页和窗格,识别窗格中运行的编程 agent,并通过 `herdr` CLI 提供当前会话的访问入口。
|
|
9
|
+
|
|
10
|
+
执行任何控制命令前,先确认当前 agent 正在 Herdr 管理的窗格内运行:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
test "${HERDR_ENV:-}" = 1
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
如果检查失败,说明当前不在 Herdr 内运行,然后停止。不要从 Herdr 外部查看或控制当前聚焦的 Herdr 会话。
|
|
17
|
+
|
|
18
|
+
检查通过后,`PATH` 中的 `herdr` 程序会与当前会话通信。使用它查看相邻工作、创建终端布局、启动 agent 和命令、读取输出,以及等待状态变化。
|
|
19
|
+
|
|
20
|
+
## 了解当前 CLI
|
|
21
|
+
|
|
22
|
+
命令语法以已安装的程序为准。先运行:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
herdr --help
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
然后运行不带子命令的相关命令组,查看其说明:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
herdr agent
|
|
32
|
+
herdr pane
|
|
33
|
+
herdr workspace
|
|
34
|
+
herdr tab
|
|
35
|
+
herdr worktree
|
|
36
|
+
herdr terminal
|
|
37
|
+
herdr notification
|
|
38
|
+
herdr integration
|
|
39
|
+
herdr session
|
|
40
|
+
herdr machine
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
不要用不带参数的 `herdr` 探索命令,它会启动或连接 TUI。不要通过省略参数来试探会修改状态的嵌套命令。`herdr workspace create` 等命令使用默认值也有效,会实际执行。
|
|
44
|
+
|
|
45
|
+
大多数控制命令返回 JSON。从响应中读取标识符和状态,不要猜测。
|
|
46
|
+
|
|
47
|
+
## 理解布局、窗格和 agent
|
|
48
|
+
|
|
49
|
+
选择与任务匹配的操作对象:
|
|
50
|
+
|
|
51
|
+
- 工作区、标签页和窗格的拓扑关系用于组织终端位置。
|
|
52
|
+
- 窗格命令控制原始终端、shell、测试、服务、输入和输出。
|
|
53
|
+
- agent 命令控制当前占用窗格、且已被识别的编程 agent。
|
|
54
|
+
|
|
55
|
+
无论是否包含 agent,窗格都独立存在。`agent start` 要求已有可用的 shell 窗格,绝不会创建、拆分或移动布局。普通进程使用窗格命令。需要 Herdr 验证 agent 身份或解释 `idle`、`working`、`blocked`、`done` 和 `unknown` 生命周期状态时,使用 agent 命令。
|
|
56
|
+
|
|
57
|
+
agent 命令接受唯一的在线 agent 名称,或当前承载该 agent 的窗格 ID。不接受终端 ID 或单独的 agent 类型标签。名称必须匹配 `[a-z][a-z0-9_-]{0,31}`,并且在在线 agent 中唯一。名称跟随当前窗格中的 agent,在该 agent 退出、被释放或被替换时清除。用 Ctrl+Z 挂起 agent 后运行非 agent 命令,只要原进程仍存活,其身份就会保留。如果另一个被识别的 agent 接管窗格,原身份不会继续保留。身份保留不代表 agent 位于前台,发送输入前先检查窗格。
|
|
58
|
+
|
|
59
|
+
`idle` 和 `done` 通常表示 agent 可以接收输入,但都不保证 Herdr 识别出了陌生的审批对话框,也不保证身份被保留的 agent 位于前台。CLI/API 根据服务端记录的已查看状态区分二者。显式聚焦命令会将目标标为已查看,读取操作不会。每个 TUI 客户端独立记录已查看的完成结果,因此其 Done 标记可能与 CLI 或其他客户端不同。Antigravity 和 Grok 可能在后台任务或子 agent 仍运行时处于 idle,因此等待状态稳定不能证明这些任务已结束。`blocked` 表示 Herdr 识别到了审批或提问界面。`unknown` 表示 agent 存在,但 Herdr 无法可靠分类,不能据此判定已完成。
|
|
60
|
+
|
|
61
|
+
## 使用 ID 和调用方上下文
|
|
62
|
+
|
|
63
|
+
公开 ID 是不应解析其内部含义的稳定标识:
|
|
64
|
+
|
|
65
|
+
- 工作区:`w1`
|
|
66
|
+
- 标签页:`w1:t1`
|
|
67
|
+
- 窗格:`w1:p1`
|
|
68
|
+
|
|
69
|
+
已关闭的标签页和窗格 ID 不会复用。窗格移动到其他工作区后,会获得带有新工作区限定的新窗格 ID。执行 `pane move` 后,继续使用 `.result.move_result.pane.pane_id` 或在线 agent 名称。旧值通过 `.result.move_result.previous_pane_id` 返回。只有被移动进程继承的调用方上下文仍能解析该旧 ID,不要将它用作通用 agent 目标。
|
|
70
|
+
|
|
71
|
+
Herdr 会向每个受管理的窗格注入调用方上下文:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
printf '%s\n' "$HERDR_WORKSPACE_ID" "$HERDR_TAB_ID" "$HERDR_PANE_ID"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
窗格命令应作用于调用方窗格时,优先使用 `--current`。`pane split` 省略目标时,如果存在 `HERDR_PANE_ID`,则使用调用方窗格,否则使用当前聚焦的窗格。其他命令可能使用 UI 中聚焦的窗格,而该窗格可能属于用户或其他客户端。
|
|
78
|
+
|
|
79
|
+
使用以下命令查看实时状态:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
herdr workspace list
|
|
83
|
+
herdr tab list --workspace "$HERDR_WORKSPACE_ID"
|
|
84
|
+
herdr pane current --current
|
|
85
|
+
herdr pane list --workspace "$HERDR_WORKSPACE_ID"
|
|
86
|
+
herdr agent list
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
创建操作的响应会提供后续应使用的 ID。`workspace create` 返回 `.result.workspace`、`.result.tab` 和 `.result.root_pane`。`tab create` 返回 `.result.tab` 和 `.result.root_pane`。`pane split` 通过 `.result.pane` 返回新窗格。
|
|
90
|
+
|
|
91
|
+
ID 和在线 agent 名称的作用域限于单个服务端。两个已保存的 SSH 机器都可能有 `w1:p1` 或名为 `reviewer` 的 agent。在 TUI 中选择机器不会改变窗格内命令的目标。不带 `--machine` 时,命令仍使用继承的会话和套接字上下文。
|
|
92
|
+
|
|
93
|
+
要控制已保存的 SSH 机器,在查看状态和后续每条命令中都使用相同的全局前缀:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
herdr --machine <label-or-id> agent list
|
|
97
|
+
herdr --machine <label-or-id> pane list
|
|
98
|
+
herdr --machine <label-or-id> agent prompt <remote-agent-name> "Reply with your current status." --wait --timeout 120000
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
选择器必须是已启用的已保存配置 ID,或区分大小写的唯一标签,不能是任意 SSH 主机名。命令使用该配置的远程会话,无需打开 TUI。不要将 `--machine` 与 `--session` 或 `--remote` 混用。先在目标机器上查询 ID,继承的本地 ID 和 `--current` 不能用于标识远程窗格。
|
|
102
|
+
|
|
103
|
+
两端安装都必须支持机器 API 转发,且远程服务端必须已运行并与 API 兼容。转发绝不会安装、启动或重启服务端,也绝不会回退到本地。不会转发本地配置、会话管理、安装命令和交互式连接。远程 worktree 路径必须是绝对路径、`~` 或以 `~/` 开头,插件链接路径必须是绝对路径。连接失败不能证明修改操作未生效,重试前先检查远程状态。
|
|
104
|
+
|
|
105
|
+
`herdr machine list` 列出已保存的连接配置,而不是跨机器的窗格清单。脚本中加上 `--json`。仅在用户要求时添加、删除、启用或禁用配置。删除配置会断开客户端连接,但不会停止远程会话。交互式 `machine add` 会发现正在运行的远程会话,并可能让用户选择。非交互式配置使用远程默认会话,除非显式提供 `--remote-session`。使用 `herdr machine status [<label-or-id>] --json` 诊断连接失败的机器。`herdr machine reconnect` 需要用户在自己的终端中完成 SSH 认证,不要代为运行。配置流程在停止不兼容的服务端前会询问,默认选择 No。未经用户同意,不要批准替换。实验性交接功能不属于 `machine add`。
|
|
106
|
+
|
|
107
|
+
## 启动和协调 agent
|
|
108
|
+
|
|
109
|
+
默认使用当前标签页中的相邻窗格和当前工作目录。除非用户明确要求相应拓扑或位置,否则不要创建工作区、标签页、worktree,也不要换用其他工作目录。
|
|
110
|
+
|
|
111
|
+
遵循用户指定的拆分方向。如果未指定,先检查调用方窗格:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
herdr pane layout --pane "$HERDR_PANE_ID"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
宽窗格向右拆分,窄窗格或高窗格向下拆分。避免连续同方向拆分,造成过窄的列或过矮的行。将用户焦点保留在调用方窗格,并显式保留调用方工作目录:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
herdr pane split --current --direction right --cwd "$PWD" --no-focus
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
适当时将 `right` 替换为 `down`。从 `.result.pane.pane_id` 读取新窗格 ID。
|
|
124
|
+
|
|
125
|
+
可用的 shell 窗格必须停在交互式提示符,shell 自身位于前台,且没有前台命令、编辑器或 agent 正在运行。在该窗格中启动受支持的 agent,并使用有意义的唯一名称:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
herdr agent start reviewer --kind codex --pane <returned-pane-id>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
使用用户要求的类型。运行 `herdr agent` 查看当前安装支持的类型和选项。agent 原生参数只能放在 `--` 之后:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
herdr agent start reviewer --kind codex --pane <returned-pane-id> -- <agent-args...>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
只有 Herdr 在同一窗格内检测到预期 agent,且认定其已准备好接收交互式输入后,`agent start` 才会成功返回。如果 agent 在启动期间受阻,命令立即返回 `agent_not_ready`,但保留名称,供 `agent read` 和 `agent send-keys` 使用。等待 agent 进入 idle 后再发送提示。启动超时默认为 30 秒。
|
|
138
|
+
|
|
139
|
+
通过 agent 命令提交工作:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
herdr agent prompt reviewer "Review the current diff and report only actionable findings." --wait --timeout 120000
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
`agent prompt` 遵循窗格当前的括号粘贴模式,将文本和编码后的 Enter 作为一次有序提交发送。只有两者都写入后才报告提交成功,但这本身不能证明 agent 开始了新一轮工作。对于 Windows 上的 Codex,Herdr 会在 Enter 前发送粘贴边界,使提交不依赖提示长度。如果 agent 已停在审批或提问对话框,命令会在发送任何输入前返回 `agent_blocked`。检查受阻界面,回答前先询问用户。普通 agent 工作使用 `--wait` 即可,它会等待首次稳定的 `idle`、`done` 或 `blocked` 状态。不要用 `--until` 重复这些默认值。
|
|
146
|
+
|
|
147
|
+
使用 `--wait` 时,从非 working 状态发送的提示必须产生可观察的 `working` 或 `blocked` 活动。提交后,Herdr 最多等待五秒来观察此类活动,无关的 `idle`、`done` 或会话变化不能满足此条件。未观察到活动时返回 `agent_prompt_stalled`,如果调用方超时先到则返回 `timeout`。调用方超时包含提交耗时。未设置超时时,在观察到活动后会无限等待状态稳定。此等待跟踪的是生命周期状态,而不是某一轮工作。如果 agent 已在工作,当前轮完成就可能满足等待条件。
|
|
148
|
+
|
|
149
|
+
仅在针对特定状态的流程中使用 `--until`,例如等待已运行的 agent 请求输入:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
herdr agent wait reviewer --until blocked --timeout 120000
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
不带 `--until` 时,独立的 `agent wait` 与 `agent prompt --wait` 使用相同的默认稳定状态。
|
|
156
|
+
|
|
157
|
+
使用逻辑按键控制 agent 的交互界面:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
herdr agent send-keys reviewer esc
|
|
161
|
+
herdr agent send-keys reviewer ctrl+c
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Herdr 在写入任何字节前会验证全部按键。通过已解析到的 agent 读取结果:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
herdr agent get reviewer
|
|
168
|
+
herdr agent read reviewer --source recent-unwrapped --lines 120
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
如果等待失败或返回 `blocked`,先检查 `agent get` 和 `agent read`,再决定发送什么输入。超时或停滞响应不能证明提示未送达,不要盲目重复提交。只有确实需要原始终端控制时,才使用窗格命令。
|
|
172
|
+
|
|
173
|
+
## 在其他窗格运行普通命令
|
|
174
|
+
|
|
175
|
+
按相同的几何规则创建相邻窗格,保留调用方工作目录,且不改变用户焦点:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
herdr pane split --current --direction right --cwd "$PWD" --no-focus
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
从 `.result.pane.pane_id` 读取新窗格 ID,然后运行并检查命令:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
herdr pane run <returned-pane-id> "just test"
|
|
185
|
+
herdr pane wait-output <returned-pane-id> --match "test result" --timeout 120000
|
|
186
|
+
herdr pane read <returned-pane-id> --source recent-unwrapped --lines 120
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
`pane run` 将命令文本和 Enter 一起排入队列。成功仅表示提交已被接纳,不代表命令已经执行。在 macOS 上,如果命令超过终端当前的规范模式行输入上限,`pane run` 和 `agent start` 会在排队前拒绝该命令。等待交互式 shell 提示符后再重试。此检查仅覆盖本次提交,不涵盖先前未完成的输入行或之后的终端模式变化。`pane wait-output` 会立即搜索所选快照,因此已存在的输出也可能匹配。`--match <text>` 用于匹配字面子串,`--regex <pattern>` 用于 Rust 正则表达式。省略 `--timeout` 时可以无限等待。
|
|
190
|
+
|
|
191
|
+
根据任务选择读取来源:
|
|
192
|
+
|
|
193
|
+
- `visible`:当前渲染的可视区域。
|
|
194
|
+
- `recent`:最近渲染的输出,包含软换行。
|
|
195
|
+
- `recent-unwrapped`:合并软换行后的最近输出,日志和对话记录优先使用它。
|
|
196
|
+
- `detection`:用于 agent 检测的底部缓冲区纯文本快照。
|
|
197
|
+
|
|
198
|
+
颜色和终端样式属于证据时使用 `--format ansi`,否则使用文本。
|
|
199
|
+
|
|
200
|
+
`--lines` 请求 Herdr 从窗格可用屏幕和宿主回滚缓冲区中读取更多行。备用屏幕的行不会进入普通宿主回滚缓冲区。对于受支持且处于 idle 的 agent,Herdr 可以收集应用自身的历史记录,并在之后恢复可视区域,但并非每个应用或响应都能以此方式恢复。
|
|
201
|
+
|
|
202
|
+
如果扩大最近输出的读取范围后仍看不到已完成的响应,让 agent 将响应写为临时目录中的 Markdown 文件,并只回复文件路径,然后在同一机器上读取该文件。仅将此方式作为后备方案,不要在初始提示中要求文件输出。
|
|
203
|
+
|
|
204
|
+
## 安全与协调规则
|
|
205
|
+
|
|
206
|
+
- 后台工作使用 `--no-focus`,除非用户要求切换上下文。
|
|
207
|
+
- 使用 `--current`、显式窗格 ID 或唯一 agent 名称。不要依赖其他客户端聚焦的窗格。
|
|
208
|
+
- 从 JSON 响应中解析 ID。不要从侧栏顺序或示例推导 ID。
|
|
209
|
+
- 未经用户明确要求,不要关闭并非由你创建的工作区、标签页、窗格或会话。普通 CLI/API 关闭操作不会继承 TUI 的最后一个窗格确认机制。`workspace close --group` 会关闭主工作区及其关联的 worktree 工作区,绝不能仅为绕过 `workspace_group_close_required` 而添加它。
|
|
210
|
+
- 仅在用户已验证仓库后使用 `--trust-repository`。它授予单次请求的 Git 信任,不是 worktree 命令失败后的常规重试手段。
|
|
211
|
+
- 更新后客户端与服务端版本可能不同。依赖新服务端功能前先检查 `herdr status`。方法缺失不代表可以停止或升级服务端。
|
|
212
|
+
- 除非用户明确打算停止服务端及其窗格进程,否则绝不要从活动会话中运行 `herdr server stop`。
|
|
213
|
+
- 绝不要杀死 Herdr 主进程。需要隔离服务端的实验应使用具名测试会话。
|
|
214
|
+
- CLI 服务端错误以 JSON 输出到 stderr,退出状态为 1。CLI 语法错误退出状态为 2。
|
|
215
|
+
|
|
216
|
+
## Claude Code & Codex & Pi 的默认启动方式命令
|
|
217
|
+
|
|
218
|
+
在已有可用 shell 窗格中启动,`<name>` 使用唯一名称,`<returned-pane-id>` 使用实际返回的窗格 ID:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
herdr agent start <name> --kind claude --pane <returned-pane-id> -- --dangerously-skip-permissions
|
|
222
|
+
herdr agent start <name> --kind codex --pane <returned-pane-id> -- --no-daemon --dangerously-bypass-approvals-and-sandbox
|
|
223
|
+
herdr agent start <name> --kind pi --pane <returned-pane-id>
|
|
224
|
+
```
|