agent-skills-standard 2.4.3 → 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,13 +5,15 @@
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.3` — 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
12
12
  npx agent-skills-standard@latest sync # install skills
13
13
  ```
14
14
 
15
+ If `ags -V` still shows an old version after reinstalling, check your PATH order. `~/Library/pnpm` must come before `~/Library/pnpm/bin`, then run `hash -r` and verify with `ags -V` again.
16
+
15
17
  ---
16
18
 
17
19
  ## What It Does
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.3",
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
  /**
@@ -4588,7 +4590,31 @@ var UpgradeCommand = class {
4588
4590
  console.log(picocolors.default.yellow(`⚠️ Failed to install v${latestVersion}. Retrying with @latest...`));
4589
4591
  (0, child_process.execSync)(this.getUpgradeCommand(pm, "latest"), { stdio: "inherit" });
4590
4592
  }
4591
- try {
4593
+ if (pm === "pnpm") {
4594
+ const installedVersion = this.getInstalledVersionFromPnpm(latestVersion);
4595
+ if (installedVersion !== latestVersion) {
4596
+ console.log("\n" + picocolors.default.red(`❌ pnpm install completed, but the installed package still reports v${installedVersion ?? "unknown"}.`));
4597
+ console.log(picocolors.default.gray(" This means the global install itself is stale or incomplete, not just the shell shim."));
4598
+ this.printShellMismatchHint();
4599
+ return;
4600
+ }
4601
+ try {
4602
+ const lines = (0, child_process.execSync)("ags -V", {
4603
+ encoding: "utf8",
4604
+ stdio: "pipe"
4605
+ }).trim().split("\n");
4606
+ const shellVersion = lines[lines.length - 1].trim();
4607
+ if (shellVersion.includes(latestVersion)) console.log(picocolors.default.green(`✅ Successfully upgraded to v${latestVersion}!`));
4608
+ else {
4609
+ console.log("\n" + picocolors.default.yellow(`⚠️ pnpm installed v${latestVersion}, but 'ags -V' still reports v${shellVersion}.`));
4610
+ console.log(picocolors.default.gray(" Your shell is still resolving a stale shim or PATH entry."));
4611
+ await this.detectAndFixStaleShim(latestVersion);
4612
+ }
4613
+ } catch {
4614
+ console.log(picocolors.default.green("\n✅ Upgrade command finished."));
4615
+ console.log(picocolors.default.gray(" (Installed version verified via pnpm; please check the shell command with 'ags -V')"));
4616
+ }
4617
+ } else try {
4592
4618
  const lines = (0, child_process.execSync)("ags -V", {
4593
4619
  encoding: "utf8",
4594
4620
  stdio: "pipe"
@@ -4596,9 +4622,14 @@ var UpgradeCommand = class {
4596
4622
  const installedVersion = lines[lines.length - 1].trim();
4597
4623
  if (installedVersion.includes(latestVersion)) console.log(picocolors.default.green(`✅ Successfully upgraded to v${latestVersion}!`));
4598
4624
  else {
4625
+ const resolvedBinary = (0, child_process.execSync)("type -a ags", {
4626
+ encoding: "utf8",
4627
+ stdio: "pipe"
4628
+ }).trim();
4599
4629
  console.log("\n" + picocolors.default.yellow(`⚠️ Installation complete, but 'ags -V' still reports v${installedVersion}.`));
4600
- console.log(picocolors.default.gray(" This is common if multiple versions are installed or your shell needs a restart."));
4601
- console.log(picocolors.default.cyan(`👉 Recommendation: Restart your terminal or run: ${picocolors.default.bold(this.getUpgradeCommand(pm, latestVersion) + " --force")}`));
4630
+ console.log(picocolors.default.gray(" This usually means your shell is still resolving a stale shim or PATH entry."));
4631
+ console.log(picocolors.default.gray(` Resolved binary:\n${resolvedBinary}`));
4632
+ 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'.`));
4602
4633
  }
4603
4634
  } catch {
4604
4635
  console.log(picocolors.default.green("\n✅ Upgrade command finished."));
@@ -4628,6 +4659,92 @@ var UpgradeCommand = class {
4628
4659
  default: return `npm install -g agent-skills-standard@${version}`;
4629
4660
  }
4630
4661
  }
4662
+ getInstalledVersionFromPnpm(version) {
4663
+ try {
4664
+ const globalRoot = (0, child_process.execSync)("pnpm root -g", {
4665
+ encoding: "utf8",
4666
+ stdio: "pipe"
4667
+ }).trim();
4668
+ const packageJsonPath = path.default.join(globalRoot, ".pnpm", `agent-skills-standard@${version}`, "node_modules", "agent-skills-standard", "package.json");
4669
+ return (0, child_process.execSync)(`node -p "require(${JSON.stringify(packageJsonPath)}).version"`, {
4670
+ encoding: "utf8",
4671
+ stdio: "pipe"
4672
+ }).trim() || null;
4673
+ } catch {
4674
+ return null;
4675
+ }
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
+ */
4681
+ printShellMismatchHint() {
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
+ }
4747
+ }
4631
4748
  printManualInstructions(pm, version) {
4632
4749
  const sudoPrefix = process.platform === "win32" ? "" : "sudo ";
4633
4750
  console.log(picocolors.default.yellow("Possible reasons:"));
@@ -4972,8 +5089,10 @@ var ValidateCommand = class {
4972
5089
  //#endregion
4973
5090
  //#region src/index.ts
4974
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");
4975
5094
  var program = new commander.Command();
4976
- 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.3");
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);
4977
5096
  program.command("init").description("Initialize a .skillsrc configuration file interactively").action(async () => {
4978
5097
  await new InitCommand().run();
4979
5098
  });