@huajiwuyan/hello 3.0.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/README.md +68 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +448 -0
- package/package.json +38 -0
- package/templates/claude/commands/hello.md +760 -0
- package/templates/claude/skills/SKILL.md +90 -0
- package/templates/claude/skills/SKILL.toml +7 -0
- package/templates/claude/skills/assets/icon-large.svg +12 -0
- package/templates/claude/skills/assets/icon-small-400px.svg +12 -0
- package/templates/claude/skills/assets/templates/CHANGELOG.md +24 -0
- package/templates/claude/skills/assets/templates/CHANGELOG_{YYYY}.md +25 -0
- package/templates/claude/skills/assets/templates/INDEX.md +36 -0
- package/templates/claude/skills/assets/templates/archive/_index.md +22 -0
- package/templates/claude/skills/assets/templates/context.md +82 -0
- package/templates/claude/skills/assets/templates/modules/_index.md +22 -0
- package/templates/claude/skills/assets/templates/modules/module.md +35 -0
- package/templates/claude/skills/assets/templates/plan/proposal.md +104 -0
- package/templates/claude/skills/assets/templates/plan/tasks.md +49 -0
- package/templates/claude/skills/references/functions/auto.md +217 -0
- package/templates/claude/skills/references/functions/clean.md +167 -0
- package/templates/claude/skills/references/functions/commit.md +374 -0
- package/templates/claude/skills/references/functions/exec.md +178 -0
- package/templates/claude/skills/references/functions/help.md +105 -0
- package/templates/claude/skills/references/functions/init.md +228 -0
- package/templates/claude/skills/references/functions/plan.md +219 -0
- package/templates/claude/skills/references/functions/review.md +146 -0
- package/templates/claude/skills/references/functions/rollback.md +208 -0
- package/templates/claude/skills/references/functions/test.md +153 -0
- package/templates/claude/skills/references/functions/upgrade.md +371 -0
- package/templates/claude/skills/references/functions/validate.md +147 -0
- package/templates/claude/skills/references/rules/package.md +212 -0
- package/templates/claude/skills/references/rules/scaling.md +150 -0
- package/templates/claude/skills/references/rules/state.md +318 -0
- package/templates/claude/skills/references/rules/tools.md +371 -0
- package/templates/claude/skills/references/services/knowledge.md +408 -0
- package/templates/claude/skills/references/services/templates.md +344 -0
- package/templates/claude/skills/references/stages/analyze.md +201 -0
- package/templates/claude/skills/references/stages/design.md +379 -0
- package/templates/claude/skills/references/stages/develop.md +497 -0
- package/templates/claude/skills/references/stages/evaluate.md +286 -0
- package/templates/claude/skills/references/stages/tweak.md +244 -0
- package/templates/claude/skills/scripts/create_package.py +260 -0
- package/templates/claude/skills/scripts/list_packages.py +145 -0
- package/templates/claude/skills/scripts/migrate_package.py +399 -0
- package/templates/claude/skills/scripts/project_stats.py +438 -0
- package/templates/claude/skills/scripts/upgradewiki.py +321 -0
- package/templates/claude/skills/scripts/utils.py +596 -0
- package/templates/claude/skills/scripts/validate_package.py +309 -0
- package/templates/codex/prompts/hello.md +757 -0
- package/templates/codex/skills/SKILL.md +74 -0
- package/templates/codex/skills/SKILL.toml +7 -0
- package/templates/codex/skills/assets/icon-large.svg +12 -0
- package/templates/codex/skills/assets/icon-small-400px.svg +12 -0
- package/templates/codex/skills/assets/templates/CHANGELOG.md +24 -0
- package/templates/codex/skills/assets/templates/CHANGELOG_{YYYY}.md +25 -0
- package/templates/codex/skills/assets/templates/INDEX.md +36 -0
- package/templates/codex/skills/assets/templates/archive/_index.md +22 -0
- package/templates/codex/skills/assets/templates/context.md +82 -0
- package/templates/codex/skills/assets/templates/modules/_index.md +22 -0
- package/templates/codex/skills/assets/templates/modules/module.md +35 -0
- package/templates/codex/skills/assets/templates/plan/proposal.md +104 -0
- package/templates/codex/skills/assets/templates/plan/tasks.md +29 -0
- package/templates/codex/skills/references/functions/auto.md +181 -0
- package/templates/codex/skills/references/functions/brain.md +275 -0
- package/templates/codex/skills/references/functions/clean.md +154 -0
- package/templates/codex/skills/references/functions/commit.md +265 -0
- package/templates/codex/skills/references/functions/debug/condition-based-waiting.md +151 -0
- package/templates/codex/skills/references/functions/debug/defense-in-depth.md +147 -0
- package/templates/codex/skills/references/functions/debug/root-cause-tracing.md +168 -0
- package/templates/codex/skills/references/functions/debug.md +389 -0
- package/templates/codex/skills/references/functions/exec.md +153 -0
- package/templates/codex/skills/references/functions/help.md +101 -0
- package/templates/codex/skills/references/functions/init.md +221 -0
- package/templates/codex/skills/references/functions/plan.md +178 -0
- package/templates/codex/skills/references/functions/review.md +135 -0
- package/templates/codex/skills/references/functions/rlm.md +864 -0
- package/templates/codex/skills/references/functions/rollback.md +190 -0
- package/templates/codex/skills/references/functions/test.md +140 -0
- package/templates/codex/skills/references/functions/upgrade.md +363 -0
- package/templates/codex/skills/references/functions/validate.md +135 -0
- package/templates/codex/skills/references/rules/cache.md +136 -0
- package/templates/codex/skills/references/rules/scaling.md +124 -0
- package/templates/codex/skills/references/rules/state.md +201 -0
- package/templates/codex/skills/references/rules/tools.md +301 -0
- package/templates/codex/skills/references/services/attention.md +53 -0
- package/templates/codex/skills/references/services/knowledge.md +559 -0
- package/templates/codex/skills/references/services/package.md +383 -0
- package/templates/codex/skills/references/services/templates.md +390 -0
- package/templates/codex/skills/references/stages/analyze.md +191 -0
- package/templates/codex/skills/references/stages/design.md +355 -0
- package/templates/codex/skills/references/stages/develop.md +520 -0
- package/templates/codex/skills/references/stages/tweak.md +239 -0
- package/templates/codex/skills/rlm/__init__.py +39 -0
- package/templates/codex/skills/rlm/agent_orchestrator.py +422 -0
- package/templates/codex/skills/rlm/context_manager.py +366 -0
- package/templates/codex/skills/rlm/engine.py +915 -0
- package/templates/codex/skills/rlm/folding.py +391 -0
- package/templates/codex/skills/rlm/repl.py +452 -0
- package/templates/codex/skills/rlm/roles/analyzer.md +66 -0
- package/templates/codex/skills/rlm/roles/designer.md +94 -0
- package/templates/codex/skills/rlm/roles/explorer.md +43 -0
- package/templates/codex/skills/rlm/roles/implementer.md +62 -0
- package/templates/codex/skills/rlm/roles/kb_keeper.md +138 -0
- package/templates/codex/skills/rlm/roles/pkg_keeper.md +163 -0
- package/templates/codex/skills/rlm/roles/reviewer.md +74 -0
- package/templates/codex/skills/rlm/roles/synthesizer.md +90 -0
- package/templates/codex/skills/rlm/roles/tester.md +83 -0
- package/templates/codex/skills/rlm/schemas/agent_result.json +174 -0
- package/templates/codex/skills/rlm/session.py +376 -0
- package/templates/codex/skills/rlm/shared_tasks.py +370 -0
- package/templates/codex/skills/scripts/create_package.py +260 -0
- package/templates/codex/skills/scripts/list_packages.py +145 -0
- package/templates/codex/skills/scripts/migrate_package.py +399 -0
- package/templates/codex/skills/scripts/project_stats.py +438 -0
- package/templates/codex/skills/scripts/upgradewiki.py +321 -0
- package/templates/codex/skills/scripts/utils.py +596 -0
- package/templates/codex/skills/scripts/validate_package.py +309 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
# ~commit 命令 - Git 提交
|
|
2
|
+
|
|
3
|
+
本模块定义 Git 提交的执行规则,基于 Conventional Commits 国际规范。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 命令说明
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
命令: ~commit [<message>]
|
|
11
|
+
类型: 场景确认类
|
|
12
|
+
功能: 智能生成提交信息并执行 Git 提交
|
|
13
|
+
触发: 用户明确表达提交意图时执行,默认不自动提交
|
|
14
|
+
|
|
15
|
+
触发方式:
|
|
16
|
+
自然语言: 用户表达提交意图("帮我提交代码"、"提交这些变更")
|
|
17
|
+
→ Layer 3 意图判定识别 → 加载本模块执行
|
|
18
|
+
仅命令: "~commit"
|
|
19
|
+
→ Layer 2 命令匹配 → 加载本模块执行
|
|
20
|
+
命令+参数: "~commit 修复登录bug"
|
|
21
|
+
→ Layer 2 命令匹配 + 提取参数 → 参数作为 summary 处理
|
|
22
|
+
|
|
23
|
+
参数处理:
|
|
24
|
+
无参数: 根据变更内容智能生成提交信息
|
|
25
|
+
有参数: 使用用户提供的 message 作为 summary
|
|
26
|
+
- 根据语义分析确定 type
|
|
27
|
+
- 如已包含 emoji/type 前缀,直接使用不重复添加
|
|
28
|
+
- 应用双语规则(BILINGUAL_COMMIT=1 时)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 执行模式适配
|
|
34
|
+
|
|
35
|
+
> 📌 规则引用: 按 G4 路由架构及 G5 执行模式规则执行
|
|
36
|
+
|
|
37
|
+
<mode_adaptation>
|
|
38
|
+
~commit 模式适配规则:
|
|
39
|
+
1. 本命令为独立工具命令,不受 WORKFLOW_MODE 影响
|
|
40
|
+
2. 提交前必须用户确认,不自动执行
|
|
41
|
+
3. 根据远程配置动态显示推送选项
|
|
42
|
+
4. 支持本地提交、推送、创建PR三种模式
|
|
43
|
+
</mode_adaptation>
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 意图判定规则(CRITICAL)
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
核心原则: 根据用户语义意图判断,默认不自动提交
|
|
51
|
+
|
|
52
|
+
禁止行为:
|
|
53
|
+
- 禁止在用户未明确表达提交意图时自动提交
|
|
54
|
+
- 禁止将"完成开发"等模糊表达等同于"提交代码"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 执行流程
|
|
60
|
+
|
|
61
|
+
### 步骤1: 环境检测
|
|
62
|
+
|
|
63
|
+
<git_env_analysis>
|
|
64
|
+
Git 环境检测推理过程:
|
|
65
|
+
1. 验证当前目录是否为 Git 仓库
|
|
66
|
+
2. 检测是否存在未提交的变更
|
|
67
|
+
3. 获取远程仓库配置和当前分支信息
|
|
68
|
+
</git_env_analysis>
|
|
69
|
+
|
|
70
|
+
```yaml
|
|
71
|
+
前置条件:
|
|
72
|
+
- 当前目录是 Git 仓库
|
|
73
|
+
- 存在未提交的变更
|
|
74
|
+
|
|
75
|
+
执行命令:
|
|
76
|
+
- git rev-parse --git-dir(验证仓库)
|
|
77
|
+
- git status --porcelain(检测变更)
|
|
78
|
+
- git remote -v(检测远程配置)
|
|
79
|
+
- git branch --show-current(获取当前分支)
|
|
80
|
+
|
|
81
|
+
异常处理:
|
|
82
|
+
非 Git 仓库: 按 G3 场景内容规则(错误)输出,建议执行 git init
|
|
83
|
+
无变更: 按 G3 场景内容规则(完成)输出,提示无需提交
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### 步骤2: 变更分析与信息生成
|
|
87
|
+
|
|
88
|
+
<commit_message_analysis>
|
|
89
|
+
提交信息生成推理过程:
|
|
90
|
+
1. 分析 git diff HEAD 输出内容
|
|
91
|
+
2. 识别变更类型(新增/修改/删除)
|
|
92
|
+
3. 提取核心改动点和功能描述
|
|
93
|
+
4. 根据 Conventional Commits 规范生成提交信息
|
|
94
|
+
5. 应用双语模式(如启用)
|
|
95
|
+
</commit_message_analysis>
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
执行命令: git diff HEAD
|
|
99
|
+
分析内容: 变更内容,提取核心改动点
|
|
100
|
+
|
|
101
|
+
提交信息生成:
|
|
102
|
+
无参数时: 根据变更内容确定 type/scope,智能生成 summary 和 body
|
|
103
|
+
有参数时: 使用用户提供的 message 作为 summary
|
|
104
|
+
- 根据语义分析确定 type
|
|
105
|
+
- 如已包含 emoji/type 前缀,直接使用不重复添加
|
|
106
|
+
- body 根据变更内容补充(可选)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 步骤3: 触发响应
|
|
110
|
+
|
|
111
|
+
```yaml
|
|
112
|
+
输出: 按 G3 场景内容规则(确认)输出,见"用户选择处理 - 提交确认"
|
|
113
|
+
|
|
114
|
+
[等待用户响应]
|
|
115
|
+
|
|
116
|
+
用户选择后按对应选项处理
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### 步骤4: 自动执行
|
|
120
|
+
|
|
121
|
+
<commit_execution_analysis>
|
|
122
|
+
提交执行推理过程:
|
|
123
|
+
1. 根据用户选择确定执行范围
|
|
124
|
+
2. 执行 git add 和 git commit
|
|
125
|
+
3. 如需推送,检测远程状态并处理冲突
|
|
126
|
+
4. 如需创建 PR,引导用户完成
|
|
127
|
+
</commit_execution_analysis>
|
|
128
|
+
|
|
129
|
+
```yaml
|
|
130
|
+
执行提交:
|
|
131
|
+
git add .
|
|
132
|
+
git commit -m "{提交信息}"
|
|
133
|
+
|
|
134
|
+
如用户选择推送:
|
|
135
|
+
检测远程状态
|
|
136
|
+
远程领先时: 自动执行 git pull --rebase
|
|
137
|
+
有冲突时: 输出冲突信息,提示用户手动处理,流程结束
|
|
138
|
+
无冲突: 执行 git push origin {branch}
|
|
139
|
+
|
|
140
|
+
如用户选择创建PR:
|
|
141
|
+
推送完成后自动引导创建 PR
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### 步骤5: 完成输出
|
|
145
|
+
|
|
146
|
+
```yaml
|
|
147
|
+
输出: 按 G3 场景内容规则(完成)输出执行结果(见"完成后输出")
|
|
148
|
+
执行: 按 G7 状态重置协议执行
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 不确定性处理
|
|
154
|
+
|
|
155
|
+
- 非 Git 仓库 → 按 G3 场景内容规则(错误)输出,建议 git init
|
|
156
|
+
- 无变更 → 按 G3 场景内容规则(完成)输出,提示无需提交
|
|
157
|
+
- 远程推送冲突 → 输出冲突信息,提示手动处理
|
|
158
|
+
- 变更类型难以判定 → 默认使用 chore 类型,提示用户确认
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## 用户选择处理
|
|
163
|
+
|
|
164
|
+
> 本章节定义 ~commit 命令需要用户确认的场景,供 G3 输出格式统一提取。
|
|
165
|
+
|
|
166
|
+
### 场景: 提交确认(检测完成后)
|
|
167
|
+
|
|
168
|
+
```yaml
|
|
169
|
+
内容要素:
|
|
170
|
+
- 当前分支和远程仓库状态
|
|
171
|
+
- 变更摘要(新增/修改/删除文件数)
|
|
172
|
+
- 关键改动点
|
|
173
|
+
- 提交信息预览(框线包裹)
|
|
174
|
+
- 提交方式选项(根据远程配置动态显示)
|
|
175
|
+
|
|
176
|
+
选项:
|
|
177
|
+
仅本地提交: 执行 git commit
|
|
178
|
+
提交并推送: 执行 git commit + git push
|
|
179
|
+
提交并创建PR: 执行 git commit + git push + 引导创建 PR
|
|
180
|
+
修改信息: 进入追问流程
|
|
181
|
+
取消: 按 G7 状态重置协议执行
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### 场景: 提交信息修改(追问)
|
|
185
|
+
|
|
186
|
+
```yaml
|
|
187
|
+
内容要素:
|
|
188
|
+
- 当前提交信息预览(框线包裹)
|
|
189
|
+
- 输入方式说明(完整格式/简短描述/确认/取消)
|
|
190
|
+
|
|
191
|
+
信息满足判定: AI 根据语义判断用户输入是否可作为提交信息
|
|
192
|
+
|
|
193
|
+
选项:
|
|
194
|
+
输入满足条件: 更新提交信息,重新展示确认
|
|
195
|
+
输入"确认": 使用当前信息,重新展示确认
|
|
196
|
+
输入"取消": 按 G7 状态重置协议执行
|
|
197
|
+
输入不满足条件: 重新展示追问
|
|
198
|
+
|
|
199
|
+
循环直到: 用户选择提交方式 或 取消
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## 附录
|
|
205
|
+
|
|
206
|
+
### 提交信息格式(Conventional Commits)
|
|
207
|
+
|
|
208
|
+
#### 基础格式
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
<emoji> <type>[(scope)]: <summary>
|
|
212
|
+
|
|
213
|
+
[body]
|
|
214
|
+
|
|
215
|
+
[footer]
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
#### 类型映射表
|
|
219
|
+
|
|
220
|
+
| emoji | type | 说明 |
|
|
221
|
+
|-------|------|------|
|
|
222
|
+
| 🎉 | init | 项目初始化 |
|
|
223
|
+
| ✨ | feat | 新功能 |
|
|
224
|
+
| 🐞 | fix | 错误修复 |
|
|
225
|
+
| 📃 | docs | 文档变更 |
|
|
226
|
+
| 🌈 | style | 代码格式化 |
|
|
227
|
+
| 🦄 | refactor | 代码重构 |
|
|
228
|
+
| 🎈 | perf | 性能优化 |
|
|
229
|
+
| 🧪 | test | 测试相关 |
|
|
230
|
+
| 🔧 | build | 构建系统 |
|
|
231
|
+
| 🐎 | ci | CI 配置 |
|
|
232
|
+
| 🐳 | chore | 辅助工具 |
|
|
233
|
+
| ↩ | revert | 撤销提交 |
|
|
234
|
+
|
|
235
|
+
#### 格式规则
|
|
236
|
+
|
|
237
|
+
```yaml
|
|
238
|
+
summary: 动词开头,≤50字符,不加句号
|
|
239
|
+
body: 说明变更动机(可选),每行≤72字符
|
|
240
|
+
footer: 关联 issue 或 BREAKING CHANGE(可选)
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### 双语模式
|
|
244
|
+
|
|
245
|
+
```yaml
|
|
246
|
+
配置: BILINGUAL_COMMIT
|
|
247
|
+
|
|
248
|
+
BILINGUAL_COMMIT = 0(默认):
|
|
249
|
+
仅使用 OUTPUT_LANGUAGE
|
|
250
|
+
|
|
251
|
+
BILINGUAL_COMMIT = 1:
|
|
252
|
+
格式: 本地语言块在上,英文块在下,用 --- 分隔
|
|
253
|
+
结构: 两个块均为完整格式(emoji + type + scope + summary + body)
|
|
254
|
+
要求: 两个语言块必须是精确互译,语义完全一致
|
|
255
|
+
|
|
256
|
+
示例:
|
|
257
|
+
✨ feat(auth): 添加用户登录功能
|
|
258
|
+
|
|
259
|
+
- 实现基于 JWT 的身份验证
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
✨ feat(auth): add user login feature
|
|
264
|
+
|
|
265
|
+
- Implement JWT-based authentication
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### 变更分析示例
|
|
269
|
+
|
|
270
|
+
```yaml
|
|
271
|
+
示例 - 新增功能:
|
|
272
|
+
git diff HEAD 输出:
|
|
273
|
+
diff --git a/src/auth/login.py b/src/auth/login.py
|
|
274
|
+
new file mode 100644
|
|
275
|
+
+def login(username: str, password: str) -> dict:
|
|
276
|
+
+ user = db.find_user(username)
|
|
277
|
+
+ if user and verify_password(password, user.password_hash):
|
|
278
|
+
+ return {"token": generate_jwt(user)}
|
|
279
|
+
+ raise AuthError("Invalid credentials")
|
|
280
|
+
|
|
281
|
+
分析过程:
|
|
282
|
+
1. 检测到新文件 src/auth/login.py
|
|
283
|
+
2. 识别新增函数 login(),功能为用户登录验证
|
|
284
|
+
3. 确定 type=feat, scope=auth
|
|
285
|
+
4. 生成 summary: "添加用户登录验证功能"
|
|
286
|
+
|
|
287
|
+
生成提交信息:
|
|
288
|
+
✨ feat(auth): 添加用户登录验证功能
|
|
289
|
+
|
|
290
|
+
- 新增 login() 函数实现用户名密码验证
|
|
291
|
+
- 验证成功返回 JWT token
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### 完成后输出
|
|
295
|
+
|
|
296
|
+
```yaml
|
|
297
|
+
本地提交完成:
|
|
298
|
+
按 G3 场景内容规则(完成)输出:
|
|
299
|
+
- 提交信息摘要
|
|
300
|
+
- 提交哈希
|
|
301
|
+
- 变更文件数
|
|
302
|
+
- 下一步建议: 可输入"推送"同步到远程
|
|
303
|
+
|
|
304
|
+
提交并推送完成:
|
|
305
|
+
按 G3 场景内容规则(完成)输出:
|
|
306
|
+
- 提交信息摘要
|
|
307
|
+
- 已推送到 origin/{branch}
|
|
308
|
+
- 仓库地址
|
|
309
|
+
|
|
310
|
+
提交并创建PR完成:
|
|
311
|
+
按 G3 场景内容规则(完成)输出:
|
|
312
|
+
- 提交信息摘要
|
|
313
|
+
- 已推送到 origin/{branch}
|
|
314
|
+
- PR 创建链接或引导
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### 特殊场景处理
|
|
318
|
+
|
|
319
|
+
```yaml
|
|
320
|
+
首次提交:
|
|
321
|
+
特征: git log 为空
|
|
322
|
+
处理: type=init,summary 建议"项目初始化"
|
|
323
|
+
|
|
324
|
+
功能分支:
|
|
325
|
+
判定: 根据分支命名约定判断(如 feature/*, fix/* 等)
|
|
326
|
+
处理: 推送后提示创建 PR
|
|
327
|
+
|
|
328
|
+
破坏性变更:
|
|
329
|
+
特征: 删除公共 API、修改数据结构等
|
|
330
|
+
处理: type 后添加 !,footer 添加 BREAKING CHANGE
|
|
331
|
+
|
|
332
|
+
回滚:
|
|
333
|
+
触发: 用户说"回滚上次提交"
|
|
334
|
+
处理: 执行 git revert HEAD,type=revert
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### 远程推送
|
|
338
|
+
|
|
339
|
+
```yaml
|
|
340
|
+
推送前检查(自动):
|
|
341
|
+
执行: git fetch origin
|
|
342
|
+
执行: git rev-list --count HEAD..origin/{branch}(远程领先数)
|
|
343
|
+
执行: git rev-list --count origin/{branch}..HEAD(本地领先数)
|
|
344
|
+
|
|
345
|
+
自动处理:
|
|
346
|
+
远程领先(有新提交):
|
|
347
|
+
自动执行 git pull --rebase
|
|
348
|
+
成功: 继续推送
|
|
349
|
+
有冲突: 输出冲突信息,提示手动处理,流程结束
|
|
350
|
+
|
|
351
|
+
本地领先(可推送):
|
|
352
|
+
执行: git push origin {branch}
|
|
353
|
+
|
|
354
|
+
分叉状态:
|
|
355
|
+
自动执行 git pull --rebase
|
|
356
|
+
有冲突: 输出冲突信息,提示手动处理,流程结束
|
|
357
|
+
|
|
358
|
+
推送失败处理: 根据错误信息分析原因并提示用户
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
### 排除文件
|
|
362
|
+
|
|
363
|
+
```yaml
|
|
364
|
+
不纳入提交信息描述(仍会被提交):
|
|
365
|
+
根据常识判断辅助性文件(如根目录文档、配置文件等)
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
### 提交粒度原则
|
|
369
|
+
|
|
370
|
+
```yaml
|
|
371
|
+
单一职责: 单次提交只做一类变更
|
|
372
|
+
可构建原则: 每个提交应可独立构建
|
|
373
|
+
禁止混入: 无关格式化、临时调试代码、未完成功能
|
|
374
|
+
```
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# ~exec 命令 - 执行方案包
|
|
2
|
+
|
|
3
|
+
本模块定义执行方案包命令的执行规则。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 命令说明
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
命令: ~exec [<方案包名称>]
|
|
11
|
+
类型: 目标选择类
|
|
12
|
+
功能: 直接执行 plan/ 目录中的方案包,跳过需求评估和方案设计
|
|
13
|
+
模式: STAGE_ENTRY_MODE = DIRECT
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 执行模式适配
|
|
19
|
+
|
|
20
|
+
> 📌 规则引用: 按 G4 路由架构及 G5 执行模式规则执行
|
|
21
|
+
|
|
22
|
+
<mode_adaptation>
|
|
23
|
+
~exec 模式适配规则:
|
|
24
|
+
1. 本命令使用 DIRECT 入口模式,跳过评估和设计阶段
|
|
25
|
+
2. 默认保持 INTERACTIVE 工作流模式
|
|
26
|
+
3. 直接从方案包进入开发实施阶段
|
|
27
|
+
4. Overview 类型方案包需特殊处理(归档而非执行)
|
|
28
|
+
</mode_adaptation>
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 执行流程
|
|
33
|
+
|
|
34
|
+
### 步骤1: 设置状态变量
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
执行内容:
|
|
38
|
+
- STAGE_ENTRY_MODE = DIRECT
|
|
39
|
+
- WORKFLOW_MODE = INTERACTIVE(保持默认)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 步骤2: 扫描方案包
|
|
43
|
+
|
|
44
|
+
> 脚本路径、存在性检查、错误恢复规则见 references/rules/tools.md
|
|
45
|
+
|
|
46
|
+
**脚本调用:** `list_packages.py`
|
|
47
|
+
|
|
48
|
+
<package_scan_analysis>
|
|
49
|
+
方案包扫描推理过程:
|
|
50
|
+
1. 扫描 helloagents/plan/ 目录
|
|
51
|
+
2. 统计有效方案包数量
|
|
52
|
+
3. 根据数量和命令参数决定选择策略
|
|
53
|
+
</package_scan_analysis>
|
|
54
|
+
|
|
55
|
+
```yaml
|
|
56
|
+
扫描范围: helloagents/plan/ 目录
|
|
57
|
+
|
|
58
|
+
判断处理:
|
|
59
|
+
0个方案包: 按 G3 场景内容规则(错误)输出,流程终止
|
|
60
|
+
1个方案包: 自动选择,设置 CURRENT_PACKAGE
|
|
61
|
+
多个方案包:
|
|
62
|
+
- 如命令指定了方案包名称: 匹配并选择
|
|
63
|
+
- 如未指定: 按 G3 场景内容规则(确认)输出,等待用户选择
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 步骤3: 验证方案包完整性
|
|
67
|
+
|
|
68
|
+
<package_validation_analysis>
|
|
69
|
+
方案包验证推理过程:
|
|
70
|
+
1. 检查 proposal.md 存在性和非空性
|
|
71
|
+
2. 检查 tasks.md 存在性和任务项数量
|
|
72
|
+
3. 判定方案包是否满足执行条件
|
|
73
|
+
</package_validation_analysis>
|
|
74
|
+
|
|
75
|
+
```yaml
|
|
76
|
+
检查必需文件:
|
|
77
|
+
- proposal.md(存在且非空)
|
|
78
|
+
- tasks.md(存在且至少1个任务项)
|
|
79
|
+
|
|
80
|
+
验证失败: 按 G3 场景内容规则(错误)输出,流程终止
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 步骤4: 检查方案包类型
|
|
84
|
+
|
|
85
|
+
<package_type_analysis>
|
|
86
|
+
方案包类型判定推理过程:
|
|
87
|
+
1. 读取 proposal.md 内容
|
|
88
|
+
2. 识别方案包类型(implementation/overview)
|
|
89
|
+
3. 根据类型决定后续处理路径
|
|
90
|
+
</package_type_analysis>
|
|
91
|
+
|
|
92
|
+
```yaml
|
|
93
|
+
读取: proposal.md 判断类型
|
|
94
|
+
|
|
95
|
+
implementation 类型: 继续执行开发实施
|
|
96
|
+
overview 类型: 按"Overview 类型处理"规则执行
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 步骤5: 开发实施
|
|
100
|
+
|
|
101
|
+
```yaml
|
|
102
|
+
执行规则: 读取并执行 references/stages/develop.md
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 步骤6: 流程级验收
|
|
106
|
+
|
|
107
|
+
```yaml
|
|
108
|
+
执行规则: 按 G9 "流程级验收规则" 执行(验收内容详见 G9)
|
|
109
|
+
|
|
110
|
+
遗留方案包扫描:
|
|
111
|
+
执行规则: 按 G7 "遗留方案包扫描" 执行
|
|
112
|
+
扫描时机: 流程即将结束时
|
|
113
|
+
显示条件: 检测到≥1个遗留方案包
|
|
114
|
+
详细规则: 参考 references/rules/package.md "遗留方案包处理"
|
|
115
|
+
|
|
116
|
+
完成后: 按 G3 场景内容规则(完成)输出执行命令结果(含验收报告)
|
|
117
|
+
执行: 按 G7 状态重置协议执行
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Overview 类型处理
|
|
123
|
+
|
|
124
|
+
> 📌 规则引用: 按 references/rules/package.md "Overview 类型方案包生命周期" 规则执行
|
|
125
|
+
|
|
126
|
+
```yaml
|
|
127
|
+
检测到 overview 类型方案包时:
|
|
128
|
+
按 G3 场景内容规则(确认)输出
|
|
129
|
+
|
|
130
|
+
内容要素: 方案包类型说明、操作选项(归档/查看/取消)
|
|
131
|
+
|
|
132
|
+
用户选择处理:
|
|
133
|
+
归档: 执行方案包迁移至 archive/
|
|
134
|
+
查看: 显示 proposal.md 内容,再次询问
|
|
135
|
+
取消: 按 G7 状态重置协议执行
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 不确定性处理
|
|
141
|
+
|
|
142
|
+
- plan/ 目录不存在 → 按 G3 场景内容规则(错误)输出,提示无方案包
|
|
143
|
+
- 方案包验证失败 → 输出具体缺失项,建议修复或重新规划
|
|
144
|
+
- 方案包类型无法识别 → 默认按 implementation 类型处理
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## 用户选择处理
|
|
149
|
+
|
|
150
|
+
> 本章节定义 ~exec 命令需要用户确认的场景,供 G3 输出格式统一提取。
|
|
151
|
+
|
|
152
|
+
### 场景: 方案包选择(多个方案包)
|
|
153
|
+
|
|
154
|
+
```yaml
|
|
155
|
+
内容要素:
|
|
156
|
+
- 方案包列表: plan/ 目录下的方案包清单(名称、创建时间、类型)
|
|
157
|
+
- 方案包摘要: 每个方案包的简要描述
|
|
158
|
+
|
|
159
|
+
选项:
|
|
160
|
+
选择方案包N: 选择对应序号的方案包执行
|
|
161
|
+
取消: 按 G7 状态重置协议执行
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### 场景: Overview类型方案包处理
|
|
165
|
+
|
|
166
|
+
> 📌 规则引用: 按 references/rules/package.md "用户选择处理 - Overview类型方案包处理" 执行
|
|
167
|
+
|
|
168
|
+
### 场景: 流程级验收完成
|
|
169
|
+
|
|
170
|
+
```yaml
|
|
171
|
+
内容要素:
|
|
172
|
+
- 验收状态: 通过/部分通过/失败
|
|
173
|
+
- 交付物摘要: 方案包、代码变更、知识库状态
|
|
174
|
+
- 需求符合性: 已完成任务/未完成任务
|
|
175
|
+
- 问题汇总: 警告和信息性记录(如有)
|
|
176
|
+
|
|
177
|
+
输出格式: 按 G3 场景内容规则(完成)输出
|
|
178
|
+
```
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# ~help 命令 - 显示帮助
|
|
2
|
+
|
|
3
|
+
本模块定义帮助命令的输出内容。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 命令说明
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
命令: ~help
|
|
11
|
+
类型: 直接执行类
|
|
12
|
+
功能: 显示帮助信息,无需确认或评估,直接输出帮助内容
|
|
13
|
+
触发: 用户输入包含 ~help 或 ~?
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 执行模式适配
|
|
19
|
+
|
|
20
|
+
> 📌 规则引用: 按 G4 路由架构及 G5 执行模式规则执行
|
|
21
|
+
|
|
22
|
+
<mode_adaptation>
|
|
23
|
+
~help 模式适配规则:
|
|
24
|
+
1. 本命令为直接执行类,无需用户确认
|
|
25
|
+
2. 不受任何工作流模式影响
|
|
26
|
+
3. 检测上下文后直接输出帮助内容
|
|
27
|
+
4. 输出后保持待命状态,无状态变量设置
|
|
28
|
+
</mode_adaptation>
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 执行流程
|
|
33
|
+
|
|
34
|
+
### 步骤1: 上下文检测
|
|
35
|
+
|
|
36
|
+
<context_analysis>
|
|
37
|
+
上下文检测推理过程:
|
|
38
|
+
1. 检测用户输入是否携带上下文(疑问、困惑、请求等)
|
|
39
|
+
2. 如有上下文,准备简短回应用户的问题或情绪
|
|
40
|
+
3. 根据上下文调整下一步建议的针对性
|
|
41
|
+
</context_analysis>
|
|
42
|
+
|
|
43
|
+
```yaml
|
|
44
|
+
执行内容:
|
|
45
|
+
- 检测用户输入是否携带上下文(疑问、困惑、请求等)
|
|
46
|
+
- 如有上下文,准备简短回应用户的问题或情绪
|
|
47
|
+
- 根据上下文调整下一步建议的针对性
|
|
48
|
+
|
|
49
|
+
目标: 友好引导,帮助用户快速上手
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 步骤2: 输出帮助信息
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
执行内容:
|
|
56
|
+
- 如步骤1检测到上下文,先简短回应
|
|
57
|
+
- 按下方"输出模板"输出帮助内容
|
|
58
|
+
- 按 G3 场景内容规则(直接回答)格式化输出
|
|
59
|
+
|
|
60
|
+
说明: 此命令为原子操作,无状态变量设置,输出后保持待命状态
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 输出模板
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
💡【HelloAGENTS】- 使用帮助
|
|
69
|
+
|
|
70
|
+
{如用户输入携带上下文,先简短回应}
|
|
71
|
+
|
|
72
|
+
智能工作流系统,提供结构化任务流程。
|
|
73
|
+
|
|
74
|
+
### 可用命令
|
|
75
|
+
|
|
76
|
+
| 命令 | 功能 | 说明 |
|
|
77
|
+
|------|------|------|
|
|
78
|
+
| `~auto` | 全授权命令 | 根据复杂度自动选择模式执行 |
|
|
79
|
+
| `~plan` | 执行到方案设计 | 仅轻量迭代/标准开发模式 |
|
|
80
|
+
| `~exec` | 执行方案包 | 执行已有的方案包 |
|
|
81
|
+
| `~init` | 初始化知识库 | 扫描代码库创建知识库 |
|
|
82
|
+
| `~upgrade` | 升级知识库 | 升级知识库结构 |
|
|
83
|
+
| `~clean` | 清理遗留方案包 | 清理未执行的方案包 |
|
|
84
|
+
| `~commit` | Git 提交 | 智能生成提交信息并执行提交 |
|
|
85
|
+
| `~test` | 运行测试 | 运行测试并分析结果 |
|
|
86
|
+
| `~review` | 代码审查 | AI辅助代码审查 |
|
|
87
|
+
| `~validate` | 验证知识库 | 验证知识库和方案包 |
|
|
88
|
+
| `~rollback` | 智能回滚 | 回滚最近的变更 |
|
|
89
|
+
| `~help` | 显示帮助 | 显示此帮助信息 |
|
|
90
|
+
|
|
91
|
+
### 工作流程
|
|
92
|
+
|
|
93
|
+
需求评估 → 复杂度判定 → 对应模式执行
|
|
94
|
+
- 微调模式: 直接执行 → 知识库(KB)同步
|
|
95
|
+
- 轻量迭代: 项目分析 → 方案设计 → 开发实施 → 方案包归档
|
|
96
|
+
- 标准开发: 项目分析 → 方案设计(含多方案对比)→ 开发实施 → 方案包归档
|
|
97
|
+
|
|
98
|
+
### 使用方式
|
|
99
|
+
|
|
100
|
+
- 输入 `~命令` 执行特定功能
|
|
101
|
+
- 直接描述需求,系统自动路由到合适的流程
|
|
102
|
+
|
|
103
|
+
────
|
|
104
|
+
🔄 下一步: {根据上下文提供针对性建议,无上下文时使用通用建议}
|
|
105
|
+
```
|