@namewta/skills-hub 0.1.0 → 0.1.1

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.
Files changed (3) hide show
  1. package/README.md +8 -8
  2. package/install.mjs +8 -12
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -10,16 +10,16 @@
10
10
 
11
11
  ```bash
12
12
  # 直接交互多选领域或技能
13
- npx @namewta/skills-hub@0.1.0
13
+ npx @namewta/skills-hub@0.1.1
14
14
 
15
15
  # 或全局安装后运行
16
- npm install -g @namewta/skills-hub@0.1.0
16
+ npm install -g @namewta/skills-hub@0.1.1
17
17
  skills-hub
18
18
 
19
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
20
+ npx @namewta/skills-hub@0.1.1 list
21
+ npx @namewta/skills-hub@0.1.1 install --domain dev
22
+ npx @namewta/skills-hub@0.1.1 install --skill dev-grill dev-spec system-proxy
23
23
  ```
24
24
 
25
25
  在目标项目根目录执行,按领域或技能选择;npm 下载包不会自动安装技能。终端中不带参数运行 `skills-hub` 或 `skills-hub install` 会进入中文交互:空格多选,回车确认,Ctrl+C 取消。支持 `skills-hub install --dry-run` 交互预览;内容冲突需检查后显式运行 `skills-hub install --replace`,不会自动覆盖。非交互环境继续要求明确参数,不会等待输入。
@@ -58,13 +58,13 @@ Windows、macOS 和 Linux 使用相同的 `node` / `npx` 命令。源码安装
58
58
  node C:\tools\skills-hub\install.mjs install --domain dev
59
59
  ```
60
60
 
61
- 仓库保存 `skills/dev/dev-spec/`,安装后是 `.agents/skills/dev-spec/`,不会多一层 `dev/`。技能自带所需的中文参考文件、模板与示例,单独安装也能工作。安装器同时把完整许可附带到 `.agents/skills-hub-licenses/`;许可位于技能目录之外,不进入技能执行上下文。相同内容再次安装无变化;有差异默认停止整次安装,`--replace` 会先保留备份。更多行为见 [安装说明](docs/installation.md)。
61
+ 仓库保存 `skills/dev/dev-spec/`,安装后是 `.agents/skills/dev-spec/`,不会多一层 `dev/`。技能自带所需的中文参考文件、模板与示例,单独安装也能工作。许可完整保留在仓库与 npm 包内;安装器不再向目标项目复制 `.agents/skills-hub-licenses/`,已有目录也不修改或删除。相同内容再次安装无变化;有差异默认停止整次安装,`--replace` 会先保留备份。更多行为见 [安装说明](docs/installation.md)。
62
62
 
63
63
  安装器只安装文件。Agent 是否自动发现 `.agents/skills/` 取决于所用工具;不支持自动发现的工具可以显式读取对应 `SKILL.md`。这不是后台服务,也不会自动启动开发或部署。
64
64
 
65
65
  ### 从 skills-wta 迁移
66
66
 
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-迁移)。
67
+ 从旧包 `skills-wta@0.0.1` 切换到 `@namewta/skills-hub@0.0.8`,继续在同一项目运行上面的安装命令。新旧版本使用相同的 `.agents/skills/<技能名>/`,技能内容相同则不变,有差异时先检查再用 `--replace`;新的开发记录写入 `.agents/dev/`,系统维护记录写入 `.agents/system/`;已有项目记录按迁移说明处理,安装器不会自动搬迁。新版不再复制项目许可目录,新备份使用 `.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-迁移)。
68
68
 
69
69
  ## dev:完整开发流程
70
70
 
@@ -223,4 +223,4 @@ G 组新增 [Herdr 上游技能](https://github.com/herdrdev/herdr/blob/master/s
223
223
 
224
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),运行说明已写在技能本地,不要求使用者访问该文档。
225
225
 
226
- 项目原创内容采用 [MIT](LICENSE)。原作者版权、MIT 许可、适用的 Apache 2.0 及 NOTICE 完整保存在 [许可目录](licenses/) 和 [第三方声明](THIRD_PARTY_NOTICES.md),包括设计材料内嵌的额外 MIT 声明。安装器每次选择任意技能,都会把整个许可目录附带到 `.agents/skills-hub-licenses/`。再次分发技能时请保留这个配套目录;不要只复制技能正文而丢失许可。
226
+ 项目原创内容采用 [MIT](LICENSE)。原作者版权、MIT 许可、适用的 Apache 2.0 及 NOTICE 完整保存在 [许可目录](licenses/) 和 [第三方声明](THIRD_PARTY_NOTICES.md),包括设计材料内嵌的额外 MIT 声明。许可随源码仓库和 npm 包分发,不再由技能安装器复制到用户项目。再次分发技能时应保留适用许可。
package/install.mjs CHANGED
@@ -127,28 +127,23 @@ export function createInstaller({ repository = repositoryRoot, fsOps = fs } = {}
127
127
  function plan(skills, project, replace = false) {
128
128
  const actualProject = fsOps.realpathSync(project);
129
129
  for (const source of [skillRoot, licenseRoot]) {
130
- if (isWithin(actualProject, fsOps.realpathSync(source))) {
130
+ if (exists(source) && isWithin(actualProject, fsOps.realpathSync(source))) {
131
131
  throw new InstallError("Run from the target project, outside this repository's source skills and licenses directories.");
132
132
  }
133
133
  }
134
- regularFiles(licenseRoot, fsOps);
135
- if (licenseBundleFiles.some((name) => !exists(path.join(licenseRoot, name))?.isFile())) {
136
- throw new InstallError('The repository license bundle is incomplete; restore licenses before installing.');
137
- }
138
134
  const agents = path.join(project, '.agents');
139
135
  const target = path.join(agents, 'skills');
140
- for (const filename of [agents, target, path.join(agents, '.skills-hub-backups'), path.join(agents, 'skills-hub-licenses')]) checkDirectory(filename);
136
+ for (const filename of [agents, target, path.join(agents, '.skills-hub-backups')]) checkDirectory(filename);
141
137
  const actions = [];
142
138
  const conflicts = [];
143
139
  const packages = skills.map((skill) => ({ source: skill.source, name: skill.name, destination: path.join(target, skill.name) }));
144
- packages.push({ source: licenseRoot, name: '.licenses', destination: path.join(agents, 'skills-hub-licenses') });
145
140
  for (const item of packages) {
146
141
  checkDirectory(item.destination);
147
142
  let kind;
148
143
  if (!exists(item.destination)) kind = 'install';
149
144
  else if (treeDigest(item.source, fsOps) === treeDigest(item.destination, fsOps)) kind = 'unchanged';
150
145
  else if (replace) kind = 'replace';
151
- else { conflicts.push(item.name === '.licenses' ? 'license notices' : item.name); continue; }
146
+ else { conflicts.push(item.name); continue; }
152
147
  actions.push({ ...item, kind });
153
148
  }
154
149
  if (conflicts.length) {
@@ -285,8 +280,7 @@ export function main(argv = process.argv.slice(2), { repository = repositoryRoot
285
280
  : installer.apply(selected, actualProject, args.replace);
286
281
  stdout(`Destination: ${path.join(actualProject, '.agents', 'skills')}`);
287
282
  for (const action of actions) {
288
- if (action.name !== '.licenses') stdout(`${args.dryRun ? 'would ' : ''}${action.kind.padEnd(9)} ${action.name}`);
289
- else if (action.kind !== 'unchanged') stdout(`${args.dryRun ? 'Would copy' : 'Copied'} license notices: ${action.destination}`);
283
+ stdout(`${args.dryRun ? 'would ' : ''}${action.kind.padEnd(9)} ${action.name}`);
290
284
  }
291
285
  if (backup !== null) stdout(`Backups: ${backup}`);
292
286
  return 0;
@@ -297,7 +291,9 @@ if (isMain(import.meta.url)) {
297
291
  const argv = process.argv.slice(2);
298
292
  const interactiveRequest = argv.length === 0 || (argv[0] === 'install' && argv.slice(1).every(value => ['--replace', '--dry-run'].includes(value)));
299
293
  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; }
294
+ // 不在本模块顶层 await:cli.mjs 会导入本模块,等待会形成模块求值死锁。
295
+ import('./cli.mjs').then(({ interactive }) => interactive({ argv }))
296
+ .then(code => { process.exitCode = code; })
297
+ .catch(error => { console.error(`Error: ${error.message}`); process.exitCode = 1; });
302
298
  } else process.exitCode = main(argv);
303
299
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@namewta/skills-hub",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "独立中文 Agent Skills:按领域安装,覆盖开发交付、项目知识与系统维护。",
5
5
  "type": "module",
6
6
  "bin": {