@namewta/skills-hub 0.1.29 → 0.1.30
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 +23 -4
- package/THIRD_PARTY_NOTICES.md +2 -0
- package/cli.mjs +5 -1
- package/install.mjs +172 -39
- package/licenses/nanobot-MIT.txt +21 -0
- package/package.json +2 -1
- package/scripts/init-persistence.mjs +26 -6
- package/scripts/persistence/home.md +11 -0
- package/skills/dev/dev-build/references/implement-task-graph.md +3 -3
- package/skills/dev/dev-grill/references/decision-interview.md +1 -1
- package/skills/dev/dev-parallel/references/program-coordination.md +2 -2
- package/skills/dev/dev-plan/references/research-method.md +1 -1
- package/skills/dev/dev-setup/SKILL.md +2 -0
- package/skills/dev/dev-setup/assets/team.md +4 -0
- package/skills/dev/dev-setup/references/configure-team.md +13 -2
- package/skills/dev/dev-workflow/references/delegate-role.md +1 -1
- package/skills/dev/dev-workflow/references/execution-support.md +1 -1
- package/skills/dev/dev-workflow/references/operating-method.md +2 -2
- package/skills/dev/dev-workflow/references/phase-boundaries.md +3 -3
- package/skills/home/home-doctor/SKILL.md +30 -0
- package/skills/home/home-doctor/references/diagnosis.md +40 -0
- package/skills/home/home-doctor/scripts/doctor.mjs +179 -0
- package/skills/home/home-history/SKILL.md +35 -0
- package/skills/home/home-history/assets/event.md +22 -0
- package/skills/home/home-history/assets/resumption.md +19 -0
- package/skills/home/home-history/references/history-method.md +90 -0
- package/skills/home/home-history/references/tools.md +57 -0
- package/skills/home/home-history/scripts/files.mjs +252 -0
- package/skills/home/home-history/scripts/history.mjs +184 -0
- package/skills/home/home-integrate/SKILL.md +23 -0
- package/skills/home/home-integrate/assets/integration.md +25 -0
- package/skills/home/home-integrate/references/integration.md +59 -0
- package/skills/home/home-knowledge/SKILL.md +37 -0
- package/skills/home/home-knowledge/assets/candidate.md +19 -0
- package/skills/home/home-knowledge/assets/exclusions.md +6 -0
- package/skills/home/home-knowledge/assets/topic.md +27 -0
- package/skills/home/home-knowledge/references/knowledge-method.md +55 -0
- package/skills/home/home-knowledge/references/maintenance.md +74 -0
- package/skills/home/home-knowledge/references/tools.md +55 -0
- package/skills/home/home-knowledge/scripts/files.mjs +252 -0
- package/skills/home/home-knowledge/scripts/knowledge.mjs +150 -0
- package/skills/home/home-map/SKILL.md +23 -0
- package/skills/home/home-map/assets/relations.md +25 -0
- package/skills/home/home-map/references/relations.md +60 -0
- package/skills/home/home-route/SKILL.md +32 -0
- package/skills/home/home-route/references/routing.md +48 -0
- package/skills/home/home-route/scripts/route.mjs +273 -0
- package/skills/home/home-setup/SKILL.md +46 -0
- package/skills/home/home-setup/assets/environment.md +18 -0
- package/skills/home/home-setup/assets/home-navigation.md +7 -0
- package/skills/home/home-setup/assets/local.schema.json +15 -0
- package/skills/home/home-setup/assets/preferences.md +16 -0
- package/skills/home/home-setup/assets/profile.md +19 -0
- package/skills/home/home-setup/assets/repos.schema.json +27 -0
- package/skills/home/home-setup/assets/team.md +24 -0
- package/skills/home/home-setup/references/configuration.md +71 -0
- package/skills/home/home-setup/references/environment.md +34 -0
- package/skills/home/home-setup/references/registry.md +110 -0
- package/skills/home/home-setup/scripts/registry.mjs +231 -0
- package/skills/home/home-workflow/SKILL.md +37 -0
- package/skills/home/home-workflow/assets/coordination.md +24 -0
- package/skills/home/home-workflow/assets/project-brief.md +25 -0
- package/skills/home/home-workflow/references/coordination.md +41 -0
- package/skills/home/home-workflow/references/delegation.md +86 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# skills-hub
|
|
2
2
|
|
|
3
|
-
按领域和独立技能分组组织的中文 Agent Skills
|
|
3
|
+
按领域和独立技能分组组织的中文 Agent Skills,覆盖个人 Home、软件开发、系统维护、服务器运维和专门工具。每个技能包含使用入口、完整方法及所需模板、示例和脚本,可以单独安装,也可以按任务组合使用。
|
|
4
4
|
|
|
5
5
|
## 安装
|
|
6
6
|
|
|
@@ -16,6 +16,9 @@ npx @namewta/skills-hub list
|
|
|
16
16
|
# 安装整个开发分组
|
|
17
17
|
npx @namewta/skills-hub install --domain dev
|
|
18
18
|
|
|
19
|
+
# 构建、运营和管理个人 Home Repo
|
|
20
|
+
npx @namewta/skills-hub install --domain home
|
|
21
|
+
|
|
19
22
|
# 单独安装 Issue 撰写与维护技能
|
|
20
23
|
npx @namewta/skills-hub install --skill dev-issue
|
|
21
24
|
|
|
@@ -34,7 +37,7 @@ npx @namewta/skills-hub install --domain upstream-skills --dry-run
|
|
|
34
37
|
|
|
35
38
|
交互界面默认勾选当前项目已安装的技能。使用 ↑/↓ 移动、Tab 展开或收拢领域、空格勾选、←/→ 翻页,按 Enter 查看安装确认。按 `/` 可搜索名称、分组或中文用途。非交互环境使用带 `--domain`、`--skill` 或 `--all` 的安装命令。
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
技能的完整本体安装到当前项目的 `.agents/skills/<技能名>/`,同时建立 `.claude/skills/<技能名>` 到该本体的目录符号链接。两个入口读取同一份资源,更新一次即可。重复安装时,相同本体保持不变并补齐缺失链接,有差异的同名本体先备份再替换。别名位置有用户文件、目录或错向链接时先报告冲突。安装需要目录符号链接能力,不执行技能中的工具;自动发现仍由实际宿主决定,也可以显式读取 `SKILL.md`。
|
|
38
41
|
|
|
39
42
|
全局命令、源码离线安装、备份恢复和旧版本迁移见[安装说明](docs/usage/installation.md)。
|
|
40
43
|
|
|
@@ -42,6 +45,7 @@ npx @namewta/skills-hub install --domain upstream-skills --dry-run
|
|
|
42
45
|
|
|
43
46
|
| 分组 | 用途 | 常用入口 |
|
|
44
47
|
| --- | --- | --- |
|
|
48
|
+
| `home` | Home Repo 构建、项目登记、用户配置、分层协作、持久知识和历史运营 | [home-workflow](skills/home/home-workflow/SKILL.md)、[home-setup](skills/home/home-setup/SKILL.md) |
|
|
45
49
|
| `dev` | 需求澄清、设计、原型、计划、实现、验证、交付和项目知识 | [dev-help](skills/dev/dev-help/SKILL.md)、[dev-workflow](skills/dev/dev-workflow/SKILL.md) |
|
|
46
50
|
| `system` | 主机检查、磁盘清理、代理、软件配置和终端协作 | [system-inspect](skills/system/system-inspect/SKILL.md) |
|
|
47
51
|
| `ops` | 多项目、多服务器与共享服务的巡检、维护、恢复和操作历史 | [ops-workflow](skills/ops/ops-workflow/SKILL.md) |
|
|
@@ -86,11 +90,25 @@ npx @namewta/skills-hub install --domain upstream-skills --dry-run
|
|
|
86
90
|
|
|
87
91
|
`upstream-skills` 只是安装分组,各技能按自身用途工作。中文说明与原版保持对应,代码、API、文件名和可执行命令保留。Archify 的完整交付检查需要 Chrome/Chromium;Modern Web Guidance 仍通过原 CLI 检索最新资料,返回内容可能是英文。运行前提与中文范围见[上游独立技能说明](docs/usage/upstream-skills.md)。
|
|
88
92
|
|
|
93
|
+
## 个人 Home Repo
|
|
94
|
+
|
|
95
|
+
在自己的 Home 仓库安装 `home` 后,可直接使用 `home-setup` 建立项目地图和按需配置,也可由 `home-workflow` 按任务调用八个方法。已有 clone 原地登记,不要求移动到 Home 下面。Agent、CLI、模型、思考参数和派遣方式由用户选择;保存配置不会启动任务。
|
|
96
|
+
|
|
97
|
+
Home 了解各项目基本背景和管理关系。涉及项目内部知识、代码、技能或验证时,由当地 Agent 进入实际项目读取和完成;项目可继续依当地规则派遣子 Agent。每层派遣记录归当地所选技能,Home 保留管理摘要与证据指针。Home 的现行知识、历史事件和当前执行状态各有明确位置,可由新会话读取普通 Markdown 接续。
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
使用 home-setup:登记这些已有项目,沿用真实目录;先保存我明确选择的协作方式。
|
|
101
|
+
使用 home-workflow:向项目 A 查询接口约定,让项目 B 验证兼容性,回报各自版本和证据。
|
|
102
|
+
使用 home-history:查明当时为什么选择这个方案,再指出当前知识是否已经更正。
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
完整用法、方法归属和验证边界见 [Home 说明](docs/home/overview.md)。
|
|
106
|
+
|
|
89
107
|
## 项目结构
|
|
90
108
|
|
|
91
109
|
| 位置 | 内容 |
|
|
92
110
|
| --- | --- |
|
|
93
|
-
| `skills/<domain>/<domain>-xxx/` |
|
|
111
|
+
| `skills/<domain>/<domain>-xxx/` | 按职责整合的 Home、开发、系统和运维技能 |
|
|
94
112
|
| `upstream-skills/zh-<原名>/` | 与原技能一一对应的独立中文运行包 |
|
|
95
113
|
| `materials/` | 固定版本的来源原件、中文对照和逐文件运行映射 |
|
|
96
114
|
| `docs/` | 使用说明、架构解释和维护规范 |
|
|
@@ -98,7 +116,7 @@ npx @namewta/skills-hub install --domain upstream-skills --dry-run
|
|
|
98
116
|
|
|
99
117
|
安装器直接扫描两个运行根,完整复制所选技能的 `SKILL.md`、`references/`、`assets/`、`scripts/` 和其他配套资源。安装后所有技能位于 `.agents/skills/` 同一层级。`materials/` 供维护时对照,不参与技能发现或安装。
|
|
100
118
|
|
|
101
|
-
|
|
119
|
+
项目资料按领域保存:Home 在 `.agents/home/`,开发在 `.agents/dev/`,系统维护在 `.agents/system/`,运维在 `.agents/ops/`。安装 dev 或 system 技能时,安装器补根 `.gitignore` 的 `/temp/`;日志和截图等原件按需写到 `temp/dev/` 或 `temp/system/`。Change 的 `evidences/` 只放与 `tasks/` 完全同名的 `.md`,完成整体验收后才写 Change 根 `evidence.md`。独立上游分组不创建 `.agents/upstream-skills/`。详见[领域持久化与迁移](docs/reference/persistence-roots.md)。
|
|
102
120
|
|
|
103
121
|
## 文档导航
|
|
104
122
|
|
|
@@ -108,6 +126,7 @@ npx @namewta/skills-hub install --domain upstream-skills --dry-run
|
|
|
108
126
|
| 安装、升级、恢复备份或迁移旧包 | [安装说明](docs/usage/installation.md) |
|
|
109
127
|
| 组合开发技能,处理原型与交接 | [开发流程](docs/development/workflow.md)、[可交互原型](docs/development/prototype.md)、[开发交接](docs/development/handoff.md) |
|
|
110
128
|
| 新建完整 Issue、更新正文或追加评论 | [Issue 撰写与维护](docs/development/issues.md) |
|
|
129
|
+
| 构建、运营和管理个人 Home | [Home 说明](docs/home/overview.md)、[方法归属](docs/home/method-ownership.md) |
|
|
111
130
|
| 维护服务器和项目运行关系 | [运维说明](docs/operations/overview.md) |
|
|
112
131
|
| 用 Herdr TUI 或 Core 启动 agent、派发任务和收取结果 | [Herdr 协作](docs/usage/herdr-coordination.md) |
|
|
113
132
|
| 使用和更新独立中文技能 | [上游独立技能](docs/usage/upstream-skills.md) |
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
| [openai/skills — Sentry](https://github.com/openai/skills/tree/main/skills/.curated/sentry),OpenAI 及贡献者 | `skills/.curated/sentry`;只读错误观测、范围核对与脱敏方法用于 `ops-inspect`。 | [Apache 2.0](licenses/openai-sentry-Apache-2.0.txt);[清单](materials/openai-sentry/manifest.tsv) |
|
|
22
22
|
| [HumanLayer](https://github.com/humanlayer/humanlayer) / [Dex Horthy](https://github.com/dexhorthy),QueryTale, Inc. d/b/a HumanLayer | 既有 PR 视觉说明中的 show-me 方法;已作中文翻译和流程适配。NOTICE 中列出的其他程序组件未因此一并收录。 | [Apache 2.0](licenses/humanlayer-Apache-2.0.txt)、[NOTICE](licenses/humanlayer-NOTICE.txt) |
|
|
23
23
|
| [abdiraimov-otabek/dashboard-design-skill](https://github.com/abdiraimov-otabek/dashboard-design-skill),Otabek Abdiraimov | 固定版本 `skills/dashboard-design/` 的 11 份 Markdown;完整翻译后独立提供 `zh-dashboard-design`。不包含来源仓库根部的示例页面、图片与 Claude 插件配置。 | [MIT](licenses/dashboard-design-skill-MIT.txt);[清单](materials/dashboard-design-skill/manifest.tsv) |
|
|
24
|
+
| [HKUDS/nanobot](https://github.com/HKUDS/nanobot),Xubin Ren 与 nanobot 贡献者 | `nanobot/skills/memory` 的完整短技能及中文底稿;采用按需读取、来源边界、已确认长期知识、读后更新、修复引用和历史检索方法。 | [MIT](licenses/nanobot-MIT.txt);[清单](materials/nanobot-memory/manifest.tsv) |
|
|
24
25
|
|
|
25
26
|
### 整合内容的修改范围
|
|
26
27
|
|
|
@@ -35,6 +36,7 @@
|
|
|
35
36
|
- `system-herdr` 保留完整 CLI 方法;客户端启动示例与按 pane 的 task/report 文件通信属于本地扩展。
|
|
36
37
|
- `system-herdr-core` 的运行版采用用户明确选用的触发条件,并增加客户端启动示例及按 Core 终端地址派发 task/report 的方法。许可原文与现有 Herdr Apache 2.0 文件字节相同。
|
|
37
38
|
- ops 将调查、经验和只读观测方法适配到本领域的 registry、run、项目资料与实际工具能力。领域之间不因此产生自动安装依赖。
|
|
39
|
+
- home 采用 Matt 的直接负责人、上下文指针、按主题组织知识和交接资料方法,将来源中常驻会话、固定回顾频率和整套开发链改为用户按需选择的项目协作;现行知识、历史和用户配置分别由所属技能维护。nanobot 的记忆方法适配为 `.agents/home/` 下的 Markdown,保留项目当地知识归属,不接入其全局工作区、私有 history.jsonl、游标或 Dream 运行时。具体来源和研究取舍见 [Home 来源](docs/home/sources.md)。
|
|
38
40
|
- issue 初始化、分诊和复现修复保留 pstack 较早 [Benny 自动化资料](https://github.com/cursor/plugins/tree/6b0300214a09fd6029cfb7077043125758cd1fd2/pstack/automations/benny)的方法;通用来源接口和项目配置属于本地适配,原 Slack 分支保留其身份核对与回读要求。
|
|
39
41
|
|
|
40
42
|
## 独立中文上游技能
|
package/cli.mjs
CHANGED
|
@@ -42,6 +42,7 @@ export async function interactive({ argv = [], project = process.cwd(), ui = pro
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
ui.note(project, '目标项目(技能写入 .agents/skills/)');
|
|
45
|
+
ui.note('每个所选技能在 .claude/skills/ 建立指向同仓 .agents/skills/ 的目录符号链接。需要目录 symlink 权限;同名真实目录、文件或外来链接会阻止安装。', '技能入口');
|
|
45
46
|
const installer = createInstaller();
|
|
46
47
|
const skills = installer.catalog();
|
|
47
48
|
const initialNames = installer.installedNames(skills, project);
|
|
@@ -50,7 +51,7 @@ export async function interactive({ argv = [], project = process.cwd(), ui = pro
|
|
|
50
51
|
const selected = select(skills, [], names);
|
|
51
52
|
if (!selected.length) throw new Error('请至少勾选一个技能。');
|
|
52
53
|
ui.note(formatSummary(selected.map(skill => skill.name)), `${selected.length} 个技能`);
|
|
53
|
-
if (selected.some(skill => ['dev', 'system', 'ops'].includes(skill.domain))) {
|
|
54
|
+
if (selected.some(skill => ['dev', 'system', 'ops', 'home'].includes(skill.domain))) {
|
|
54
55
|
ui.note('将补齐所选领域的持久化目录和简短 AGENTS.md;固定模板自动更新,业务记录保留,预览不写入。', '领域初始化');
|
|
55
56
|
}
|
|
56
57
|
if (selected.some(skill => skill.domain === 'dev' || skill.domain === 'system')) {
|
|
@@ -59,6 +60,9 @@ export async function interactive({ argv = [], project = process.cwd(), ui = pro
|
|
|
59
60
|
if (selected.some(skill => skill.domain === 'dev')) {
|
|
60
61
|
ui.note('如缺少规则,将在项目根 .gitignore 追加 /.agents/dev/worktree/。', '开发工作树');
|
|
61
62
|
}
|
|
63
|
+
if (selected.some(skill => skill.domain === 'home')) {
|
|
64
|
+
ui.note('如缺少规则,将补项目根 .gitignore 的 /.agents/home/local.json 默认规则,保留项目例外;Home 业务资料由相应技能按需创建。', 'Home 本机映射');
|
|
65
|
+
}
|
|
62
66
|
if (!await ask(ui.confirm({ message: dryRun ? '检查安装计划?(不写入文件)' : '安装或更新以上技能?(有差异的现有技能会先备份)', initialValue: true }))) {
|
|
63
67
|
ui.cancel('已取消,未修改文件。'); return 0;
|
|
64
68
|
}
|
package/install.mjs
CHANGED
|
@@ -132,6 +132,16 @@ export function createInstaller({ repository = repositoryRoot, fsOps = fs } = {}
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
function checkDirectoryPath(project, directory) {
|
|
136
|
+
if (!isWithin(directory, project)) throw new InstallError(`Destination is outside the current project: ${directory}`);
|
|
137
|
+
let current = project;
|
|
138
|
+
checkDirectory(current);
|
|
139
|
+
for (const part of path.relative(project, directory).split(path.sep).filter(Boolean)) {
|
|
140
|
+
current = path.join(current, part);
|
|
141
|
+
checkDirectory(current);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
135
145
|
function installedNames(skills, project) {
|
|
136
146
|
const agents = path.join(project, '.agents');
|
|
137
147
|
const target = path.join(agents, 'skills');
|
|
@@ -142,6 +152,53 @@ export function createInstaller({ repository = repositoryRoot, fsOps = fs } = {}
|
|
|
142
152
|
}).map(({ name }) => name);
|
|
143
153
|
}
|
|
144
154
|
|
|
155
|
+
function planLink(name, project, canonical) {
|
|
156
|
+
const relative = `.claude/skills/${name}`;
|
|
157
|
+
const destination = path.join(project, '.claude', 'skills', name);
|
|
158
|
+
const target = path.relative(path.dirname(destination), canonical);
|
|
159
|
+
const stat = exists(destination);
|
|
160
|
+
if (!stat) return { path: relative, destination, target, kind: 'link' };
|
|
161
|
+
if (!stat.isSymbolicLink()) {
|
|
162
|
+
throw new InstallError(`Claude skill entry conflict: ${destination} is not a symlink. Expected a directory symlink to ${canonical}; existing content was not changed.`);
|
|
163
|
+
}
|
|
164
|
+
const previous = fsOps.readlinkSync(destination);
|
|
165
|
+
const resolved = path.resolve(path.dirname(destination), previous);
|
|
166
|
+
// 预期本体尚未安装时,准确指向它的断链仍是可保留的入口。
|
|
167
|
+
let matches = path.relative(resolved, canonical) === '';
|
|
168
|
+
if (exists(canonical)) {
|
|
169
|
+
try {
|
|
170
|
+
matches = path.relative(fsOps.realpathSync(destination), fsOps.realpathSync(canonical)) === '' &&
|
|
171
|
+
fsOps.statSync(destination).isDirectory();
|
|
172
|
+
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
if (!['ENOENT', 'ENOTDIR', 'ELOOP'].includes(error.code)) throw error;
|
|
175
|
+
matches = false;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (!matches) {
|
|
179
|
+
throw new InstallError(`Claude skill entry conflict: ${destination} -> ${previous}. Expected ${canonical}; the existing link and its target were not changed.`);
|
|
180
|
+
}
|
|
181
|
+
return { path: relative, destination, target: previous, kind: 'preserved' };
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function checkLinkParents(project) {
|
|
185
|
+
for (const relative of ['.agents', '.agents/skills', '.claude', '.claude/skills']) {
|
|
186
|
+
checkDirectory(path.join(project, relative));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function verifyLink(action, project) {
|
|
191
|
+
checkLinkParents(project);
|
|
192
|
+
checkDirectory(action.destination);
|
|
193
|
+
const actual = planLink(action.name, project, action.destination);
|
|
194
|
+
if (actual.kind !== 'preserved' || actual.target !== action.link.target ||
|
|
195
|
+
path.relative(fsOps.realpathSync(actual.destination), fsOps.realpathSync(action.destination)) !== '') {
|
|
196
|
+
throw new InstallError(`Claude skill link verification failed: ${action.link.destination}`);
|
|
197
|
+
}
|
|
198
|
+
const manifest = path.join(actual.destination, 'SKILL.md');
|
|
199
|
+
if (!exists(manifest)?.isFile()) throw new InstallError(`Expected a regular skill entry: ${manifest}`);
|
|
200
|
+
}
|
|
201
|
+
|
|
145
202
|
function plan(skills, project, replace = true) {
|
|
146
203
|
const actualProject = fsOps.realpathSync(project);
|
|
147
204
|
for (const source of [skillRoot, upstreamRoot, licenseRoot]) {
|
|
@@ -149,41 +206,60 @@ export function createInstaller({ repository = repositoryRoot, fsOps = fs } = {}
|
|
|
149
206
|
throw new InstallError("Run from the target project, outside this repository's source skills and licenses directories (including upstream-skills).");
|
|
150
207
|
}
|
|
151
208
|
}
|
|
209
|
+
project = actualProject;
|
|
152
210
|
const agents = path.join(project, '.agents');
|
|
153
211
|
const target = path.join(agents, 'skills');
|
|
154
212
|
for (const filename of [agents, target, path.join(agents, '.skills-hub-backups')]) checkDirectory(filename);
|
|
213
|
+
checkLinkParents(project);
|
|
155
214
|
const actions = [];
|
|
156
215
|
const conflicts = [];
|
|
157
216
|
const packages = skills.map((skill) => ({ source: skill.source, name: skill.name, destination: path.join(target, skill.name) }));
|
|
158
217
|
for (const item of packages) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
218
|
+
try {
|
|
219
|
+
checkDirectory(item.destination);
|
|
220
|
+
let kind;
|
|
221
|
+
if (!exists(item.destination)) kind = 'install';
|
|
222
|
+
else if (treeDigest(item.source, fsOps) === treeDigest(item.destination, fsOps)) kind = 'unchanged';
|
|
223
|
+
else if (replace) kind = 'replace';
|
|
224
|
+
else throw new InstallError(`Existing packages differ: ${item.name}. Inspect them first; --replace saves backups before replacement.`);
|
|
225
|
+
actions.push({ ...item, kind, link: planLink(item.name, project, item.destination) });
|
|
226
|
+
} catch (error) { conflicts.push(error.message); }
|
|
166
227
|
}
|
|
228
|
+
try { planPersistence(skills, project, fsOps); }
|
|
229
|
+
catch (error) { conflicts.push(error.message); }
|
|
167
230
|
if (conflicts.length) {
|
|
168
|
-
throw new InstallError(`
|
|
231
|
+
throw new InstallError(`Installation conflicts; no files were changed:\n${conflicts.join('\n')}`);
|
|
169
232
|
}
|
|
170
|
-
planPersistence(skills, project, fsOps);
|
|
171
233
|
return actions;
|
|
172
234
|
}
|
|
173
235
|
|
|
174
236
|
function persistencePlan(skills, project) { return planPersistence(skills, project, fsOps); }
|
|
175
237
|
|
|
176
238
|
function apply(skills, project, replace = true) {
|
|
239
|
+
project = fsOps.realpathSync(project);
|
|
177
240
|
let actions = plan(skills, project, replace);
|
|
178
241
|
let persistence = persistencePlan(skills, project);
|
|
179
|
-
if (actions.every((action) => action.kind === 'unchanged') && persistence.every(item => item.action === 'preserve')) {
|
|
242
|
+
if (actions.every((action) => action.kind === 'unchanged' && action.link.kind === 'preserved') && persistence.every(item => item.action === 'preserve')) {
|
|
243
|
+
for (const action of actions) verifyLink(action, project);
|
|
180
244
|
return { actions, backup: null, persistence };
|
|
181
245
|
}
|
|
182
246
|
const agents = path.join(project, '.agents');
|
|
183
|
-
fsOps.mkdirSync(agents, { recursive: true });
|
|
184
247
|
const locks = [];
|
|
248
|
+
let staging = null;
|
|
249
|
+
let backup = null;
|
|
250
|
+
const journal = { skills: [], persistence: [], links: [], directories: [] };
|
|
251
|
+
const recoveryErrors = [];
|
|
252
|
+
let failure = null;
|
|
253
|
+
function ensureDirectory(directory) {
|
|
254
|
+
checkDirectoryPath(project, directory);
|
|
255
|
+
if (!exists(directory)) {
|
|
256
|
+
fsOps.mkdirSync(directory);
|
|
257
|
+
journal.directories.push(directory);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
185
260
|
try {
|
|
186
|
-
|
|
261
|
+
ensureDirectory(agents);
|
|
262
|
+
// 先取得旧版共用锁;链接补建也与现有安装事务互斥。
|
|
187
263
|
for (const name of ['.skills-wta-install.lock', '.skills-hub-install.lock']) {
|
|
188
264
|
const lock = path.join(agents, name);
|
|
189
265
|
try { fsOps.mkdirSync(lock); }
|
|
@@ -193,28 +269,21 @@ export function createInstaller({ repository = repositoryRoot, fsOps = fs } = {}
|
|
|
193
269
|
}
|
|
194
270
|
locks.push(lock);
|
|
195
271
|
}
|
|
196
|
-
} catch (error) {
|
|
197
|
-
for (const lock of locks.reverse()) fsOps.rmdirSync(lock);
|
|
198
|
-
throw error;
|
|
199
|
-
}
|
|
200
|
-
let staging = null;
|
|
201
|
-
let backup = null;
|
|
202
|
-
const completed = [];
|
|
203
|
-
const persistenceJournal = [];
|
|
204
|
-
try {
|
|
205
272
|
actions = plan(skills, project, replace);
|
|
206
273
|
persistence = persistencePlan(skills, project);
|
|
207
|
-
staging = fsOps.mkdtempSync(path.join(agents, '.skills-hub-stage-'));
|
|
274
|
+
if (actions.some(action => action.kind !== 'unchanged')) staging = fsOps.mkdtempSync(path.join(agents, '.skills-hub-stage-'));
|
|
208
275
|
for (const action of actions) {
|
|
209
276
|
if (action.kind !== 'unchanged') {
|
|
210
277
|
fsOps.cpSync(action.source, path.join(staging, action.name), { recursive: true, errorOnExist: true, force: false });
|
|
211
278
|
}
|
|
212
279
|
}
|
|
213
|
-
|
|
280
|
+
ensureDirectory(path.join(agents, 'skills'));
|
|
214
281
|
if (actions.some((action) => action.kind === 'replace')) {
|
|
215
282
|
const stamp = new Date().toISOString().replace(/[-:]/g, '').replace(/\.\d{3}Z$/, 'Z');
|
|
216
|
-
|
|
217
|
-
|
|
283
|
+
const backups = path.join(agents, '.skills-hub-backups');
|
|
284
|
+
ensureDirectory(backups);
|
|
285
|
+
backup = path.join(backups, `${stamp}-${randomUUID().replaceAll('-', '').slice(0, 8)}`);
|
|
286
|
+
ensureDirectory(backup);
|
|
218
287
|
}
|
|
219
288
|
for (const action of actions) {
|
|
220
289
|
if (action.kind === 'unchanged') continue;
|
|
@@ -222,29 +291,89 @@ export function createInstaller({ repository = repositoryRoot, fsOps = fs } = {}
|
|
|
222
291
|
if (action.kind === 'replace') {
|
|
223
292
|
previous = path.join(backup, action.name);
|
|
224
293
|
fsOps.renameSync(action.destination, previous);
|
|
225
|
-
|
|
294
|
+
journal.skills.push({ destination: action.destination, previous });
|
|
226
295
|
}
|
|
227
296
|
fsOps.renameSync(path.join(staging, action.name), action.destination);
|
|
228
|
-
if (previous === null)
|
|
297
|
+
if (previous === null) journal.skills.push({ destination: action.destination, previous });
|
|
298
|
+
}
|
|
299
|
+
applyPersistence(persistence, project, fsOps, journal.persistence);
|
|
300
|
+
ensureDirectory(path.join(project, '.claude'));
|
|
301
|
+
ensureDirectory(path.join(project, '.claude', 'skills'));
|
|
302
|
+
for (const action of actions) {
|
|
303
|
+
checkLinkParents(project);
|
|
304
|
+
checkDirectory(action.destination);
|
|
305
|
+
const current = planLink(action.name, project, action.destination);
|
|
306
|
+
if (current.kind !== action.link.kind || current.target !== action.link.target) {
|
|
307
|
+
throw new InstallError(`Claude skill entry changed during installation: ${action.link.destination}`);
|
|
308
|
+
}
|
|
309
|
+
if (action.link.kind === 'link') {
|
|
310
|
+
try { fsOps.symlinkSync(action.link.target, action.link.destination, 'dir'); }
|
|
311
|
+
catch (error) {
|
|
312
|
+
throw new InstallError(`Cannot create directory symlink ${action.link.destination} -> ${action.link.target}: ${error.code ?? ''} ${error.message}. Directory symlink support is required; no junction or copy fallback is used.`);
|
|
313
|
+
}
|
|
314
|
+
journal.links.push(action.link);
|
|
315
|
+
}
|
|
316
|
+
verifyLink(action, project);
|
|
317
|
+
}
|
|
318
|
+
for (const action of actions) {
|
|
319
|
+
verifyLink(action, project);
|
|
320
|
+
if (treeDigest(action.source, fsOps) !== treeDigest(action.destination, fsOps)) {
|
|
321
|
+
throw new InstallError(`Installed skill verification failed: ${action.destination}`);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
if (persistencePlan(skills, project).some(item => item.action !== 'preserve')) {
|
|
325
|
+
throw new InstallError('Project initialization verification failed; check the reported paths and retry.');
|
|
229
326
|
}
|
|
230
|
-
applyPersistence(persistence, project, fsOps, persistenceJournal);
|
|
231
|
-
return { actions, backup, persistence };
|
|
232
327
|
} catch (error) {
|
|
233
|
-
|
|
234
|
-
for (const
|
|
328
|
+
failure = error;
|
|
329
|
+
for (const link of [...journal.links].reverse()) {
|
|
235
330
|
try {
|
|
331
|
+
checkLinkParents(project);
|
|
332
|
+
const stat = exists(link.destination);
|
|
333
|
+
if (!stat) continue;
|
|
334
|
+
if (!stat.isSymbolicLink() || fsOps.readlinkSync(link.destination) !== link.target) {
|
|
335
|
+
throw new InstallError('The created link changed; preserving the current entry for manual recovery.');
|
|
336
|
+
}
|
|
337
|
+
fsOps.unlinkSync(link.destination);
|
|
338
|
+
} catch (recoveryError) { recoveryErrors.push(`${link.destination}: ${recoveryError.message}`); }
|
|
339
|
+
}
|
|
340
|
+
recoveryErrors.push(...rollbackPersistence(journal.persistence, fsOps));
|
|
341
|
+
for (const item of [...journal.skills].reverse()) {
|
|
342
|
+
try {
|
|
343
|
+
checkDirectoryPath(project, path.dirname(item.destination));
|
|
344
|
+
if (item.previous !== null) checkDirectoryPath(project, path.dirname(item.previous));
|
|
236
345
|
if (exists(item.destination)) fsOps.rmSync(item.destination, { recursive: true });
|
|
237
346
|
if (item.previous !== null) fsOps.renameSync(item.previous, item.destination);
|
|
238
347
|
} catch (recoveryError) { recoveryErrors.push(`${item.destination}: ${recoveryError.message}`); }
|
|
239
348
|
}
|
|
349
|
+
} finally {
|
|
350
|
+
if (staging !== null) {
|
|
351
|
+
try { checkDirectoryPath(project, path.dirname(staging)); fsOps.rmSync(staging, { recursive: true, force: true }); }
|
|
352
|
+
catch (error) { recoveryErrors.push(`${staging}: ${error.message}`); }
|
|
353
|
+
}
|
|
354
|
+
for (const lock of locks.reverse()) {
|
|
355
|
+
try { checkDirectoryPath(project, lock); fsOps.rmdirSync(lock); }
|
|
356
|
+
catch (error) { recoveryErrors.push(`${lock}: ${error.message}`); }
|
|
357
|
+
}
|
|
358
|
+
if (failure) {
|
|
359
|
+
for (const directory of [...journal.directories].reverse()) {
|
|
360
|
+
try { checkDirectoryPath(project, directory); fsOps.rmdirSync(directory); }
|
|
361
|
+
catch (error) {
|
|
362
|
+
if (!['ENOENT', 'ENOTEMPTY', 'EEXIST'].includes(error.code)) recoveryErrors.push(`${directory}: ${error.message}`);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
if (failure) {
|
|
240
368
|
if (recoveryErrors.length) {
|
|
241
|
-
throw new InstallError(`Installation failed: ${
|
|
369
|
+
throw new InstallError(`Installation failed: ${failure.message}. Some files need manual recovery.${backup ? ` Keep ${backup}.` : ''} ${recoveryErrors.join('; ')}`);
|
|
242
370
|
}
|
|
243
|
-
throw new InstallError(`Installation failed; changes to skill directories and project initialization files were rolled back: ${
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
371
|
+
throw new InstallError(`Installation failed; changes to skill directories, Claude links and project initialization files were rolled back: ${failure.message}`);
|
|
372
|
+
}
|
|
373
|
+
if (recoveryErrors.length) {
|
|
374
|
+
throw new InstallError(`Installation files were updated, but temporary artifacts need manual cleanup: ${recoveryErrors.join('; ')}`);
|
|
247
375
|
}
|
|
376
|
+
return { actions, backup, persistence };
|
|
248
377
|
}
|
|
249
378
|
return { catalog, installedNames, plan, apply, persistencePlan };
|
|
250
379
|
}
|
|
@@ -254,10 +383,12 @@ export function catalog(repository = repositoryRoot) { return createInstaller({
|
|
|
254
383
|
const usage = `Usage: skills-hub <list|install> [--domain DOMAIN ...] [--skill NAME ...] [--all]
|
|
255
384
|
skills-hub install <selection> [--dry-run] [--replace]
|
|
256
385
|
|
|
257
|
-
Install complete skills into the current project's .agents/skills
|
|
386
|
+
Install complete skills into the current project's .agents/skills/ and link each selected .claude/skills/<name> to that same skill. No destination option.
|
|
387
|
+
Directory symlink support is required, including on Windows; conflicting Claude entries are never replaced.
|
|
258
388
|
--domain upstream-skills selects the independent Chinese upstream skills; it creates no domain navigation.
|
|
259
|
-
Selected dev/system/ops domains initialize domain AGENTS.md navigation; managed templates are updated and business records are preserved.
|
|
389
|
+
Selected dev/system/ops/home domains initialize domain AGENTS.md navigation; managed templates are updated and business records are preserved.
|
|
260
390
|
Dev or system selections add /temp/ to the project .gitignore when missing; dev also adds /.agents/dev/worktree/.
|
|
391
|
+
Home selections add /.agents/home/local.json to .gitignore; Home business records are created on demand by their owning skills.
|
|
261
392
|
--dry-run Preview without writing files.
|
|
262
393
|
Differing selected skills are backed up and replaced automatically.
|
|
263
394
|
--replace Accepted for compatibility; replacement is already the default.
|
|
@@ -311,8 +442,10 @@ export function main(argv = process.argv.slice(2), { repository = repositoryRoot
|
|
|
311
442
|
? { actions: installer.plan(selected, actualProject, args.replace), backup: null, persistence: installer.persistencePlan(selected, actualProject) }
|
|
312
443
|
: installer.apply(selected, actualProject, args.replace);
|
|
313
444
|
stdout(`Destination: ${path.join(actualProject, '.agents', 'skills')}`);
|
|
445
|
+
stdout(`Claude entries: ${path.join(actualProject, '.claude', 'skills')}`);
|
|
314
446
|
for (const action of actions) {
|
|
315
|
-
|
|
447
|
+
const prefix = args.dryRun ? 'would ' : '';
|
|
448
|
+
stdout(`${prefix}${action.kind.padEnd(9)} ${action.name} | ${prefix}${action.link.kind.padEnd(9)} ${action.link.path} -> ${action.link.target}`);
|
|
316
449
|
}
|
|
317
450
|
for (const item of persistence) stdout(`${args.dryRun ? 'would ' : ''}${item.action.padEnd(9)} ${item.path}`);
|
|
318
451
|
if (backup !== null) stdout(`Backups: ${backup}`);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-present Xubin Ren and the nanobot contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@namewta/skills-hub",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"description": "独立中文 Agent Skills:按领域安装,覆盖开发交付、项目知识与系统维护。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"check:package": "node scripts/check-package.mjs",
|
|
30
30
|
"check:statechart": "node scripts/check-statechart-replay.mjs",
|
|
31
31
|
"check:upstream": "node scripts/check-upstream-runtime.mjs",
|
|
32
|
+
"check:claude": "node scripts/check-claude-discovery.mjs",
|
|
32
33
|
"test": "node scripts/check.mjs --full",
|
|
33
34
|
"build": "node scripts/check.mjs --full",
|
|
34
35
|
"hooks": "node scripts/install-hooks.mjs"
|
|
@@ -15,6 +15,7 @@ const targets = [
|
|
|
15
15
|
['dev', 'context', '.agents/dev/context'],
|
|
16
16
|
['system', 'system', '.agents/system'],
|
|
17
17
|
['ops', 'ops', '.agents/ops'],
|
|
18
|
+
['home', 'home', '.agents/home'],
|
|
18
19
|
];
|
|
19
20
|
|
|
20
21
|
function inspect(project, relative, fsOps) {
|
|
@@ -42,11 +43,12 @@ function ensureIgnoreRules(previous, rules) {
|
|
|
42
43
|
|
|
43
44
|
const eol = original.match(/\r?\n/)?.[0] ?? '\n';
|
|
44
45
|
let content = previous;
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
const defaults = missing.filter(rule => ['/temp/', '/.agents/home/local.json'].includes(rule));
|
|
47
|
+
if (original && defaults.length) {
|
|
48
|
+
// 新默认规则先于用户规则,保留用户对运行原件和本机映射的明确例外。
|
|
47
49
|
const bom = text.startsWith('\uFEFF') ? 3 : 0;
|
|
48
|
-
content = Buffer.concat([previous.subarray(0, bom), Buffer.from(
|
|
49
|
-
missing.splice(missing.indexOf(
|
|
50
|
+
content = Buffer.concat([previous.subarray(0, bom), Buffer.from(defaults.join(eol) + eol), previous.subarray(bom)]);
|
|
51
|
+
for (const rule of defaults) missing.splice(missing.indexOf(rule), 1);
|
|
50
52
|
}
|
|
51
53
|
if (!missing.length) return content;
|
|
52
54
|
const separator = original && !original.endsWith('\n') ? eol : '';
|
|
@@ -63,6 +65,7 @@ export function planPersistence(skills, project, fsOps = fs) {
|
|
|
63
65
|
const ignoreRules = [];
|
|
64
66
|
if (domains.has('dev')) ignoreRules.push('/.agents/dev/worktree/');
|
|
65
67
|
if (domains.has('dev') || domains.has('system')) ignoreRules.push('/temp/');
|
|
68
|
+
if (domains.has('home')) ignoreRules.push('/.agents/home/local.json');
|
|
66
69
|
if (ignoreRules.length) {
|
|
67
70
|
entries.push(['.gitignore', previous => ensureIgnoreRules(previous ?? Buffer.alloc(0), ignoreRules)]);
|
|
68
71
|
}
|
|
@@ -95,11 +98,11 @@ export function applyPersistence(plan, project, fsOps = fs, journal = []) {
|
|
|
95
98
|
const directory = path.join(project, ...parts.slice(0, index + 1));
|
|
96
99
|
if (!fsOps.lstatSync(directory, { throwIfNoEntry: false })) {
|
|
97
100
|
fsOps.mkdirSync(directory);
|
|
98
|
-
journal.push({ path: directory, directory: true });
|
|
101
|
+
journal.push({ project, path: directory, directory: true });
|
|
99
102
|
}
|
|
100
103
|
}
|
|
101
104
|
const descriptor = fsOps.openSync(item.destination, item.action === 'update' ? 'r+' : 'wx');
|
|
102
|
-
journal.push({ path: item.destination, directory: false, previous: item.previous });
|
|
105
|
+
journal.push({ project, path: item.destination, directory: false, previous: item.previous });
|
|
103
106
|
try {
|
|
104
107
|
fsOps.writeFileSync(descriptor, item.content);
|
|
105
108
|
fsOps.ftruncateSync(descriptor, item.content.length);
|
|
@@ -112,6 +115,23 @@ export function rollbackPersistence(journal, fsOps = fs) {
|
|
|
112
115
|
const errors = [];
|
|
113
116
|
for (const item of [...journal].reverse()) {
|
|
114
117
|
try {
|
|
118
|
+
// 回滚也不跟随安装期间被替换的父目录或文件链接。
|
|
119
|
+
const relative = path.relative(item.project, item.path);
|
|
120
|
+
if (!relative || relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
|
|
121
|
+
throw new Error('回滚路径不在原项目内:' + item.path);
|
|
122
|
+
}
|
|
123
|
+
let current = item.project;
|
|
124
|
+
const parts = relative.split(path.sep);
|
|
125
|
+
for (let index = -1; index < parts.length; index += 1) {
|
|
126
|
+
if (index >= 0) current = path.join(current, parts[index]);
|
|
127
|
+
const stat = fsOps.lstatSync(current, { throwIfNoEntry: false });
|
|
128
|
+
if (!stat) continue;
|
|
129
|
+
if (stat.isSymbolicLink()) throw new Error('回滚拒绝符号链接:' + current);
|
|
130
|
+
const directory = index < parts.length - 1 || item.directory;
|
|
131
|
+
if (directory ? !stat.isDirectory() : !stat.isFile()) {
|
|
132
|
+
throw new Error('回滚路径类型已变化:' + current);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
115
135
|
if (item.previous) fsOps.writeFileSync(item.path, item.previous);
|
|
116
136
|
else if (item.directory) fsOps.rmdirSync(item.path);
|
|
117
137
|
else fsOps.unlinkSync(item.path);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Home 资料
|
|
2
|
+
|
|
3
|
+
- home-setup 管理 repos.json、派生 repos.md、本机 local.json 与 context/ 配置。
|
|
4
|
+
- home-map 管理 relations.md。
|
|
5
|
+
- home-knowledge 管理 notes/、inbox/、archive/notes/、exclusions.md 及知识索引。
|
|
6
|
+
- home-history 管理 history/、archive/history/ 及历史索引。
|
|
7
|
+
- home-workflow 管理 coordination/ 摘要;home-route 定位,home-integrate 协调联合验证,home-doctor 只读诊断。
|
|
8
|
+
|
|
9
|
+
资料按需建立。项目内部资料由当地 Agent 读取,每层派遣记录归当地所选方法。用户选择决定工具与配置,保存不等于启动。历史不代替当前状态,跨 owner 更正和忘记由 workflow 协调。
|
|
10
|
+
|
|
11
|
+
自定义规则放根 AGENTS.md。
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
## 已选择逐工单隔离实施时
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
下面展开每项使用独立工作树、汇入同一整合分支的做法。按本次已选派遣规则复用或新建实施者会话;工作树隔离不要求每项新建会话,接手时仍核对实际工作树与工单契约。
|
|
20
20
|
|
|
21
21
|
与子代理之间的通信应当稀疏。主要通过**上下文指针**通信:指向规格、工单、研究笔记和先前提交。不要重复已经可以通过指针获取的信息。
|
|
22
22
|
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
|
|
38
38
|
5. 同一批工单交回后,由一位集成者调用 `dev-worktree`,依次将完成的工作合并到直接父分支并验证本批整合结果。
|
|
39
39
|
|
|
40
|
-
6.
|
|
40
|
+
6. 如果这改变了可处理工单的**工作前沿**,先核实已退出实例、释放或保留的资源,再在当前预算内向可用的**实施子代理**派发下一批工单;原执行者完成当前工单后可继续接手,集成树、构建和测试也占用同一预算。
|
|
41
41
|
|
|
42
|
-
7. 所有工单完成后,对整合分支按本地 `dev-review
|
|
42
|
+
7. 所有工单完成后,对整合分支按本地 `dev-review`(两轴审查)。按本次已选派遣规则安排原实施者或其他**实施子代理**核实代码审查问题,修复已确认且属于本次范围的问题。
|
|
43
43
|
|
|
44
44
|
8. 如果存在草稿 PR,将其标记为可供审查。否则按当前授权和跟踪器约定标记完成;关闭外部工单须有授权,并报告整合分支。
|
|
45
45
|
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
|
|
21
21
|
用户回答的每轮都会重塑树:确定的决定向外推进前沿,解除依赖问题的阻塞。把答案、理由和来源写回同一权威决策记录,重新计算前沿,再问下一轮。如果某问题的答案依赖本轮另一个仍未解决的问题,它应属于**后续**轮次,而不是这一轮。调用方已有问题解决记录时写回该记录,不再创建平行 brief。
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
查明**事实**是你的工作,绝不是用户的工作。当前沿问题需要环境事实,例如文件系统、工具等,有可用并行能力时按本次已选派遣规则派发给合适的现有或新子智能体去寻找,否则自行读取相关证据;凡是自己能查的,不要问用户。不要因此阻塞整体:正在运行的探索是尚未解决的前置条件,只有依赖它的下游问题需要等待;其余前沿问题现在就问。涉及产品目标、不可代决的取舍属于用户,给出推荐后等待回答;用户已授权自主处理的可逆实现选择自行决定并记录。
|
|
24
24
|
|
|
25
25
|
当前前沿为空但仍有阻塞本次选择的事实或前置决定时,明确剩余依赖,不能把暂时无可问问题当作完成。本次任务依赖的产品选择均已解决时访谈完成;整理决定与记录指针,返回调用方。用户只要求讨论时交付讨论结果,已经要求实施时依据持续授权继续,不增加一次形式化确认。未来范围的分支保留为未来问题,不无限追问;已有契约充分时不再强制经过规格编写。
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- **每个 PR 一位负责人。** 负责人是分支唯一写入者,从构建负责到合并。只有负责人推送、变基或改目标。关闭或改基础 PR 目标会让上方全部 PR 失去基础,因此只能按你的决定做。你不编写或编辑代码,冲突合并、链式变基、修复交负责人。
|
|
10
10
|
- **需要独立上下文时使用新执行者。** 启动说明带齐所需内容,包括依赖报告的真实文件指针;无法共享文件系统时再提供必要原文。不假设执行者能读取兄弟上下文。默认独立工作区或当前工具实际提供的隔离环境,除非工作需要本机,如 `当前可用工具集` 的 `界面控制工具` 或 `终端控制工具` 运行检查、本地对话、模拟器、只存在本机的认证。
|
|
11
11
|
- **只有某领域有许多并行执行者时才设子协调者。** 它负责该领域执行者和启动说明,只向你交一份汇总,不交原始报告。最多三层:你、子协调者、执行者。所有协调者依据当前执行主机的可用资源共享同一预算和预留入口,子协调者只能在获分配额度内再分工,并同时遵守工具上限;完成后核实资源释放再补位,不让层级数放大总并发。
|
|
12
|
-
-
|
|
12
|
+
- **新工作需要执行者已建立状态时可接续原执行者,** 例如检出、未提交修改、运行进程。按本次已选派遣规则,在原任务完成后派发下一项 task;需要独立执行且工具支持时再分叉。按当前工具的真实语义查询状态,避免使用会意外重启任务的调用;同一工作的后续指令通过对应消息或跟进能力传递。
|
|
13
13
|
- **每个 PR 有独立于作者的验证者,** 使用独立上下文核验,并如实说明独立性限制。负责人只有在当前头提交得到验证通过后才合并。
|
|
14
14
|
- **从一个单元开始。** 先完整走过启动、负责人、验证者、合并,再扇出,让启动说明缺陷只浪费一位而非五十位智能体。几乎相同且便宜的单元,第一项就是这个试验。
|
|
15
15
|
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
- **阅读差异或产物,不只读摘要。** 绿色 CI 是裁决输入,不是裁决。行为工作需要类型检查之外的证明。裁决覆盖一个头 SHA,新推送就需要新裁决。子协调者的执行者运行时,抽查其启动说明,发现失败就修指令。
|
|
20
20
|
- **范围漂移或超出要求的工作退回。** 只保留阻塞项目的修复,其他放后续事项。
|
|
21
21
|
- **报告 PR 前查看实时状态,** 用 `gh pr view`、`gh pr checks` 或托管工具等价功能,不用执行者最后报告。每个派出的执行者都要交代为完成、替换或被其他执行者范围吸收。
|
|
22
|
-
- **停止或替换停滞、循环的执行者。** 根据推送和 PR
|
|
22
|
+
- **停止或替换停滞、循环的执行者。** 根据推送和 PR 活动判断,不看状态文字;正常上下文压缩不属于失败或停滞,不能仅因此替换执行者。按原因重试:上下文或内存限制后缩范围,连接断开后用同简报,工具错误后核对调用参数与实际能力。两次重试后放弃该单元,围绕它重规划。被停止执行者晚返回时,对照 PR 当前状态检查结果,把独特发现交给新执行者。
|
|
23
23
|
- **只为真实决策或阻塞询问用户,** 如不可逆行动、实验无法解决的产品或偏好选择、重新规划仍无法解决的死路。变基细节、重试、CI 偶发失败、审查分类和“是否继续”不交给用户。
|
|
24
24
|
|
|
25
25
|
**回复:** 对照目标落地了什么,每个 PR 的实时状态、裁决及链接,放弃了什么及原因,等待用户的决策。
|
|
@@ -22,6 +22,8 @@ description: 核对项目运行环境、当前宿主及用户指定远端的有
|
|
|
22
22
|
|
|
23
23
|
只有用户要求创建、修改或整理团队配置时,读取[团队配置方法](references/configure-team.md),使用[团队模板](assets/team.md)保存到 `.agents/dev/context/team/<team_name>.md`。未指定名称时从 topic 生成可辨识且不覆盖其他团队的名称。多个文件独立存在,由用户在任务中显式引用具体文件;普通环境初始化不创建默认团队,不扫描或合并团队规则,也不向根项目指令注入自动加载入口。
|
|
24
24
|
|
|
25
|
+
派遣规则写入团队文件的“协作约定”,按用户选择记录同一会话接续多个 task、Lead 与 worker 自主压缩及必要独立性的适用条件。执行任务直接沿用本次已选约定,不要求逐 task 重新运行本技能。
|
|
26
|
+
|
|
25
27
|
仅编辑团队文档时不启动环境探测或任务。只保存文件不宣称改变了宿主参数。
|
|
26
28
|
|
|
27
29
|
## 报告来源与监控
|