zcf 2.2.0 → 2.3.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.
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import ansis from 'ansis';
3
3
  import cac from 'cac';
4
- import { d as SUPPORTED_LANGS, I as I18N, L as LANG_LABELS, z as updateZcfConfig, Z as ZCF_CONFIG_FILE, B as readZcfConfig, D as resolveAiOutputLanguage, p as applyAiLanguageDirective, E as configureAiPersonality, u as updateDefaultModel, F as isWindows, r as readMcpConfig, x as fixWindowsMcpConfig, w as writeMcpConfig, G as selectMcpServices, s as backupMcpConfig, M as MCP_SERVICES, v as buildMcpServerConfig, t as mergeMcpServers, o as getExistingApiConfig, H as formatApiKeyDisplay, J as modifyApiConfigPartially, K as validateApiKey, l as configureApi, N as displayBanner, O as selectScriptLanguage, S as SETTINGS_FILE, P as updatePromptOnly, Q as version, R as handleExitPromptError, T as handleGeneralError, U as displayBannerWithInfo, i as init } from './shared/zcf.BES32wHt.mjs';
4
+ import { d as SUPPORTED_LANGS, I as I18N, L as LANG_LABELS, z as updateZcfConfig, Z as ZCF_CONFIG_FILE, B as readZcfConfig, D as resolveAiOutputLanguage, p as applyAiLanguageDirective, E as configureAiPersonality, u as updateDefaultModel, F as isWindows, r as readMcpConfig, x as fixWindowsMcpConfig, w as writeMcpConfig, G as selectMcpServices, s as backupMcpConfig, M as MCP_SERVICES, v as buildMcpServerConfig, t as mergeMcpServers, o as getExistingApiConfig, H as formatApiKeyDisplay, J as modifyApiConfigPartially, K as validateApiKey, l as configureApi, N as displayBanner, O as selectScriptLanguage, S as SETTINGS_FILE, P as updatePromptOnly, Q as version, R as handleExitPromptError, T as handleGeneralError, U as displayBannerWithInfo, i as init } from './shared/zcf.ChHPmCup.mjs';
5
5
  import inquirer from 'inquirer';
6
6
  import { existsSync, unlinkSync } from 'node:fs';
7
7
  import 'node:os';
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AI_OUTPUT_LANGUAGES, C as CLAUDE_DIR, a as CLAUDE_MD_FILE, b as ClAUDE_CONFIG_FILE, I as I18N, L as LANG_LABELS, M as MCP_SERVICES, S as SETTINGS_FILE, d as SUPPORTED_LANGS, Z as ZCF_CONFIG_FILE, y as addCompletedOnboarding, p as applyAiLanguageDirective, j as backupExistingConfig, s as backupMcpConfig, v as buildMcpServerConfig, c as commandExists, l as configureApi, k as copyConfigFiles, h as ensureClaudeDir, x as fixWindowsMcpConfig, o as getExistingApiConfig, q as getMcpConfigPath, g as getPlatform, i as init, f as installClaudeCode, e as isClaudeCodeInstalled, m as mergeConfigs, t as mergeMcpServers, n as mergeSettingsFile, r as readMcpConfig, u as updateDefaultModel, w as writeMcpConfig } from './shared/zcf.BES32wHt.mjs';
1
+ export { A as AI_OUTPUT_LANGUAGES, C as CLAUDE_DIR, a as CLAUDE_MD_FILE, b as ClAUDE_CONFIG_FILE, I as I18N, L as LANG_LABELS, M as MCP_SERVICES, S as SETTINGS_FILE, d as SUPPORTED_LANGS, Z as ZCF_CONFIG_FILE, y as addCompletedOnboarding, p as applyAiLanguageDirective, j as backupExistingConfig, s as backupMcpConfig, v as buildMcpServerConfig, c as commandExists, l as configureApi, k as copyConfigFiles, h as ensureClaudeDir, x as fixWindowsMcpConfig, o as getExistingApiConfig, q as getMcpConfigPath, g as getPlatform, i as init, f as installClaudeCode, e as isClaudeCodeInstalled, m as mergeConfigs, t as mergeMcpServers, n as mergeSettingsFile, r as readMcpConfig, u as updateDefaultModel, w as writeMcpConfig } from './shared/zcf.ChHPmCup.mjs';
2
2
  import 'inquirer';
3
3
  import 'ansis';
4
4
  import 'node:fs';
@@ -7,7 +7,7 @@ import dayjs from 'dayjs';
7
7
  import { fileURLToPath } from 'node:url';
8
8
  import { exec } from 'tinyexec';
9
9
 
10
- const version = "2.2.0";
10
+ const version = "2.3.0";
11
11
  const homepage = "https://github.com/UfoMiao/zcf";
12
12
 
13
13
  const CLAUDE_DIR = join(homedir(), ".claude");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zcf",
3
3
  "type": "module",
4
- "version": "2.2.0",
4
+ "version": "2.3.0",
5
5
  "description": "Zero-Config Claude-Code Flow - One-click configuration tool for Claude Code",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/UfoMiao/zcf",
@@ -1,23 +1,5 @@
1
1
  ---
2
2
  description: Add New Feature
3
-
4
- allowed-tools:
5
- - Task
6
- - Bash
7
- - Glob
8
- - Grep
9
- - Read
10
- - Edit
11
- - MultiEdit
12
- - Write
13
- - WebFetch
14
- - WebSearch
15
- - Notebook.*
16
- - Edit|Write
17
- - mcp__.*
18
- - mcp__memory__.*
19
- - mcp__filesystem__.*
20
- - mcp__github__.*
21
3
  ---
22
4
 
23
5
  $ARGUMENTS
@@ -1,22 +1,5 @@
1
1
  ---
2
2
  description: 'Professional AI programming assistant with structured workflow (Research -> Ideate -> Plan -> Execute -> Optimize -> Review) for developers'
3
- allowed-tools:
4
- - Task
5
- - Bash
6
- - Glob
7
- - Grep
8
- - Read
9
- - Edit
10
- - MultiEdit
11
- - Write
12
- - WebFetch
13
- - WebSearch
14
- - Notebook.*
15
- - Edit|Write
16
- - mcp__.*
17
- - mcp__memory__.*
18
- - mcp__filesystem__.*
19
- - mcp__github__.*
20
3
  ---
21
4
 
22
5
  # Workflow - Professional Development Assistant
@@ -1,74 +1,73 @@
1
1
  # Technical Execution Guidelines
2
2
 
3
- This document provides best practices that Claude Code should follow when executing specific technical tasks.
3
+ This document provides best practices for Claude Code when executing technical tasks.
4
+
5
+ ## Dangerous Operations Confirmation
6
+
7
+ **Important**: The following operations require explicit user confirmation before execution:
8
+
9
+ ### Operations Requiring Confirmation
10
+ - **File System**: Delete files/directories, bulk modifications, move system files
11
+ - **Code Commits**: `git commit`, `git push`, `git reset --hard`
12
+ - **System Config**: Modify environment variables, system settings, permissions
13
+ - **Data Operations**: Database deletions, schema changes, bulk updates
14
+ - **Network Requests**: Send sensitive data, call production APIs
15
+ - **Package Management**: Global install/uninstall, update core dependencies
16
+
17
+ ### Confirmation Process
18
+ Before executing dangerous operations:
19
+ 1. Clearly explain the operation and its impacts
20
+ 2. Wait for explicit user confirmation (e.g., "yes", "confirm", "proceed")
21
+ 3. If user hesitates or declines, provide more information or alternatives
4
22
 
5
23
  ## Command Execution Best Practices
6
24
 
7
25
  ### Path Handling Standards
8
26
 
9
- **Important**: Always use double quotes to wrap file paths when executing commands on all operating systems, especially on Windows.
27
+ **Important**: Always use double quotes to wrap file paths when executing commands.
10
28
 
11
- #### Correct Examples
12
29
  ```bash
13
- # ✅ Correct: Paths wrapped in double quotes
30
+ # ✅ Correct
14
31
  cd "C:\Users\name\My Documents"
15
- python "C:\Program Files\MyApp\script.py"
16
32
  node "/path/with spaces/app.js"
17
- ```
18
33
 
19
- #### Incorrect Examples
20
- ```bash
21
- # ❌ Incorrect: No quotes, backslashes will be swallowed on Windows
34
+ # Incorrect
22
35
  cd C:\Users\name\My Documents
23
- python C:\Program Files\MyApp\script.py
24
36
  ```
25
37
 
26
38
  ### Cross-Platform Compatibility
39
+ - Prefer forward slashes `/` as path separators
40
+ - When using backslashes, ensure paths are double-quoted
27
41
 
28
- - Prefer forward slashes `/` as path separators (supported by most tools)
29
- - When backslashes must be used, ensure paths are wrapped in double quotes
30
- - Be mindful of spaces and special characters even with relative paths
42
+ ## Search Tool Usage
31
43
 
32
- ## Search Tool Usage Guidelines
44
+ ### Content Search
45
+ **Always prioritize `rg` (ripgrep)** - faster and won't timeout.
33
46
 
34
- ### Content Search Priority
35
-
36
- **Always prioritize `rg` (ripgrep) for file content searches** over `grep`.
37
-
38
- > **Note**: ripgrep requires user installation. Most developers already have this tool installed. If `rg` command is not found, remind users to install:
39
- > - macOS: `brew install ripgrep`
40
- > - Windows: `scoop install ripgrep` or `choco install ripgrep`
41
- > - Linux: `sudo apt-get install ripgrep` or see [official installation guide](https://github.com/BurntSushi/ripgrep#installation)
42
-
43
- #### Reasons
44
- 1. **Superior Performance**: rg won't timeout in large codebases (e.g., Chromium, Emacs)
45
- 2. **Faster Execution**: rg is significantly faster than grep
46
- 3. **Smarter Defaults**: Automatically respects .gitignore files
47
-
48
- #### Usage Examples
49
47
  ```bash
50
- # ✅ Prefer rg
51
- rg "search pattern" .
52
- rg -i "case insensitive" src/
48
+ # ✅ Preferred
49
+ rg "pattern" .
53
50
  rg -t js "console.log" .
54
51
 
55
- # ⚠️ Only use grep when rg is unavailable
52
+ # ⚠️ Fallback
56
53
  grep -r "pattern" .
57
54
  ```
58
55
 
56
+ > Note: If `rg` unavailable, remind user to install: `brew/scoop/apt install ripgrep`
57
+
59
58
  ### File Finding
60
- - Use Glob tool for filename pattern matching
59
+ - Use Glob tool for pattern matching
61
60
  - Use LS tool for directory listings
62
- - Avoid using `find` command (specialized tools are more efficient)
61
+ - Avoid using `find` command
63
62
 
64
63
  ## Tool Usage Principles
65
64
 
66
- 1. **Prefer Specialized Tools**: Use Read, Write, Edit tools instead of cat, echo commands
65
+ 1. **Prefer Specialized Tools**: Use Read, Write, Edit instead of cat, echo
67
66
  2. **Batch Operations**: Call multiple tools simultaneously for efficiency
68
- 3. **Error Handling**: Check for path quoting issues first when commands fail
67
+ 3. **Error Handling**: Check path quoting first when commands fail
69
68
 
70
- ## Performance Optimization Tips
69
+ ## Performance Optimization
71
70
 
72
71
  - Use Task tool for complex searches in large projects
73
- - Understand project structure before searching to narrow scope
74
- - Use search parameters wisely (e.g., file type filters) for efficiency
72
+ - Understand project structure before searching
73
+ - Use file type filters wisely for efficiency
@@ -8,19 +8,23 @@
8
8
  "includeCoAuthoredBy": false,
9
9
  "permissions": {
10
10
  "allow": [
11
- "Bash(*)",
12
- "LS(*)",
13
- "Read(*)",
14
- "Write(*)",
15
- "Edit(*)",
16
- "MultiEdit(*)",
17
- "Glob(*)",
18
- "Grep(*)",
19
- "WebFetch(*)",
20
- "WebSearch(*)",
21
- "TodoWrite(*)",
22
- "NotebookRead(*)",
23
- "NotebookEdit(*)"
11
+ "Bash",
12
+ "LS",
13
+ "Read",
14
+ "Write",
15
+ "Edit",
16
+ "MultiEdit",
17
+ "Glob",
18
+ "Grep",
19
+ "WebFetch",
20
+ "WebSearch",
21
+ "TodoWrite",
22
+ "NotebookRead",
23
+ "NotebookEdit",
24
+ "mcp__exa",
25
+ "mcp__context7",
26
+ "mcp__mcp-deepwiki",
27
+ "mcp__Playwright"
24
28
  ],
25
29
  "deny": []
26
30
  },
@@ -1,23 +1,5 @@
1
1
  ---
2
2
  description: '用于新增功能开发的命令,支持完整的开发流程和工具集成'
3
-
4
- allowed-tools:
5
- - Task
6
- - Bash
7
- - Glob
8
- - Grep
9
- - Read
10
- - Edit
11
- - MultiEdit
12
- - Write
13
- - WebFetch
14
- - WebSearch
15
- - Notebook.*
16
- - Edit|Write
17
- - mcp__.*
18
- - mcp__memory__.*
19
- - mcp__filesystem__.*
20
- - mcp__github__.*
21
3
  ---
22
4
 
23
5
  $ARGUMENTS
@@ -1,22 +1,5 @@
1
1
  ---
2
2
  description: '专业AI编程助手,提供结构化六阶段开发工作流(研究→构思→计划→执行→优化→评审),适用于专业开发者'
3
- allowed-tools:
4
- - Task
5
- - Bash
6
- - Glob
7
- - Grep
8
- - Read
9
- - Edit
10
- - MultiEdit
11
- - Write
12
- - WebFetch
13
- - WebSearch
14
- - Notebook.*
15
- - Edit|Write
16
- - mcp__.*
17
- - mcp__memory__.*
18
- - mcp__filesystem__.*
19
- - mcp__github__.*
20
3
  ---
21
4
 
22
5
  # Workflow - 专业开发助手
@@ -1,74 +1,73 @@
1
1
  # 技术执行指南
2
2
 
3
- 本文档提供 Claude Code 在执行具体技术任务时应遵循的最佳实践。
3
+ 本文档提供 Claude Code 执行技术任务时的最佳实践。
4
+
5
+ ## 危险操作确认机制
6
+
7
+ **重要**:以下操作需要明确的用户确认后才能执行:
8
+
9
+ ### 需确认的操作类型
10
+ - **文件系统**:删除文件/目录、批量修改、移动系统文件
11
+ - **代码提交**:`git commit`、`git push`、`git reset --hard`
12
+ - **系统配置**:修改环境变量、系统设置、权限变更
13
+ - **数据操作**:数据库删除、结构变更、批量更新
14
+ - **网络请求**:发送敏感数据、调用生产环境API
15
+ - **包管理**:全局安装/卸载、更新核心依赖
16
+
17
+ ### 确认方式
18
+ 执行危险操作前,必须:
19
+ 1. 明确说明即将执行的操作及其影响
20
+ 2. 等待用户明确确认(如"是"、"确认"、"继续")
21
+ 3. 用户未确认或表示犹豫时,提供更多信息或替代方案
4
22
 
5
23
  ## 命令执行最佳实践
6
24
 
7
25
  ### 路径处理规范
8
26
 
9
- **重要**:在所有操作系统上执行命令时,**始终使用双引号包裹文件路径**,特别是在 Windows 系统上。
27
+ **重要**:执行命令时**始终使用双引号包裹文件路径**。
10
28
 
11
- #### 正确示例
12
29
  ```bash
13
- # ✅ 正确:路径使用双引号
30
+ # ✅ 正确
14
31
  cd "C:\Users\name\My Documents"
15
- python "C:\Program Files\MyApp\script.py"
16
32
  node "/path/with spaces/app.js"
17
- ```
18
33
 
19
- #### 错误示例
20
- ```bash
21
- # ❌ 错误:未使用引号,Windows 下反斜杠会被吞掉
34
+ # ❌ 错误
22
35
  cd C:\Users\name\My Documents
23
- python C:\Program Files\MyApp\script.py
24
36
  ```
25
37
 
26
38
  ### 跨平台兼容性
39
+ - 优先使用正斜杠 `/` 作为路径分隔符
40
+ - 使用反斜杠时确保路径被双引号包裹
27
41
 
28
- - 优先使用正斜杠 `/` 作为路径分隔符(大多数工具都支持)
29
- - 当必须使用反斜杠时,确保路径被双引号包裹
30
- - 使用相对路径时也要注意空格和特殊字符
42
+ ## 搜索工具使用
31
43
 
32
- ## 搜索工具使用指南
44
+ ### 内容搜索
45
+ **始终优先使用 `rg` (ripgrep)**,速度更快且不会超时。
33
46
 
34
- ### 内容搜索优先级
35
-
36
- **始终优先使用 `rg` (ripgrep) 进行文件内容搜索**,而不是 `grep`。
37
-
38
- > **注意**:ripgrep 需要用户自行安装。大多数开发者已经安装了此工具,如果遇到 `rg` 命令不存在,请提醒用户安装:
39
- > - macOS: `brew install ripgrep`
40
- > - Windows: `scoop install ripgrep` 或 `choco install ripgrep`
41
- > - Linux: `sudo apt-get install ripgrep` 或查看 [官方安装指南](https://github.com/BurntSushi/ripgrep#installation)
42
-
43
- #### 原因
44
- 1. **性能优越**:在大型代码库(如 Chromium、Emacs)中,rg 不会超时
45
- 2. **速度更快**:rg 的执行速度显著快于 grep
46
- 3. **默认配置更智能**:自动忽略 .gitignore 中的文件
47
-
48
- #### 使用示例
49
47
  ```bash
50
- # ✅ 优先使用 rg
51
- rg "search pattern" .
52
- rg -i "case insensitive" src/
48
+ # ✅ 优先使用
49
+ rg "pattern" .
53
50
  rg -t js "console.log" .
54
51
 
55
- # ⚠️ 仅在 rg 不可用时才使用 grep
52
+ # ⚠️ 备选方案
56
53
  grep -r "pattern" .
57
54
  ```
58
55
 
56
+ > 提示:如 `rg` 不可用,提醒用户安装:`brew/scoop/apt install ripgrep`
57
+
59
58
  ### 文件查找
60
- - 使用 Glob 工具查找文件名模式
61
- - 使用 LS 工具列出目录内容
62
- - 避免使用 `find` 命令(使用专门的工具更高效)
59
+ - 使用 Glob 工具进行模式匹配
60
+ - 使用 LS 工具列出目录
61
+ - 避免使用 `find` 命令
63
62
 
64
63
  ## 工具使用原则
65
64
 
66
- 1. **优先使用专门的工具**:使用 Read、Write、Edit 等专门工具,而不是 cat、echo 等命令
67
- 2. **批量操作**:可以同时调用多个工具以提高效率
68
- 3. **错误处理**:命令失败后,先检查路径引号问题再重试
65
+ 1. **优先专用工具**:使用 Read、Write、Edit 而非 cat、echo
66
+ 2. **批量操作**:同时调用多个工具以提高效率
67
+ 3. **错误处理**:命令失败时先检查路径引号问题
69
68
 
70
- ## 性能优化建议
69
+ ## 性能优化
71
70
 
72
- - 对于大型项目,使用 Task 工具进行复杂搜索
73
- - 搜索前先了解项目结构,缩小搜索范围
74
- - 合理使用搜索参数(如文件类型过滤)以提高效率
71
+ - 大型项目使用 Task 工具进行复杂搜索
72
+ - 搜索前了解项目结构,缩小范围
73
+ - 合理使用文件类型过滤提高效率