aico-cli 0.3.20 → 0.4.1
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/chunks/simple-config.mjs +1 -1
- package/package.json +1 -1
- package/templates/agents/aico/plan/function-point-analyzer.md +219 -0
- package/templates/agents/aico/requirement/WINDOWS_USAGE.md +478 -0
- package/templates/agents/aico/requirement/crossplatform-utils.ps1 +465 -0
- package/templates/agents/aico/requirement/requirement-aligner.md +47 -0
- package/templates/agents/aico/requirement/requirement-functions-crossplatform.ps1 +458 -0
- package/templates/agents/aico/requirement/requirement-identifier.md +43 -4
- package/templates/agents/aico/requirement/requirement-launcher.ps1 +223 -0
- package/templates/agents/aico/requirement/task-executor-validator.md +42 -0
- package/templates/agents/aico/requirement/task-executor.md +44 -0
- package/templates/agents/aico/requirement/task-splitter-validator.md +44 -2
- package/templates/agents/aico/requirement/test-crossplatform.ps1 +506 -0
- package/templates/agents/aico/requirement/test-crossplatform.sh +456 -0
- package/templates/commands/base//344/273/243/347/240/201/345/256/241/346/237/245/346/231/272/350/203/275/344/275/223.md +2 -5
- package/templates/commands/base//345/212/237/350/203/275/347/202/271/346/265/213/347/256/227.md +469 -19
- package/templates/hooks/claude-code-hooks.json +69 -0
- package/templates/hooks/notify.ps1 +1 -27
- package/templates/hooks/notify.sh +0 -23
- package/templates/hooks/scripts/Notification/bash/desktop-notifier.sh +63 -0
- package/templates/hooks/scripts/Notification/powershell/desktop-notifier.ps1 +67 -0
- package/templates/hooks/scripts/PostToolUse/bash/code-formatter.sh +73 -0
- package/templates/hooks/scripts/PostToolUse/powershell/code-formatter.ps1 +90 -0
- package/templates/hooks/scripts/PreToolUse/bash/command-logger.sh +38 -0
- package/templates/hooks/scripts/PreToolUse/bash/file-protection.sh +55 -0
- package/templates/hooks/scripts/PreToolUse/powershell/command-logger.ps1 +34 -0
- package/templates/hooks/scripts/PreToolUse/powershell/file-protection.ps1 +46 -0
- package/templates/hooks/scripts/Stop/bash/session-summary.sh +83 -0
- package/templates/hooks/scripts/Stop/powershell/session-summary.ps1 +95 -0
- package/templates/hooks/scripts/UserPromptSubmit/bash/input-notifier.sh +58 -0
- package/templates/hooks/scripts/UserPromptSubmit/powershell/input-notifier.ps1 +57 -0
- package/templates/hooks/utils/crossplatform-detector.ps1 +117 -0
- package/templates/hooks/utils/crossplatform-detector.sh +111 -0
- package/templates/personality.md +3 -3
- package/templates/settings.json +4 -4
- package/templates/agents/aico/requirement/PLATFORM_COMPATIBILITY.md +0 -219
- package/templates/hooks/claude-code-hook-config.json +0 -35
- package/templates/hooks/hooks-config.json +0 -47
- package/templates/hooks/requirement/common-utils.sh +0 -186
- package/templates/hooks/requirement/hook-utils.ps1 +0 -365
- package/templates/hooks/requirement/post-requirement-aligner.sh +0 -61
- package/templates/hooks/requirement/post-requirement-identifier.sh +0 -58
- package/templates/hooks/requirement/post-task-executor-validator.sh +0 -96
- package/templates/hooks/requirement/post-task-executor.sh +0 -78
- package/templates/hooks/requirement/post-task-splitter-validator.sh +0 -73
- package/templates/hooks/requirement/pre-requirement-aligner.sh +0 -70
- package/templates/hooks/requirement/pre-requirement-identifier.sh +0 -61
- package/templates/hooks/requirement/pre-task-executor-validator.sh +0 -81
- package/templates/hooks/requirement/pre-task-executor.sh +0 -91
- package/templates/hooks/requirement/pre-task-splitter-validator.sh +0 -61
- package/templates/test-windows-compatibility.ps1 +0 -476
package/templates/commands/base//345/212/237/350/203/275/347/202/271/346/265/213/347/256/227.md
CHANGED
|
@@ -1,29 +1,421 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: function-point-
|
|
3
|
-
description: "
|
|
2
|
+
name: function-point-analyzer
|
|
3
|
+
description: "自动识别工程模块并分析Git提交记录,按月份输出功能点统计CSV到子文件夹"
|
|
4
|
+
allowed-tools: Read(**), Write(.aico/功能点/**/*.csv), Bash
|
|
5
|
+
argument-hint: [模块名]
|
|
4
6
|
---
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
ILF对应10,EI对应4,EO对应4,EQ对应5。
|
|
8
|
+
## 用法
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
- 外部查询(EQ): 4 点(如可停输界面导出、筛选)
|
|
11
|
-
- 外部输入(EI): 4 点(如可停输界面删除、修改)
|
|
10
|
+
`/base:功能点测算 [模块名]`
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
## 自动加载的项目上下文:
|
|
13
|
+
@/CLAUDE.md
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## 全生命周期管理
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
2. **提交/变更类** -> `外部输入 (EI)`, 4 点
|
|
19
|
-
3. **纯 UI 交互类** -> `内部逻辑文件 (ILF)`, 10 点
|
|
20
|
-
4. **绝不使用** `功能点标准分类` 以外的类别。
|
|
17
|
+
作为功能点测算的指挥官,统筹整个功能点分析流程,明确各阶段职责和智能体调用关系:
|
|
21
18
|
|
|
22
|
-
|
|
19
|
+
### 🎯 工程识别阶段
|
|
20
|
+
**职责**:检测Git环境,识别项目基础信息
|
|
21
|
+
**执行环节**:步骤1-2
|
|
22
|
+
**调用智能体**:`function-point-analyzer`
|
|
23
|
+
**前置条件**:无
|
|
24
|
+
**输出**:项目名称、项目类型确认信息
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
### 🔍 数据采集阶段
|
|
27
|
+
**职责**:获取Git提交记录,按月份分组
|
|
28
|
+
**执行环节**:步骤3
|
|
29
|
+
**调用智能体**:`function-point-analyzer`
|
|
30
|
+
**前置条件**:工程识别完成
|
|
31
|
+
**输出**:近3个月Git提交记录分组数据
|
|
25
32
|
|
|
26
|
-
|
|
33
|
+
### 📊 功能点分析阶段
|
|
34
|
+
**职责**:智能识别功能点类型,提取模块层级
|
|
35
|
+
**执行环节**:步骤4-6
|
|
36
|
+
**调用智能体**:`function-point-analyzer`
|
|
37
|
+
**前置条件**:Git数据采集完成
|
|
38
|
+
**输出**:功能点分类结果、模块层级信息
|
|
39
|
+
|
|
40
|
+
### 📋 报告生成阶段
|
|
41
|
+
**职责**:生成CSV统计报告,输出分析摘要
|
|
42
|
+
**执行环节**:步骤7-8
|
|
43
|
+
**调用智能体**:`function-point-analyzer`
|
|
44
|
+
**前置条件**:功能点分析完成
|
|
45
|
+
**输出**:`.aico/功能点/`目录下的CSV文件和统计摘要
|
|
46
|
+
|
|
47
|
+
## 编排说明
|
|
48
|
+
|
|
49
|
+
**步骤 1**:检查当前目录是否为Git仓库,确认工程环境。
|
|
50
|
+
|
|
51
|
+
**步骤 2**:根据用户输入和上下文智能识别需要执行的功能点测算流程:
|
|
52
|
+
|
|
53
|
+
### 智能体调用决策逻辑
|
|
54
|
+
|
|
55
|
+
**基于用户输入和项目状态的智能路由**:
|
|
56
|
+
|
|
57
|
+
1. **初始判断**:分析用户输入内容,识别是否包含模块名参数
|
|
58
|
+
2. **环境检查**:验证当前目录是否为Git仓库
|
|
59
|
+
3. **智能路由**:
|
|
60
|
+
- 如果环境检查通过 → 调用 `function-point-analyzer` 智能体
|
|
61
|
+
- 如果环境检查失败 → 提示用户"当前目录不是Git仓库,请切换到项目根目录"
|
|
62
|
+
|
|
63
|
+
4. **执行机制**:`function-point-analyzer` 智能体严格按照本模板的8个标准步骤执行:
|
|
64
|
+
- 步骤1:工程识别阶段
|
|
65
|
+
- 步骤2:项目基础信息采集
|
|
66
|
+
- 步骤3:Git数据批量获取阶段
|
|
67
|
+
- 步骤4:功能点智能识别阶段
|
|
68
|
+
- 步骤5:模块层级智能提取阶段
|
|
69
|
+
- 步骤6:智能属性赋值规则
|
|
70
|
+
- 步骤7:CSV文件生成阶段
|
|
71
|
+
- 步骤8:统计分析与输出阶段
|
|
72
|
+
|
|
73
|
+
5. **输出验证**:确保生成的CSV文件符合格式规范,统计摘要准确完整
|
|
74
|
+
|
|
75
|
+
### 执行约束
|
|
76
|
+
|
|
77
|
+
**操作边界**:
|
|
78
|
+
- 📁 **文件操作**:只在 `.aico/功能点/` 目录下创建CSV文件
|
|
79
|
+
- 🔒 **权限控制**:需要读取Git记录和写入文件的权限
|
|
80
|
+
- 🏗️ **架构保护**:保持现有项目结构不变,只进行数据分析和报告生成
|
|
81
|
+
|
|
82
|
+
**安全防护**:
|
|
83
|
+
- ✅ **输入验证**:对Git提交记录进行安全过滤
|
|
84
|
+
- 🛡️ **数据保护**:不修改任何源代码文件,只进行统计分析
|
|
85
|
+
- ⚠️ **风险预警**:识别潜在的数据解析问题并提前预警
|
|
86
|
+
|
|
87
|
+
## 流程可视化
|
|
88
|
+
|
|
89
|
+
```mermaid
|
|
90
|
+
graph TD
|
|
91
|
+
A[用户输入功能点测算需求] --> B{环境检查}
|
|
92
|
+
B -->|Git仓库| C[function-point-analyzer]
|
|
93
|
+
B -->|非Git仓库| D[提示用户切换到项目根目录]
|
|
94
|
+
|
|
95
|
+
C --> E[工程识别阶段]
|
|
96
|
+
E --> F[数据采集阶段]
|
|
97
|
+
F --> G[功能点分析阶段]
|
|
98
|
+
G --> H[报告生成阶段]
|
|
99
|
+
H --> I[输出CSV文件和统计摘要]
|
|
100
|
+
I --> J[完成]
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
# 🔄 标准执行流程
|
|
106
|
+
|
|
107
|
+
## 步骤1:工程识别阶段(必须优先执行)
|
|
108
|
+
|
|
109
|
+
### 🔍 Git环境检测
|
|
110
|
+
**规则**:
|
|
111
|
+
1. 检查当前目录是否为Git仓库
|
|
112
|
+
2. 如果不是Git仓库 → 终止执行并提示用户
|
|
113
|
+
|
|
114
|
+
**执行命令**:
|
|
115
|
+
```bash
|
|
116
|
+
git rev-parse --is-inside-work-tree
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**成功标准**:
|
|
120
|
+
- 返回值为`true`
|
|
121
|
+
- 当前目录存在`.git`目录
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 步骤2:项目基础信息采集
|
|
126
|
+
|
|
127
|
+
### 📋 项目名称识别规则(按优先级):
|
|
128
|
+
1. **最高优先级**:从`package.json`获取`name`字段
|
|
129
|
+
```
|
|
130
|
+
package.json → package.name字段
|
|
131
|
+
```
|
|
132
|
+
2. **次要优先级**:从Git远程URL提取项目名
|
|
133
|
+
```
|
|
134
|
+
git remote get-url origin → 从URL中提取仓库名
|
|
135
|
+
示例:https://github.com/user/aico-cli → aico-cli
|
|
136
|
+
```
|
|
137
|
+
3. **最低优先级**:使用当前目录名
|
|
138
|
+
|
|
139
|
+
### 🔧 项目类型判定规则:
|
|
140
|
+
```
|
|
141
|
+
文件存在判定逻辑 → 项目类型:
|
|
142
|
+
├── package.json → Node.js
|
|
143
|
+
├── pom.xml → Java
|
|
144
|
+
├── requirements.txt → Python
|
|
145
|
+
├── Cargo.toml → Rust
|
|
146
|
+
├── go.mod → Go
|
|
147
|
+
└── Gemfile → Ruby
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### ✅ 信息确认阶段:
|
|
151
|
+
执行完成后必须输出确认信息:
|
|
152
|
+
```
|
|
153
|
+
✅ 工程识别完成:
|
|
154
|
+
项目名称: <项目名称>
|
|
155
|
+
项目类型: <项目类型>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## 步骤3:Git数据批量获取阶段
|
|
161
|
+
|
|
162
|
+
### 📅 时间范围计算规则:
|
|
163
|
+
**输入参数**:默认3个月(可通过--months调整)
|
|
164
|
+
**计算逻辑**:
|
|
165
|
+
```javascript
|
|
166
|
+
const startDate = new Date();
|
|
167
|
+
startDate.setMonth(startDate.getMonth() - months);
|
|
168
|
+
// 格式化为 YYYY-MM-DD
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### 📊 Git提交记录获取规则:
|
|
172
|
+
**执行命令**:
|
|
173
|
+
```bash
|
|
174
|
+
git log --since="YYYY-MM-DD" --pretty=format:"%H|%ad|%an|%s" --date=short --name-only
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**数据字段说明**:
|
|
178
|
+
- `%H`:提交哈希
|
|
179
|
+
- `%ad`:提交日期(YYYY-MM-DD格式)
|
|
180
|
+
- `%an`:作者名称
|
|
181
|
+
- `%s`:提交消息
|
|
182
|
+
|
|
183
|
+
### 🗂️ 数据分组规则:
|
|
184
|
+
按月份对提交记录进行分组:
|
|
185
|
+
```
|
|
186
|
+
分组键:YYYY-MM格式(如2025-10)
|
|
187
|
+
分组数据:该月份的所有提交记录
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## 步骤4:功能点智能识别阶段
|
|
193
|
+
|
|
194
|
+
### 🎯 功能点分类判定规则(严格匹配):
|
|
195
|
+
|
|
196
|
+
#### 内部逻辑文件(ILF)- 10点
|
|
197
|
+
**匹配模式**(任一匹配即判定为ILF):
|
|
198
|
+
```regex
|
|
199
|
+
/新增.*界面/i
|
|
200
|
+
/创建.*模块/i
|
|
201
|
+
/实现.*功能/i
|
|
202
|
+
/添加.*页面/i
|
|
203
|
+
/feat\(.+\):/i
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
#### 外部查询(EQ)- 4点
|
|
207
|
+
**匹配模式**(任一匹配即判定为EQ):
|
|
208
|
+
```regex
|
|
209
|
+
/查询.*数据/i
|
|
210
|
+
/导出.*报表/i
|
|
211
|
+
/筛选.*条件/i
|
|
212
|
+
/搜索.*功能/i
|
|
213
|
+
/get.*list/i
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
#### 外部输入(EI)- 4点
|
|
217
|
+
**匹配模式**(任一匹配即判定为EI):
|
|
218
|
+
```regex
|
|
219
|
+
/修改.*数据/i
|
|
220
|
+
/删除.*记录/i
|
|
221
|
+
/更新.*信息/i
|
|
222
|
+
/编辑.*内容/i
|
|
223
|
+
/fix\(.+\):/i
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
#### 外部输出(EO)- 5点
|
|
227
|
+
**匹配模式**(任一匹配即判定为EO):
|
|
228
|
+
```regex
|
|
229
|
+
/生成.*报告/i
|
|
230
|
+
/输出.*结果/i
|
|
231
|
+
/计算.*统计/i
|
|
232
|
+
/分析.*数据/i
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### 📈 默认兜底规则:
|
|
236
|
+
如果提交消息未匹配任何模式,但包含代码文件,则判定为**内部逻辑文件(ILF)- 10点**:
|
|
237
|
+
```javascript
|
|
238
|
+
if (results.length === 0 && files.some(file =>
|
|
239
|
+
file.endsWith('.ts') || file.endsWith('.js') || file.endsWith('.py')
|
|
240
|
+
)) {
|
|
241
|
+
// 默认为ILF,10点
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## 步骤5:模块层级智能提取阶段
|
|
248
|
+
|
|
249
|
+
### 🏗️ 模块层级提取规则:
|
|
250
|
+
|
|
251
|
+
#### 优先级1:从文件路径提取(主要来源)
|
|
252
|
+
```
|
|
253
|
+
路径示例:src/utils/commands/function-point.ts
|
|
254
|
+
提取结果:
|
|
255
|
+
├── 一级模块: utils
|
|
256
|
+
├── 二级模块: commands
|
|
257
|
+
├── 三级模块: function-point
|
|
258
|
+
└── 四级模块: (留空)
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
**处理逻辑**:
|
|
262
|
+
1. 过滤包含`src/`的文件路径
|
|
263
|
+
2. 移除`src/`前缀
|
|
264
|
+
3. 按`/`分割路径组件
|
|
265
|
+
4. 最多提取三个层级的模块信息
|
|
266
|
+
|
|
267
|
+
#### 优先级2:从提交消息提取(辅助验证)
|
|
268
|
+
**正则表达式**:
|
|
269
|
+
```regex
|
|
270
|
+
/(?:模块|module)[::]\s*(\w+)/i
|
|
271
|
+
/(?:功能|feature)[::]\s*(\w+)/i
|
|
272
|
+
/(?:组件|component)[::]\s*(\w+)/i
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## 步骤6:智能属性赋值规则
|
|
278
|
+
|
|
279
|
+
### 🏷️ 功能点计数项命名规则:
|
|
280
|
+
```
|
|
281
|
+
逻辑:提取中文关键词 + 功能点类型简称
|
|
282
|
+
模式:<关键词序列>_<类型>
|
|
283
|
+
|
|
284
|
+
示例:
|
|
285
|
+
"新增用户管理界面" → 新增用户界面_ILF
|
|
286
|
+
"修复登录验证问题" → 修复登录验证_EI
|
|
287
|
+
"导出订单数据查询" → 导出订单查询_EQ
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### 📊 属性赋值标准:
|
|
291
|
+
|
|
292
|
+
#### 复用程度判定:
|
|
293
|
+
```
|
|
294
|
+
逻辑:根据功能点类型和描述关键词
|
|
295
|
+
内部逻辑文件(ILF) → 低 (新建为主)
|
|
296
|
+
外部查询(EQ) → 中 (常见查询模式)
|
|
297
|
+
外部输入(EI) → 中 (常见操作模式)
|
|
298
|
+
外部输出(EO) → 高 (复杂处理逻辑)
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
#### 修改类型判定:
|
|
302
|
+
```
|
|
303
|
+
新增/创建/实现 → 新增
|
|
304
|
+
修改/调整/优化 → 修改
|
|
305
|
+
删除/移除/清理 → 删除
|
|
306
|
+
修复/解决/调整 → 修复
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## 步骤7:CSV文件生成阶段
|
|
312
|
+
|
|
313
|
+
### 📁 目录结构创建规则:
|
|
314
|
+
```
|
|
315
|
+
基础目录:.aico/功能点/
|
|
316
|
+
月份子目录:中文月份名称(1月、2月、3月...)
|
|
317
|
+
文件命名:<项目名>_功能点统计.csv
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### 📋 CSV格式规范:
|
|
321
|
+
|
|
322
|
+
#### 文件格式要求:
|
|
323
|
+
- **文件编码**:UTF-8 with BOM
|
|
324
|
+
- **分隔符**:英文逗号(,)
|
|
325
|
+
- **引号字符**:双引号(")
|
|
326
|
+
- **换行符**:CRLF(\r\n)
|
|
327
|
+
- **文件扩展名**:.csv
|
|
328
|
+
|
|
329
|
+
#### CSV字段顺序(严格按此顺序):
|
|
330
|
+
```
|
|
331
|
+
一级模块,二级模块(选填),三级模块(选填),四级模块(选填),
|
|
332
|
+
功能项描述,功能点计数项名称,类别,未调整功能点数(UFP),
|
|
333
|
+
复用程度,修改类型,关联人
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
#### 字段处理规则:
|
|
337
|
+
- **一级模块**:必须填写,默认为"核心模块"
|
|
338
|
+
- **二级/三级模块**:可选,无则留空
|
|
339
|
+
- **四级模块**:固定留空
|
|
340
|
+
- **功能项描述**:原始提交消息,需要转义双引号为""
|
|
341
|
+
- **功能点计数项名称**:生成的计数项名称
|
|
342
|
+
- **类别**:功能点类型分类
|
|
343
|
+
- **未调整功能点数**:对应点数(4/5/10)
|
|
344
|
+
- **复用程度**:低/中/高
|
|
345
|
+
- **修改类型**:新增/修改/删除/修复
|
|
346
|
+
- **关联人**:Git提交作者
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## 步骤8:统计分析与输出阶段
|
|
351
|
+
|
|
352
|
+
### 📊 统计摘要计算规则:
|
|
353
|
+
|
|
354
|
+
#### 总体统计:
|
|
355
|
+
- 总计功能点数 = 所有功能点未调整功能点数之和
|
|
356
|
+
- 总计功能点记录数 = 所有功能点记录数量
|
|
357
|
+
|
|
358
|
+
#### 分类统计:
|
|
359
|
+
- 按类型分组:内部逻辑文件、外部查询、外部输入、外部输出
|
|
360
|
+
- 按月份分组:10月、9月、8月等
|
|
361
|
+
- 按模块分组:utils、commands等一级模块
|
|
362
|
+
|
|
363
|
+
### 📈 输出格式规范:
|
|
364
|
+
```
|
|
365
|
+
✅ 功能点分析完成!
|
|
366
|
+
总计识别: <总数> 个功能点
|
|
367
|
+
输出目录: <输出路径>
|
|
368
|
+
|
|
369
|
+
📊 功能点统计摘要:
|
|
370
|
+
总计功能点: <总数>
|
|
371
|
+
按类型分布:
|
|
372
|
+
<类型名>: <数量>
|
|
373
|
+
按月份分布:
|
|
374
|
+
<月份名>: <数量>
|
|
375
|
+
按模块分布:
|
|
376
|
+
<模块名>: <数量>
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
---
|
|
380
|
+
|
|
381
|
+
# 🚨 执行约束与错误处理
|
|
382
|
+
|
|
383
|
+
## ⛔ 必须终止的情况:
|
|
384
|
+
1. 当前目录不是Git仓库
|
|
385
|
+
2. 指定时间范围内无任何提交记录
|
|
386
|
+
3. 无法识别到任何有效的功能点
|
|
387
|
+
|
|
388
|
+
## ⚠️ 警告但继续执行的情况:
|
|
389
|
+
1. 项目名称无法识别(使用目录名)
|
|
390
|
+
2. 项目类型无法识别(标记为Unknown)
|
|
391
|
+
3. 某些提交无法解析功能点(跳过该提交)
|
|
392
|
+
|
|
393
|
+
## ✅ 成功标准:
|
|
394
|
+
1. 至少识别到1个有效功能点
|
|
395
|
+
2. 成功创建月份子目录
|
|
396
|
+
3. 成功生成CSV文件
|
|
397
|
+
4. 成功输出统计摘要
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
# 📋 执行检查清单
|
|
402
|
+
|
|
403
|
+
执行前确保:
|
|
404
|
+
- [ ] 当前目录是Git仓库
|
|
405
|
+
- [ ] 有读取Git记录的权限
|
|
406
|
+
- [ ] 有写入.aico目录的权限
|
|
407
|
+
|
|
408
|
+
执行中验证:
|
|
409
|
+
- [ ] Git命令执行成功
|
|
410
|
+
- [ ] 提交记录解析正确
|
|
411
|
+
- [ ] 功能点分类准确
|
|
412
|
+
- [ ] 模块层级提取完整
|
|
413
|
+
|
|
414
|
+
执行后确认:
|
|
415
|
+
- [ ] CSV文件生成成功
|
|
416
|
+
- [ ] 目录结构正确
|
|
417
|
+
- [ ] 数据格式符合规范
|
|
418
|
+
- [ ] 统计摘要准确
|
|
27
419
|
|
|
28
420
|
# 相关内容
|
|
29
421
|
|
|
@@ -104,7 +496,7 @@ ILF对应10,EI对应4,EO对应4,EQ对应5。
|
|
|
104
496
|
- 使用模糊笼统词汇的需求
|
|
105
497
|
- 与技术实现相关的描述
|
|
106
498
|
|
|
107
|
-
##
|
|
499
|
+
## 功能标题和描述细则
|
|
108
500
|
为了规范化录入研发需求,制定该细则,细则针对研发需求的标题及描述制定了描述规则,规则如下:
|
|
109
501
|
研发需求标题描述句式
|
|
110
502
|
触发主体+核心业务对象+精确动作动词+处理逻辑(复杂计算逻辑需要描述)+关联的数据实体(外部)(外部系统获取信息,通过“(外部)”来标识,存在外部接口数据需要描述)
|
|
@@ -149,5 +541,63 @@ ILF对应10,EI对应4,EO对应4,EQ对应5。
|
|
|
149
541
|
❌ 2025年6月-XX项目开发运维需求
|
|
150
542
|
❌ 系统优化
|
|
151
543
|
❌ 开发工业互联网大屏项目
|
|
152
|
-
|
|
153
|
-
|
|
544
|
+
---
|
|
545
|
+
|
|
546
|
+
# 📝 完整执行示例
|
|
547
|
+
|
|
548
|
+
以下是一个完整的功能点测算执行流程示例:
|
|
549
|
+
|
|
550
|
+
## 输入
|
|
551
|
+
```markdown
|
|
552
|
+
启动功能点测算智能体
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
## 执行过程
|
|
556
|
+
1. ✅ 检测Git环境 → 成功
|
|
557
|
+
2. ✅ 识别项目信息 → aico-cli, Node.js
|
|
558
|
+
3. ✅ 获取Git记录 → 102个提交,3个月
|
|
559
|
+
4. ✅ 功能点分析 → 识别62个功能点
|
|
560
|
+
5. ✅ CSV生成 → 3个月份文件夹
|
|
561
|
+
6. ✅ 统计摘要 → 完整输出
|
|
562
|
+
|
|
563
|
+
## 输出
|
|
564
|
+
```
|
|
565
|
+
✅ 工程识别完成:
|
|
566
|
+
项目名称: aico-cli
|
|
567
|
+
项目类型: Node.js
|
|
568
|
+
|
|
569
|
+
📊 正在分析近3个月的Git提交记录...
|
|
570
|
+
📈 正在分析功能点...
|
|
571
|
+
✅ 2025-10: 分析 11 个提交,识别 3 个功能点
|
|
572
|
+
✅ 2025-09: 分析 58 个提交,识别 31 个功能点
|
|
573
|
+
✅ 2025-08: 分析 33 个提交,识别 28 个功能点
|
|
574
|
+
|
|
575
|
+
✅ 功能点分析完成!
|
|
576
|
+
总计识别: 62 个功能点
|
|
577
|
+
输出目录: .aico/功能点
|
|
578
|
+
|
|
579
|
+
📊 功能点统计摘要:
|
|
580
|
+
总计功能点: 62
|
|
581
|
+
按类型分布:
|
|
582
|
+
内部逻辑文件(ILF): 62
|
|
583
|
+
按月份分布:
|
|
584
|
+
10月: 3
|
|
585
|
+
9月: 31
|
|
586
|
+
8月: 28
|
|
587
|
+
按模块分布:
|
|
588
|
+
utils: 18
|
|
589
|
+
commands: 10
|
|
590
|
+
cli-setup: 17
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
## 生成文件
|
|
594
|
+
```
|
|
595
|
+
.aico/功能点/
|
|
596
|
+
├── 10月/aico-cli_功能点统计.csv
|
|
597
|
+
├── 9月/aico-cli_功能点统计.csv
|
|
598
|
+
└── 8月/aico-cli_功能点统计.csv
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
---
|
|
602
|
+
|
|
603
|
+
**🎯 该智能体严格执行8个步骤的标准化流程,确保功能点测算的准确性和一致性。**
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
|
3
|
+
"hooks": {
|
|
4
|
+
"PreToolUse": [
|
|
5
|
+
{
|
|
6
|
+
"matcher": "Bash",
|
|
7
|
+
"hooks": [
|
|
8
|
+
{
|
|
9
|
+
"type": "command",
|
|
10
|
+
"command": "if [ \"$OS\" = \"Windows_NT\" ]; then powershell -File \"$env:USERPROFILE/.claude/hooks/scripts/PreToolUse/powershell/command-logger.ps1\"; else ~/.claude/hooks/scripts/PreToolUse/bash/command-logger.sh; fi"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"matcher": "Edit|Write",
|
|
16
|
+
"hooks": [
|
|
17
|
+
{
|
|
18
|
+
"type": "command",
|
|
19
|
+
"command": "if [ \"$OS\" = \"Windows_NT\" ]; then powershell -File \"$env:USERPROFILE/.claude/hooks/scripts/PreToolUse/powershell/file-protection.ps1\"; else ~/.claude/hooks/scripts/PreToolUse/bash/file-protection.sh; fi"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"PostToolUse": [
|
|
25
|
+
{
|
|
26
|
+
"matcher": "Edit|Write",
|
|
27
|
+
"hooks": [
|
|
28
|
+
{
|
|
29
|
+
"type": "command",
|
|
30
|
+
"command": "if [ \"$OS\" = \"Windows_NT\" ]; then powershell -File \"$env:USERPROFILE/.claude/hooks/scripts/PostToolUse/powershell/code-formatter.ps1\"; else ~/.claude/hooks/scripts/PostToolUse/bash/code-formatter.sh; fi"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"UserPromptSubmit": [
|
|
36
|
+
{
|
|
37
|
+
"matcher": "",
|
|
38
|
+
"hooks": [
|
|
39
|
+
{
|
|
40
|
+
"type": "command",
|
|
41
|
+
"command": "if [ \"$OS\" = \"Windows_NT\" ]; then powershell -File \"$env:USERPROFILE/.claude/hooks/scripts/UserPromptSubmit/powershell/input-notifier.ps1\"; else ~/.claude/hooks/scripts/UserPromptSubmit/bash/input-notifier.sh; fi"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"Notification": [
|
|
47
|
+
{
|
|
48
|
+
"matcher": "",
|
|
49
|
+
"hooks": [
|
|
50
|
+
{
|
|
51
|
+
"type": "command",
|
|
52
|
+
"command": "if [ \"$OS\" = \"Windows_NT\" ]; then powershell -File \"$env:USERPROFILE/.claude/hooks/scripts/Notification/powershell/desktop-notifier.ps1\"; else ~/.claude/hooks/scripts/Notification/bash/desktop-notifier.sh; fi"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"Stop": [
|
|
58
|
+
{
|
|
59
|
+
"matcher": "",
|
|
60
|
+
"hooks": [
|
|
61
|
+
{
|
|
62
|
+
"type": "command",
|
|
63
|
+
"command": "if [ \"$OS\" = \"Windows_NT\" ]; then powershell -File \"$env:USERPROFILE/.claude/hooks/scripts/Stop/powershell/session-summary.ps1\"; else ~/.claude/hooks/scripts/Stop/bash/session-summary.sh; fi"
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -7,24 +7,12 @@ param(
|
|
|
7
7
|
[string]$EventType
|
|
8
8
|
)
|
|
9
9
|
|
|
10
|
-
# Debug logging
|
|
11
|
-
$LogFile = "$env:USERPROFILE\.claude\hooks\notify-ps.log"
|
|
12
|
-
$LogDir = Split-Path $LogFile -Parent
|
|
13
|
-
New-Item -ItemType Directory -Force -Path $LogDir | Out-Null
|
|
14
10
|
|
|
15
|
-
function Write-Log {
|
|
16
|
-
param([string]$Message)
|
|
17
|
-
$Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
|
18
|
-
Add-Content -Path $LogFile -Value "${Timestamp}: $Message"
|
|
19
|
-
}
|
|
20
11
|
|
|
21
12
|
# Get the directory where this script is located
|
|
22
13
|
$ScriptDir = $PSScriptRoot
|
|
23
14
|
$SoundsDir = Join-Path $ScriptDir "sounds"
|
|
24
15
|
|
|
25
|
-
Write-Log "notify.ps1 called with EventType: $EventType"
|
|
26
|
-
Write-Log "Script directory: $ScriptDir"
|
|
27
|
-
Write-Log "Sounds directory: $SoundsDir"
|
|
28
16
|
|
|
29
17
|
# Function to play a sound file
|
|
30
18
|
function Play-SoundFile {
|
|
@@ -32,22 +20,17 @@ function Play-SoundFile {
|
|
|
32
20
|
|
|
33
21
|
# Check if file exists
|
|
34
22
|
if (-not (Test-Path $SoundFile)) {
|
|
35
|
-
Write-Log "ERROR: Sound file not found: $SoundFile"
|
|
36
23
|
return $false
|
|
37
24
|
}
|
|
38
25
|
|
|
39
|
-
Write-Log "Playing sound: $SoundFile"
|
|
40
|
-
|
|
41
26
|
try {
|
|
42
27
|
# Method 1: Use .NET SoundPlayer (most reliable)
|
|
43
28
|
Add-Type -AssemblyName System.Windows.Forms
|
|
44
29
|
$Sound = New-Object System.Media.SoundPlayer($SoundFile)
|
|
45
30
|
$Sound.PlaySync()
|
|
46
|
-
Write-Log "Sound played successfully using .NET SoundPlayer"
|
|
47
31
|
return $true
|
|
48
32
|
}
|
|
49
33
|
catch {
|
|
50
|
-
Write-Log "SoundPlayer failed: $($_.Exception.Message)"
|
|
51
34
|
|
|
52
35
|
try {
|
|
53
36
|
# Method 2: Use Windows Media Player as fallback
|
|
@@ -64,20 +47,16 @@ function Play-SoundFile {
|
|
|
64
47
|
$Elapsed += 0.1
|
|
65
48
|
}
|
|
66
49
|
$Player.close()
|
|
67
|
-
Write-Log "Sound played using Windows Media Player"
|
|
68
50
|
return $true
|
|
69
51
|
}
|
|
70
52
|
catch {
|
|
71
|
-
Write-Log "Windows Media Player failed: $($_.Exception.Message)"
|
|
72
53
|
|
|
73
54
|
try {
|
|
74
55
|
# Method 3: System beep as final fallback
|
|
75
56
|
[System.Media.SystemSounds]::Beep.Play()
|
|
76
|
-
Write-Log "System beep played as fallback"
|
|
77
57
|
return $true
|
|
78
58
|
}
|
|
79
59
|
catch {
|
|
80
|
-
Write-Log "All audio methods failed"
|
|
81
60
|
return $false
|
|
82
61
|
}
|
|
83
62
|
}
|
|
@@ -87,22 +66,17 @@ function Play-SoundFile {
|
|
|
87
66
|
# Main script logic
|
|
88
67
|
switch ($EventType) {
|
|
89
68
|
"input" {
|
|
90
|
-
Write-Log "Input needed event triggered"
|
|
91
69
|
$SoundFile = Join-Path $SoundsDir "input-needed.wav"
|
|
92
70
|
Play-SoundFile $SoundFile
|
|
93
71
|
}
|
|
94
72
|
|
|
95
73
|
"complete" {
|
|
96
|
-
Write-Log "Complete event triggered"
|
|
97
74
|
$SoundFile = Join-Path $SoundsDir "complete.wav"
|
|
98
75
|
Play-SoundFile $SoundFile
|
|
99
76
|
}
|
|
100
77
|
|
|
101
78
|
default {
|
|
102
|
-
Write-Log "ERROR: Invalid event type: $EventType"
|
|
103
79
|
Write-Host "Usage: .\notify.ps1 {input|complete}"
|
|
104
80
|
exit 1
|
|
105
81
|
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
Write-Log "Script execution completed"
|
|
82
|
+
}
|