ccjk 1.4.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 (57) 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 +388 -45
  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/en/workflow.json +28 -9
  20. package/dist/i18n/locales/zh-CN/marketplace.json +84 -0
  21. package/dist/i18n/locales/zh-CN/menu.json +38 -1
  22. package/dist/i18n/locales/zh-CN/skills.json +140 -0
  23. package/dist/i18n/locales/zh-CN/smartGuide.json +49 -0
  24. package/dist/i18n/locales/zh-CN/subagent.json +69 -0
  25. package/dist/i18n/locales/zh-CN/superpowers.json +58 -0
  26. package/dist/i18n/locales/zh-CN/workflow.json +28 -9
  27. package/dist/index.d.mts +1 -0
  28. package/dist/index.d.ts +1 -0
  29. package/package.json +26 -27
  30. package/templates/claude-code/en/workflow/essential/commands/feat.md +196 -51
  31. package/templates/claude-code/zh-CN/workflow/essential/commands/feat.md +194 -51
  32. package/templates/common/skills/en/brainstorming.md +64 -0
  33. package/templates/common/skills/en/code-review.md +81 -0
  34. package/templates/common/skills/en/documentation-gen.md +808 -0
  35. package/templates/common/skills/en/executing-plans.md +75 -0
  36. package/templates/common/skills/en/git-commit.md +216 -0
  37. package/templates/common/skills/en/interview.md +223 -0
  38. package/templates/common/skills/en/migration-assistant.md +312 -0
  39. package/templates/common/skills/en/performance-profiling.md +576 -0
  40. package/templates/common/skills/en/pr-review.md +341 -0
  41. package/templates/common/skills/en/refactoring.md +384 -0
  42. package/templates/common/skills/en/security-audit.md +462 -0
  43. package/templates/common/skills/en/systematic-debugging.md +82 -0
  44. package/templates/common/skills/en/tdd-workflow.md +93 -0
  45. package/templates/common/skills/en/verification.md +81 -0
  46. package/templates/common/skills/en/workflow.md +370 -0
  47. package/templates/common/skills/en/writing-plans.md +78 -0
  48. package/templates/common/skills/zh-CN/documentation-gen.md +807 -0
  49. package/templates/common/skills/zh-CN/migration-assistant.md +318 -0
  50. package/templates/common/skills/zh-CN/performance-profiling.md +746 -0
  51. package/templates/common/skills/zh-CN/pr-review.md +341 -0
  52. package/templates/common/skills/zh-CN/refactoring.md +384 -0
  53. package/templates/common/skills/zh-CN/security-audit.md +462 -0
  54. package/templates/common/smart-guide/en/smart-guide.md +72 -0
  55. package/templates/common/smart-guide/zh-CN/smart-guide.md +72 -0
  56. package/templates/common/workflow/sixStep/en/workflow.md +137 -31
  57. package/templates/common/workflow/sixStep/zh-CN/workflow.md +152 -10
@@ -0,0 +1,234 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { readFile, writeFile } from 'node:fs/promises';
3
+ import { homedir } from 'node:os';
4
+ import { join } from 'pathe';
5
+
6
+ const QUICK_ACTIONS = [
7
+ {
8
+ id: 1,
9
+ name: "Smart Commit",
10
+ nameZh: "\u667A\u80FD\u63D0\u4EA4",
11
+ icon: "\u{1F4DD}",
12
+ description: "Auto-generate commit message",
13
+ descriptionZh: "\u81EA\u52A8\u751F\u6210 commit \u6D88\u606F",
14
+ command: "/commit",
15
+ autoActivate: true,
16
+ triggers: ["commit", "git", "push", "save", "\u63D0\u4EA4", "\u4FDD\u5B58"]
17
+ },
18
+ {
19
+ id: 2,
20
+ name: "Code Review",
21
+ nameZh: "\u4EE3\u7801\u5BA1\u67E5",
22
+ icon: "\u{1F50D}",
23
+ description: "Deep two-stage code review",
24
+ descriptionZh: "\u6DF1\u5EA6\u4E24\u9636\u6BB5\u4EE3\u7801\u5BA1\u67E5",
25
+ command: "/review",
26
+ autoActivate: true,
27
+ triggers: ["review", "check", "pr", "merge", "\u5BA1\u67E5", "\u68C0\u67E5", "\u5408\u5E76"]
28
+ },
29
+ {
30
+ id: 3,
31
+ name: "Write Tests",
32
+ nameZh: "\u7F16\u5199\u6D4B\u8BD5",
33
+ icon: "\u{1F9EA}",
34
+ description: "TDD workflow",
35
+ descriptionZh: "TDD \u5DE5\u4F5C\u6D41",
36
+ command: "/tdd",
37
+ autoActivate: true,
38
+ triggers: ["test", "tdd", "unit", "spec", "\u6D4B\u8BD5", "\u5355\u5143\u6D4B\u8BD5"]
39
+ },
40
+ {
41
+ id: 4,
42
+ name: "Plan Feature",
43
+ nameZh: "\u89C4\u5212\u529F\u80FD",
44
+ icon: "\u{1F4CB}",
45
+ description: "6-step development workflow",
46
+ descriptionZh: "6\u6B65\u5F00\u53D1\u6D41\u7A0B",
47
+ command: "/workflow",
48
+ autoActivate: true,
49
+ triggers: ["plan", "feature", "implement", "build", "create", "\u89C4\u5212", "\u529F\u80FD", "\u5B9E\u73B0", "\u521B\u5EFA"]
50
+ },
51
+ {
52
+ id: 5,
53
+ name: "Debug Issue",
54
+ nameZh: "\u8C03\u8BD5\u95EE\u9898",
55
+ icon: "\u{1F41B}",
56
+ description: "Systematic debugging",
57
+ descriptionZh: "\u7CFB\u7EDF\u6027\u8C03\u8BD5",
58
+ command: "/debug",
59
+ autoActivate: true,
60
+ triggers: ["debug", "bug", "error", "fix", "issue", "problem", "\u8C03\u8BD5", "\u9519\u8BEF", "\u4FEE\u590D", "\u95EE\u9898"]
61
+ },
62
+ {
63
+ id: 6,
64
+ name: "Brainstorm",
65
+ nameZh: "\u5934\u8111\u98CE\u66B4",
66
+ icon: "\u{1F4A1}",
67
+ description: "Explore ideas and solutions",
68
+ descriptionZh: "\u63A2\u7D22\u60F3\u6CD5\u548C\u65B9\u6848",
69
+ command: "/brainstorm",
70
+ autoActivate: true,
71
+ triggers: ["brainstorm", "idea", "design", "think", "explore", "\u5934\u8111\u98CE\u66B4", "\u60F3\u6CD5", "\u8BBE\u8BA1", "\u63A2\u7D22"]
72
+ },
73
+ {
74
+ id: 7,
75
+ name: "Verify Code",
76
+ nameZh: "\u9A8C\u8BC1\u4EE3\u7801",
77
+ icon: "\u2705",
78
+ description: "Quality verification",
79
+ descriptionZh: "\u8D28\u91CF\u9A8C\u8BC1",
80
+ command: "/verify",
81
+ autoActivate: true,
82
+ triggers: ["verify", "validate", "quality", "deploy", "\u9A8C\u8BC1", "\u8D28\u91CF", "\u90E8\u7F72"]
83
+ },
84
+ {
85
+ id: 8,
86
+ name: "Write Docs",
87
+ nameZh: "\u5199\u6587\u6863",
88
+ icon: "\u{1F4D6}",
89
+ description: "Generate documentation",
90
+ descriptionZh: "\u751F\u6210\u6587\u6863",
91
+ command: "/docs",
92
+ autoActivate: false,
93
+ triggers: ["doc", "docs", "readme", "documentation", "\u6587\u6863", "\u8BF4\u660E"]
94
+ }
95
+ ];
96
+ function generateQuickActionsPanel(lang = "en") {
97
+ const isZh = lang === "zh-CN";
98
+ const title = isZh ? "\u{1F4A1} \u5FEB\u6377\u64CD\u4F5C\uFF08\u8F93\u5165\u6570\u5B57\u6267\u884C\uFF09\uFF1A" : "\u{1F4A1} Quick Actions (type number to execute):";
99
+ const lines = [
100
+ title,
101
+ "\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"
102
+ ];
103
+ for (const action of QUICK_ACTIONS) {
104
+ const name = isZh ? action.nameZh : action.name;
105
+ const desc = isZh ? action.descriptionZh : action.description;
106
+ const line = `\u2502 ${action.id}. ${action.icon} ${name.padEnd(10)} - ${desc.padEnd(16)} \u2502`;
107
+ lines.push(line);
108
+ }
109
+ lines.push("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518");
110
+ lines.push(isZh ? "\u8F93\u5165\u6570\u5B57 (1-8) \u6216\u63CF\u8FF0\u4F60\u7684\u4EFB\u52A1..." : "Type number (1-8) or describe your task...");
111
+ return lines.join("\n");
112
+ }
113
+ function generateSkillReferenceCard(lang = "en") {
114
+ const isZh = lang === "zh-CN";
115
+ const header = isZh ? "\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557\n\u2551 CCJK \u6280\u80FD\u901F\u67E5\u5361 \u2551\n\u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563" : "\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557\n\u2551 CCJK Skills Reference \u2551\n\u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563";
116
+ const lines = [header];
117
+ for (const action of QUICK_ACTIONS) {
118
+ const name = isZh ? action.nameZh : action.name;
119
+ const line = `\u2551 ${action.icon} ${name.padEnd(10)} ${isZh ? "\u8F93\u5165" : "Type"}: ${action.id} ${isZh ? "\u6216" : "or"} ${action.command.padEnd(12)} \u2551`;
120
+ lines.push(line);
121
+ }
122
+ lines.push("\u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563");
123
+ lines.push(isZh ? "\u2551 \u{1F4A1} \u63D0\u793A: \u76F4\u63A5\u8F93\u5165\u6570\u5B57\uFF0CClaude \u4F1A\u81EA\u52A8\u6267\u884C\u5BF9\u5E94\u64CD\u4F5C \u2551" : "\u2551 \u{1F4A1} Tip: Just type a number, Claude will execute automatically \u2551");
124
+ lines.push("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D");
125
+ return lines.join("\n");
126
+ }
127
+ function generateSmartGuideDirective(lang = "en") {
128
+ const isZh = lang === "zh-CN";
129
+ const directive = isZh ? `
130
+ ## \u{1F3AF} CCJK \u667A\u80FD\u52A9\u624B\u6A21\u5F0F
131
+
132
+ ### \u5BF9\u8BDD\u5F00\u59CB\u65F6
133
+ \u5728\u6BCF\u6B21\u5BF9\u8BDD\u5F00\u59CB\u65F6\uFF0C\u663E\u793A\u5FEB\u6377\u64CD\u4F5C\u9762\u677F\uFF1A
134
+
135
+ \`\`\`
136
+ ${generateQuickActionsPanel("zh-CN")}
137
+ \`\`\`
138
+
139
+ ### \u6570\u5B57\u8F93\u5165\u5904\u7406
140
+ \u5F53\u7528\u6237\u8F93\u5165\u5355\u4E2A\u6570\u5B57 (1-8) \u65F6\uFF0C\u81EA\u52A8\u6267\u884C\u5BF9\u5E94\u6280\u80FD\uFF1A
141
+ ${QUICK_ACTIONS.map((a) => `- **${a.id}** \u2192 \u6267\u884C ${a.command} (${a.nameZh})`).join("\n")}
142
+
143
+ ### \u667A\u80FD\u573A\u666F\u611F\u77E5
144
+ \u6839\u636E\u7528\u6237\u8F93\u5165\u81EA\u52A8\u63A8\u8350\uFF1A
145
+ - \u63D0\u5230"\u63D0\u4EA4/commit/push" \u2192 \u63A8\u8350\u8F93\u5165 **1**
146
+ - \u63D0\u5230"\u5BA1\u67E5/review/\u68C0\u67E5" \u2192 \u63A8\u8350\u8F93\u5165 **2**
147
+ - \u63D0\u5230"\u6D4B\u8BD5/test/tdd" \u2192 \u63A8\u8350\u8F93\u5165 **3**
148
+ - \u63D0\u5230"\u529F\u80FD/feature/\u5B9E\u73B0" \u2192 \u63A8\u8350\u8F93\u5165 **4**
149
+ - \u63D0\u5230"bug/\u9519\u8BEF/\u4FEE\u590D" \u2192 \u63A8\u8350\u8F93\u5165 **5**
150
+ - \u63D0\u5230"\u60F3\u6CD5/\u8BBE\u8BA1/\u65B9\u6848" \u2192 \u63A8\u8350\u8F93\u5165 **6**
151
+
152
+ ### \u5E2E\u52A9\u547D\u4EE4
153
+ - \u7528\u6237\u8BF4"\u66F4\u591A"\u6216"\u5E2E\u52A9" \u2192 \u663E\u793A\u5B8C\u6574\u6280\u80FD\u5217\u8868
154
+ - \u7528\u6237\u8BF4"?" \u2192 \u663E\u793A\u5FEB\u6377\u64CD\u4F5C\u9762\u677F
155
+ ` : `
156
+ ## \u{1F3AF} CCJK Smart Assistant Mode
157
+
158
+ ### At Conversation Start
159
+ Display quick actions panel at the start of each conversation:
160
+
161
+ \`\`\`
162
+ ${generateQuickActionsPanel("en")}
163
+ \`\`\`
164
+
165
+ ### Number Input Handling
166
+ When user types a single number (1-8), automatically execute the corresponding skill:
167
+ ${QUICK_ACTIONS.map((a) => `- **${a.id}** \u2192 Execute ${a.command} (${a.name})`).join("\n")}
168
+
169
+ ### Intelligent Context Detection
170
+ Auto-suggest based on user input:
171
+ - Mentions "commit/push/save" \u2192 Suggest typing **1**
172
+ - Mentions "review/check/pr" \u2192 Suggest typing **2**
173
+ - Mentions "test/tdd/spec" \u2192 Suggest typing **3**
174
+ - Mentions "feature/implement/build" \u2192 Suggest typing **4**
175
+ - Mentions "bug/error/fix" \u2192 Suggest typing **5**
176
+ - Mentions "idea/design/explore" \u2192 Suggest typing **6**
177
+
178
+ ### Help Commands
179
+ - User says "more" or "help" \u2192 Show full skill list
180
+ - User says "?" \u2192 Show quick actions panel
181
+ `;
182
+ return directive;
183
+ }
184
+ function getClaudeMdPath() {
185
+ return join(homedir(), ".claude", "CLAUDE.md");
186
+ }
187
+ async function injectSmartGuide(lang = "en") {
188
+ const claudeMdPath = getClaudeMdPath();
189
+ try {
190
+ let content = "";
191
+ if (existsSync(claudeMdPath)) {
192
+ content = await readFile(claudeMdPath, "utf-8");
193
+ if (content.includes("CCJK \u667A\u80FD\u52A9\u624B\u6A21\u5F0F") || content.includes("CCJK Smart Assistant Mode")) {
194
+ content = content.replace(/\n## 🎯 CCJK (智能助手模式|Smart Assistant Mode)[\s\S]*?(?=\n## |$)/g, "");
195
+ }
196
+ }
197
+ const directive = generateSmartGuideDirective(lang);
198
+ content = `${content.trim()}
199
+ ${directive}`;
200
+ await writeFile(claudeMdPath, content, "utf-8");
201
+ return true;
202
+ } catch (error) {
203
+ console.error("Failed to inject smart guide:", error);
204
+ return false;
205
+ }
206
+ }
207
+ async function removeSmartGuide() {
208
+ const claudeMdPath = getClaudeMdPath();
209
+ try {
210
+ if (!existsSync(claudeMdPath)) {
211
+ return true;
212
+ }
213
+ let content = await readFile(claudeMdPath, "utf-8");
214
+ content = content.replace(/\n## 🎯 CCJK (智能助手模式|Smart Assistant Mode)[\s\S]*?(?=\n## |$)/g, "");
215
+ await writeFile(claudeMdPath, content.trim(), "utf-8");
216
+ return true;
217
+ } catch {
218
+ return false;
219
+ }
220
+ }
221
+ async function isSmartGuideInstalled() {
222
+ const claudeMdPath = getClaudeMdPath();
223
+ try {
224
+ if (!existsSync(claudeMdPath)) {
225
+ return false;
226
+ }
227
+ const content = await readFile(claudeMdPath, "utf-8");
228
+ return content.includes("CCJK \u667A\u80FD\u52A9\u624B\u6A21\u5F0F") || content.includes("CCJK Smart Assistant Mode");
229
+ } catch {
230
+ return false;
231
+ }
232
+ }
233
+
234
+ export { QUICK_ACTIONS, generateQuickActionsPanel, generateSkillReferenceCard, generateSmartGuideDirective, injectSmartGuide, isSmartGuideInstalled, removeSmartGuide };