@iceinvein/agent-skills 0.1.14 → 0.1.16

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/dist/cli/index.js CHANGED
@@ -644,16 +644,66 @@ async function updateSkill(cwd, skillName) {
644
644
  }
645
645
  return { ok: true, from: oldVersion, to: manifestResult.manifest.version };
646
646
  }
647
+ async function updateAllSkills(cwd) {
648
+ const lockfile = await readLockfile(cwd);
649
+ const skillNames = Object.keys(lockfile.skills);
650
+ if (skillNames.length === 0)
651
+ return [];
652
+ const results = [];
653
+ for (const name of skillNames) {
654
+ const result = await updateSkill(cwd, name);
655
+ results.push({ name, ...result });
656
+ }
657
+ return results;
658
+ }
659
+
660
+ // src/cli/update-check.ts
661
+ var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;
662
+ async function checkForUpdates(cwd) {
663
+ try {
664
+ const lockfile = await readLockfile(cwd);
665
+ const skillNames = Object.keys(lockfile.skills);
666
+ if (skillNames.length === 0)
667
+ return [];
668
+ if (lockfile.lastUpdateCheck) {
669
+ const lastCheck = new Date(lockfile.lastUpdateCheck).getTime();
670
+ if (Date.now() - lastCheck < CHECK_INTERVAL_MS)
671
+ return [];
672
+ }
673
+ const results = await Promise.all(skillNames.map(async (name) => {
674
+ try {
675
+ const result = await fetchSkillManifest2(name);
676
+ if (!result.ok)
677
+ return null;
678
+ const installed = lockfile.skills[name].version;
679
+ if (result.manifest.version !== installed) {
680
+ return { name, installed, latest: result.manifest.version };
681
+ }
682
+ return null;
683
+ } catch {
684
+ return null;
685
+ }
686
+ }));
687
+ lockfile.lastUpdateCheck = new Date().toISOString();
688
+ await writeLockfile(cwd, lockfile);
689
+ return results.filter((r) => r !== null);
690
+ } catch {
691
+ return [];
692
+ }
693
+ }
647
694
 
648
695
  // src/cli/types.ts
649
696
  var TOOL_NAMES2 = ["claude", "cursor", "codex", "gemini"];
650
697
 
651
698
  // src/cli/prompt.ts
652
699
  import { createInterface } from "node:readline";
653
- var rl = createInterface({ input: process.stdin, output: process.stdout });
654
700
  function ask(question) {
701
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
655
702
  return new Promise((resolve) => {
656
- rl.question(question, (answer) => resolve(answer.trim()));
703
+ rl.question(question, (answer) => {
704
+ rl.close();
705
+ resolve(answer.trim());
706
+ });
657
707
  });
658
708
  }
659
709
  async function promptSelect(message, options) {
@@ -666,7 +716,6 @@ ${message}
666
716
  console.log(` ${options.length + 1}) All of the above`);
667
717
  const answer = await ask(`
668
718
  Select (comma-separated numbers, e.g. 1,3): `);
669
- rl.close();
670
719
  const nums = answer.split(",").map((s) => parseInt(s.trim(), 10));
671
720
  if (nums.includes(options.length + 1)) {
672
721
  return options.map((o) => o.value);
@@ -689,7 +738,7 @@ function resolveInstallDir(flags) {
689
738
  }
690
739
  return process.cwd();
691
740
  }
692
- var BOOLEAN_FLAGS = new Set(["global", "g"]);
741
+ var BOOLEAN_FLAGS = new Set(["global", "g", "all"]);
693
742
  function parseArgs(argv) {
694
743
  if (argv.length === 0)
695
744
  return { command: "help", args: [], flags: {} };
@@ -722,6 +771,7 @@ Usage:
722
771
  agent-skills install <skill> [--tool <tool>] [-g] Install a skill
723
772
  agent-skills remove <skill> [-g] Remove a skill
724
773
  agent-skills update <skill> [-g] Update a skill
774
+ agent-skills update --all [-g] Update all installed skills
725
775
  agent-skills list List available skills
726
776
  agent-skills info <skill> Show skill details
727
777
 
@@ -821,12 +871,31 @@ async function main() {
821
871
  break;
822
872
  }
823
873
  case "update": {
874
+ const updateDir = resolveInstallDir(flags);
875
+ if (flags.all !== undefined) {
876
+ console.log(`Updating all installed skills...
877
+ `);
878
+ const results = await updateAllSkills(updateDir);
879
+ if (results.length === 0) {
880
+ console.log("No skills installed.");
881
+ break;
882
+ }
883
+ for (const r of results) {
884
+ if (!r.ok) {
885
+ console.error(` \u2717 ${r.name}: ${r.error}`);
886
+ } else if (r.from === r.to) {
887
+ console.log(` \u2298 ${r.name} already up to date (v${r.to})`);
888
+ } else {
889
+ console.log(` \u2713 ${r.name} v${r.from} \u2192 v${r.to}`);
890
+ }
891
+ }
892
+ break;
893
+ }
824
894
  const skillName = args[0];
825
895
  if (!skillName) {
826
896
  console.error("Error: skill name required. Usage: agent-skills update <skill>");
827
897
  process.exit(1);
828
898
  }
829
- const updateDir = resolveInstallDir(flags);
830
899
  console.log(`Updating '${skillName}'...`);
831
900
  const result = await updateSkill(updateDir, skillName);
832
901
  if (!result.ok) {
@@ -879,6 +948,16 @@ ${m.name} v${m.version}`);
879
948
  printHelp();
880
949
  break;
881
950
  }
951
+ if (command !== "update") {
952
+ const checkDir = flags.global !== undefined || flags.g !== undefined ? homedir() : process.cwd();
953
+ const outdated = await checkForUpdates(checkDir);
954
+ if (outdated.length > 0) {
955
+ const list = outdated.map((s) => `${s.name} (v${s.installed} \u2192 v${s.latest})`).join(", ");
956
+ console.log(`
957
+ \u26A0 Updates available: ${list}`);
958
+ console.log(" Run: agent-skills update --all");
959
+ }
960
+ }
882
961
  }
883
962
  main().catch((err) => {
884
963
  console.error("Fatal:", err.message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iceinvein/agent-skills",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "Install agent skills into AI coding tools",
5
5
  "author": "iceinvein",
6
6
  "license": "MIT",
@@ -5,6 +5,7 @@ description: >
5
5
  and readable prose. Three intensity levels: clean, tight (default), sharp.
6
6
  Always-on from session start. Switch with /terse clean|tight|sharp.
7
7
  Off with "stop terse" or "normal mode".
8
+ argument-hint: "[clean|tight|sharp]"
8
9
  ---
9
10
 
10
11
  Respond direct and concise. All technical substance stays. Grammar stays. Only waste dies.
@@ -13,7 +14,7 @@ Respond direct and concise. All technical substance stays. Grammar stays. Only w
13
14
 
14
15
  ACTIVE EVERY RESPONSE. No filler drift after many turns. Still active if unsure. Off only: "stop terse" / "normal mode".
15
16
 
16
- Default: **tight**. Switch: `/terse clean|tight|sharp`.
17
+ Active level: **$ARGUMENTS[0]** (default to **tight** if no argument provided). Switch anytime: `/terse clean|tight|sharp`.
17
18
 
18
19
  ## What to Eliminate
19
20