ccjk 1.5.0 → 2.0.0

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.
Files changed (51) hide show
  1. package/README.ja.md +249 -297
  2. package/README.ko.md +241 -290
  3. package/README.md +216 -360
  4. package/README.zh-CN.md +234 -311
  5. package/dist/chunks/claude-code-config-manager.mjs +7 -7
  6. package/dist/chunks/claude-code-incremental-manager.mjs +1 -1
  7. package/dist/chunks/codex-config-switch.mjs +3 -3
  8. package/dist/chunks/codex-uninstaller.mjs +2 -2
  9. package/dist/chunks/features.mjs +10 -10
  10. package/dist/chunks/simple-config.mjs +302 -27
  11. package/dist/chunks/smart-guide.mjs +234 -0
  12. package/dist/cli.mjs +2325 -1317
  13. package/dist/i18n/locales/en/marketplace.json +84 -0
  14. package/dist/i18n/locales/en/menu.json +38 -1
  15. package/dist/i18n/locales/en/skills.json +140 -0
  16. package/dist/i18n/locales/en/smartGuide.json +49 -0
  17. package/dist/i18n/locales/en/subagent.json +69 -0
  18. package/dist/i18n/locales/en/superpowers.json +58 -0
  19. package/dist/i18n/locales/zh-CN/marketplace.json +84 -0
  20. package/dist/i18n/locales/zh-CN/menu.json +38 -1
  21. package/dist/i18n/locales/zh-CN/skills.json +140 -0
  22. package/dist/i18n/locales/zh-CN/smartGuide.json +49 -0
  23. package/dist/i18n/locales/zh-CN/subagent.json +69 -0
  24. package/dist/i18n/locales/zh-CN/superpowers.json +58 -0
  25. package/dist/index.d.mts +1 -0
  26. package/dist/index.d.ts +1 -0
  27. package/package.json +26 -27
  28. package/templates/common/skills/en/brainstorming.md +64 -0
  29. package/templates/common/skills/en/code-review.md +81 -0
  30. package/templates/common/skills/en/documentation-gen.md +808 -0
  31. package/templates/common/skills/en/executing-plans.md +75 -0
  32. package/templates/common/skills/en/git-commit.md +216 -0
  33. package/templates/common/skills/en/interview.md +223 -0
  34. package/templates/common/skills/en/migration-assistant.md +312 -0
  35. package/templates/common/skills/en/performance-profiling.md +576 -0
  36. package/templates/common/skills/en/pr-review.md +341 -0
  37. package/templates/common/skills/en/refactoring.md +384 -0
  38. package/templates/common/skills/en/security-audit.md +462 -0
  39. package/templates/common/skills/en/systematic-debugging.md +82 -0
  40. package/templates/common/skills/en/tdd-workflow.md +93 -0
  41. package/templates/common/skills/en/verification.md +81 -0
  42. package/templates/common/skills/en/workflow.md +370 -0
  43. package/templates/common/skills/en/writing-plans.md +78 -0
  44. package/templates/common/skills/zh-CN/documentation-gen.md +807 -0
  45. package/templates/common/skills/zh-CN/migration-assistant.md +318 -0
  46. package/templates/common/skills/zh-CN/performance-profiling.md +746 -0
  47. package/templates/common/skills/zh-CN/pr-review.md +341 -0
  48. package/templates/common/skills/zh-CN/refactoring.md +384 -0
  49. package/templates/common/skills/zh-CN/security-audit.md +462 -0
  50. package/templates/common/smart-guide/en/smart-guide.md +72 -0
  51. package/templates/common/smart-guide/zh-CN/smart-guide.md +72 -0
@@ -14,13 +14,13 @@ import toggleModule from 'inquirer-toggle';
14
14
  import ora from 'ora';
15
15
  import { exec, x } from 'tinyexec';
16
16
  import semver from 'semver';
17
- import { rm, mkdir, copyFile as copyFile$1 } from 'node:fs/promises';
17
+ import { readFile as readFile$1, rm, mkdir, copyFile as copyFile$1 } from 'node:fs/promises';
18
18
  import { pathExists } from 'fs-extra';
19
19
  import trash from 'trash';
20
20
  import i18next from 'i18next';
21
21
  import Backend from 'i18next-fs-backend';
22
22
 
23
- const version = "1.5.0";
23
+ const version = "2.0.0";
24
24
  const homepage = "https://github.com/miounet11/ccjk";
25
25
 
26
26
  const i18n = i18next.createInstance();
@@ -38,10 +38,18 @@ const NAMESPACES = [
38
38
  "interview",
39
39
  // Interview-Driven Development
40
40
  "language",
41
+ "marketplace",
42
+ // Marketplace system for plugins, skills, and workflows
41
43
  "mcp",
42
44
  "menu",
43
45
  "multi-config",
44
46
  "shencha",
47
+ "skills",
48
+ // Skills management system
49
+ "smartGuide",
50
+ // Smart Guide for quick actions
51
+ "superpowers",
52
+ // Superpowers plugin integration
45
53
  "team",
46
54
  "tools",
47
55
  "uninstall",
@@ -2258,7 +2266,7 @@ function getFallbackPresets() {
2258
2266
  ];
2259
2267
  }
2260
2268
 
2261
- const execAsync$3 = promisify(exec$1);
2269
+ const execAsync$4 = promisify(exec$1);
2262
2270
  const CCR_CONFIG_DIR = join(homedir(), ".claude-code-router");
2263
2271
  const CCR_CONFIG_FILE = join(CCR_CONFIG_DIR, "config.json");
2264
2272
  const CCR_BACKUP_DIR = CCR_CONFIG_DIR;
@@ -2425,10 +2433,10 @@ async function restartAndCheckCcrStatus() {
2425
2433
  ensureI18nInitialized();
2426
2434
  try {
2427
2435
  console.log(ansis.cyan(`${i18n.t("ccr:restartingCcr")}`));
2428
- await execAsync$3("ccr restart");
2436
+ await execAsync$4("ccr restart");
2429
2437
  console.log(ansis.green(`\u2714 ${i18n.t("ccr:ccrRestartSuccess")}`));
2430
2438
  console.log(ansis.cyan(`${i18n.t("ccr:checkingCcrStatus")}`));
2431
- const { stdout } = await execAsync$3("ccr status");
2439
+ const { stdout } = await execAsync$4("ccr status");
2432
2440
  console.log(ansis.gray(stdout));
2433
2441
  } catch (error) {
2434
2442
  console.error(ansis.red(`${i18n.t("ccr:ccrRestartFailed")}:`), error.message || error);
@@ -2565,16 +2573,16 @@ const config = {
2565
2573
  writeCcrConfig: writeCcrConfig
2566
2574
  };
2567
2575
 
2568
- const execAsync$2 = promisify(exec$1);
2576
+ const execAsync$3 = promisify(exec$1);
2569
2577
  async function getInstalledVersion(command, maxRetries = 3) {
2570
2578
  for (let attempt = 1; attempt <= maxRetries; attempt++) {
2571
2579
  try {
2572
2580
  let stdout;
2573
2581
  try {
2574
- const result = await execAsync$2(`${command} -v`);
2582
+ const result = await execAsync$3(`${command} -v`);
2575
2583
  stdout = result.stdout;
2576
2584
  } catch {
2577
- const result = await execAsync$2(`${command} --version`);
2585
+ const result = await execAsync$3(`${command} --version`);
2578
2586
  stdout = result.stdout;
2579
2587
  }
2580
2588
  const versionMatch = stdout.match(/(\d+\.\d+\.\d+(?:-[\w.]+)?)/);
@@ -2591,7 +2599,7 @@ async function getInstalledVersion(command, maxRetries = 3) {
2591
2599
  async function getLatestVersion(packageName, maxRetries = 3) {
2592
2600
  for (let attempt = 1; attempt <= maxRetries; attempt++) {
2593
2601
  try {
2594
- const { stdout } = await execAsync$2(`npm view ${packageName} version`);
2602
+ const { stdout } = await execAsync$3(`npm view ${packageName} version`);
2595
2603
  return stdout.trim();
2596
2604
  } catch {
2597
2605
  if (attempt === maxRetries) {
@@ -2620,7 +2628,7 @@ async function getClaudeCodeInstallationSource() {
2620
2628
  return { isHomebrew: true, commandPath, source: "homebrew-cask" };
2621
2629
  }
2622
2630
  try {
2623
- const { stdout: realPath } = await execAsync$2(`readlink -f "${commandPath}" 2>/dev/null || realpath "${commandPath}" 2>/dev/null || echo "${commandPath}"`);
2631
+ const { stdout: realPath } = await execAsync$3(`readlink -f "${commandPath}" 2>/dev/null || realpath "${commandPath}" 2>/dev/null || echo "${commandPath}"`);
2624
2632
  const resolvedPath = realPath.trim();
2625
2633
  if (resolvedPath.includes("/Caskroom/claude-code/")) {
2626
2634
  return { isHomebrew: true, commandPath, source: "homebrew-cask" };
@@ -2639,7 +2647,7 @@ async function detectAllClaudeCodeInstallations() {
2639
2647
  let activeResolvedPath = null;
2640
2648
  if (activeCommandPath) {
2641
2649
  try {
2642
- const { stdout } = await execAsync$2(`readlink -f "${activeCommandPath}" 2>/dev/null || realpath "${activeCommandPath}" 2>/dev/null || echo "${activeCommandPath}"`);
2650
+ const { stdout } = await execAsync$3(`readlink -f "${activeCommandPath}" 2>/dev/null || realpath "${activeCommandPath}" 2>/dev/null || echo "${activeCommandPath}"`);
2643
2651
  activeResolvedPath = stdout.trim();
2644
2652
  } catch {
2645
2653
  activeResolvedPath = activeCommandPath;
@@ -2647,7 +2655,7 @@ async function detectAllClaudeCodeInstallations() {
2647
2655
  }
2648
2656
  async function getVersionFromPath(path) {
2649
2657
  try {
2650
- const { stdout } = await execAsync$2(`"${path}" -v 2>/dev/null || "${path}" --version 2>/dev/null`);
2658
+ const { stdout } = await execAsync$3(`"${path}" -v 2>/dev/null || "${path}" --version 2>/dev/null`);
2651
2659
  const versionMatch = stdout.match(/(\d+\.\d+\.\d+(?:-[\w.]+)?)/);
2652
2660
  return versionMatch ? versionMatch[1] : null;
2653
2661
  } catch {
@@ -2662,7 +2670,7 @@ async function detectAllClaudeCodeInstallations() {
2662
2670
  async function addInstallation(path, source) {
2663
2671
  let resolvedPath = path;
2664
2672
  try {
2665
- const { stdout } = await execAsync$2(`readlink -f "${path}" 2>/dev/null || realpath "${path}" 2>/dev/null || echo "${path}"`);
2673
+ const { stdout } = await execAsync$3(`readlink -f "${path}" 2>/dev/null || realpath "${path}" 2>/dev/null || echo "${path}"`);
2666
2674
  resolvedPath = stdout.trim();
2667
2675
  } catch {
2668
2676
  }
@@ -2698,7 +2706,7 @@ async function detectAllClaudeCodeInstallations() {
2698
2706
  }
2699
2707
  }
2700
2708
  try {
2701
- await execAsync$2("brew list --cask claude-code");
2709
+ await execAsync$3("brew list --cask claude-code");
2702
2710
  const homebrewPrefixes = ["/opt/homebrew", "/usr/local"];
2703
2711
  for (const prefix of homebrewPrefixes) {
2704
2712
  const caskroomPath = `${prefix}/Caskroom/claude-code`;
@@ -2723,7 +2731,7 @@ async function detectAllClaudeCodeInstallations() {
2723
2731
  if (nodeFs.existsSync(path)) {
2724
2732
  let resolvedPath = path;
2725
2733
  try {
2726
- const { stdout } = await execAsync$2(`readlink -f "${path}" 2>/dev/null || realpath "${path}" 2>/dev/null || echo "${path}"`);
2734
+ const { stdout } = await execAsync$3(`readlink -f "${path}" 2>/dev/null || realpath "${path}" 2>/dev/null || echo "${path}"`);
2727
2735
  resolvedPath = stdout.trim();
2728
2736
  } catch {
2729
2737
  }
@@ -2913,7 +2921,7 @@ async function handleDuplicateInstallations(skipPrompt = false) {
2913
2921
  }
2914
2922
  async function getHomebrewClaudeCodeVersion() {
2915
2923
  try {
2916
- const { stdout } = await execAsync$2("brew info --cask claude-code --json=v2");
2924
+ const { stdout } = await execAsync$3("brew info --cask claude-code --json=v2");
2917
2925
  const info = JSON.parse(stdout);
2918
2926
  if (info.casks && info.casks.length > 0) {
2919
2927
  return info.casks[0].version;
@@ -3219,15 +3227,15 @@ const autoUpdater = {
3219
3227
  updateCometixLine: updateCometixLine
3220
3228
  };
3221
3229
 
3222
- const execAsync$1 = promisify(exec$1);
3230
+ const execAsync$2 = promisify(exec$1);
3223
3231
  async function isCcrInstalled() {
3224
3232
  let commandExists = false;
3225
3233
  try {
3226
- await execAsync$1("ccr version");
3234
+ await execAsync$2("ccr version");
3227
3235
  commandExists = true;
3228
3236
  } catch {
3229
3237
  try {
3230
- await execAsync$1("which ccr");
3238
+ await execAsync$2("which ccr");
3231
3239
  commandExists = true;
3232
3240
  } catch {
3233
3241
  commandExists = false;
@@ -3235,7 +3243,7 @@ async function isCcrInstalled() {
3235
3243
  }
3236
3244
  let hasCorrectPackage = false;
3237
3245
  try {
3238
- await execAsync$1("npm list -g @musistudio/claude-code-router");
3246
+ await execAsync$2("npm list -g @musistudio/claude-code-router");
3239
3247
  hasCorrectPackage = true;
3240
3248
  } catch {
3241
3249
  hasCorrectPackage = false;
@@ -3255,10 +3263,10 @@ async function installCcr() {
3255
3263
  }
3256
3264
  if (isInstalled && !hasCorrectPackage) {
3257
3265
  try {
3258
- await execAsync$1("npm list -g claude-code-router");
3266
+ await execAsync$2("npm list -g claude-code-router");
3259
3267
  console.log(ansis.yellow(`\u26A0 ${i18n.t("ccr:detectedIncorrectPackage")}`));
3260
3268
  try {
3261
- await execAsync$1("npm uninstall -g claude-code-router");
3269
+ await execAsync$2("npm uninstall -g claude-code-router");
3262
3270
  console.log(ansis.green(`\u2714 ${i18n.t("ccr:uninstalledIncorrectPackage")}`));
3263
3271
  } catch {
3264
3272
  console.log(ansis.yellow(`\u26A0 ${i18n.t("ccr:failedToUninstallIncorrectPackage")}`));
@@ -3273,7 +3281,7 @@ async function installCcr() {
3273
3281
  if (usedSudo) {
3274
3282
  console.log(ansis.yellow(`\u2139 ${i18n.t("installation:usingSudo")}`));
3275
3283
  }
3276
- await execAsync$1([command, ...args].join(" "));
3284
+ await execAsync$2([command, ...args].join(" "));
3277
3285
  console.log(ansis.green(`\u2714 ${i18n.t("ccr:ccrInstallSuccess")}`));
3278
3286
  } catch (error) {
3279
3287
  if (error.message?.includes("EEXIST")) {
@@ -5371,10 +5379,10 @@ const COMETIX_COMMANDS = {
5371
5379
  TUI_CONFIG: `${COMETIX_COMMAND_NAME} -c`
5372
5380
  };
5373
5381
 
5374
- const execAsync = promisify(exec$1);
5382
+ const execAsync$1 = promisify(exec$1);
5375
5383
  async function isCometixLineInstalled() {
5376
5384
  try {
5377
- await execAsync(COMETIX_COMMANDS.CHECK_INSTALL);
5385
+ await execAsync$1(COMETIX_COMMANDS.CHECK_INSTALL);
5378
5386
  return true;
5379
5387
  } catch {
5380
5388
  return false;
@@ -5388,7 +5396,7 @@ async function installCometixLine() {
5388
5396
  if (usedSudo) {
5389
5397
  console.log(ansis.yellow(`\u2139 ${i18n.t("installation:usingSudo")}`));
5390
5398
  }
5391
- await execAsync([command, ...args].join(" "));
5399
+ await execAsync$1([command, ...args].join(" "));
5392
5400
  };
5393
5401
  const isInstalled = await isCometixLineInstalled();
5394
5402
  if (isInstalled) {
@@ -6607,6 +6615,208 @@ async function handleMultipleInstallations(status) {
6607
6615
  }
6608
6616
  }
6609
6617
 
6618
+ const execAsync = promisify(exec$1);
6619
+ function getClaudePluginDir() {
6620
+ return join(homedir(), ".claude", "plugins");
6621
+ }
6622
+ function getSuperpowersPath() {
6623
+ return join(getClaudePluginDir(), "superpowers");
6624
+ }
6625
+ async function checkSuperpowersInstalled() {
6626
+ const superpowersPath = getSuperpowersPath();
6627
+ if (!existsSync(superpowersPath)) {
6628
+ return { installed: false };
6629
+ }
6630
+ try {
6631
+ const packageJsonPath = join(superpowersPath, "package.json");
6632
+ if (existsSync(packageJsonPath)) {
6633
+ const packageJson = JSON.parse(await readFile$1(packageJsonPath, "utf-8"));
6634
+ const skillsDir = join(superpowersPath, "skills");
6635
+ let skillCount = 0;
6636
+ if (existsSync(skillsDir)) {
6637
+ const { readdir } = await import('node:fs/promises');
6638
+ const entries = await readdir(skillsDir, { withFileTypes: true });
6639
+ skillCount = entries.filter((e) => e.isDirectory()).length;
6640
+ }
6641
+ return {
6642
+ installed: true,
6643
+ version: packageJson.version,
6644
+ skillCount,
6645
+ path: superpowersPath
6646
+ };
6647
+ }
6648
+ return { installed: true, path: superpowersPath };
6649
+ } catch {
6650
+ return { installed: true, path: superpowersPath };
6651
+ }
6652
+ }
6653
+ async function installSuperpowers(_options) {
6654
+ try {
6655
+ const status = await checkSuperpowersInstalled();
6656
+ if (status.installed) {
6657
+ return {
6658
+ success: true,
6659
+ message: i18n.t("superpowers:alreadyInstalled")
6660
+ };
6661
+ }
6662
+ console.log(i18n.t("superpowers:addingMarketplace"));
6663
+ try {
6664
+ await execAsync("claude /plugin marketplace add obra/superpowers-marketplace", {
6665
+ timeout: 6e4
6666
+ });
6667
+ } catch {
6668
+ }
6669
+ console.log(i18n.t("superpowers:installing"));
6670
+ await execAsync("claude /plugin install superpowers@superpowers-marketplace", {
6671
+ timeout: 12e4
6672
+ });
6673
+ const newStatus = await checkSuperpowersInstalled();
6674
+ if (newStatus.installed) {
6675
+ return {
6676
+ success: true,
6677
+ message: i18n.t("superpowers:installSuccess")
6678
+ };
6679
+ }
6680
+ return {
6681
+ success: false,
6682
+ message: i18n.t("superpowers:installFailed"),
6683
+ error: "Installation completed but plugin not found"
6684
+ };
6685
+ } catch (error) {
6686
+ const errorMessage = error instanceof Error ? error.message : String(error);
6687
+ return {
6688
+ success: false,
6689
+ message: i18n.t("superpowers:installFailed"),
6690
+ error: errorMessage
6691
+ };
6692
+ }
6693
+ }
6694
+ async function installSuperpowersViaGit() {
6695
+ try {
6696
+ const pluginDir = getClaudePluginDir();
6697
+ const superpowersPath = getSuperpowersPath();
6698
+ const { mkdir } = await import('node:fs/promises');
6699
+ await mkdir(pluginDir, { recursive: true });
6700
+ console.log(i18n.t("superpowers:cloning"));
6701
+ await execAsync(
6702
+ `git clone https://github.com/obra/superpowers.git "${superpowersPath}"`,
6703
+ { timeout: 12e4 }
6704
+ );
6705
+ const status = await checkSuperpowersInstalled();
6706
+ if (status.installed) {
6707
+ return {
6708
+ success: true,
6709
+ message: i18n.t("superpowers:installSuccess")
6710
+ };
6711
+ }
6712
+ return {
6713
+ success: false,
6714
+ message: i18n.t("superpowers:installFailed")
6715
+ };
6716
+ } catch (error) {
6717
+ const errorMessage = error instanceof Error ? error.message : String(error);
6718
+ return {
6719
+ success: false,
6720
+ message: i18n.t("superpowers:installFailed"),
6721
+ error: errorMessage
6722
+ };
6723
+ }
6724
+ }
6725
+ async function uninstallSuperpowers() {
6726
+ try {
6727
+ const status = await checkSuperpowersInstalled();
6728
+ if (!status.installed) {
6729
+ return {
6730
+ success: true,
6731
+ message: i18n.t("superpowers:notInstalled")
6732
+ };
6733
+ }
6734
+ try {
6735
+ await execAsync("claude /plugin uninstall superpowers", {
6736
+ timeout: 6e4
6737
+ });
6738
+ } catch {
6739
+ const superpowersPath = getSuperpowersPath();
6740
+ if (existsSync(superpowersPath)) {
6741
+ const { rm } = await import('node:fs/promises');
6742
+ await rm(superpowersPath, { recursive: true, force: true });
6743
+ }
6744
+ }
6745
+ const newStatus = await checkSuperpowersInstalled();
6746
+ if (!newStatus.installed) {
6747
+ return {
6748
+ success: true,
6749
+ message: i18n.t("superpowers:uninstallSuccess")
6750
+ };
6751
+ }
6752
+ return {
6753
+ success: false,
6754
+ message: i18n.t("superpowers:uninstallFailed")
6755
+ };
6756
+ } catch (error) {
6757
+ const errorMessage = error instanceof Error ? error.message : String(error);
6758
+ return {
6759
+ success: false,
6760
+ message: i18n.t("superpowers:uninstallFailed"),
6761
+ error: errorMessage
6762
+ };
6763
+ }
6764
+ }
6765
+ async function updateSuperpowers() {
6766
+ try {
6767
+ const status = await checkSuperpowersInstalled();
6768
+ if (!status.installed) {
6769
+ return {
6770
+ success: false,
6771
+ message: i18n.t("superpowers:notInstalled")
6772
+ };
6773
+ }
6774
+ try {
6775
+ await execAsync("claude /plugin update superpowers", {
6776
+ timeout: 12e4
6777
+ });
6778
+ return {
6779
+ success: true,
6780
+ message: i18n.t("superpowers:updateSuccess")
6781
+ };
6782
+ } catch {
6783
+ const superpowersPath = getSuperpowersPath();
6784
+ await execAsync("git pull", {
6785
+ cwd: superpowersPath,
6786
+ timeout: 6e4
6787
+ });
6788
+ return {
6789
+ success: true,
6790
+ message: i18n.t("superpowers:updateSuccess")
6791
+ };
6792
+ }
6793
+ } catch (error) {
6794
+ const errorMessage = error instanceof Error ? error.message : String(error);
6795
+ return {
6796
+ success: false,
6797
+ message: i18n.t("superpowers:updateFailed"),
6798
+ error: errorMessage
6799
+ };
6800
+ }
6801
+ }
6802
+ async function getSuperpowersSkills() {
6803
+ try {
6804
+ const status = await checkSuperpowersInstalled();
6805
+ if (!status.installed || !status.path) {
6806
+ return [];
6807
+ }
6808
+ const skillsDir = join(status.path, "skills");
6809
+ if (!existsSync(skillsDir)) {
6810
+ return [];
6811
+ }
6812
+ const { readdir } = await import('node:fs/promises');
6813
+ const entries = await readdir(skillsDir, { withFileTypes: true });
6814
+ return entries.filter((e) => e.isDirectory()).map((e) => e.name);
6815
+ } catch {
6816
+ return [];
6817
+ }
6818
+ }
6819
+
6610
6820
  function getRootDir() {
6611
6821
  const currentFilePath = fileURLToPath(import.meta.url);
6612
6822
  const distDir = dirname(dirname(currentFilePath));
@@ -6854,6 +7064,12 @@ async function validateSkipPromptOptions(options) {
6854
7064
  if (options.installCometixLine === void 0) {
6855
7065
  options.installCometixLine = true;
6856
7066
  }
7067
+ if (typeof options.installSuperpowers === "string") {
7068
+ options.installSuperpowers = options.installSuperpowers.toLowerCase() === "true";
7069
+ }
7070
+ if (options.installSuperpowers === void 0) {
7071
+ options.installSuperpowers = false;
7072
+ }
6857
7073
  if (options.configAction && !["new", "backup", "merge", "docs-only", "skip"].includes(options.configAction)) {
6858
7074
  throw new Error(
6859
7075
  i18n.t("errors:invalidConfigAction", { value: options.configAction })
@@ -6943,6 +7159,53 @@ async function validateSkipPromptOptions(options) {
6943
7159
  options.workflows = WORKFLOW_CONFIG_BASE.map((w) => w.id);
6944
7160
  }
6945
7161
  }
7162
+ async function handleSuperpowersInstallation(options) {
7163
+ try {
7164
+ const status = await checkSuperpowersInstalled();
7165
+ if (status.installed) {
7166
+ console.log(ansis.green(`\u2714 ${i18n.t("superpowers:alreadyInstalled")}`));
7167
+ if (status.version) {
7168
+ console.log(ansis.gray(` ${i18n.t("superpowers:status.version", { version: status.version })}`));
7169
+ }
7170
+ if (status.skillCount) {
7171
+ console.log(ansis.gray(` ${i18n.t("superpowers:status.skillCount", { count: status.skillCount })}`));
7172
+ }
7173
+ return;
7174
+ }
7175
+ let shouldInstall = false;
7176
+ if (options.skipPrompt) {
7177
+ shouldInstall = options.installSuperpowers === true;
7178
+ } else {
7179
+ console.log(ansis.cyan(`
7180
+ ${i18n.t("superpowers:title")}`));
7181
+ console.log(ansis.gray(i18n.t("superpowers:description")));
7182
+ console.log(ansis.gray(i18n.t("superpowers:installPromptDescription")));
7183
+ shouldInstall = await promptBoolean({
7184
+ message: i18n.t("superpowers:installPrompt"),
7185
+ defaultValue: false
7186
+ });
7187
+ }
7188
+ if (!shouldInstall) {
7189
+ console.log(ansis.yellow(i18n.t("common:skip")));
7190
+ return;
7191
+ }
7192
+ const result = await installSuperpowers({
7193
+ lang: i18n.language,
7194
+ skipPrompt: options.skipPrompt
7195
+ });
7196
+ if (result.success) {
7197
+ console.log(ansis.green(`\u2714 ${result.message}`));
7198
+ } else {
7199
+ console.error(ansis.red(`\u2716 ${result.message}`));
7200
+ if (result.error) {
7201
+ console.error(ansis.gray(` ${result.error}`));
7202
+ }
7203
+ }
7204
+ } catch (error) {
7205
+ const errorMessage = error instanceof Error ? error.message : String(error);
7206
+ console.error(ansis.red(`${i18n.t("superpowers:installFailed")}: ${errorMessage}`));
7207
+ }
7208
+ }
6946
7209
  async function init(options = {}) {
6947
7210
  if (options.skipPrompt) {
6948
7211
  await validateSkipPromptOptions(options);
@@ -7460,6 +7723,18 @@ async function init(options = {}) {
7460
7723
  } else {
7461
7724
  console.log(ansis.green(`\u2714 ${i18n.t("cometix:cometixAlreadyInstalled")}`));
7462
7725
  }
7726
+ if (!options.skipPrompt || options.installSuperpowers) {
7727
+ await handleSuperpowersInstallation(options);
7728
+ }
7729
+ try {
7730
+ const { injectSmartGuide } = await import('./smart-guide.mjs');
7731
+ const smartGuideSuccess = await injectSmartGuide(configLang);
7732
+ if (smartGuideSuccess) {
7733
+ console.log(ansis.green(`\u2714 ${i18n.t("smartGuide:enabled")}`));
7734
+ }
7735
+ } catch {
7736
+ console.log(ansis.gray(`\u2139 ${i18n.t("smartGuide:skipped")}`));
7737
+ }
7463
7738
  updateZcfConfig({
7464
7739
  version,
7465
7740
  preferredLang: i18n.language,
@@ -10459,4 +10734,4 @@ async function openSettingsJson() {
10459
10734
  }
10460
10735
  }
10461
10736
 
10462
- export { AI_OUTPUT_LANGUAGES as $, AIDER_DIR as A, CODEX_AGENTS_FILE as B, CCJK_PLUGINS_DIR as C, CODEX_PROMPTS_DIR as D, CLINE_DIR as E, CLINE_CONFIG_FILE as F, CURSOR_DIR as G, CURSOR_CONFIG_FILE as H, CCJK_CONFIG_DIR as I, CCJK_CONFIG_FILE as J, LEGACY_ZCF_CONFIG_FILE as K, LEGACY_ZCF_CONFIG_DIR as L, LEGACY_ZCF_CONFIG_FILES as M, ZCF_CONFIG_FILE as N, CODE_TOOL_TYPES as O, DEFAULT_CODE_TOOL_TYPE as P, CODE_TOOL_BANNERS as Q, CODE_TOOL_ALIASES as R, STATUS as S, CODE_TOOL_INFO as T, isCodeToolType as U, API_DEFAULT_URL as V, API_ENV_KEY as W, resolveCodeToolType as X, SUPPORTED_LANGS as Y, ZCF_CONFIG_DIR as Z, LANG_LABELS as _, CCJK_SKILLS_DIR as a, getAvailableManagementActions as a$, getAiOutputLanguageLabel as a0, detectPackageManager as a1, detectFrameworks as a2, detectBuildTools as a3, detectTestFrameworks as a4, detectCICDSystems as a5, detectLanguages as a6, determineProjectType as a7, detectProject as a8, generateSuggestions as a9, createBackupDirectory as aA, ensureEnvKeyMigration as aB, getBackupMessage as aC, getCodexVersion as aD, getCurrentCodexProvider as aE, installCodexCli as aF, isCodexInstalled$1 as aG, listCodexProviders as aH, migrateEnvKeyInContent as aI, migrateEnvKeyToTempEnvKey as aJ, needsEnvKeyMigration as aK, parseCodexConfig as aL, readCodexConfig as aM, renderCodexConfig as aN, runCodexFullInit as aO, runCodexSystemPromptSelection as aP, runCodexUninstall as aQ, runCodexUpdate as aR, runCodexWorkflowImport as aS, runCodexWorkflowImportWithLanguageSelection as aT, runCodexWorkflowSelection as aU, switchCodexProvider as aV, switchToProvider as aW, writeAuthFile as aX, writeCodexConfig as aY, detectConfigManagementMode as aZ, shouldShowManagementMode as a_, getProjectSummary as aa, displayBanner as ab, displayBannerWithInfo as ac, renderProgressBar as ad, boxify as ae, menuItem as af, getMcpConfigPath as ag, readMcpConfig as ah, writeMcpConfig as ai, backupMcpConfig as aj, mergeMcpServers as ak, buildMcpServerConfig as al, fixWindowsMcpConfig as am, addCompletedOnboarding as an, ensureApiKeyApproved as ao, removeApiKeyFromRejected as ap, manageApiKeyApproval as aq, setPrimaryApiKey as ar, backupCodexAgents as as, backupCodexComplete as at, backupCodexConfig as au, backupCodexFiles as av, backupCodexPrompts as aw, checkCodexUpdate as ax, switchToOfficialLogin as ay, configureCodexApi as az, CCJK_GROUPS_DIR as b, trustDirectory as b$, configureCodexMcp as b0, applyCodexPlatformCommand as b1, getToolConfigPath as b2, getToolDir as b3, isToolInstalled as b4, getToolVersion as b5, getToolStatus as b6, getAllToolsStatus as b7, getInstalledTools as b8, installTool as b9, runDoctor as bA, isClaudeCodeInstalled as bB, installClaudeCode as bC, isCodexInstalled as bD, installCodex as bE, isLocalClaudeCodeInstalled as bF, getInstallationStatus as bG, removeLocalClaudeCode as bH, uninstallCodeTool as bI, setInstallMethod as bJ, detectInstalledVersion as bK, selectInstallMethod as bL, executeInstallMethod as bM, handleInstallFailure as bN, verifyInstallation as bO, createHomebrewSymlink as bP, displayVerificationResult as bQ, loadKnowledgeBase as bR, saveKnowledgeBase as bS, runOnboarding as bT, quickSync as bU, getProjectKnowledge as bV, exportProjectKnowledge as bW, PERMISSION_TEMPLATES as bX, readPermissions as bY, writePermissions as bZ, applyTemplate as b_, getToolInfo as ba, getAllToolsInfo as bb, getToolsByCategory as bc, formatToolStatus as bd, getRecommendedTools as be, ensureClaudeDir as bf, backupExistingConfig as bg, copyConfigFiles as bh, configureApi as bi, mergeConfigs as bj, updateCustomModel as bk, updateDefaultModel as bl, mergeSettingsFile as bm, getExistingModelConfig as bn, getExistingApiConfig as bo, applyAiLanguageDirective as bp, switchToOfficialLogin$1 as bq, promptApiConfigurationAction as br, detectAllConfigs as bs, compareConfigs as bt, consolidateConfigs as bu, writeConsolidatedConfig as bv, removeRedundantConfigs as bw, displayConfigScan as bx, runHealthCheck as by, displayHealthReport as bz, AIDER_CONFIG_FILE as c, getMcpServices as c$, untrustDirectory as c0, isPermissionAllowed as c1, isDirectoryTrusted as c2, addAutoApprovePattern as c3, removeAutoApprovePattern as c4, resetPermissions as c5, exportPermissions as c6, importPermissions as c7, getCurrentTemplateId as c8, displayPermissions as c9, checkAndUpdateTools as cA, resolveCodeType as cB, readJsonConfig as cC, writeJsonConfig as cD, moveToTrash as cE, readZcfConfig as cF, updateZcfConfig as cG, version as cH, resolveAiOutputLanguage as cI, updatePromptOnly as cJ, selectAndInstallWorkflows as cK, checkClaudeCodeVersionAndPrompt as cL, readZcfConfigAsync as cM, initI18n as cN, selectScriptLanguage as cO, changeLanguage as cP, validateApiKey$1 as cQ, ensureDir as cR, readDefaultTomlConfig as cS, createDefaultTomlConfig as cT, exists as cU, writeTomlConfig as cV, clearModelEnv as cW, copyFile as cX, configureOutputStyle as cY, isWindows as cZ, selectMcpServices as c_, checkClaudeCodeVersion as ca, checkCcjkVersion as cb, checkPluginVersions as cc, upgradeClaudeCode as cd, upgradeCcjk as ce, upgradePlugin as cf, upgradeAllPlugins as cg, checkAllVersions as ch, upgradeAll as ci, i18n as cj, testApiConnection as ck, quickSetup as cl, format as cm, getAllPresets as cn, ensureI18nInitialized as co, readCcrConfig as cp, isCcrInstalled as cq, installCcr as cr, configureCcrFeature as cs, promptBoolean as ct, handleExitPromptError as cu, handleGeneralError as cv, COMETIX_COMMAND_NAME as cw, COMETIX_COMMANDS as cx, installCometixLine as cy, addNumbersToChoices as cz, AIDER_ENV_FILE as d, setupCcrConfiguration as d0, modifyApiConfigPartially as d1, formatApiKeyDisplay as d2, index as d3, fsOperations as d4, jsonConfig as d5, claudeConfig as d6, config$1 as d7, config as d8, prompts as d9, codex as da, installer as db, CONTINUE_DIR as e, CONTINUE_CONFIG_FILE as f, COLORS as g, displayCurrentStatus as h, init as i, cleanupPermissions as j, commandExists as k, getPlatform as l, mergeAndCleanPermissions as m, importRecommendedEnv as n, importRecommendedPermissions as o, openSettingsJson as p, CLAUDE_DIR$1 as q, runConfigWizard as r, sectionDivider as s, SETTINGS_FILE$1 as t, CLAUDE_MD_FILE as u, ClAUDE_CONFIG_FILE as v, CLAUDE_VSC_CONFIG_FILE as w, CODEX_DIR as x, CODEX_CONFIG_FILE as y, CODEX_AUTH_FILE as z };
10737
+ export { AI_OUTPUT_LANGUAGES as $, AIDER_DIR as A, CODEX_AGENTS_FILE as B, CCJK_PLUGINS_DIR as C, CODEX_PROMPTS_DIR as D, CLINE_DIR as E, CLINE_CONFIG_FILE as F, CURSOR_DIR as G, CURSOR_CONFIG_FILE as H, CCJK_CONFIG_DIR as I, CCJK_CONFIG_FILE as J, LEGACY_ZCF_CONFIG_FILE as K, LEGACY_ZCF_CONFIG_DIR as L, LEGACY_ZCF_CONFIG_FILES as M, ZCF_CONFIG_FILE as N, CODE_TOOL_TYPES as O, DEFAULT_CODE_TOOL_TYPE as P, CODE_TOOL_BANNERS as Q, CODE_TOOL_ALIASES as R, STATUS as S, CODE_TOOL_INFO as T, isCodeToolType as U, API_DEFAULT_URL as V, API_ENV_KEY as W, resolveCodeToolType as X, SUPPORTED_LANGS as Y, ZCF_CONFIG_DIR as Z, LANG_LABELS as _, CCJK_SKILLS_DIR as a, getAvailableManagementActions as a$, getAiOutputLanguageLabel as a0, detectPackageManager as a1, detectFrameworks as a2, detectBuildTools as a3, detectTestFrameworks as a4, detectCICDSystems as a5, detectLanguages as a6, determineProjectType as a7, detectProject as a8, generateSuggestions as a9, createBackupDirectory as aA, ensureEnvKeyMigration as aB, getBackupMessage as aC, getCodexVersion as aD, getCurrentCodexProvider as aE, installCodexCli as aF, isCodexInstalled$1 as aG, listCodexProviders as aH, migrateEnvKeyInContent as aI, migrateEnvKeyToTempEnvKey as aJ, needsEnvKeyMigration as aK, parseCodexConfig as aL, readCodexConfig as aM, renderCodexConfig as aN, runCodexFullInit as aO, runCodexSystemPromptSelection as aP, runCodexUninstall as aQ, runCodexUpdate as aR, runCodexWorkflowImport as aS, runCodexWorkflowImportWithLanguageSelection as aT, runCodexWorkflowSelection as aU, switchCodexProvider as aV, switchToProvider as aW, writeAuthFile as aX, writeCodexConfig as aY, detectConfigManagementMode as aZ, shouldShowManagementMode as a_, getProjectSummary as aa, displayBanner as ab, displayBannerWithInfo as ac, renderProgressBar as ad, boxify as ae, menuItem as af, getMcpConfigPath as ag, readMcpConfig as ah, writeMcpConfig as ai, backupMcpConfig as aj, mergeMcpServers as ak, buildMcpServerConfig as al, fixWindowsMcpConfig as am, addCompletedOnboarding as an, ensureApiKeyApproved as ao, removeApiKeyFromRejected as ap, manageApiKeyApproval as aq, setPrimaryApiKey as ar, backupCodexAgents as as, backupCodexComplete as at, backupCodexConfig as au, backupCodexFiles as av, backupCodexPrompts as aw, checkCodexUpdate as ax, switchToOfficialLogin as ay, configureCodexApi as az, CCJK_GROUPS_DIR as b, trustDirectory as b$, configureCodexMcp as b0, applyCodexPlatformCommand as b1, getToolConfigPath as b2, getToolDir as b3, isToolInstalled as b4, getToolVersion as b5, getToolStatus as b6, getAllToolsStatus as b7, getInstalledTools as b8, installTool as b9, runDoctor as bA, isClaudeCodeInstalled as bB, installClaudeCode as bC, isCodexInstalled as bD, installCodex as bE, isLocalClaudeCodeInstalled as bF, getInstallationStatus as bG, removeLocalClaudeCode as bH, uninstallCodeTool as bI, setInstallMethod as bJ, detectInstalledVersion as bK, selectInstallMethod as bL, executeInstallMethod as bM, handleInstallFailure as bN, verifyInstallation as bO, createHomebrewSymlink as bP, displayVerificationResult as bQ, loadKnowledgeBase as bR, saveKnowledgeBase as bS, runOnboarding as bT, quickSync as bU, getProjectKnowledge as bV, exportProjectKnowledge as bW, PERMISSION_TEMPLATES as bX, readPermissions as bY, writePermissions as bZ, applyTemplate as b_, getToolInfo as ba, getAllToolsInfo as bb, getToolsByCategory as bc, formatToolStatus as bd, getRecommendedTools as be, ensureClaudeDir as bf, backupExistingConfig as bg, copyConfigFiles as bh, configureApi as bi, mergeConfigs as bj, updateCustomModel as bk, updateDefaultModel as bl, mergeSettingsFile as bm, getExistingModelConfig as bn, getExistingApiConfig as bo, applyAiLanguageDirective as bp, switchToOfficialLogin$1 as bq, promptApiConfigurationAction as br, detectAllConfigs as bs, compareConfigs as bt, consolidateConfigs as bu, writeConsolidatedConfig as bv, removeRedundantConfigs as bw, displayConfigScan as bx, runHealthCheck as by, displayHealthReport as bz, AIDER_CONFIG_FILE as c, writeTomlConfig as c$, untrustDirectory as c0, isPermissionAllowed as c1, isDirectoryTrusted as c2, addAutoApprovePattern as c3, removeAutoApprovePattern as c4, resetPermissions as c5, exportPermissions as c6, importPermissions as c7, getCurrentTemplateId as c8, displayPermissions as c9, checkAndUpdateTools as cA, resolveCodeType as cB, readZcfConfig as cC, readJsonConfig as cD, writeJsonConfig as cE, moveToTrash as cF, updateZcfConfig as cG, version as cH, resolveAiOutputLanguage as cI, updatePromptOnly as cJ, selectAndInstallWorkflows as cK, checkClaudeCodeVersionAndPrompt as cL, checkSuperpowersInstalled as cM, getSuperpowersSkills as cN, updateSuperpowers as cO, uninstallSuperpowers as cP, installSuperpowers as cQ, installSuperpowersViaGit as cR, readZcfConfigAsync as cS, initI18n as cT, selectScriptLanguage as cU, changeLanguage as cV, validateApiKey$1 as cW, ensureDir as cX, readDefaultTomlConfig as cY, createDefaultTomlConfig as cZ, exists as c_, checkClaudeCodeVersion as ca, checkCcjkVersion as cb, checkPluginVersions as cc, upgradeClaudeCode as cd, upgradeCcjk as ce, upgradePlugin as cf, upgradeAllPlugins as cg, checkAllVersions as ch, upgradeAll as ci, i18n as cj, testApiConnection as ck, quickSetup as cl, format as cm, getAllPresets as cn, ensureI18nInitialized as co, readCcrConfig as cp, isCcrInstalled as cq, installCcr as cr, configureCcrFeature as cs, promptBoolean as ct, handleExitPromptError as cu, handleGeneralError as cv, COMETIX_COMMAND_NAME as cw, COMETIX_COMMANDS as cx, installCometixLine as cy, addNumbersToChoices as cz, AIDER_ENV_FILE as d, clearModelEnv as d0, copyFile as d1, configureOutputStyle as d2, isWindows as d3, selectMcpServices as d4, getMcpServices as d5, setupCcrConfiguration as d6, modifyApiConfigPartially as d7, formatApiKeyDisplay as d8, index as d9, fsOperations as da, jsonConfig as db, claudeConfig as dc, config$1 as dd, config as de, prompts as df, codex as dg, installer as dh, CONTINUE_DIR as e, CONTINUE_CONFIG_FILE as f, COLORS as g, displayCurrentStatus as h, init as i, cleanupPermissions as j, commandExists as k, getPlatform as l, mergeAndCleanPermissions as m, importRecommendedEnv as n, importRecommendedPermissions as o, openSettingsJson as p, CLAUDE_DIR$1 as q, runConfigWizard as r, sectionDivider as s, SETTINGS_FILE$1 as t, CLAUDE_MD_FILE as u, ClAUDE_CONFIG_FILE as v, CLAUDE_VSC_CONFIG_FILE as w, CODEX_DIR as x, CODEX_CONFIG_FILE as y, CODEX_AUTH_FILE as z };