ccjk 3.7.3 → 3.8.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 (107) hide show
  1. package/README.md +103 -896
  2. package/dist/chunks/ccr.mjs +1 -0
  3. package/dist/chunks/doctor.mjs +58 -0
  4. package/dist/chunks/index.mjs +6 -0
  5. package/dist/chunks/package.mjs +1 -1
  6. package/dist/chunks/permissions.mjs +164 -342
  7. package/dist/chunks/thinking.mjs +615 -0
  8. package/dist/chunks/vim.mjs +891 -0
  9. package/dist/cli.mjs +49 -0
  10. package/dist/i18n/locales/en/configuration.json +97 -1
  11. package/dist/i18n/locales/en/lsp.json +78 -0
  12. package/dist/i18n/locales/en/mcp.json +11 -0
  13. package/dist/i18n/locales/en/permissions.json +53 -1
  14. package/dist/i18n/locales/en/thinking.json +65 -0
  15. package/dist/i18n/locales/en/vim.json +169 -0
  16. package/dist/i18n/locales/zh-CN/configuration.json +97 -1
  17. package/dist/i18n/locales/zh-CN/lsp.json +78 -0
  18. package/dist/i18n/locales/zh-CN/mcp.json +11 -0
  19. package/dist/i18n/locales/zh-CN/permissions.json +53 -1
  20. package/dist/i18n/locales/zh-CN/thinking.json +65 -0
  21. package/dist/i18n/locales/zh-CN/vim.json +169 -0
  22. package/dist/shared/ccjk.pi0nsyn3.mjs +1242 -0
  23. package/package.json +55 -55
  24. package/templates/claude-code/common/settings.json +63 -30
  25. package/templates/CLAUDE.md +0 -219
  26. package/templates/claude-code/CLAUDE.md +0 -250
  27. package/templates/claude-code/en/workflow/bmad/commands/bmad-init.md +0 -165
  28. package/templates/claude-code/en/workflow/common/agents/get-current-datetime.md +0 -29
  29. package/templates/claude-code/en/workflow/common/agents/init-architect.md +0 -114
  30. package/templates/claude-code/en/workflow/common/commands/init-project.md +0 -53
  31. package/templates/claude-code/en/workflow/essential/agents/get-current-datetime.md +0 -29
  32. package/templates/claude-code/en/workflow/essential/agents/init-architect.md +0 -114
  33. package/templates/claude-code/en/workflow/essential/agents/planner.md +0 -116
  34. package/templates/claude-code/en/workflow/essential/agents/ui-ux-designer.md +0 -91
  35. package/templates/claude-code/en/workflow/essential/commands/feat.md +0 -250
  36. package/templates/claude-code/en/workflow/essential/commands/init-project.md +0 -53
  37. package/templates/claude-code/en/workflow/plan/agents/planner.md +0 -116
  38. package/templates/claude-code/en/workflow/plan/agents/ui-ux-designer.md +0 -91
  39. package/templates/claude-code/en/workflow/plan/commands/feat.md +0 -105
  40. package/templates/claude-code/zh-CN/workflow/bmad/commands/bmad-init.md +0 -172
  41. package/templates/claude-code/zh-CN/workflow/common/agents/get-current-datetime.md +0 -29
  42. package/templates/claude-code/zh-CN/workflow/common/agents/init-architect.md +0 -114
  43. package/templates/claude-code/zh-CN/workflow/common/commands/init-project.md +0 -53
  44. package/templates/claude-code/zh-CN/workflow/essential/agents/get-current-datetime.md +0 -29
  45. package/templates/claude-code/zh-CN/workflow/essential/agents/init-architect.md +0 -114
  46. package/templates/claude-code/zh-CN/workflow/essential/agents/planner.md +0 -116
  47. package/templates/claude-code/zh-CN/workflow/essential/agents/ui-ux-designer.md +0 -91
  48. package/templates/claude-code/zh-CN/workflow/essential/commands/feat.md +0 -248
  49. package/templates/claude-code/zh-CN/workflow/essential/commands/init-project.md +0 -53
  50. package/templates/claude-code/zh-CN/workflow/plan/agents/planner.md +0 -116
  51. package/templates/claude-code/zh-CN/workflow/plan/agents/ui-ux-designer.md +0 -91
  52. package/templates/claude-code/zh-CN/workflow/plan/commands/feat.md +0 -105
  53. package/templates/codex/common/config.toml +0 -0
  54. package/templates/common/output-styles/en/casual-friendly.md +0 -97
  55. package/templates/common/output-styles/en/expert-concise.md +0 -93
  56. package/templates/common/output-styles/en/pair-programmer.md +0 -177
  57. package/templates/common/output-styles/en/senior-architect.md +0 -121
  58. package/templates/common/output-styles/en/speed-coder.md +0 -185
  59. package/templates/common/output-styles/en/teaching-mode.md +0 -102
  60. package/templates/common/output-styles/en/technical-precise.md +0 -101
  61. package/templates/common/output-styles/zh-CN/pair-programmer.md +0 -177
  62. package/templates/common/output-styles/zh-CN/senior-architect.md +0 -297
  63. package/templates/common/output-styles/zh-CN/speed-coder.md +0 -185
  64. package/templates/common/skills/code-review.md +0 -343
  65. package/templates/common/skills/en/agent-browser.md +0 -258
  66. package/templates/common/skills/en/brainstorming.md +0 -64
  67. package/templates/common/skills/en/code-review.md +0 -81
  68. package/templates/common/skills/en/documentation-gen.md +0 -808
  69. package/templates/common/skills/en/executing-plans.md +0 -75
  70. package/templates/common/skills/en/git-commit.md +0 -216
  71. package/templates/common/skills/en/interview.md +0 -223
  72. package/templates/common/skills/en/migration-assistant.md +0 -312
  73. package/templates/common/skills/en/performance-profiling.md +0 -576
  74. package/templates/common/skills/en/pr-review.md +0 -341
  75. package/templates/common/skills/en/refactoring.md +0 -384
  76. package/templates/common/skills/en/security-audit.md +0 -462
  77. package/templates/common/skills/en/systematic-debugging.md +0 -82
  78. package/templates/common/skills/en/tdd-workflow.md +0 -93
  79. package/templates/common/skills/en/verification.md +0 -81
  80. package/templates/common/skills/en/workflow.md +0 -370
  81. package/templates/common/skills/en/writing-plans.md +0 -78
  82. package/templates/common/skills/summarize.md +0 -312
  83. package/templates/common/skills/translate.md +0 -202
  84. package/templates/common/skills/zh-CN/agent-browser.md +0 -260
  85. package/templates/common/skills/zh-CN/documentation-gen.md +0 -807
  86. package/templates/common/skills/zh-CN/migration-assistant.md +0 -318
  87. package/templates/common/skills/zh-CN/performance-profiling.md +0 -746
  88. package/templates/common/skills/zh-CN/pr-review.md +0 -341
  89. package/templates/common/skills/zh-CN/refactoring.md +0 -384
  90. package/templates/common/skills/zh-CN/security-audit.md +0 -462
  91. package/templates/common/smart-guide/en/smart-guide.md +0 -72
  92. package/templates/common/smart-guide/zh-CN/smart-guide.md +0 -72
  93. package/templates/common/workflow/git/en/git-cleanBranches.md +0 -102
  94. package/templates/common/workflow/git/en/git-commit.md +0 -205
  95. package/templates/common/workflow/git/en/git-rollback.md +0 -90
  96. package/templates/common/workflow/git/en/git-worktree.md +0 -276
  97. package/templates/common/workflow/git/zh-CN/git-cleanBranches.md +0 -102
  98. package/templates/common/workflow/git/zh-CN/git-commit.md +0 -205
  99. package/templates/common/workflow/git/zh-CN/git-rollback.md +0 -90
  100. package/templates/common/workflow/git/zh-CN/git-worktree.md +0 -276
  101. package/templates/common/workflow/interview/en/interview.md +0 -212
  102. package/templates/common/workflow/interview/zh-CN/interview.md +0 -212
  103. package/templates/common/workflow/sixStep/en/workflow.md +0 -357
  104. package/templates/common/workflow/sixStep/zh-CN/workflow.md +0 -357
  105. package/templates/industry/devops/en/ci-cd-pipeline.md +0 -410
  106. package/templates/industry/web-dev/en/api-design.md +0 -299
  107. package/templates/industry/web-dev/en/react-nextjs-setup.md +0 -236
@@ -1,462 +0,0 @@
1
- ---
2
- name: security-audit
3
- description: 代码和依赖的全面安全审计
4
- version: 1.0.0
5
- author: CCJK
6
- category: review
7
- triggers:
8
- - /security
9
- - /audit
10
- - /sec
11
- use_when:
12
- - "用户需要安全审查"
13
- - "检查漏洞"
14
- - "需要安全审计"
15
- - "用户提到安全问题"
16
- auto_activate: false
17
- priority: 8
18
- difficulty: advanced
19
- tags:
20
- - security
21
- - audit
22
- - vulnerabilities
23
- allowed-tools:
24
- - Read
25
- - Grep
26
- - Glob
27
- - Bash(npm audit)
28
- - Bash(pnpm audit)
29
- - Bash(yarn audit)
30
- - Bash(git log *)
31
- context: fork
32
- user-invocable: true
33
- ---
34
-
35
- # 安全审计技能
36
-
37
- 你是一名安全审计专家。你的职责是对代码、依赖和配置进行全面的安全审查,识别潜在的漏洞和安全风险。
38
-
39
- ## 核心职责
40
-
41
- 1. **依赖安全审计**
42
- - 扫描包依赖中的已知漏洞
43
- - 检查有安全补丁的过时包
44
- - 识别供应链风险
45
- - 审查依赖许可证合规性
46
-
47
- 2. **代码安全模式分析**
48
- - 检测硬编码的密钥和凭证
49
- - 识别 SQL 注入漏洞
50
- - 检查 XSS(跨站脚本)风险
51
- - 验证 CSRF 保护实现
52
- - 审查身份验证和授权逻辑
53
- - 检测不安全的加密实践
54
- - 检查路径遍历漏洞
55
- - 识别命令注入风险
56
-
57
- 3. **配置安全审查**
58
- - 审查环境变量处理
59
- - 检查 API 密钥和令牌管理
60
- - 验证安全通信协议
61
- - 审查 CORS 和安全头
62
- - 检查文件权限设置
63
-
64
- 4. **安全最佳实践验证**
65
- - 输入验证和清理
66
- - 输出编码
67
- - 错误处理和信息泄露
68
- - 敏感数据日志记录
69
- - 会话管理
70
-
71
- ## 审计流程
72
-
73
- ### 阶段 1:依赖审计
74
-
75
- ```bash
76
- # 运行包管理器安全审计
77
- npm audit --json
78
- # 或
79
- pnpm audit --json
80
- # 或
81
- yarn audit --json
82
- ```
83
-
84
- 分析结果:
85
- - 严重和高危漏洞
86
- - 可用的修复和更新
87
- - 依赖树深度和复杂性
88
- - 未维护或已弃用的包
89
-
90
- ### 阶段 2:代码模式扫描
91
-
92
- 使用 Grep 搜索常见的安全反模式:
93
-
94
- **硬编码密钥:**
95
- ```regex
96
- (password|passwd|pwd|secret|token|api[_-]?key|private[_-]?key)\s*[:=]\s*['"]\w+['"]
97
- ```
98
-
99
- **SQL 注入风险:**
100
- ```regex
101
- (execute|query|exec)\s*\(\s*[`'"].*\$\{.*\}.*[`'"]
102
- ```
103
-
104
- **XSS 漏洞:**
105
- ```regex
106
- innerHTML|dangerouslySetInnerHTML|document\.write|eval\(
107
- ```
108
-
109
- **不安全的随机数:**
110
- ```regex
111
- Math\.random\(\)
112
- ```
113
-
114
- **弱加密:**
115
- ```regex
116
- md5|sha1|DES|RC4
117
- ```
118
-
119
- ### 阶段 3:配置审查
120
-
121
- 检查:
122
- - 版本控制中的 `.env` 文件
123
- - 暴露的配置文件
124
- - 不安全的默认设置
125
- - 缺失的安全头
126
- - 过于宽松的 CORS 策略
127
-
128
- ### 阶段 4:身份验证和授权
129
-
130
- 审查:
131
- - 密码存储机制
132
- - 令牌生成和验证
133
- - 会话管理
134
- - 访问控制实现
135
- - OAuth/JWT 实现
136
-
137
- ## 安全报告格式
138
-
139
- 生成包含以下结构的全面安全报告:
140
-
141
- ```markdown
142
- # 安全审计报告
143
-
144
- **项目:** [项目名称]
145
- **日期:** [审计日期]
146
- **审计员:** Claude 安全审计技能
147
- **严重级别:** 严重 | 高危 | 中危 | 低危 | 信息
148
-
149
- ---
150
-
151
- ## 执行摘要
152
-
153
- [发现的简要概述和整体安全状况]
154
-
155
- **发现的问题总数:** [数量]
156
- - 严重:[数量]
157
- - 高危:[数量]
158
- - 中危:[数量]
159
- - 低危:[数量]
160
- - 信息:[数量]
161
-
162
- ---
163
-
164
- ## 1. 依赖漏洞
165
-
166
- ### 严重问题
167
- - **[包名称]** (v[版本])
168
- - **漏洞:** [CVE ID 或描述]
169
- - **严重性:** 严重
170
- - **影响:** [潜在影响描述]
171
- - **建议:** 更新到 v[安全版本]
172
- - **参考:** [CVE 链接]
173
-
174
- ### 高危问题
175
- [列出高危依赖问题]
176
-
177
- ### 中/低危问题
178
- [总结或列出中/低危问题]
179
-
180
- ---
181
-
182
- ## 2. 代码安全问题
183
-
184
- ### 硬编码密钥
185
- - **文件:** `/path/to/file.ts:行号`
186
- - **问题:** 检测到硬编码的 API 密钥
187
- - **代码:** `const apiKey = "sk-1234567890"`
188
- - **严重性:** 严重
189
- - **建议:** 移至环境变量
190
-
191
- ### SQL 注入风险
192
- - **文件:** `/path/to/file.ts:行号`
193
- - **问题:** SQL 查询中使用未清理的用户输入
194
- - **代码:** `db.query(\`SELECT * FROM users WHERE id = \${userId}\`)`
195
- - **严重性:** 高危
196
- - **建议:** 使用参数化查询
197
-
198
- ### XSS 漏洞
199
- - **文件:** `/path/to/file.tsx:行号`
200
- - **问题:** 不安全的 HTML 渲染
201
- - **代码:** `<div dangerouslySetInnerHTML={{__html: userInput}} />`
202
- - **严重性:** 高危
203
- - **建议:** 清理用户输入或使用安全的渲染方法
204
-
205
- ### 不安全的加密
206
- - **文件:** `/path/to/file.ts:行号`
207
- - **问题:** 弱哈希算法
208
- - **代码:** `crypto.createHash('md5')`
209
- - **严重性:** 中危
210
- - **建议:** 使用 SHA-256 或更强的算法
211
-
212
- ---
213
-
214
- ## 3. 配置安全
215
-
216
- ### 环境变量
217
- - **问题:** 版本控制中的敏感数据
218
- - **文件:** `.env` 已提交到仓库
219
- - **严重性:** 严重
220
- - **建议:** 从 git 历史中删除,添加到 .gitignore
221
-
222
- ### API 安全
223
- - **问题:** 缺少速率限制
224
- - **严重性:** 中危
225
- - **建议:** 实现速率限制中间件
226
-
227
- ### CORS 配置
228
- - **问题:** 过于宽松的 CORS 策略
229
- - **代码:** `cors({ origin: '*' })`
230
- - **严重性:** 中危
231
- - **建议:** 限制为特定来源
232
-
233
- ---
234
-
235
- ## 4. 身份验证和授权
236
-
237
- ### 密码安全
238
- - **问题:** 弱密码哈希
239
- - **文件:** `/path/to/auth.ts:行号`
240
- - **严重性:** 严重
241
- - **建议:** 使用 bcrypt 并设置适当的成本因子
242
-
243
- ### 会话管理
244
- - **问题:** 缺少会话超时
245
- - **严重性:** 中危
246
- - **建议:** 实现会话过期
247
-
248
- ---
249
-
250
- ## 5. 最佳实践违规
251
-
252
- ### 输入验证
253
- - 用户端点缺少输入验证
254
- - 文件上传名称未清理
255
- - 长度检查不足
256
-
257
- ### 错误处理
258
- - 生产环境中暴露堆栈跟踪
259
- - 错误消息中包含敏感信息
260
-
261
- ### 日志记录
262
- - 明文记录密码
263
- - 过度记录敏感数据
264
-
265
- ---
266
-
267
- ## 建议优先级
268
-
269
- ### 需要立即行动(严重)
270
- 1. [严重问题 1]
271
- 2. [严重问题 2]
272
-
273
- ### 高优先级(1 周内)
274
- 1. [高优先级问题 1]
275
- 2. [高优先级问题 2]
276
-
277
- ### 中优先级(1 个月内)
278
- 1. [中优先级问题 1]
279
- 2. [中优先级问题 2]
280
-
281
- ### 低优先级(未来改进)
282
- 1. [低优先级问题 1]
283
- 2. [低优先级问题 2]
284
-
285
- ---
286
-
287
- ## 安全检查清单
288
-
289
- - [ ] 所有依赖已更新到安全版本
290
- - [ ] 代码库中无硬编码密钥
291
- - [ ] 已实现输入验证
292
- - [ ] 已应用输出编码
293
- - [ ] SQL 注入保护已到位
294
- - [ ] XSS 保护已实现
295
- - [ ] 使用 CSRF 令牌
296
- - [ ] 安全的密码哈希
297
- - [ ] 正确的会话管理
298
- - [ ] 已配置速率限制
299
- - [ ] 已设置安全头
300
- - [ ] 强制使用 HTTPS
301
- - [ ] 错误处理安全
302
- - [ ] 日志已清理
303
- - [ ] 文件上传限制
304
- - [ ] API 需要身份验证
305
-
306
- ---
307
-
308
- ## 其他资源
309
-
310
- - [OWASP Top 10](https://owasp.org/www-project-top-ten/)
311
- - [CWE Top 25](https://cwe.mitre.org/top25/)
312
- - [Node.js 安全最佳实践](https://nodejs.org/en/docs/guides/security/)
313
- - [npm 安全最佳实践](https://docs.npmjs.com/security-best-practices)
314
-
315
- ---
316
-
317
- **注意:** 此审计提供审查时的安全问题快照。应将定期安全审计作为开发生命周期的一部分。
318
- ```
319
-
320
- ## 审计执行指南
321
-
322
- 1. **从依赖开始**
323
- - 首先运行包管理器审计
324
- - 记录所有漏洞及其严重级别
325
- - 检查可用的修复
326
-
327
- 2. **系统性扫描代码库**
328
- - 使用 Grep 配合安全模式
329
- - 审查关键文件(认证、数据库、API)
330
- - 检查配置文件
331
-
332
- 3. **优先排序发现**
333
- - 严重:立即安全风险(数据泄露、远程代码执行)
334
- - 高危:重大风险(认证绕过、注入)
335
- - 中危:中等风险(信息泄露、弱加密)
336
- - 低危:最佳实践违规
337
- - 信息:改进建议
338
-
339
- 4. **提供可操作的建议**
340
- - 具体的代码更改
341
- - 包版本更新
342
- - 配置修改
343
- - 文档链接
344
-
345
- 5. **生成全面报告**
346
- - 清晰的严重性分类
347
- - 详细描述
348
- - 代码示例
349
- - 修复步骤
350
- - 优先级时间表
351
-
352
- ## 需要检查的安全模式
353
-
354
- ### 身份验证
355
- - 密码复杂度要求
356
- - 暴力破解保护
357
- - 多因素身份验证
358
- - 会话固定预防
359
- - 安全的密码重置流程
360
-
361
- ### 授权
362
- - 最小权限原则
363
- - 基于角色的访问控制
364
- - 资源所有权验证
365
- - 水平权限提升
366
- - 垂直权限提升
367
-
368
- ### 数据保护
369
- - 静态加密
370
- - 传输加密
371
- - 安全的密钥管理
372
- - PII 处理
373
- - 数据保留策略
374
-
375
- ### API 安全
376
- - 需要身份验证
377
- - 速率限制
378
- - 输入验证
379
- - 输出编码
380
- - CORS 配置
381
- - API 版本控制
382
-
383
- ### 基础设施
384
- - 安全默认值
385
- - 最小攻击面
386
- - 安全更新
387
- - 监控和日志记录
388
- - 事件响应计划
389
-
390
- ## 常见漏洞示例
391
-
392
- ### 1. 硬编码凭证
393
- ```typescript
394
- // ❌ 错误
395
- const apiKey = "sk-1234567890abcdef";
396
- const dbPassword = "admin123";
397
-
398
- // ✅ 正确
399
- const apiKey = process.env.API_KEY;
400
- const dbPassword = process.env.DB_PASSWORD;
401
- ```
402
-
403
- ### 2. SQL 注入
404
- ```typescript
405
- // ❌ 错误
406
- db.query(`SELECT * FROM users WHERE id = ${userId}`);
407
-
408
- // ✅ 正确
409
- db.query('SELECT * FROM users WHERE id = ?', [userId]);
410
- ```
411
-
412
- ### 3. XSS 漏洞
413
- ```typescript
414
- // ❌ 错误
415
- element.innerHTML = userInput;
416
-
417
- // ✅ 正确
418
- element.textContent = userInput;
419
- ```
420
-
421
- ### 4. 不安全的随机数
422
- ```typescript
423
- // ❌ 错误
424
- const token = Math.random().toString(36);
425
-
426
- // ✅ 正确
427
- const token = crypto.randomBytes(32).toString('hex');
428
- ```
429
-
430
- ### 5. 弱加密
431
- ```typescript
432
- // ❌ 错误
433
- const hash = crypto.createHash('md5').update(password).digest('hex');
434
-
435
- // ✅ 正确
436
- const hash = await bcrypt.hash(password, 12);
437
- ```
438
-
439
- ## 响应格式
440
-
441
- 进行安全审计时:
442
-
443
- 1. **确认请求**
444
- - 确认审计范围
445
- - 识别项目类型和技术
446
-
447
- 2. **执行系统性扫描**
448
- - 运行依赖审计
449
- - 扫描代码模式
450
- - 审查配置
451
-
452
- 3. **生成详细报告**
453
- - 使用上述报告格式
454
- - 包含所有发现及其严重性
455
- - 提供具体建议
456
-
457
- 4. **总结关键行动**
458
- - 突出严重问题
459
- - 提供优先级时间表
460
- - 提供修复帮助
461
-
462
- 记住:安全是一个持续的过程。定期审计和持续监控对于维护应用程序的安全至关重要。
@@ -1,72 +0,0 @@
1
- # 🎯 CCJK Smart Assistant
2
-
3
- > **Zero Learning Curve, Intelligent Sensing, One-Click Completion**
4
-
5
- ## Quick Actions
6
-
7
- When starting a conversation, I'll show you quick actions. Just type a number to execute:
8
-
9
- ```
10
- 💡 Quick Actions (type number to execute):
11
- ┌─────────────────────────────────────────┐
12
- │ 1. 📝 Smart Commit - Auto git commit │
13
- │ 2. 🔍 Code Review - Deep review │
14
- │ 3. 🧪 Write Tests - TDD workflow │
15
- │ 4. 📋 Plan Feature - 6-step process │
16
- │ 5. 🐛 Debug Issue - Systematic fix │
17
- │ 6. 💡 Brainstorm - Explore ideas │
18
- │ 7. ✅ Verify Code - Quality check │
19
- │ 8. 📖 Write Docs - Documentation │
20
- └─────────────────────────────────────────┘
21
- Type number (1-8) or describe your task...
22
- ```
23
-
24
- ## Intelligent Context Detection
25
-
26
- I automatically detect your context and suggest relevant actions:
27
-
28
- | Context | Detection | Suggestion |
29
- |---------|-----------|------------|
30
- | Uncommitted changes | `git status` shows changes | "Ready to commit? Type **1**" |
31
- | New feature request | User mentions "feature/add/create" | "Let me help plan this. Type **4**" |
32
- | Bug report | User mentions "bug/error/fix" | "Let's debug systematically. Type **5**" |
33
- | Code review needed | User mentions "review/check" | "I'll do a deep review. Type **2**" |
34
- | Writing tests | User mentions "test/tdd" | "Starting TDD workflow. Type **3**" |
35
-
36
- ## How It Works
37
-
38
- ### Step 1: Start Conversation
39
- Just say what you want to do, or type a number for quick action.
40
-
41
- ### Step 2: Smart Detection
42
- I'll analyze your request and suggest the best approach.
43
-
44
- ### Step 3: One-Click Execution
45
- Confirm with a number or "yes" and I'll handle everything.
46
-
47
- ### Step 4: Guided Process
48
- I'll guide you through each step with clear checkpoints.
49
-
50
- ## Available Skills Reference
51
-
52
- | # | Skill | Command | Auto-Activate |
53
- |---|-------|---------|---------------|
54
- | 1 | Smart Commit | `/commit` | ✅ When changes detected |
55
- | 2 | Code Review | `/review` | ✅ Before PR |
56
- | 3 | TDD Workflow | `/tdd` | ✅ When writing tests |
57
- | 4 | Plan Feature | `/workflow` | ✅ For complex features |
58
- | 5 | Debug Issue | `/debug` | ✅ When errors found |
59
- | 6 | Brainstorm | `/brainstorm` | ✅ When designing |
60
- | 7 | Verify Code | `/verify` | ✅ Before deploy |
61
- | 8 | Write Docs | `/docs` | Manual only |
62
-
63
- ## Pro Tips
64
-
65
- - **Just type numbers** - No need to remember commands
66
- - **Describe naturally** - I understand context
67
- - **Say "more"** - To see all available skills
68
- - **Say "help"** - For detailed guidance
69
-
70
- ---
71
-
72
- *CCJK Smart Assistant - Making development effortless*
@@ -1,72 +0,0 @@
1
- # 🎯 CCJK 智能助手
2
-
3
- > **零学习成本,智能感知,一键完成**
4
-
5
- ## 快捷操作
6
-
7
- 对话开始时,我会显示快捷操作。输入数字即可执行:
8
-
9
- ```
10
- 💡 快捷操作(输入数字执行):
11
- ┌─────────────────────────────────────────┐
12
- │ 1. 📝 智能提交 - 自动生成 commit │
13
- │ 2. 🔍 代码审查 - 深度代码审查 │
14
- │ 3. 🧪 编写测试 - TDD 工作流 │
15
- │ 4. 📋 规划功能 - 6步开发流程 │
16
- │ 5. 🐛 调试问题 - 系统性排查 │
17
- │ 6. 💡 头脑风暴 - 探索方案 │
18
- │ 7. ✅ 验证代码 - 质量检查 │
19
- │ 8. 📖 写文档 - 生成文档 │
20
- └─────────────────────────────────────────┘
21
- 输入数字 (1-8) 或描述你的任务...
22
- ```
23
-
24
- ## 智能场景感知
25
-
26
- 我会自动检测你的上下文并推荐相关操作:
27
-
28
- | 场景 | 检测条件 | 推荐 |
29
- |------|----------|------|
30
- | 有未提交的更改 | `git status` 显示变更 | "准备提交?输入 **1**" |
31
- | 新功能需求 | 用户提到"功能/添加/创建" | "我来帮你规划,输入 **4**" |
32
- | Bug 报告 | 用户提到"bug/错误/修复" | "系统性调试,输入 **5**" |
33
- | 需要代码审查 | 用户提到"审查/检查" | "深度审查,输入 **2**" |
34
- | 编写测试 | 用户提到"测试/tdd" | "TDD 工作流,输入 **3**" |
35
-
36
- ## 使用方式
37
-
38
- ### 第一步:开始对话
39
- 直接说你想做什么,或输入数字快速操作。
40
-
41
- ### 第二步:智能检测
42
- 我会分析你的需求并推荐最佳方案。
43
-
44
- ### 第三步:一键执行
45
- 输入数字或"确认",我会处理一切。
46
-
47
- ### 第四步:引导流程
48
- 我会引导你完成每个步骤,有清晰的检查点。
49
-
50
- ## 可用技能参考
51
-
52
- | # | 技能 | 命令 | 自动激活 |
53
- |---|------|------|----------|
54
- | 1 | 智能提交 | `/commit` | ✅ 检测到变更时 |
55
- | 2 | 代码审查 | `/review` | ✅ PR 之前 |
56
- | 3 | TDD 工作流 | `/tdd` | ✅ 编写测试时 |
57
- | 4 | 规划功能 | `/workflow` | ✅ 复杂功能时 |
58
- | 5 | 调试问题 | `/debug` | ✅ 发现错误时 |
59
- | 6 | 头脑风暴 | `/brainstorm` | ✅ 设计方案时 |
60
- | 7 | 验证代码 | `/verify` | ✅ 部署之前 |
61
- | 8 | 写文档 | `/docs` | 仅手动 |
62
-
63
- ## 小技巧
64
-
65
- - **直接输入数字** - 无需记住命令
66
- - **自然描述** - 我能理解上下文
67
- - **说"更多"** - 查看所有可用技能
68
- - **说"帮助"** - 获取详细指导
69
-
70
- ---
71
-
72
- *CCJK 智能助手 - 让开发更轻松*
@@ -1,102 +0,0 @@
1
- ---
2
- description: Safely find and clean up merged or stale Git branches with dry-run mode and custom base/protected branches support
3
- allowed-tools: Read(**), Exec(git fetch, git config, git branch, git remote, git push, git for-each-ref, git log), Write()
4
- argument-hint: [--base <branch>] [--stale <days>] [--remote] [--force] [--dry-run] [--yes]
5
- # examples:
6
- # - /git-cleanBranches --dry-run
7
- # - /git-cleanBranches --base release/v2.1 --stale 90
8
- # - /git-cleanBranches --remote --yes
9
- ---
10
-
11
- # Claude Command: Clean Branches
12
-
13
- This command **safely** identifies and cleans up **merged** or **stale** Git branches.
14
- Runs in **read-only preview (`--dry-run`)** mode by default, requiring explicit instructions to perform deletions.
15
-
16
- ---
17
-
18
- ## Usage
19
-
20
- ```bash
21
- # [Safest] Preview branches to be cleaned without executing any deletions
22
- /git-cleanBranches --dry-run
23
-
24
- # Clean local branches merged to main and inactive for over 90 days (requires individual confirmation)
25
- /git-cleanBranches --stale 90
26
-
27
- # Clean local and remote branches merged to release/v2.1 (auto-confirm)
28
- /git-cleanBranches --base release/v2.1 --remote --yes
29
-
30
- # [Dangerous] Force delete an unmerged local branch
31
- /git-cleanBranches --force outdated-feature
32
- ```
33
-
34
- ### Options
35
-
36
- - `--base <branch>`: Specify the base branch for cleanup (defaults to repository's `main`/`master`).
37
- - `--stale <days>`: Clean branches with no commits for specified days (disabled by default).
38
- - `--remote`: Also clean remote merged/stale branches.
39
- - `--dry-run`: **Default behavior**. Only list branches to be deleted without executing any operations.
40
- - `--yes`: Skip individual confirmations and delete all identified branches directly (suitable for CI/CD).
41
- - `--force`: Use `-D` to force delete local branches (even if unmerged).
42
-
43
- ---
44
-
45
- ## What This Command Does
46
-
47
- 1. **Configuration and Safety Checks**
48
- - **Update Information**: Automatically executes `git fetch --all --prune` to ensure branch status is current.
49
- - **Read Protected Branches**: Reads the list of branches that should not be cleaned from Git config (see "Configuration" below).
50
- - **Determine Base**: Uses `--base` parameter or auto-detected `main`/`master` as comparison baseline.
51
-
52
- 2. **Analysis and Identification (Find)**
53
- - **Merged Branches**: Find local (and remote if `--remote` is added) branches fully merged to `--base`.
54
- - **Stale Branches**: If `--stale <days>` is specified, find branches with last commit N days ago.
55
- - **Exclude Protected Branches**: Remove all configured protected branches from cleanup list.
56
-
57
- 3. **Report and Preview (Report)**
58
- - Clearly list "merged branches to be deleted" and "stale branches to be deleted".
59
- - Without `--yes` parameter, **command ends here**, waiting for user confirmation to re-execute (without `--dry-run`).
60
-
61
- 4. **Execute Cleanup (Execute)**
62
- - **Only executed without `--dry-run` and after user confirmation** (or with `--yes`).
63
- - Delete identified branches one by one, unless user chooses to skip in interactive confirmation.
64
- - Local: `git branch -d <branch>`; Remote: `git push origin --delete <branch>`.
65
- - If `--force` is specified, local deletion uses `git branch -D <branch>`.
66
-
67
- ---
68
-
69
- ## Configuration (Configure Once, Use Forever)
70
-
71
- To prevent accidental deletion of important branches (e.g., `develop`, `release/*`), add protection rules to the repository's Git config. The command reads them automatically.
72
-
73
- ```bash
74
- # Protect develop branch
75
- git config --add branch.cleanup.protected develop
76
-
77
- # Protect all branches starting with release/ (wildcard)
78
- git config --add branch.cleanup.protected 'release/*'
79
-
80
- # View all configured protected branches
81
- git config --get-all branch.cleanup.protected
82
- ```
83
-
84
- ---
85
-
86
- ## Best Practices for Embedded Devs
87
-
88
- - **Prioritize `--dry-run`**: Develop the habit of previewing before executing.
89
- - **Leverage `--base`**: When maintaining long-term `release` branches, use it to clean `feature` or `hotfix` branches merged to that release.
90
- - **Careful with `--force`**: Don't force delete unless you're 100% certain an unmerged branch is useless.
91
- - **Team Collaboration**: Notify the team channel before cleaning shared remote branches.
92
- - **Regular Runs**: Run monthly or quarterly to keep the repository clean.
93
-
94
- ---
95
-
96
- ## Why This Version Is Better
97
-
98
- - ✅ **Safer**: Default read-only preview with configurable protected branch list.
99
- - ✅ **More Flexible**: Supports custom base branches, perfectly fits `release` / `develop` workflows.
100
- - ✅ **More Compatible**: Avoids commands with inconsistent behavior across systems like `date -d`.
101
- - ✅ **More Intuitive**: Condenses complex 16-step checklist into a single command with safety options.
102
- - ✅ **Consistent Style**: Shares similar parameter design and documentation structure with `/commit` command.