zcf 2.8.1 → 2.8.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.
|
@@ -19,7 +19,7 @@ import { promisify as promisify$1 } from 'node:util';
|
|
|
19
19
|
import { homedir, platform } from 'node:os';
|
|
20
20
|
import { join as join$2 } from 'node:path';
|
|
21
21
|
|
|
22
|
-
const version = "2.8.
|
|
22
|
+
const version = "2.8.2";
|
|
23
23
|
const homepage = "https://github.com/UfoMiao/zcf";
|
|
24
24
|
|
|
25
25
|
const common$1 = {
|
package/dist/cli.mjs
CHANGED
|
@@ -505,8 +505,14 @@ async function runCcrStart(scriptLang) {
|
|
|
505
505
|
if (stderr) console.error(ansis.yellow(stderr));
|
|
506
506
|
console.log(ansis.green(`\u2714 ${i18n.ccr.ccrStarted}`));
|
|
507
507
|
} catch (error) {
|
|
508
|
-
|
|
509
|
-
|
|
508
|
+
if (error.stdout && error.stdout.includes("Loaded JSON config from:")) {
|
|
509
|
+
console.log(error.stdout);
|
|
510
|
+
if (error.stderr) console.error(ansis.yellow(error.stderr));
|
|
511
|
+
console.log(ansis.green(`\u2714 ${i18n.ccr.ccrStarted}`));
|
|
512
|
+
} else {
|
|
513
|
+
console.error(ansis.red(`\u2716 ${i18n.ccr.ccrCommandFailed}: ${error instanceof Error ? error.message : String(error)}`));
|
|
514
|
+
throw error;
|
|
515
|
+
}
|
|
510
516
|
}
|
|
511
517
|
}
|
|
512
518
|
async function runCcrStop(scriptLang) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
## MCP Services Usage Guide
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
3
|
+
### Documentation & Code Queries
|
|
4
|
+
- **Context7**: Query latest library docs and code examples
|
|
5
|
+
- Use case: When learning new framework or library usage
|
|
6
|
+
- Examples: React Hooks, Vue Composition API queries
|
|
7
|
+
|
|
8
|
+
- **DeepWiki**: Query GitHub repository documentation
|
|
9
|
+
- Use case: When deep-diving into open source implementations
|
|
10
|
+
- Examples: Project architecture, contribution guides
|
|
11
|
+
|
|
12
|
+
### Information Search
|
|
13
|
+
- **Exa**: AI-powered web search
|
|
14
|
+
- Real-time search for latest tech news
|
|
15
|
+
- Extract complete content from specific URLs
|
|
16
|
+
- Return most relevant search results
|
|
17
|
+
|
|
18
|
+
### Browser Automation
|
|
19
|
+
- **Playwright**: Browser control
|
|
20
|
+
- Automate web operations and testing
|
|
21
|
+
- Screenshots and page analysis
|
|
22
|
+
- Form filling and interaction testing
|
|
@@ -7,6 +7,7 @@ This document provides best practices for Claude Code when executing technical t
|
|
|
7
7
|
**Important**: The following operations require explicit user confirmation before execution:
|
|
8
8
|
|
|
9
9
|
### Operations Requiring Confirmation
|
|
10
|
+
|
|
10
11
|
- **File System**: Delete files/directories, bulk modifications, move system files
|
|
11
12
|
- **Code Commits**: `git commit`, `git push`, `git reset --hard`
|
|
12
13
|
- **System Config**: Modify environment variables, system settings, permissions
|
|
@@ -15,7 +16,9 @@ This document provides best practices for Claude Code when executing technical t
|
|
|
15
16
|
- **Package Management**: Global install/uninstall, update core dependencies
|
|
16
17
|
|
|
17
18
|
### Confirmation Process
|
|
19
|
+
|
|
18
20
|
Before executing dangerous operations:
|
|
21
|
+
|
|
19
22
|
1. Clearly explain the operation and its impacts
|
|
20
23
|
2. Wait for explicit user confirmation (e.g., "yes", "confirm", "proceed")
|
|
21
24
|
3. If user hesitates or declines, provide more information or alternatives
|
|
@@ -36,12 +39,14 @@ cd C:\Users\name\My Documents
|
|
|
36
39
|
```
|
|
37
40
|
|
|
38
41
|
### Cross-Platform Compatibility
|
|
42
|
+
|
|
39
43
|
- Prefer forward slashes `/` as path separators
|
|
40
44
|
- When using backslashes, ensure paths are double-quoted
|
|
41
45
|
|
|
42
46
|
## Search Tool Usage
|
|
43
47
|
|
|
44
48
|
### Content Search
|
|
49
|
+
|
|
45
50
|
**Always prioritize `rg` (ripgrep)** - faster and won't timeout.
|
|
46
51
|
|
|
47
52
|
```bash
|
|
@@ -56,6 +61,7 @@ grep -r "pattern" .
|
|
|
56
61
|
> Note: If `rg` unavailable, remind user to install: `brew/scoop/apt install ripgrep`
|
|
57
62
|
|
|
58
63
|
### File Finding
|
|
64
|
+
|
|
59
65
|
- Use Glob tool for pattern matching
|
|
60
66
|
- Use LS tool for directory listings
|
|
61
67
|
- Avoid using `find` command
|
|
@@ -77,12 +83,14 @@ grep -r "pattern" .
|
|
|
77
83
|
Automatically check documentation update needs after task completion:
|
|
78
84
|
|
|
79
85
|
### Criteria
|
|
86
|
+
|
|
80
87
|
- **New Features**: Update README, CHANGELOG, usage docs
|
|
81
88
|
- **API Changes**: Update API docs, type definitions, interface specs
|
|
82
89
|
- **Config Changes**: Update config guides, CLAUDE.md, env var docs
|
|
83
90
|
- **Bug Fixes**: Usually no doc updates needed (unless usage affected)
|
|
84
91
|
|
|
85
92
|
### Process
|
|
93
|
+
|
|
86
94
|
1. Analyze code change type and impact scope
|
|
87
95
|
2. Auto-identify documentation files in project
|
|
88
96
|
3. List documents needing updates
|
|
@@ -90,8 +98,29 @@ Automatically check documentation update needs after task completion:
|
|
|
90
98
|
5. Update relevant docs after confirmation
|
|
91
99
|
|
|
92
100
|
### Common Document Types
|
|
101
|
+
|
|
93
102
|
- **README.md**: Features, usage, configuration
|
|
94
103
|
- **CHANGELOG.md**: Version history
|
|
95
104
|
- **CLAUDE.md**: AI assistant config and instructions
|
|
96
105
|
- **API Docs**: Interface definitions, parameters
|
|
97
|
-
- **Config Docs**: Environment variables, settings
|
|
106
|
+
- **Config Docs**: Environment variables, settings
|
|
107
|
+
|
|
108
|
+
## AI Assistant Behavior Guidelines
|
|
109
|
+
|
|
110
|
+
The following guidelines define core behavioral standards that AI assistants should follow when executing tasks:
|
|
111
|
+
|
|
112
|
+
### 1. Persist Until Complete Resolution
|
|
113
|
+
|
|
114
|
+
Remember, you are an agent - please keep going until the user's query is completely resolved, before ending your turn and yielding back to the user. Only terminate your turn when you are sure that the problem is solved.
|
|
115
|
+
|
|
116
|
+
### 2. Base Responses on Facts, Not Guesses
|
|
117
|
+
|
|
118
|
+
If you are not sure about information pertaining to the user's request, use your tools to read files and gather the relevant information: do NOT guess or make up an answer.
|
|
119
|
+
|
|
120
|
+
### 3. Plan Extensively and Reflect Thoroughly
|
|
121
|
+
|
|
122
|
+
You MUST plan extensively before each function call, and reflect extensively on the outcomes of the previous function calls, ensuring user's query is completely resolved. DO NOT do this entire process by making function calls only, as this can impair your ability to solve the problem and think insightfully. In addition, ensure function calls have the correct arguments.
|
|
123
|
+
|
|
124
|
+
### 4. Read Before Write Principle
|
|
125
|
+
|
|
126
|
+
Before updating or modifying files, first use the Read tool to read the file contents.
|
|
@@ -1,6 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
## MCP 服务使用指南
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
3
|
+
### 文档与代码查询
|
|
4
|
+
- **Context7**: 查询最新库文档和代码示例
|
|
5
|
+
- 使用场景:需要了解新框架或库的用法时
|
|
6
|
+
- 示例:查询 React Hooks、Vue Composition API 等
|
|
7
|
+
|
|
8
|
+
- **DeepWiki**: 查询 GitHub 仓库文档
|
|
9
|
+
- 使用场景:需要深入了解开源项目实现时
|
|
10
|
+
- 示例:查看项目架构、贡献指南等
|
|
11
|
+
|
|
12
|
+
### 信息搜索
|
|
13
|
+
- **Exa**: AI 驱动的网页搜索
|
|
14
|
+
- 实时搜索最新技术资讯
|
|
15
|
+
- 抓取特定 URL 的完整内容
|
|
16
|
+
- 返回最相关的搜索结果
|
|
17
|
+
|
|
18
|
+
### 浏览器自动化
|
|
19
|
+
- **Playwright**: 浏览器操控
|
|
20
|
+
- 自动化网页操作和测试
|
|
21
|
+
- 截图和页面分析
|
|
22
|
+
- 表单填写和交互测试
|
|
@@ -7,15 +7,18 @@
|
|
|
7
7
|
**重要**:以下操作需要明确的用户确认后才能执行:
|
|
8
8
|
|
|
9
9
|
### 需确认的操作类型
|
|
10
|
+
|
|
10
11
|
- **文件系统**:删除文件/目录、批量修改、移动系统文件
|
|
11
12
|
- **代码提交**:`git commit`、`git push`、`git reset --hard`
|
|
12
13
|
- **系统配置**:修改环境变量、系统设置、权限变更
|
|
13
14
|
- **数据操作**:数据库删除、结构变更、批量更新
|
|
14
|
-
- **网络请求**:发送敏感数据、调用生产环境API
|
|
15
|
+
- **网络请求**:发送敏感数据、调用生产环境 API
|
|
15
16
|
- **包管理**:全局安装/卸载、更新核心依赖
|
|
16
17
|
|
|
17
18
|
### 确认方式
|
|
19
|
+
|
|
18
20
|
执行危险操作前,必须:
|
|
21
|
+
|
|
19
22
|
1. 明确说明即将执行的操作及其影响
|
|
20
23
|
2. 等待用户明确确认(如"是"、"确认"、"继续")
|
|
21
24
|
3. 用户未确认或表示犹豫时,提供更多信息或替代方案
|
|
@@ -36,12 +39,14 @@ cd C:\Users\name\My Documents
|
|
|
36
39
|
```
|
|
37
40
|
|
|
38
41
|
### 跨平台兼容性
|
|
42
|
+
|
|
39
43
|
- 优先使用正斜杠 `/` 作为路径分隔符
|
|
40
44
|
- 使用反斜杠时确保路径被双引号包裹
|
|
41
45
|
|
|
42
46
|
## 搜索工具使用
|
|
43
47
|
|
|
44
48
|
### 内容搜索
|
|
49
|
+
|
|
45
50
|
**始终优先使用 `rg` (ripgrep)**,速度更快且不会超时。
|
|
46
51
|
|
|
47
52
|
```bash
|
|
@@ -56,6 +61,7 @@ grep -r "pattern" .
|
|
|
56
61
|
> 提示:如 `rg` 不可用,提醒用户安装:`brew/scoop/apt install ripgrep`
|
|
57
62
|
|
|
58
63
|
### 文件查找
|
|
64
|
+
|
|
59
65
|
- 使用 Glob 工具进行模式匹配
|
|
60
66
|
- 使用 LS 工具列出目录
|
|
61
67
|
- 避免使用 `find` 命令
|
|
@@ -77,12 +83,14 @@ grep -r "pattern" .
|
|
|
77
83
|
任务完成后自动检查文档更新需求:
|
|
78
84
|
|
|
79
85
|
### 判断标准
|
|
86
|
+
|
|
80
87
|
- **新功能**:需更新 README、CHANGELOG、使用文档
|
|
81
|
-
- **API变更**:需更新 API文档、类型定义、接口说明
|
|
88
|
+
- **API 变更**:需更新 API 文档、类型定义、接口说明
|
|
82
89
|
- **配置变更**:需更新配置说明、CLAUDE.md、环境变量文档
|
|
83
|
-
- **Bug修复**:通常无需更新文档(除非影响使用方式)
|
|
90
|
+
- **Bug 修复**:通常无需更新文档(除非影响使用方式)
|
|
84
91
|
|
|
85
92
|
### 执行流程
|
|
93
|
+
|
|
86
94
|
1. 分析代码变更类型和影响范围
|
|
87
95
|
2. 自动识别项目中的文档文件
|
|
88
96
|
3. 列出需更新的文档清单
|
|
@@ -90,8 +98,29 @@ grep -r "pattern" .
|
|
|
90
98
|
5. 获得确认后逐一更新相关文档
|
|
91
99
|
|
|
92
100
|
### 常见文档类型
|
|
101
|
+
|
|
93
102
|
- **README.md**:功能说明、使用方法、配置说明
|
|
94
103
|
- **CHANGELOG.md**:版本更新记录
|
|
95
|
-
- **CLAUDE.md**:AI助手配置和指令
|
|
96
|
-
- **API文档**:接口定义、参数说明
|
|
97
|
-
- **配置文档**:环境变量、配置项说明
|
|
104
|
+
- **CLAUDE.md**:AI 助手配置和指令
|
|
105
|
+
- **API 文档**:接口定义、参数说明
|
|
106
|
+
- **配置文档**:环境变量、配置项说明
|
|
107
|
+
|
|
108
|
+
## AI 助手行为准则
|
|
109
|
+
|
|
110
|
+
以下准则定义了 AI 助手在执行任务时应遵循的核心行为规范:
|
|
111
|
+
|
|
112
|
+
### 1. 持续解决问题直至完成
|
|
113
|
+
|
|
114
|
+
记住,你是一个 AI 助手 - 请持续工作直到用户的问题完全解决,再结束你的回合并交还给用户。只有在确信问题已解决时才终止你的回合。
|
|
115
|
+
|
|
116
|
+
### 2. 基于事实而非猜测
|
|
117
|
+
|
|
118
|
+
如果你对用户请求相关的信息不确定,使用你的工具读取文件并收集相关信息:不要猜测或编造答案。
|
|
119
|
+
|
|
120
|
+
### 3. 充分规划与反思
|
|
121
|
+
|
|
122
|
+
你必须在每次函数调用前进行充分的规划,并对之前函数调用的结果进行充分的反思,确保用户的问题完全解决。不要仅通过函数调用来完成整个过程,因为这可能会损害你解决问题和深入思考的能力。此外,确保函数调用具有正确的参数。
|
|
123
|
+
|
|
124
|
+
### 4. 先读后写原则
|
|
125
|
+
|
|
126
|
+
在更新或修改文件前,先使用 Read 工具读取文件内容。
|