ccjk 2.6.0 → 2.6.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.
package/README.md CHANGED
@@ -130,6 +130,41 @@ Every developer using Claude Code faces the same problems:
130
130
 
131
131
  ## ✨ Killer Features
132
132
 
133
+ ### 🆕 What's New in v2.6.0
134
+
135
+ <table>
136
+ <tr>
137
+ <td width="33%" align="center">
138
+ <h4>🎯 Zero-Config</h4>
139
+ <sub>Auto-detects your project and configures everything. Just run <code>npx ccjk</code> and start coding.</sub>
140
+ </td>
141
+ <td width="33%" align="center">
142
+ <h4>🌐 Smart Registry</h4>
143
+ <sub>Auto-detects China mirrors, caches versions, ensures fastest downloads worldwide.</sub>
144
+ </td>
145
+ <td width="33%" align="center">
146
+ <h4>🔍 Capability Discovery</h4>
147
+ <sub>Scans your project and suggests optimal AI workflows based on your tech stack.</sub>
148
+ </td>
149
+ </tr>
150
+ <tr>
151
+ <td width="33%" align="center">
152
+ <h4>🛡️ Config Guardian</h4>
153
+ <sub>Auto-validates and repairs configurations. Never break your setup again.</sub>
154
+ </td>
155
+ <td width="33%" align="center">
156
+ <h4>🚀 Startup Orchestrator</h4>
157
+ <sub>Modular initialization with hooks. Customize your startup sequence.</sub>
158
+ </td>
159
+ <td width="33%" align="center">
160
+ <h4>🔀 Tool Router</h4>
161
+ <sub>Intelligent conflict resolution and priority management for multiple AI tools.</sub>
162
+ </td>
163
+ </tr>
164
+ </table>
165
+
166
+ <br/>
167
+
133
168
  ### 🧠 Intelligent Skill System
134
169
 
135
170
  **Your AI assistant that actually remembers and learns.**
@@ -401,6 +436,17 @@ ccjk interview # Interview-driven development
401
436
  ccjk mcp <action> # MCP server management
402
437
  ccjk browser <action> # Agent Browser automation
403
438
  ccjk postmortem <action># Learn from historical bugs
439
+ ccjk skills <action> # Manage AI skills
440
+ ccjk hooks <action> # Configure lifecycle hooks
441
+ ```
442
+
443
+ ### Configuration Commands
444
+
445
+ ```bash
446
+ ccjk config <action> # Configuration management
447
+ ccjk providers <action> # API provider management
448
+ ccjk permissions # Permission management
449
+ ccjk sandbox <action> # Sandbox environment control
404
450
  ```
405
451
 
406
452
  ### System Commands
@@ -410,6 +456,8 @@ ccjk system setup # First-time setup
410
456
  ccjk system upgrade # Upgrade all components
411
457
  ccjk system versions # Check versions
412
458
  ccjk check-updates # Check for updates
459
+ ccjk stats # Usage statistics
460
+ ccjk session <action> # Session management
413
461
  ```
414
462
 
415
463
  <br/>
package/README.zh-CN.md CHANGED
@@ -130,6 +130,41 @@ npx ccjk
130
130
 
131
131
  ## ✨ 核心功能
132
132
 
133
+ ### 🆕 v2.6.0 新功能
134
+
135
+ <table>
136
+ <tr>
137
+ <td width="33%" align="center">
138
+ <h4>🎯 零配置启动</h4>
139
+ <sub>自动检测项目类型并配置一切。只需运行 <code>npx ccjk</code> 即可开始编码。</sub>
140
+ </td>
141
+ <td width="33%" align="center">
142
+ <h4>🌐 智能镜像</h4>
143
+ <sub>自动检测中国镜像,缓存版本信息,确保全球最快下载速度。</sub>
144
+ </td>
145
+ <td width="33%" align="center">
146
+ <h4>🔍 能力发现</h4>
147
+ <sub>扫描项目并根据技术栈推荐最优 AI 工作流。</sub>
148
+ </td>
149
+ </tr>
150
+ <tr>
151
+ <td width="33%" align="center">
152
+ <h4>🛡️ 配置守护</h4>
153
+ <sub>自动验证和修复配置。再也不会搞坏你的设置。</sub>
154
+ </td>
155
+ <td width="33%" align="center">
156
+ <h4>🚀 启动编排器</h4>
157
+ <sub>模块化初始化,支持钩子。自定义你的启动流程。</sub>
158
+ </td>
159
+ <td width="33%" align="center">
160
+ <h4>🔀 工具路由</h4>
161
+ <sub>智能冲突解决和优先级管理,多 AI 工具协同无忧。</sub>
162
+ </td>
163
+ </tr>
164
+ </table>
165
+
166
+ <br/>
167
+
133
168
  ### 🧠 智能技能系统
134
169
 
135
170
  **真正能记住和学习的 AI 助手。**
@@ -401,6 +436,17 @@ ccjk interview # 访谈驱动开发
401
436
  ccjk mcp <action> # MCP 服务器管理
402
437
  ccjk browser <action> # Agent Browser 自动化
403
438
  ccjk postmortem <action># 从历史 Bug 中学习
439
+ ccjk skills <action> # 管理 AI 技能
440
+ ccjk hooks <action> # 配置生命周期钩子
441
+ ```
442
+
443
+ ### 配置命令
444
+
445
+ ```bash
446
+ ccjk config <action> # 配置管理
447
+ ccjk providers <action> # API 提供商管理
448
+ ccjk permissions # 权限管理
449
+ ccjk sandbox <action> # 沙箱环境控制
404
450
  ```
405
451
 
406
452
  ### 系统命令
@@ -410,6 +456,8 @@ ccjk system setup # 首次配置
410
456
  ccjk system upgrade # 升级所有组件
411
457
  ccjk system versions # 检查版本
412
458
  ccjk check-updates # 检查更新
459
+ ccjk stats # 使用统计
460
+ ccjk session <action> # 会话管理
413
461
  ```
414
462
 
415
463
  <br/>
@@ -47,14 +47,20 @@ function generateHookScript(shellType) {
47
47
  return `
48
48
  # CCJK Context Compression Hook - DO NOT EDIT THIS BLOCK
49
49
  # This hook enables transparent context compression for claude commands
50
- # Native slash commands (/plugin, /doctor, etc.) are passed through directly
50
+ # Native slash commands are handled by CCJK plugin system
51
51
  claude() {
52
52
  # Find the real claude command path (bypass this function)
53
53
  local real_claude
54
54
  real_claude=$(command -v claude 2>/dev/null)
55
55
 
56
- # If first arg starts with '/', it's a native slash command - pass through directly
57
- # Examples: /plugin, /doctor, /config, /permissions, /allowed-tools, etc.
56
+ # Handle /plugin command - use CCJK's plugin marketplace
57
+ if [[ "$1" == "/plugin" ]]; then
58
+ shift # Remove /plugin
59
+ ${ccjkPath} plugin "$@"
60
+ return $?
61
+ fi
62
+
63
+ # Other native slash commands (/doctor, /config, etc.) - pass through directly
58
64
  if [[ "$1" == /* ]]; then
59
65
  "$real_claude" "$@"
60
66
  return $?
@@ -78,12 +84,19 @@ claude() {
78
84
  return `
79
85
  # CCJK Context Compression Hook - DO NOT EDIT THIS BLOCK
80
86
  # This hook enables transparent context compression for claude commands
81
- # Native slash commands (/plugin, /doctor, etc.) are passed through directly
87
+ # Native slash commands are handled by CCJK plugin system
82
88
  function claude
83
89
  # Find the real claude command path
84
90
  set real_claude (command -v claude 2>/dev/null)
85
91
 
86
- # If first arg starts with '/', it's a native slash command - pass through directly
92
+ # Handle /plugin command - use CCJK's plugin marketplace
93
+ if test "$argv[1]" = "/plugin"
94
+ set -e argv[1] # Remove /plugin
95
+ ${ccjkPath} plugin $argv
96
+ return $status
97
+ end
98
+
99
+ # Other native slash commands (/doctor, /config, etc.) - pass through directly
87
100
  if string match -q '/*' -- $argv[1]
88
101
  $real_claude $argv
89
102
  return $status
@@ -259,6 +272,9 @@ const PASSTHROUGH_ARGS = /* @__PURE__ */ new Set([
259
272
  function shouldPassthrough(args) {
260
273
  if (args.length === 0)
261
274
  return false;
275
+ if (args[0]?.startsWith("/")) {
276
+ return true;
277
+ }
262
278
  return args.some((arg) => PASSTHROUGH_ARGS.has(arg));
263
279
  }
264
280
  async function claudeWrapper(args, options = {}) {
@@ -335,17 +335,34 @@ async function promptCustomModels(defaultPrimaryModel, defaultHaikuModel, defaul
335
335
  }
336
336
  async function configureAiMemoryFeature() {
337
337
  ensureI18nInitialized();
338
+ const isZh = i18n.language === "zh-CN";
338
339
  const { option } = await inquirer.prompt({
339
340
  type: "list",
340
341
  name: "option",
341
- message: i18n.t("configuration:selectMemoryOption") || "Select configuration option",
342
+ message: isZh ? "\u9009\u62E9 AI \u8BB0\u5FC6\u7BA1\u7406\u9009\u9879" : "Select AI memory management option",
342
343
  choices: addNumbersToChoices([
343
344
  {
344
- name: i18n.t("configuration:configureAiLanguage") || "Configure AI output language",
345
+ name: isZh ? "\u{1F4C4} \u67E5\u770B\u5168\u5C40 CLAUDE.md\uFF08\u7CFB\u7EDF\u63D0\u793A\uFF09" : "\u{1F4C4} View global CLAUDE.md (system prompt)",
346
+ value: "viewGlobalClaudeMd"
347
+ },
348
+ {
349
+ name: isZh ? "\u{1F4C1} \u67E5\u770B\u9879\u76EE CLAUDE.md" : "\u{1F4C1} View project CLAUDE.md",
350
+ value: "viewProjectClaudeMd"
351
+ },
352
+ {
353
+ name: isZh ? "\u{1F52C} \u67E5\u770B Postmortem\uFF08\u5386\u53F2 Bug \u7ECF\u9A8C\uFF09" : "\u{1F52C} View Postmortem (bug lessons learned)",
354
+ value: "viewPostmortem"
355
+ },
356
+ {
357
+ name: isZh ? "\u270F\uFE0F \u7F16\u8F91\u5168\u5C40 CLAUDE.md" : "\u270F\uFE0F Edit global CLAUDE.md",
358
+ value: "editGlobalClaudeMd"
359
+ },
360
+ {
361
+ name: isZh ? "\u{1F310} \u914D\u7F6E AI \u8F93\u51FA\u8BED\u8A00" : "\u{1F310} Configure AI output language",
345
362
  value: "language"
346
363
  },
347
364
  {
348
- name: i18n.t("configuration:configureOutputStyle") || "Configure global AI output style",
365
+ name: isZh ? "\u{1F3A8} \u914D\u7F6E\u8F93\u51FA\u98CE\u683C" : "\u{1F3A8} Configure output style",
349
366
  value: "outputStyle"
350
367
  }
351
368
  ])
@@ -353,32 +370,154 @@ async function configureAiMemoryFeature() {
353
370
  if (!option) {
354
371
  return;
355
372
  }
356
- if (option === "language") {
357
- const zcfConfig = readZcfConfig();
358
- const existingLang = zcfConfig?.aiOutputLang;
359
- if (existingLang) {
360
- console.log(
361
- `
373
+ const { readFileSync, existsSync, writeFileSync } = await import('node:fs');
374
+ const { homedir } = await import('node:os');
375
+ const { join } = await import('pathe');
376
+ const { execSync } = await import('node:child_process');
377
+ const nodeProcess = await import('node:process');
378
+ const cwd = nodeProcess.default.cwd();
379
+ const globalClaudeMdPath = join(homedir(), ".claude", "CLAUDE.md");
380
+ const projectClaudeMdPath = join(cwd, "CLAUDE.md");
381
+ const localClaudeMdPath = join(cwd, ".claude", "CLAUDE.md");
382
+ switch (option) {
383
+ case "viewGlobalClaudeMd": {
384
+ if (existsSync(globalClaudeMdPath)) {
385
+ console.log(ansis.cyan.bold(`
386
+ \u{1F4C4} ${isZh ? "\u5168\u5C40 CLAUDE.md \u5185\u5BB9" : "Global CLAUDE.md Content"}:`));
387
+ console.log(ansis.dim("\u2500".repeat(60)));
388
+ const content = readFileSync(globalClaudeMdPath, "utf-8");
389
+ console.log(content);
390
+ console.log(ansis.dim("\u2500".repeat(60)));
391
+ console.log(ansis.gray(`${isZh ? "\u8DEF\u5F84" : "Path"}: ${globalClaudeMdPath}`));
392
+ } else {
393
+ console.log(ansis.yellow(`
394
+ \u26A0\uFE0F ${isZh ? "\u5168\u5C40 CLAUDE.md \u4E0D\u5B58\u5728" : "Global CLAUDE.md does not exist"}`));
395
+ console.log(ansis.gray(`${isZh ? "\u9884\u671F\u8DEF\u5F84" : "Expected path"}: ${globalClaudeMdPath}`));
396
+ }
397
+ break;
398
+ }
399
+ case "viewProjectClaudeMd": {
400
+ let foundPath = null;
401
+ if (existsSync(projectClaudeMdPath)) {
402
+ foundPath = projectClaudeMdPath;
403
+ } else if (existsSync(localClaudeMdPath)) {
404
+ foundPath = localClaudeMdPath;
405
+ }
406
+ if (foundPath) {
407
+ console.log(ansis.cyan.bold(`
408
+ \u{1F4C1} ${isZh ? "\u9879\u76EE CLAUDE.md \u5185\u5BB9" : "Project CLAUDE.md Content"}:`));
409
+ console.log(ansis.dim("\u2500".repeat(60)));
410
+ const content = readFileSync(foundPath, "utf-8");
411
+ console.log(content);
412
+ console.log(ansis.dim("\u2500".repeat(60)));
413
+ console.log(ansis.gray(`${isZh ? "\u8DEF\u5F84" : "Path"}: ${foundPath}`));
414
+ } else {
415
+ console.log(ansis.yellow(`
416
+ \u26A0\uFE0F ${isZh ? "\u9879\u76EE CLAUDE.md \u4E0D\u5B58\u5728" : "Project CLAUDE.md does not exist"}`));
417
+ console.log(ansis.gray(`${isZh ? "\u5DF2\u68C0\u67E5\u8DEF\u5F84" : "Checked paths"}:`));
418
+ console.log(ansis.gray(` - ${projectClaudeMdPath}`));
419
+ console.log(ansis.gray(` - ${localClaudeMdPath}`));
420
+ }
421
+ break;
422
+ }
423
+ case "viewPostmortem": {
424
+ const postmortemDir = join(cwd, ".postmortem");
425
+ if (existsSync(postmortemDir)) {
426
+ console.log(ansis.cyan.bold(`
427
+ \u{1F52C} ${isZh ? "Postmortem \u62A5\u544A" : "Postmortem Reports"}:`));
428
+ console.log(ansis.dim("\u2500".repeat(60)));
429
+ const { readdirSync } = await import('node:fs');
430
+ const files = readdirSync(postmortemDir).filter((f) => f.endsWith(".md"));
431
+ if (files.length === 0) {
432
+ console.log(ansis.yellow(isZh ? "\u6682\u65E0 Postmortem \u62A5\u544A" : "No postmortem reports yet"));
433
+ } else {
434
+ console.log(ansis.green(`${isZh ? "\u627E\u5230" : "Found"} ${files.length} ${isZh ? "\u4E2A\u62A5\u544A" : "reports"}:
435
+ `));
436
+ const { selectedFile } = await inquirer.prompt({
437
+ type: "list",
438
+ name: "selectedFile",
439
+ message: isZh ? "\u9009\u62E9\u8981\u67E5\u770B\u7684\u62A5\u544A" : "Select a report to view",
440
+ choices: [
441
+ ...files.map((f) => ({ name: f, value: f })),
442
+ { name: isZh ? "\u8FD4\u56DE" : "Back", value: "back" }
443
+ ]
444
+ });
445
+ if (selectedFile !== "back") {
446
+ const reportPath = join(postmortemDir, selectedFile);
447
+ const content = readFileSync(reportPath, "utf-8");
448
+ console.log(ansis.dim("\u2500".repeat(60)));
449
+ console.log(content);
450
+ console.log(ansis.dim("\u2500".repeat(60)));
451
+ }
452
+ }
453
+ console.log(ansis.gray(`
454
+ ${isZh ? "\u76EE\u5F55" : "Directory"}: ${postmortemDir}`));
455
+ console.log(ansis.gray(`\u{1F4A1} ${isZh ? "\u8FD0\u884C `ccjk postmortem init` \u4ECE\u5386\u53F2 fix commits \u751F\u6210\u62A5\u544A" : "Run `ccjk postmortem init` to generate reports from fix commits"}`));
456
+ } else {
457
+ console.log(ansis.yellow(`
458
+ \u26A0\uFE0F ${isZh ? "Postmortem \u76EE\u5F55\u4E0D\u5B58\u5728" : "Postmortem directory does not exist"}`));
459
+ console.log(ansis.gray(`\u{1F4A1} ${isZh ? "\u8FD0\u884C `ccjk postmortem init` \u521D\u59CB\u5316 Postmortem \u7CFB\u7EDF" : "Run `ccjk postmortem init` to initialize the Postmortem system"}`));
460
+ }
461
+ break;
462
+ }
463
+ case "editGlobalClaudeMd": {
464
+ const editor = nodeProcess.default.env.EDITOR || nodeProcess.default.env.VISUAL || "vi";
465
+ if (!existsSync(globalClaudeMdPath)) {
466
+ const claudeDir = join(homedir(), ".claude");
467
+ const { mkdirSync } = await import('node:fs');
468
+ if (!existsSync(claudeDir)) {
469
+ mkdirSync(claudeDir, { recursive: true });
470
+ }
471
+ writeFileSync(globalClaudeMdPath, `# Claude Global Memory
472
+
473
+ <!-- Add your global instructions here -->
474
+ `);
475
+ console.log(ansis.green(`\u2705 ${isZh ? "\u5DF2\u521B\u5EFA\u5168\u5C40 CLAUDE.md" : "Created global CLAUDE.md"}`));
476
+ }
477
+ console.log(ansis.cyan(`
478
+ \u{1F4DD} ${isZh ? "\u6B63\u5728\u6253\u5F00\u7F16\u8F91\u5668..." : "Opening editor..."}`));
479
+ console.log(ansis.gray(`${isZh ? "\u7F16\u8F91\u5668" : "Editor"}: ${editor}`));
480
+ console.log(ansis.gray(`${isZh ? "\u6587\u4EF6" : "File"}: ${globalClaudeMdPath}`));
481
+ try {
482
+ execSync(`${editor} "${globalClaudeMdPath}"`, { stdio: "inherit" });
483
+ console.log(ansis.green(`
484
+ \u2705 ${isZh ? "\u7F16\u8F91\u5B8C\u6210" : "Edit complete"}`));
485
+ } catch {
486
+ console.log(ansis.yellow(`
487
+ \u26A0\uFE0F ${isZh ? "\u7F16\u8F91\u5668\u9000\u51FA" : "Editor exited"}`));
488
+ }
489
+ break;
490
+ }
491
+ case "language": {
492
+ const zcfConfig = readZcfConfig();
493
+ const existingLang = zcfConfig?.aiOutputLang;
494
+ if (existingLang) {
495
+ console.log(
496
+ `
362
497
  ${ansis.blue(`\u2139 ${i18n.t("configuration:existingLanguageConfig") || "Existing AI output language configuration"}`)}`
363
- );
364
- console.log(ansis.gray(` ${i18n.t("configuration:currentLanguage") || "Current language"}: ${existingLang}
498
+ );
499
+ console.log(ansis.gray(` ${i18n.t("configuration:currentLanguage") || "Current language"}: ${existingLang}
365
500
  `));
366
- const modify = await promptBoolean({
367
- message: i18n.t("configuration:modifyLanguage") || "Modify AI output language?",
368
- defaultValue: false
369
- });
370
- if (!modify) {
371
- console.log(ansis.green(`\u2714 ${i18n.t("configuration:keepLanguage") || "Keeping existing language configuration"}`));
372
- return;
501
+ const modify = await promptBoolean({
502
+ message: i18n.t("configuration:modifyLanguage") || "Modify AI output language?",
503
+ defaultValue: false
504
+ });
505
+ if (!modify) {
506
+ console.log(ansis.green(`\u2714 ${i18n.t("configuration:keepLanguage") || "Keeping existing language configuration"}`));
507
+ return;
508
+ }
373
509
  }
510
+ const { selectAiOutputLanguage } = await import('./prompts.mjs');
511
+ const aiOutputLang = await selectAiOutputLanguage();
512
+ applyAiLanguageDirective(aiOutputLang);
513
+ updateZcfConfig({ aiOutputLang });
514
+ console.log(ansis.green(`\u2714 ${i18n.t("configuration:aiLanguageConfigured") || "AI output language configured"}`));
515
+ break;
516
+ }
517
+ case "outputStyle": {
518
+ await configureOutputStyle();
519
+ break;
374
520
  }
375
- const { selectAiOutputLanguage } = await import('./prompts.mjs');
376
- const aiOutputLang = await selectAiOutputLanguage();
377
- applyAiLanguageDirective(aiOutputLang);
378
- updateZcfConfig({ aiOutputLang });
379
- console.log(ansis.green(`\u2714 ${i18n.t("configuration:aiLanguageConfigured") || "AI output language configured"}`));
380
- } else if (option === "outputStyle") {
381
- await configureOutputStyle();
382
521
  }
383
522
  }
384
523
  async function changeScriptLanguageFeature(currentLang) {
@@ -20,6 +20,7 @@ import { join } from 'pathe';
20
20
  import { i18n, ensureI18nInitialized } from './index2.mjs';
21
21
  import { writeFileAtomic } from './fs-operations.mjs';
22
22
  import '../shared/ccjk.B-lZxV2u.mjs';
23
+ import '../shared/ccjk.B2Aos9HI.mjs';
23
24
  import { r as readCodexConfig, b as backupCodexComplete, w as writeCodexConfig, a as writeAuthFile, d as detectConfigManagementMode } from './codex.mjs';
24
25
  import inquirer from 'inquirer';
25
26
  import { readJsonConfig } from './json-config.mjs';
@@ -472,24 +472,20 @@ async function generateContextRules(context, lang) {
472
472
  `));
473
473
  const recommendedIds = getRecommendedRules(context);
474
474
  const applicableRules = getApplicableRules(context.type);
475
- console.log(ansis.bold(isZh ? "\u63A8\u8350\u7684\u89C4\u5219\uFF1A" : "Recommended Rules:"));
476
- for (const rule of applicableRules) {
477
- const isRecommended = recommendedIds.includes(rule.id);
478
- const icon = isRecommended ? ansis.green("\u2605") : ansis.dim("\u25CB");
479
- const name = isZh ? rule.nameZh : rule.name;
480
- const desc = isZh ? rule.descriptionZh : rule.description;
481
- console.log(` ${icon} ${name} - ${ansis.dim(desc)}`);
482
- }
483
- console.log("");
484
- const { confirm } = await inquirer.prompt([
475
+ const { selectedRules } = await inquirer.prompt([
485
476
  {
486
- type: "confirm",
487
- name: "confirm",
488
- message: isZh ? "\u4F7F\u7528\u63A8\u8350\u89C4\u5219\u751F\u6210 CLAUDE.md\uFF1F" : "Generate CLAUDE.md with recommended rules?",
489
- default: true
477
+ type: "checkbox",
478
+ name: "selectedRules",
479
+ message: isZh ? "\u9009\u62E9\u8981\u5E94\u7528\u7684\u89C4\u5219\uFF08\u63A8\u8350\u89C4\u5219\u5DF2\u9884\u9009\uFF09" : "Select rules to apply (recommended rules pre-selected)",
480
+ choices: applicableRules.map((rule) => ({
481
+ name: `${recommendedIds.includes(rule.id) ? ansis.green("\u2605") : " "} ${isZh ? rule.nameZh : rule.name} - ${ansis.dim(isZh ? rule.descriptionZh : rule.description)}`,
482
+ value: rule.id,
483
+ checked: recommendedIds.includes(rule.id)
484
+ }))
490
485
  }
491
486
  ]);
492
- if (!confirm) {
487
+ if (selectedRules.length === 0) {
488
+ console.log(ansis.yellow(isZh ? "\u672A\u9009\u62E9\u4EFB\u4F55\u89C4\u5219" : "No rules selected"));
493
489
  return;
494
490
  }
495
491
  const { location } = await inquirer.prompt([
@@ -548,7 +544,7 @@ async function generateContextRules(context, lang) {
548
544
  if (overwrite === "merge") {
549
545
  const existingContent = readContextFile(targetFile.path);
550
546
  if (existingContent) {
551
- const mergedContent = mergeContextContent(existingContent, recommendedIds, lang);
547
+ const mergedContent = mergeContextContent(existingContent, selectedRules, lang);
552
548
  const success2 = await writeContextFile(targetFile.path, mergedContent);
553
549
  if (success2) {
554
550
  console.log(ansis.green(`
@@ -561,7 +557,7 @@ async function generateContextRules(context, lang) {
561
557
  }
562
558
  }
563
559
  }
564
- const content = generateContextContent(context, recommendedIds, lang);
560
+ const content = generateContextContent(context, selectedRules, lang);
565
561
  const success = await writeContextFile(targetFile.path, content);
566
562
  if (success) {
567
563
  console.log(ansis.green(`