@house365/comate 0.9.7 → 0.9.10

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 (2) hide show
  1. package/bin/init.mjs +11 -32
  2. package/package.json +55 -55
package/bin/init.mjs CHANGED
@@ -256,9 +256,9 @@ function pruneDeprecatedSkills(
256
256
  return removed;
257
257
  }
258
258
 
259
- // True only when the pinned `skills` dependency resolves locally. This keeps a
260
- // postinstall from downloading an arbitrary CLI through the npx fallback. The
261
- // CLI may still fetch declared skill sources such as obra/superpowers.
259
+ // True only when the pinned `skills` dependency resolves locally. A postinstall
260
+ // must never reach the network, so this gates syncComateSkills: if resolution
261
+ // fails we skip rather than let skillsInvocation fall back to `npx skills@latest`.
262
262
  function skillsResolvesLocally(pkgRoot) {
263
263
  try {
264
264
  createRequire(join(pkgRoot, 'package.json')).resolve('skills/package.json');
@@ -268,40 +268,19 @@ function skillsResolvesLocally(pkgRoot) {
268
268
  }
269
269
  }
270
270
 
271
- // Install the user-level skills needed by comate via the bundled skills CLI.
272
- // Superpowers is fetched only when its marker is absent; comate's bundled skills
273
- // are always refreshed on npm upgrades. `comate init` remains the diagnostic
274
- // fallback when this best-effort postinstall sync cannot complete.
275
- function syncComateSkills(
276
- pkgRoot,
277
- {
278
- home = process.env.HOME ?? process.env.USERPROFILE ?? '',
279
- runner = run,
280
- exists = existsSync,
281
- } = {},
282
- ) {
271
+ // Copy comate's own skills into ~/.agents/skills via the bundled skills CLI —
272
+ // the exact command `comate init` runs, so the layout is identical. Local-only:
273
+ // skips (never goes to network) when the skills dep can't be resolved, leaving
274
+ // `comate init` as the fallback. Returns { ok, skipped }.
275
+ function syncComateSkills(pkgRoot, { home = process.env.HOME ?? process.env.USERPROFILE ?? '', runner = run } = {}) {
283
276
  if (!skillsResolvesLocally(pkgRoot)) return { ok: false, skipped: 'no-local-cli' };
284
-
285
- const superpowersMarker = join(home, '.agents', 'skills', 'using-superpowers', 'SKILL.md');
286
- let superpowers = { ok: true };
287
- if (!exists(superpowersMarker)) {
288
- superpowers = runner(
289
- skillsInvocation(pkgRoot, ['add', 'obra/superpowers', '-g', '-y']),
290
- SKILLS_TIMEOUT_MS,
291
- { quiet: true },
292
- );
293
- }
294
-
295
- const comate = runner(
277
+ const r = runner(
296
278
  skillsInvocation(pkgRoot, ['add', pkgRoot, '--skill', '*', '-g', '-y']),
297
279
  SKILLS_TIMEOUT_MS,
298
280
  { quiet: true },
299
281
  );
300
- const comateMarker = join(home, '.agents', 'skills', 'comate', 'SKILL.md');
301
- return {
302
- ok: superpowers.ok && exists(superpowersMarker) && comate.ok && exists(comateMarker),
303
- skipped: null,
304
- };
282
+ const landed = existsSync(join(home, '.agents', 'skills', 'comate', 'SKILL.md'));
283
+ return { ok: r.ok && landed, skipped: null };
305
284
  }
306
285
 
307
286
  export {
package/package.json CHANGED
@@ -1,55 +1,55 @@
1
- {
2
- "name": "@house365/comate",
3
- "version": "0.9.7",
4
- "description": "comate —— SDD (规约驱动开发) 的 AI 开发编排器(Agent Skills)",
5
- "type": "module",
6
- "license": "MIT",
7
- "publishConfig": {
8
- "access": "public",
9
- "registry": "https://registry.npmjs.org"
10
- },
11
- "bin": {
12
- "comate": "bin/cli.mjs",
13
- "comate-skills": "bin/cli.mjs"
14
- },
15
- "files": [
16
- "skills",
17
- "bin",
18
- "!bin/*.test.mjs",
19
- "docs",
20
- "README.md",
21
- "LICENSE"
22
- ],
23
- "keywords": [
24
- "agent-skills",
25
- "skills",
26
- "claude-code",
27
- "openspec",
28
- "superpowers",
29
- "spec-driven-development",
30
- "ai-agents"
31
- ],
32
- "repository": {
33
- "type": "git",
34
- "url": "git+https://github.com/liangjiankk/comate.git"
35
- },
36
- "homepage": "https://github.com/liangjiankk/comate#readme",
37
- "bugs": {
38
- "url": "https://github.com/liangjiankk/comate/issues"
39
- },
40
- "engines": {
41
- "node": ">=20"
42
- },
43
- "dependencies": {
44
- "ccusage": "^20.0.19",
45
- "skills": "^1.5.21"
46
- },
47
- "scripts": {
48
- "postinstall": "node bin/postinstall.mjs",
49
- "test": "node bin/init.test.mjs && node bin/usage.test.mjs && bash skills/comate/tests/run.sh",
50
- "doctor": "cd skills && bash comate/scripts/comate.sh doctor",
51
- "prepublish-check": "node scripts/prepublish-check.mjs",
52
- "pack-check": "node scripts/pack-check.mjs",
53
- "prepublishOnly": "npm run prepublish-check && npm run pack-check && npm run doctor && npm test"
54
- }
55
- }
1
+ {
2
+ "name": "@house365/comate",
3
+ "version": "0.9.10",
4
+ "description": "comate —— SDD (规约驱动开发) 的 AI 开发编排器(Agent Skills)",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "publishConfig": {
8
+ "access": "public",
9
+ "registry": "https://registry.npmjs.org"
10
+ },
11
+ "bin": {
12
+ "comate": "bin/cli.mjs",
13
+ "comate-skills": "bin/cli.mjs"
14
+ },
15
+ "files": [
16
+ "skills",
17
+ "bin",
18
+ "!bin/*.test.mjs",
19
+ "docs",
20
+ "README.md",
21
+ "LICENSE"
22
+ ],
23
+ "keywords": [
24
+ "agent-skills",
25
+ "skills",
26
+ "claude-code",
27
+ "openspec",
28
+ "superpowers",
29
+ "spec-driven-development",
30
+ "ai-agents"
31
+ ],
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/liangjiankk/comate.git"
35
+ },
36
+ "homepage": "https://github.com/liangjiankk/comate#readme",
37
+ "bugs": {
38
+ "url": "https://github.com/liangjiankk/comate/issues"
39
+ },
40
+ "engines": {
41
+ "node": ">=20"
42
+ },
43
+ "dependencies": {
44
+ "ccusage": "^20.0.19",
45
+ "skills": "^1.5.21"
46
+ },
47
+ "scripts": {
48
+ "postinstall": "node bin/postinstall.mjs",
49
+ "test": "node bin/init.test.mjs && node bin/usage.test.mjs && bash skills/comate/tests/run.sh",
50
+ "doctor": "cd skills && bash comate/scripts/comate.sh doctor",
51
+ "prepublish-check": "node scripts/prepublish-check.mjs",
52
+ "pack-check": "node scripts/pack-check.mjs",
53
+ "prepublishOnly": "npm run prepublish-check && npm run pack-check && npm run doctor && npm test"
54
+ }
55
+ }