agent-skills-standard 2.4.4 → 2.4.5

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 CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  **Sync 242 AI coding standards to any project in one command.** Works with Cursor, Claude Code, GitHub Copilot, Gemini, Windsurf, Trae, Kiro, and Roo.
7
7
 
8
- **Current release:** `v2.4.4` — packaged `ags -V` now matches the published CLI version.
8
+ **Current release:** `v2.4.5` — packaged `ags -V` now detects stale pnpm shims and guides repair.
9
9
 
10
10
  ```bash
11
11
  npx agent-skills-standard@latest init # detect your stack
package/dist/index.js CHANGED
@@ -24,10 +24,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  let commander = require("commander");
25
25
  let dotenv = require("dotenv");
26
26
  dotenv = __toESM(dotenv);
27
- let inquirer = require("inquirer");
28
- inquirer = __toESM(inquirer);
29
27
  let picocolors = require("picocolors");
30
28
  picocolors = __toESM(picocolors);
29
+ let inquirer = require("inquirer");
30
+ inquirer = __toESM(inquirer);
31
31
  let fs_extra = require("fs-extra");
32
32
  fs_extra = __toESM(fs_extra);
33
33
  let js_yaml = require("js-yaml");
@@ -40,6 +40,60 @@ cross_fetch = __toESM(cross_fetch);
40
40
  let os = require("os");
41
41
  os = __toESM(os);
42
42
  let child_process = require("child_process");
43
+ let fs = require("fs");
44
+ var package_default = {
45
+ name: "agent-skills-standard",
46
+ version: "2.4.5",
47
+ description: "A CLI to manage and sync AI agent skills standard for Cursor, Claude, Copilot, Windsurf, and more.",
48
+ main: "dist/index.js",
49
+ bin: {
50
+ "agent-skills-standard": "dist/index.js",
51
+ "ags": "dist/index.js"
52
+ },
53
+ files: ["dist"],
54
+ scripts: {
55
+ "build": "vite build",
56
+ "start": "node dist/index.js",
57
+ "dev": "tsx src/index.ts",
58
+ "validate": "tsx src/index.ts validate",
59
+ "validate:all": "tsx src/index.ts validate --all",
60
+ "format": "prettier --write \"src/**/*.ts\"",
61
+ "format:check": "prettier --check \"src/**/*.ts\"",
62
+ "lint": "eslint \"src/**/*.ts\" --fix",
63
+ "lint:check": "eslint \"src/**/*.ts\"",
64
+ "test": "vitest run",
65
+ "test:watch": "vitest",
66
+ "test:cov": "vitest run --coverage",
67
+ "prepublishOnly": "pnpm build"
68
+ },
69
+ keywords: [
70
+ "ai",
71
+ "agent",
72
+ "cursor",
73
+ "claude",
74
+ "copilot",
75
+ "cli",
76
+ "antigravity"
77
+ ],
78
+ author: "Hoang Nguyen",
79
+ license: "MIT",
80
+ dependencies: {
81
+ "commander": "^11.1.0",
82
+ "cross-fetch": "^4.1.0",
83
+ "dotenv": "^17.2.3",
84
+ "fs-extra": "^11.2.0",
85
+ "inquirer": "^8.2.5",
86
+ "js-yaml": "^4.1.0",
87
+ "picocolors": "^1.0.0",
88
+ "zod": "^3.22.4"
89
+ },
90
+ devDependencies: {
91
+ "@vitest/coverage-v8": "^4.0.17",
92
+ "vite": "^7.0.0",
93
+ "vitest": "^4.0.17"
94
+ }
95
+ };
96
+ //#endregion
43
97
  //#region src/services/FeedbackService.ts
44
98
  /**
45
99
  * Service to handle automated feedback reporting via Proxy Backend.
@@ -4485,58 +4539,6 @@ var SyncCommand = class {
4485
4539
  }
4486
4540
  }
4487
4541
  };
4488
- var package_default = {
4489
- name: "agent-skills-standard",
4490
- version: "2.4.4",
4491
- description: "A CLI to manage and sync AI agent skills standard for Cursor, Claude, Copilot, Windsurf, and more.",
4492
- main: "dist/index.js",
4493
- bin: {
4494
- "agent-skills-standard": "dist/index.js",
4495
- "ags": "dist/index.js"
4496
- },
4497
- files: ["dist"],
4498
- scripts: {
4499
- "build": "vite build",
4500
- "start": "node dist/index.js",
4501
- "dev": "tsx src/index.ts",
4502
- "validate": "tsx src/index.ts validate",
4503
- "validate:all": "tsx src/index.ts validate --all",
4504
- "format": "prettier --write \"src/**/*.ts\"",
4505
- "format:check": "prettier --check \"src/**/*.ts\"",
4506
- "lint": "eslint \"src/**/*.ts\" --fix",
4507
- "lint:check": "eslint \"src/**/*.ts\"",
4508
- "test": "vitest run",
4509
- "test:watch": "vitest",
4510
- "test:cov": "vitest run --coverage",
4511
- "prepublishOnly": "pnpm build"
4512
- },
4513
- keywords: [
4514
- "ai",
4515
- "agent",
4516
- "cursor",
4517
- "claude",
4518
- "copilot",
4519
- "cli",
4520
- "antigravity"
4521
- ],
4522
- author: "Hoang Nguyen",
4523
- license: "MIT",
4524
- dependencies: {
4525
- "commander": "^11.1.0",
4526
- "cross-fetch": "^4.1.0",
4527
- "dotenv": "^17.2.3",
4528
- "fs-extra": "^11.2.0",
4529
- "inquirer": "^8.2.5",
4530
- "js-yaml": "^4.1.0",
4531
- "picocolors": "^1.0.0",
4532
- "zod": "^3.22.4"
4533
- },
4534
- devDependencies: {
4535
- "@vitest/coverage-v8": "^4.0.17",
4536
- "vite": "^7.0.0",
4537
- "vitest": "^4.0.17"
4538
- }
4539
- };
4540
4542
  //#endregion
4541
4543
  //#region src/commands/upgrade.ts
4542
4544
  /**
@@ -4606,7 +4608,7 @@ var UpgradeCommand = class {
4606
4608
  else {
4607
4609
  console.log("\n" + picocolors.default.yellow(`⚠️ pnpm installed v${latestVersion}, but 'ags -V' still reports v${shellVersion}.`));
4608
4610
  console.log(picocolors.default.gray(" Your shell is still resolving a stale shim or PATH entry."));
4609
- this.printShellMismatchHint();
4611
+ await this.detectAndFixStaleShim(latestVersion);
4610
4612
  }
4611
4613
  } catch {
4612
4614
  console.log(picocolors.default.green("\n✅ Upgrade command finished."));
@@ -4672,13 +4674,76 @@ var UpgradeCommand = class {
4672
4674
  return null;
4673
4675
  }
4674
4676
  }
4677
+ /**
4678
+ * Shown when the pnpm package store itself is stale/incomplete (Case 1).
4679
+ * Falls back to a resolved-binary hint and PATH guidance.
4680
+ */
4675
4681
  printShellMismatchHint() {
4676
- const resolvedBinary = (0, child_process.execSync)("type -a ags", {
4677
- encoding: "utf8",
4678
- stdio: "pipe"
4679
- }).trim();
4680
- console.log(picocolors.default.gray(` Resolved binary:\n${resolvedBinary}`));
4681
- console.log(picocolors.default.cyan(`👉 Recommendation: make sure ${picocolors.default.bold("~/Library/pnpm")} comes before ${picocolors.default.bold("~/Library/pnpm/bin")} in PATH, then run ${picocolors.default.bold("hash -r")} and recheck with 'ags -V'.`));
4682
+ try {
4683
+ const resolvedBinary = (0, child_process.execSync)("type -a ags", {
4684
+ encoding: "utf8",
4685
+ stdio: "pipe"
4686
+ }).trim();
4687
+ console.log(picocolors.default.gray(` Resolved binary:\n${resolvedBinary}`));
4688
+ } catch {}
4689
+ this.printShimPathHint();
4690
+ }
4691
+ /**
4692
+ * Prints the standard PATH-order fix recommendation.
4693
+ */
4694
+ printShimPathHint() {
4695
+ console.log(picocolors.default.cyan(`👉 Make sure ${picocolors.default.bold("~/Library/pnpm")} comes before ${picocolors.default.bold("~/Library/pnpm/bin")} in PATH, then run ${picocolors.default.bold("hash -r")} and recheck with ${picocolors.default.bold("ags -V")}.`));
4696
+ }
4697
+ /**
4698
+ * Called when the pnpm store is correct but `ags -V` still reports an old
4699
+ * version (Case 2 — stale shim). Attempts to locate and remove the stale
4700
+ * shim file at <pnpm-bin>/bin/ags, which is created by older pnpm versions
4701
+ * using a content-addressed hash path that is never updated on reinstall.
4702
+ */
4703
+ async detectAndFixStaleShim(latestVersion) {
4704
+ try {
4705
+ const resolvedBinary = (0, child_process.execSync)("type -a ags", {
4706
+ encoding: "utf8",
4707
+ stdio: "pipe"
4708
+ }).trim();
4709
+ console.log(picocolors.default.gray(` Resolved binary:\n${resolvedBinary}`));
4710
+ } catch {}
4711
+ try {
4712
+ const pnpmBin = (0, child_process.execSync)("pnpm bin -g", {
4713
+ encoding: "utf8",
4714
+ stdio: "pipe"
4715
+ }).trim();
4716
+ const staleShimPath = path.default.join(pnpmBin, "bin", "ags");
4717
+ if (!(0, fs.existsSync)(staleShimPath)) {
4718
+ this.printShimPathHint();
4719
+ return;
4720
+ }
4721
+ if ((0, fs.readFileSync)(staleShimPath, "utf8").includes(`agent-skills-standard@${latestVersion}`)) {
4722
+ this.printShimPathHint();
4723
+ return;
4724
+ }
4725
+ const correctShimPath = path.default.join(pnpmBin, "ags");
4726
+ if (!(0, fs.existsSync)(correctShimPath)) {
4727
+ console.log(picocolors.default.yellow(`⚠️ Correct shim not found at ${correctShimPath}. Re-run: ${picocolors.default.bold("pnpm add -g agent-skills-standard@latest")}`));
4728
+ this.printShimPathHint();
4729
+ return;
4730
+ }
4731
+ console.log("\n" + picocolors.default.yellow(`🔍 Stale shim detected: ${staleShimPath}`));
4732
+ console.log(picocolors.default.gray(" It points to an old install path and will always report the wrong version."));
4733
+ const { remove } = await inquirer.default.prompt([{
4734
+ type: "confirm",
4735
+ name: "remove",
4736
+ message: `Remove stale shim at ${staleShimPath}?`,
4737
+ default: true
4738
+ }]);
4739
+ if (remove) {
4740
+ (0, fs.unlinkSync)(staleShimPath);
4741
+ console.log(picocolors.default.green("✅ Stale shim removed."));
4742
+ console.log(picocolors.default.cyan(` Run ${picocolors.default.bold("hash -r")} then ${picocolors.default.bold("ags -V")} to confirm the correct version.`));
4743
+ } else this.printShimPathHint();
4744
+ } catch {
4745
+ this.printShimPathHint();
4746
+ }
4682
4747
  }
4683
4748
  printManualInstructions(pm, version) {
4684
4749
  const sudoPrefix = process.platform === "win32" ? "" : "sudo ";
@@ -5024,8 +5089,10 @@ var ValidateCommand = class {
5024
5089
  //#endregion
5025
5090
  //#region src/index.ts
5026
5091
  dotenv.default.config();
5092
+ var _agsExecPath = process.argv[1] ?? "";
5093
+ if (_agsExecPath.includes("/pnpm/") && _agsExecPath.includes("/node_modules/agent-skills-standard/") && !_agsExecPath.includes(`agent-skills-standard@${package_default.version}`)) process.stderr.write(`\n${picocolors.default.yellow("⚠️ ags is running from a stale global shim — reported version will be wrong.")}\n ${picocolors.default.cyan("Quickfix:")} ${picocolors.default.bold("npx agent-skills-standard@latest upgrade")} ` + picocolors.default.gray("(auto-detects & removes the stale shim)") + "\n\n");
5027
5094
  var program = new commander.Command();
5028
- program.name("agent-skills-standard").description("A CLI to manage and sync AI agent skills for Cursor, Claude, Copilot, Windsurf, and more.").version("2.4.4");
5095
+ program.name("agent-skills-standard").description("A CLI to manage and sync AI agent skills for Cursor, Claude, Copilot, Windsurf, and more.").version(package_default.version);
5029
5096
  program.command("init").description("Initialize a .skillsrc configuration file interactively").action(async () => {
5030
5097
  await new InitCommand().run();
5031
5098
  });