patchcord 0.6.24 → 0.6.25
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/.claude-plugin/plugin.json +1 -1
- package/bin/patchcord.mjs +26 -9
- package/package.json +1 -1
package/bin/patchcord.mjs
CHANGED
|
@@ -257,11 +257,14 @@ function _purgeLegacyKimiProjectConfig(dir) {
|
|
|
257
257
|
} catch {}
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
-
// Cursor slash menu duplicates come from
|
|
261
|
-
//
|
|
262
|
-
// cursor-agent's node_modules/patchcord
|
|
263
|
-
//
|
|
264
|
-
//
|
|
260
|
+
// Cursor slash menu duplicates come from multiple trees Cursor CLI indexes:
|
|
261
|
+
// (a) stale no-hyphen / colon dirs under skills-cursor
|
|
262
|
+
// (b) cursor-agent's bundled node_modules/patchcord — both skills/ (Claude
|
|
263
|
+
// colon names → /patchcordinbox) AND per-project-skills/cursor (exact
|
|
264
|
+
// dupes of skills-cursor /patchcord-inbox)
|
|
265
|
+
// (c) ~/.agents/skills Codex copies (/patchcord) — Cursor indexes Agent Skills
|
|
266
|
+
// NEVER delete ~/.agents/skills content (Codex owns that tree). We only strip
|
|
267
|
+
// the cursor-agent-bundled copies Cursor should not show.
|
|
265
268
|
function _purgeCursorSkillDuplicates() {
|
|
266
269
|
const staleCursorOnly = [
|
|
267
270
|
"patchcord",
|
|
@@ -278,8 +281,22 @@ function _purgeCursorSkillDuplicates() {
|
|
|
278
281
|
if (!existsSync(d)) continue;
|
|
279
282
|
try { rmSync(d, { recursive: true, force: true }); } catch {}
|
|
280
283
|
}
|
|
281
|
-
//
|
|
282
|
-
//
|
|
284
|
+
// Keep ONLY the three hyphenated Cursor skills under skills-cursor.
|
|
285
|
+
// Anything else named patchcord* there is leftover junk.
|
|
286
|
+
if (existsSync(cursorSkillsRoot)) {
|
|
287
|
+
const keep = new Set(["patchcord-inbox", "patchcord-wait", "patchcord-subscribe"]);
|
|
288
|
+
try {
|
|
289
|
+
for (const ent of readdirSync(cursorSkillsRoot, { withFileTypes: true })) {
|
|
290
|
+
if (!ent.isDirectory()) continue;
|
|
291
|
+
if (!/^patchcord/i.test(ent.name)) continue;
|
|
292
|
+
if (keep.has(ent.name)) continue;
|
|
293
|
+
try { rmSync(join(cursorSkillsRoot, ent.name), { recursive: true, force: true }); } catch {}
|
|
294
|
+
}
|
|
295
|
+
} catch {}
|
|
296
|
+
}
|
|
297
|
+
// cursor-agent ships the full npm package. Cursor indexes SKILL.md under it,
|
|
298
|
+
// so strip BOTH skills/ and per-project-skills/ from every bundled copy.
|
|
299
|
+
// Canonical Cursor skills live only in ~/.cursor/skills-cursor/.
|
|
283
300
|
const cursorAgentRoot = join(HOME, ".local", "share", "cursor-agent");
|
|
284
301
|
if (existsSync(cursorAgentRoot)) {
|
|
285
302
|
const walk = (dir, depth = 0) => {
|
|
@@ -290,8 +307,8 @@ function _purgeCursorSkillDuplicates() {
|
|
|
290
307
|
const p = join(dir, ent.name);
|
|
291
308
|
if (ent.isDirectory()) {
|
|
292
309
|
if (ent.name === "patchcord" && dir.endsWith("node_modules")) {
|
|
293
|
-
for (const
|
|
294
|
-
const sd = join(p,
|
|
310
|
+
for (const sub of ["skills", "per-project-skills"]) {
|
|
311
|
+
const sd = join(p, sub);
|
|
295
312
|
if (existsSync(sd)) {
|
|
296
313
|
try { rmSync(sd, { recursive: true, force: true }); } catch {}
|
|
297
314
|
}
|
package/package.json
CHANGED