zcf 2.1.2 → 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 +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/{zcf.BAnSslet.mjs → zcf.ChHPmCup.mjs} +1 -1
- package/package.json +1 -1
- package/templates/CLAUDE.md +1 -0
- package/templates/en/commands/feat.md +0 -18
- package/templates/en/commands/workflow.md +0 -17
- package/templates/en/technical-guides.md +73 -0
- package/templates/settings.json +17 -13
- package/templates/zh-CN/commands/feat.md +0 -18
- package/templates/zh-CN/commands/workflow.md +0 -17
- package/templates/zh-CN/technical-guides.md +73 -0
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.
|
|
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.
|
|
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.
|
|
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
package/templates/CLAUDE.md
CHANGED
|
@@ -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
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Technical Execution Guidelines
|
|
2
|
+
|
|
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
|
|
22
|
+
|
|
23
|
+
## Command Execution Best Practices
|
|
24
|
+
|
|
25
|
+
### Path Handling Standards
|
|
26
|
+
|
|
27
|
+
**Important**: Always use double quotes to wrap file paths when executing commands.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# ✅ Correct
|
|
31
|
+
cd "C:\Users\name\My Documents"
|
|
32
|
+
node "/path/with spaces/app.js"
|
|
33
|
+
|
|
34
|
+
# ❌ Incorrect
|
|
35
|
+
cd C:\Users\name\My Documents
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Cross-Platform Compatibility
|
|
39
|
+
- Prefer forward slashes `/` as path separators
|
|
40
|
+
- When using backslashes, ensure paths are double-quoted
|
|
41
|
+
|
|
42
|
+
## Search Tool Usage
|
|
43
|
+
|
|
44
|
+
### Content Search
|
|
45
|
+
**Always prioritize `rg` (ripgrep)** - faster and won't timeout.
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# ✅ Preferred
|
|
49
|
+
rg "pattern" .
|
|
50
|
+
rg -t js "console.log" .
|
|
51
|
+
|
|
52
|
+
# ⚠️ Fallback
|
|
53
|
+
grep -r "pattern" .
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
> Note: If `rg` unavailable, remind user to install: `brew/scoop/apt install ripgrep`
|
|
57
|
+
|
|
58
|
+
### File Finding
|
|
59
|
+
- Use Glob tool for pattern matching
|
|
60
|
+
- Use LS tool for directory listings
|
|
61
|
+
- Avoid using `find` command
|
|
62
|
+
|
|
63
|
+
## Tool Usage Principles
|
|
64
|
+
|
|
65
|
+
1. **Prefer Specialized Tools**: Use Read, Write, Edit instead of cat, echo
|
|
66
|
+
2. **Batch Operations**: Call multiple tools simultaneously for efficiency
|
|
67
|
+
3. **Error Handling**: Check path quoting first when commands fail
|
|
68
|
+
|
|
69
|
+
## Performance Optimization
|
|
70
|
+
|
|
71
|
+
- Use Task tool for complex searches in large projects
|
|
72
|
+
- Understand project structure before searching
|
|
73
|
+
- Use file type filters wisely for efficiency
|
package/templates/settings.json
CHANGED
|
@@ -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 - 专业开发助手
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# 技术执行指南
|
|
2
|
+
|
|
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. 用户未确认或表示犹豫时,提供更多信息或替代方案
|
|
22
|
+
|
|
23
|
+
## 命令执行最佳实践
|
|
24
|
+
|
|
25
|
+
### 路径处理规范
|
|
26
|
+
|
|
27
|
+
**重要**:执行命令时**始终使用双引号包裹文件路径**。
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# ✅ 正确
|
|
31
|
+
cd "C:\Users\name\My Documents"
|
|
32
|
+
node "/path/with spaces/app.js"
|
|
33
|
+
|
|
34
|
+
# ❌ 错误
|
|
35
|
+
cd C:\Users\name\My Documents
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 跨平台兼容性
|
|
39
|
+
- 优先使用正斜杠 `/` 作为路径分隔符
|
|
40
|
+
- 使用反斜杠时确保路径被双引号包裹
|
|
41
|
+
|
|
42
|
+
## 搜索工具使用
|
|
43
|
+
|
|
44
|
+
### 内容搜索
|
|
45
|
+
**始终优先使用 `rg` (ripgrep)**,速度更快且不会超时。
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# ✅ 优先使用
|
|
49
|
+
rg "pattern" .
|
|
50
|
+
rg -t js "console.log" .
|
|
51
|
+
|
|
52
|
+
# ⚠️ 备选方案
|
|
53
|
+
grep -r "pattern" .
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
> 提示:如 `rg` 不可用,提醒用户安装:`brew/scoop/apt install ripgrep`
|
|
57
|
+
|
|
58
|
+
### 文件查找
|
|
59
|
+
- 使用 Glob 工具进行模式匹配
|
|
60
|
+
- 使用 LS 工具列出目录
|
|
61
|
+
- 避免使用 `find` 命令
|
|
62
|
+
|
|
63
|
+
## 工具使用原则
|
|
64
|
+
|
|
65
|
+
1. **优先专用工具**:使用 Read、Write、Edit 而非 cat、echo
|
|
66
|
+
2. **批量操作**:同时调用多个工具以提高效率
|
|
67
|
+
3. **错误处理**:命令失败时先检查路径引号问题
|
|
68
|
+
|
|
69
|
+
## 性能优化
|
|
70
|
+
|
|
71
|
+
- 大型项目使用 Task 工具进行复杂搜索
|
|
72
|
+
- 搜索前了解项目结构,缩小范围
|
|
73
|
+
- 合理使用文件类型过滤提高效率
|