@ia-ccun/code-agent-cli 0.0.39 → 0.0.41
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AICode Coding Agent CLI
|
|
2
2
|
|
|
3
|
-
You are a professional AICode coding agent, specialized in helping developers with high-quality code development, refactoring, and optimization. You have deep programming knowledge and best practices understanding.
|
|
3
|
+
You are a professional AICode coding agent,built by JIANJIANG, specialized in helping developers with high-quality code development, refactoring, and optimization. You have deep programming knowledge and best practices understanding.
|
|
4
4
|
|
|
5
5
|
## Core Capabilities
|
|
6
6
|
- Code Analysis and Review
|
|
@@ -11,7 +11,7 @@ triggers:
|
|
|
11
11
|
- "提交信息"
|
|
12
12
|
- "提交到 git"
|
|
13
13
|
---
|
|
14
|
-
|
|
14
|
+
```
|
|
15
15
|
# examples:
|
|
16
16
|
# - /git-commit # 分析当前改动,生成提交信息
|
|
17
17
|
# - /git-commit --all # 暂存所有改动并提交
|
|
@@ -19,7 +19,7 @@ triggers:
|
|
|
19
19
|
# - /git-commit --emoji # 在提交信息中包含 emoji
|
|
20
20
|
# - /git-commit --scope ui --type feat # 指定作用域和类型
|
|
21
21
|
# - /git-commit --amend --signoff # 修补上次提交并签名
|
|
22
|
-
|
|
22
|
+
```
|
|
23
23
|
# Claude Command: Commit (Git-only)
|
|
24
24
|
|
|
25
25
|
该命令在**不依赖任何包管理器/构建工具**的前提下,仅通过 **Git**:
|
|
@@ -77,6 +77,10 @@ triggers:
|
|
|
77
77
|
- 生成消息头:`[<emoji>] <type>(<scope>)?: <subject>`(首行 ≤ 72 字符,祈使语气,仅在使用 `--emoji` 时包含 emoji)。
|
|
78
78
|
- 生成消息体:要点列表(动机、实现要点、影响范围、BREAKING CHANGE 如有)。
|
|
79
79
|
- 根据 Git 历史提交的主要语言选择提交信息语言。优先检查最近提交主题(例如 `git log -n 50 --pretty=%s`)判断中文/英文;若无法判断,则回退到仓库主要语言或英文。
|
|
80
|
+
- **必须添加 AI 署名块**,用于标识 AI 参与贡献:
|
|
81
|
+
```
|
|
82
|
+
Co-Authored-By: AICode CLI <noreply@aicode-cli>
|
|
83
|
+
```
|
|
80
84
|
- 将草稿写入 `.git/COMMIT_EDITMSG`,并用于 `git commit`。
|
|
81
85
|
|
|
82
86
|
5. **执行提交**
|
|
@@ -11,14 +11,14 @@ triggers:
|
|
|
11
11
|
- "isolate branch"
|
|
12
12
|
- "独立分支"
|
|
13
13
|
---
|
|
14
|
-
|
|
14
|
+
```
|
|
15
15
|
# examples:
|
|
16
16
|
# - /git-worktree add feature-ui # 从 main/master 创建新分支 'feature-ui'
|
|
17
17
|
# - /git-worktree add feature-ui -o # 创建 worktree 并直接用 IDE 打开
|
|
18
18
|
# - /git-worktree add hotfix -b fix/login -o # 创建新分支 'fix/login',路径为 'hotfix'
|
|
19
19
|
# - /git-worktree migrate feature-ui --from main # 将主分支未提交内容迁移到 feature-ui
|
|
20
20
|
# - /git-worktree migrate feature-ui --stash # 将当前 stash 迁移到 feature-ui
|
|
21
|
-
|
|
21
|
+
```
|
|
22
22
|
# Claude Command: Git Worktree
|
|
23
23
|
|
|
24
24
|
管理 Git worktree,支持智能默认、IDE 集成和内容迁移,使用结构化的 `../.zcf/项目名/` 路径。
|
|
@@ -9,7 +9,7 @@ metadata:
|
|
|
9
9
|
# Git Commit Skill
|
|
10
10
|
|
|
11
11
|
## 描述
|
|
12
|
-
分析代码变更并生成规范的 Git commit
|
|
12
|
+
分析代码变更并生成规范的 Git commit 消息,按修改分类,修改内容较多时建议拆分commit
|
|
13
13
|
|
|
14
14
|
## 触发方式
|
|
15
15
|
`/skill:commit`
|
|
@@ -30,21 +30,24 @@ metadata:
|
|
|
30
30
|
- 格式: `<type>(<scope>): <description>`
|
|
31
31
|
- 添加详细 body 说明(如果需要)
|
|
32
32
|
- 添加 footer 用于 breaking changes 或 issue 引用
|
|
33
|
+
- **必须添加 AI 署名块**(见下方格式)
|
|
33
34
|
|
|
34
35
|
4. **执行 Commit**
|
|
35
36
|
- 先显示 commit 消息供用户确认
|
|
36
|
-
- 用户确认后执行 `git commit -m "..."`
|
|
37
|
+
- 用户确认后执行 `git commit -m "..."` 或 `git commit -e -F .git/COMMIT_EDITMSG`
|
|
37
38
|
|
|
38
39
|
## 输出格式
|
|
39
40
|
|
|
40
41
|
```
|
|
41
|
-
feat: 添加用户登录功能
|
|
42
|
+
feat: 添加用户登录功能 - By AICode
|
|
42
43
|
|
|
43
44
|
- 实现用户名密码登录
|
|
44
45
|
- 添加 token 验证
|
|
45
46
|
- 集成 OAuth 第三方登录
|
|
46
47
|
|
|
47
48
|
Closes #123
|
|
49
|
+
|
|
50
|
+
Co-Authored-By: AICode CLI <noreply@aicode-cli>
|
|
48
51
|
```
|
|
49
52
|
|
|
50
53
|
## 注意事项
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -169,16 +169,60 @@ const packageConfigDir = join(__dirname, '..', 'config', 'agent');
|
|
|
169
169
|
const FORCE_OVERWRITE_LIST = [
|
|
170
170
|
'extensions/working-msg.ts',
|
|
171
171
|
'extensions/custom-footer.ts',
|
|
172
|
-
//
|
|
173
|
-
|
|
174
|
-
// 'skills/some-skill',
|
|
175
|
-
// 'prompts/some-prompt.md',
|
|
176
|
-
// 'themes/dark.json',
|
|
172
|
+
// Force overwrite all skills SKILL.md files
|
|
173
|
+
'skills/*/SKILL.md',
|
|
177
174
|
];
|
|
178
175
|
|
|
176
|
+
// Function to expand glob patterns like "skills/*/SKILL.md"
|
|
177
|
+
function expandGlob(pattern) {
|
|
178
|
+
const results = [];
|
|
179
|
+
|
|
180
|
+
if (pattern.includes('*')) {
|
|
181
|
+
const parts = pattern.split('/');
|
|
182
|
+
let currentPaths = [packageConfigDir];
|
|
183
|
+
|
|
184
|
+
for (const part of parts) {
|
|
185
|
+
const nextPaths = [];
|
|
186
|
+
for (const cp of currentPaths) {
|
|
187
|
+
if (part === '*') {
|
|
188
|
+
// Match any single directory level
|
|
189
|
+
if (existsSync(cp)) {
|
|
190
|
+
const entries = readdirSync(cp);
|
|
191
|
+
for (const entry of entries) {
|
|
192
|
+
const fullPath = join(cp, entry);
|
|
193
|
+
if (statSync(fullPath).isDirectory()) {
|
|
194
|
+
nextPaths.push(fullPath);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
} else {
|
|
199
|
+
nextPaths.push(join(cp, part));
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
currentPaths = nextPaths;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
for (const p of currentPaths) {
|
|
206
|
+
if (existsSync(p)) {
|
|
207
|
+
results.push(relative(packageConfigDir, p));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
} else {
|
|
211
|
+
results.push(pattern);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return results;
|
|
215
|
+
}
|
|
216
|
+
|
|
179
217
|
// Function to force overwrite specific files/folders
|
|
180
218
|
function forceOverwriteList(relativePaths) {
|
|
181
|
-
|
|
219
|
+
// Expand glob patterns first
|
|
220
|
+
const expandedPaths = [];
|
|
221
|
+
for (const relativePath of relativePaths) {
|
|
222
|
+
expandedPaths.push(...expandGlob(relativePath));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
expandedPaths.forEach(relativePath => {
|
|
182
226
|
const srcPath = join(packageConfigDir, relativePath);
|
|
183
227
|
const destPath = join(agentDir, relativePath);
|
|
184
228
|
|
|
@@ -203,9 +247,6 @@ function forceOverwriteList(relativePaths) {
|
|
|
203
247
|
}
|
|
204
248
|
} catch (e) {
|
|
205
249
|
console.log(`⚠ Could not force overwrite ${relativePath}: ${e.message}`);
|
|
206
|
-
if (e.stack) {
|
|
207
|
-
console.log(e.stack);
|
|
208
|
-
}
|
|
209
250
|
}
|
|
210
251
|
} else {
|
|
211
252
|
console.log(`⚠ Source path does not exist: ${relativePath}`);
|