compound-workflow 1.6.10 → 1.6.12

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compound-workflow",
3
- "version": "1.6.10",
3
+ "version": "1.6.12",
4
4
  "description": "Clarify -> plan -> execute -> verify -> capture workflow: commands, skills, and agents for Claude Code",
5
5
  "author": {
6
6
  "name": "Compound Workflow"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compound-workflow",
3
- "version": "1.6.10",
3
+ "version": "1.6.12",
4
4
  "description": "Clarify -> plan -> execute -> verify -> capture workflow for Cursor",
5
5
  "author": {
6
6
  "name": "Compound Workflow"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compound-workflow",
3
- "version": "1.6.10",
3
+ "version": "1.6.12",
4
4
  "description": "Clarify → plan → execute → verify → capture. One Install action for Cursor, Claude, and OpenCode.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -328,8 +328,13 @@ function ensureDirs(targetRoot, dryRun) {
328
328
  }
329
329
  }
330
330
 
331
+ /**
332
+ * Writes .cursor-plugin/plugin.json and .claude-plugin/plugin.json at targetRoot.
333
+ * Paths (commands, agents, skills) in the written manifests are relative to project root
334
+ * (parent of .cursor-plugin / .claude-plugin) so Cursor/Claude resolve assets correctly.
335
+ */
331
336
  function writePluginManifests(targetRoot, dryRun, isSelfInstall) {
332
- const pathsBase = isSelfInstall ? "src/.agents" : "node_modules/compound-workflow/src/.agents";
337
+ const pathsBase = isSelfInstall ? "./src/.agents" : "./node_modules/compound-workflow/src/.agents";
333
338
  const pathOverrides = {
334
339
  commands: `${pathsBase}/commands`,
335
340
  agents: `${pathsBase}/agents`,
@@ -346,23 +351,15 @@ function writePluginManifests(targetRoot, dryRun, isSelfInstall) {
346
351
  const cursorDir = path.join(targetRoot, ".cursor-plugin");
347
352
  const claudeDir = path.join(targetRoot, ".claude-plugin");
348
353
 
349
- const installPathAbs = realpathSafe(targetRoot);
350
- const registrationDescriptor = {
351
- pluginId: "compound-workflow@local",
352
- scope: "user",
353
- installPath: installPathAbs,
354
- };
355
-
356
354
  if (dryRun) {
357
- console.log("[dry-run] Would write .cursor-plugin/plugin.json, .claude-plugin/plugin.json, .cursor-plugin/registration.json");
355
+ console.log("[dry-run] Would write .cursor-plugin/plugin.json, .claude-plugin/plugin.json");
358
356
  return;
359
357
  }
360
358
  fs.mkdirSync(cursorDir, { recursive: true });
361
359
  fs.mkdirSync(claudeDir, { recursive: true });
362
360
  fs.writeFileSync(path.join(cursorDir, "plugin.json"), JSON.stringify(cursorOut, null, 2) + "\n", "utf8");
363
361
  fs.writeFileSync(path.join(claudeDir, "plugin.json"), JSON.stringify(claudeOut, null, 2) + "\n", "utf8");
364
- fs.writeFileSync(path.join(cursorDir, "registration.json"), JSON.stringify(registrationDescriptor, null, 2) + "\n", "utf8");
365
- console.log("Wrote: .cursor-plugin/plugin.json, .claude-plugin/plugin.json, .cursor-plugin/registration.json");
362
+ console.log("Wrote: .cursor-plugin/plugin.json, .claude-plugin/plugin.json");
366
363
  }
367
364
 
368
365
  /**
@@ -449,68 +446,17 @@ function cursorDetected() {
449
446
  }
450
447
 
451
448
  function applyCursorRegistration(targetRoot, dryRun, noRegisterCursor, forceRegister, isSelfInstall) {
452
- const claudePluginsDir = path.join(os.homedir(), ".claude", "plugins");
453
- const installedPath = path.join(claudePluginsDir, "installed_plugins.json");
454
449
  const settingsPath = path.join(os.homedir(), ".claude", "settings.json");
455
450
 
456
- const pluginVersion = (() => {
457
- try {
458
- const pkgPath = path.join(PACKAGE_ROOT, "package.json");
459
- return JSON.parse(fs.readFileSync(pkgPath, "utf8")).version || "0.0.0";
460
- } catch {
461
- return "0.0.0";
462
- }
463
- })();
464
-
465
- // For self-install (dev), use the package root with user scope.
466
- // For consumer projects, use the project root with project scope so each
467
- // project gets its own entry and installs don't overwrite each other.
468
- const targetRootReal = realpathSafe(isSelfInstall ? PACKAGE_ROOT : targetRoot);
469
- const pluginId = "compound-workflow@local";
470
- const scope = isSelfInstall ? "user" : "project";
471
-
472
- let installed = {};
473
- if (fs.existsSync(installedPath)) {
474
- try {
475
- installed = readJsonMaybe(installedPath) ?? {};
476
- } catch {
477
- installed = {};
478
- }
479
- }
480
- const plugins = ensureObject(installed.plugins);
481
- const existingEntries = Array.isArray(plugins[pluginId]) ? plugins[pluginId] : [];
482
-
483
- // Remove legacy scope:"user" entries when switching to project-scope
484
- const cleanedEntries = scope === "project"
485
- ? existingEntries.filter((e) => e.scope !== "user")
486
- : existingEntries;
487
-
488
- // Prune stale entries whose installPath no longer has a plugin manifest on disk
489
- const pruned = cleanedEntries.filter((e) => {
490
- const manifest = path.join(e.installPath || "", ".claude-plugin", "plugin.json");
491
- return fs.existsSync(manifest);
492
- });
493
-
494
- // Find existing entry for this project (or user-scope entry for self-install)
495
- const matchIndex = pruned.findIndex((e) =>
496
- scope === "user" ? e.scope === "user" : e.scope === "project" && e.projectPath === targetRootReal
497
- );
451
+ const LEGACY_PLUGIN_ID = "compound-workflow@local";
452
+ const pluginId = "compound-workflow@compound-workflow";
498
453
 
499
- const existingEntry = matchIndex >= 0 ? pruned[matchIndex] : {};
500
- const now = new Date().toISOString();
501
- const newEntry = {
502
- scope,
503
- ...(scope === "project" ? { projectPath: targetRootReal } : {}),
504
- installPath: targetRootReal,
505
- version: pluginVersion,
506
- installedAt: existingEntry.installedAt || now,
507
- lastUpdated: now,
508
- };
509
-
510
- plugins[pluginId] = matchIndex >= 0
511
- ? pruned.map((e, i) => (i === matchIndex ? newEntry : e))
512
- : [...pruned, newEntry];
513
- installed.plugins = plugins;
454
+ // Marketplace source path:
455
+ // - Self-install (dev): absolute path to package root
456
+ // - Consumer projects: relative path from project root to package
457
+ const marketplacePath = isSelfInstall
458
+ ? realpathSafe(PACKAGE_ROOT)
459
+ : "./node_modules/compound-workflow";
514
460
 
515
461
  let settings = {};
516
462
  if (fs.existsSync(settingsPath)) {
@@ -520,31 +466,50 @@ function applyCursorRegistration(targetRoot, dryRun, noRegisterCursor, forceRegi
520
466
  settings = {};
521
467
  }
522
468
  }
523
- // User-level settings (backward compat)
469
+ // Clean up legacy @local entry and register with correct plugin ID
524
470
  settings.enabledPlugins = ensureObject(settings.enabledPlugins);
471
+ delete settings.enabledPlugins[LEGACY_PLUGIN_ID];
525
472
  settings.enabledPlugins[pluginId] = true;
526
473
 
527
474
  if (dryRun) {
528
- console.log("[dry-run] Would register Claude plugin:", JSON.stringify(newEntry, null, 2));
475
+ console.log("[dry-run] Would register Claude plugin via extraKnownMarketplaces with id:", pluginId);
529
476
  return;
530
477
  }
531
478
 
532
- fs.mkdirSync(claudePluginsDir, { recursive: true });
533
479
  fs.mkdirSync(path.dirname(settingsPath), { recursive: true });
534
- fs.writeFileSync(installedPath, JSON.stringify(installed, null, 2) + "\n", "utf8");
535
480
  fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n", "utf8");
536
481
 
537
- // Project-level settings required for scope:"project" to activate
482
+ // Project-level settings: register local marketplace and enable plugin
538
483
  if (!isSelfInstall) {
539
484
  const projectSettingsPath = path.join(targetRoot, ".claude", "settings.json");
540
485
  let projectSettings = {};
541
486
  if (fs.existsSync(projectSettingsPath)) {
542
487
  try { projectSettings = readJsonMaybe(projectSettingsPath) ?? {}; } catch { projectSettings = {}; }
543
488
  }
489
+ // Clean up legacy @local entry
544
490
  projectSettings.enabledPlugins = ensureObject(projectSettings.enabledPlugins);
491
+ delete projectSettings.enabledPlugins[LEGACY_PLUGIN_ID];
545
492
  projectSettings.enabledPlugins[pluginId] = true;
493
+ // Register the package as a local marketplace so Claude Code resolves compound-workflow@compound-workflow
494
+ projectSettings.extraKnownMarketplaces = ensureObject(projectSettings.extraKnownMarketplaces);
495
+ projectSettings.extraKnownMarketplaces["compound-workflow"] = {
496
+ source: {
497
+ source: "local",
498
+ path: marketplacePath,
499
+ },
500
+ };
546
501
  fs.mkdirSync(path.join(targetRoot, ".claude"), { recursive: true });
547
502
  fs.writeFileSync(projectSettingsPath, JSON.stringify(projectSettings, null, 2) + "\n", "utf8");
503
+ } else {
504
+ // Self-install: register marketplace at user level with absolute path
505
+ settings.extraKnownMarketplaces = ensureObject(settings.extraKnownMarketplaces);
506
+ settings.extraKnownMarketplaces["compound-workflow"] = {
507
+ source: {
508
+ source: "local",
509
+ path: marketplacePath,
510
+ },
511
+ };
512
+ fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n", "utf8");
548
513
  }
549
514
 
550
515
  console.log("Registered compound-workflow with Claude Code. Restart Claude Code; enable 'Include third-party Plugins, Skills, and other configs' in Settings if needed.");
@@ -556,8 +521,8 @@ function applyCursorRegistration(targetRoot, dryRun, noRegisterCursor, forceRegi
556
521
  return;
557
522
  }
558
523
 
559
- const registrationPath = path.join(targetRoot, ".cursor-plugin", "registration.json");
560
- if (!fs.existsSync(registrationPath)) return;
524
+ const cursorPluginPath = path.join(targetRoot, ".cursor-plugin", "plugin.json");
525
+ if (!fs.existsSync(cursorPluginPath)) return;
561
526
  console.log("Registered compound-workflow with Cursor. Restart Cursor; enable 'Include third-party Plugins, Skills, and other configs' in Settings if needed.");
562
527
  }
563
528
 
@@ -1,11 +0,0 @@
1
- {
2
- "name": "compound-workflow",
3
- "owner": { "name": "Compound Workflow" },
4
- "plugins": [
5
- {
6
- "name": "compound-workflow",
7
- "source": ".",
8
- "description": "Clarify → plan → execute → verify → capture workflow. Commands, skills, and agents for structured development."
9
- }
10
- ]
11
- }