@trendai-crem/claude-skills 1.0.1 → 1.0.2

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.
@@ -142,11 +142,23 @@ export const marketplaceHandler = {
142
142
 
143
143
  /**
144
144
  * Uninstalls stale plugin@marketplace keys.
145
+ * Skips plugins that are already not installed (idempotent).
145
146
  * @param {string[]} staleItems - Keys like "plugin@marketplace".
146
147
  * @returns {Array<{label, action, ok}>}
147
148
  */
148
149
  uninstall(staleItems) {
150
+ // Check which plugins are actually installed before attempting uninstall.
151
+ const installedPath = join(homedir(), '.claude', 'plugins', 'installed_plugins.json');
152
+ const installedData = readJsonObject(installedPath, {}, 'installed_plugins.json');
153
+ const rawInstalled = installedData.plugins ?? installedData;
154
+ const installed = (typeof rawInstalled === 'object' && rawInstalled !== null && !Array.isArray(rawInstalled))
155
+ ? rawInstalled : {};
156
+
149
157
  return staleItems.map(key => {
158
+ // Already not installed — skip silently, desired state already achieved.
159
+ if (!Object.hasOwn(installed, key)) {
160
+ return { label: key, action: 'uninstall', ok: true };
161
+ }
150
162
  try {
151
163
  execFileSync('claude', ['plugin', 'uninstall', key], { stdio: 'inherit' });
152
164
  return { label: key, action: 'uninstall', ok: true };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trendai-crem/claude-skills",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Claude Code skills installer for the trendai-crem team",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {