agent-configs 1.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 +223 -0
- package/agents/architect.md +211 -0
- package/agents/code-reviewer.md +104 -0
- package/agents/planner.md +119 -0
- package/agents/refactor-cleaner.md +306 -0
- package/agents/security-reviewer.md +545 -0
- package/agents/tdd-guide.md +280 -0
- package/bundles/bk-chat-bundle/README.md +48 -0
- package/bundles/bk-chat-bundle/manifest.json +10 -0
- package/bundles/continuous-learning/.claude/commands/evolve.md +190 -0
- package/bundles/continuous-learning/.claude/commands/instinct-status.md +64 -0
- package/bundles/continuous-learning/.claude/commands/learn.md +83 -0
- package/bundles/continuous-learning/.claude/hooks/learning-end.js +85 -0
- package/bundles/continuous-learning/.claude/hooks/observe.js +131 -0
- package/bundles/continuous-learning/.claude/lib/learning.js +559 -0
- package/bundles/continuous-learning/.claude/lib/utils.js +312 -0
- package/bundles/continuous-learning/.claude/skills/continuous-learning/SKILL.md +200 -0
- package/bundles/continuous-learning/.cursor/hooks/learning-end.js +102 -0
- package/bundles/continuous-learning/.cursor/rules/continuous-learning.mdc +34 -0
- package/bundles/continuous-learning/.cursor/skills/continuous-learning/SKILL.md +77 -0
- package/bundles/continuous-learning/README.md +159 -0
- package/bundles/continuous-learning/manifest.json +51 -0
- package/bundles/planning-bundle/README.md +34 -0
- package/bundles/planning-bundle/manifest.json +10 -0
- package/bundles/review-bundle/README.md +43 -0
- package/bundles/review-bundle/manifest.json +11 -0
- package/bundles/shared-memory/.claude/commands/list-sessions.md +124 -0
- package/bundles/shared-memory/.claude/commands/load-session.md +169 -0
- package/bundles/shared-memory/.claude/commands/save-session.md +137 -0
- package/bundles/shared-memory/.claude/hooks/memory-compact.js +43 -0
- package/bundles/shared-memory/.claude/hooks/memory-end.js +42 -0
- package/bundles/shared-memory/.claude/hooks/memory-start.js +59 -0
- package/bundles/shared-memory/.claude/lib/memory.js +416 -0
- package/bundles/shared-memory/.claude/lib/utils.js +209 -0
- package/bundles/shared-memory/.claude/skills/shared-memory/SKILL.md +183 -0
- package/bundles/shared-memory/.cursor/hooks/memory-start.js +42 -0
- package/bundles/shared-memory/.cursor/rules/shared-memory.mdc +37 -0
- package/bundles/shared-memory/.cursor/skills/shared-memory/SKILL.md +183 -0
- package/bundles/tdd-bundle/README.md +33 -0
- package/bundles/tdd-bundle/manifest.json +10 -0
- package/cli.js +978 -0
- package/commands/build-fix.md +29 -0
- package/commands/code-review.md +40 -0
- package/commands/e2e.md +363 -0
- package/commands/learn.md +114 -0
- package/commands/plan.md +113 -0
- package/commands/refactor-clean.md +28 -0
- package/commands/tdd.md +326 -0
- package/commands/test-coverage.md +27 -0
- package/commands/update-codemaps.md +17 -0
- package/commands/update-docs.md +31 -0
- package/configs.json +158 -0
- package/hooks/hooks.json +101 -0
- package/package.json +58 -0
- package/rules/agents.md +49 -0
- package/rules/coding-style.md +70 -0
- package/rules/git-workflow.md +45 -0
- package/rules/hooks.md +46 -0
- package/rules/patterns.md +55 -0
- package/rules/performance.md +47 -0
- package/rules/security.md +36 -0
- package/rules/testing.md +30 -0
- package/skills/ai-config-architect/SKILL.md +59 -0
- package/skills/ai-config-architect/references/agents.md +77 -0
- package/skills/ai-config-architect/references/commands.md +66 -0
- package/skills/ai-config-architect/references/hooks.md +70 -0
- package/skills/ai-config-architect/references/patterns.md +66 -0
- package/skills/ai-config-architect/references/platforms.md +82 -0
- package/skills/ai-config-architect/references/rules.md +66 -0
- package/skills/ai-config-architect/references/skills.md +67 -0
- package/skills/bk-chat-helper/SKILL.md +398 -0
- package/skills/bk-chat-helper/references/api-reference.md +606 -0
- package/skills/bk-chat-helper/references/examples.md +789 -0
- package/skills/bk-chat-helper/references/integration-guide.md +583 -0
- package/skills/bk-chat-x/SKILL.md +400 -0
- package/skills/bk-chat-x/references/components-api.md +340 -0
- package/skills/bk-chat-x/references/examples.md +386 -0
- package/skills/bk-chat-x/references/shortcuts-guide.md +375 -0
- package/skills/coding-standards/SKILL.md +523 -0
- package/skills/security-review/SKILL.md +497 -0
- package/skills/security-review/references/cloud-infrastructure-security.md +361 -0
- package/skills/strategic-compact/SKILL.md +66 -0
- package/skills/strategic-compact/scripts/suggest-compact.sh +52 -0
- package/skills/tdd-workflow/SKILL.md +412 -0
- package/skills/verification-loop/SKILL.md +128 -0
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
# 快捷指令配置指南
|
|
2
|
+
|
|
3
|
+
## Shortcut 类型定义
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
interface Shortcut {
|
|
7
|
+
id: string; // 唯一标识
|
|
8
|
+
name: string; // 显示名称
|
|
9
|
+
description?: string; // 描述
|
|
10
|
+
icon?: string | VNode | ((h) => Component | VNode); // 图标
|
|
11
|
+
components?: ShortcutComponent[]; // 表单组件配置
|
|
12
|
+
formModel?: Record<string, unknown>; // 表单初始值
|
|
13
|
+
}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 基础快捷指令
|
|
17
|
+
|
|
18
|
+
不带表单的简单快捷指令:
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
const shortcuts: Shortcut[] = [
|
|
22
|
+
{ id: 'ask', name: '问问小鲸' },
|
|
23
|
+
{ id: 'translate', name: '翻译' },
|
|
24
|
+
{ id: 'explain', name: '解释' },
|
|
25
|
+
{ id: 'summarize', name: '总结' },
|
|
26
|
+
];
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## 带图标的快捷指令
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import { ThinkingIcon, CopyIcon } from '@blueking/chat-x';
|
|
33
|
+
|
|
34
|
+
const shortcuts: Shortcut[] = [
|
|
35
|
+
{
|
|
36
|
+
id: 'ask',
|
|
37
|
+
name: '问问小鲸',
|
|
38
|
+
icon: ThinkingIcon, // 组件图标
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 'translate',
|
|
42
|
+
name: '翻译',
|
|
43
|
+
icon: '🌐', // 字符串图标
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'code',
|
|
47
|
+
name: '代码生成',
|
|
48
|
+
icon: () => CopyIcon, // 函数返回组件
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 带表单的快捷指令
|
|
54
|
+
|
|
55
|
+
### ShortcutComponent 类型
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
interface ShortcutComponent {
|
|
59
|
+
type: 'input' | 'text' | 'textarea' | 'number' | 'select' | 'radioGroup' | 'checkboxGroup' | 'switcher';
|
|
60
|
+
key: string; // 表单字段 key
|
|
61
|
+
name?: string; // 字段标签
|
|
62
|
+
default?: unknown; // 默认值
|
|
63
|
+
fillBack?: boolean; // 是否回填选中文本
|
|
64
|
+
fillRegx?: RegExp; // 回填内容正则验证
|
|
65
|
+
props?: Record<string, any>; // 组件 props
|
|
66
|
+
formItemProps?: Record<string, any>; // FormItem props
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 表单组件类型
|
|
71
|
+
|
|
72
|
+
| type | 说明 | 对应 bkui-vue 组件 |
|
|
73
|
+
|------|------|-------------------|
|
|
74
|
+
| `input` | 单行输入框 | Input |
|
|
75
|
+
| `text` | 单行输入框 (同 input) | Input |
|
|
76
|
+
| `textarea` | 多行文本框 | Input[type=textarea] |
|
|
77
|
+
| `number` | 数字输入框 | Input[type=number] |
|
|
78
|
+
| `select` | 下拉选择 | Select |
|
|
79
|
+
| `radioGroup` | 单选组 | Radio.Group |
|
|
80
|
+
| `checkboxGroup` | 多选组 | Checkbox.Group |
|
|
81
|
+
| `switcher` | 开关 | Switcher |
|
|
82
|
+
|
|
83
|
+
### 完整示例
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
const shortcuts: Shortcut[] = [
|
|
87
|
+
{
|
|
88
|
+
id: 'translate',
|
|
89
|
+
name: '翻译',
|
|
90
|
+
description: '将选中文本翻译成目标语言',
|
|
91
|
+
components: [
|
|
92
|
+
// 下拉选择
|
|
93
|
+
{
|
|
94
|
+
type: 'select',
|
|
95
|
+
key: 'targetLang',
|
|
96
|
+
name: '目标语言',
|
|
97
|
+
default: 'en',
|
|
98
|
+
props: {
|
|
99
|
+
options: [
|
|
100
|
+
{ label: '英文', value: 'en' },
|
|
101
|
+
{ label: '中文', value: 'zh' },
|
|
102
|
+
{ label: '日文', value: 'ja' },
|
|
103
|
+
{ label: '韩文', value: 'ko' },
|
|
104
|
+
],
|
|
105
|
+
clearable: false,
|
|
106
|
+
},
|
|
107
|
+
formItemProps: {
|
|
108
|
+
required: true,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
// 多行文本 (回填选中文本)
|
|
112
|
+
{
|
|
113
|
+
type: 'textarea',
|
|
114
|
+
key: 'content',
|
|
115
|
+
name: '翻译内容',
|
|
116
|
+
fillBack: true, // 自动填充选中的文本
|
|
117
|
+
props: {
|
|
118
|
+
rows: 4,
|
|
119
|
+
placeholder: '请输入要翻译的内容',
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
formModel: {
|
|
124
|
+
targetLang: 'en',
|
|
125
|
+
content: '',
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
{
|
|
130
|
+
id: 'code-gen',
|
|
131
|
+
name: '代码生成',
|
|
132
|
+
components: [
|
|
133
|
+
// 单行输入
|
|
134
|
+
{
|
|
135
|
+
type: 'input',
|
|
136
|
+
key: 'language',
|
|
137
|
+
name: '编程语言',
|
|
138
|
+
default: 'JavaScript',
|
|
139
|
+
props: {
|
|
140
|
+
placeholder: '如:JavaScript、Python',
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
// 数字输入
|
|
144
|
+
{
|
|
145
|
+
type: 'number',
|
|
146
|
+
key: 'maxLines',
|
|
147
|
+
name: '最大行数',
|
|
148
|
+
default: 50,
|
|
149
|
+
props: {
|
|
150
|
+
min: 1,
|
|
151
|
+
max: 500,
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
// 单选组
|
|
155
|
+
{
|
|
156
|
+
type: 'radioGroup',
|
|
157
|
+
key: 'style',
|
|
158
|
+
name: '代码风格',
|
|
159
|
+
default: 'concise',
|
|
160
|
+
props: {
|
|
161
|
+
options: [
|
|
162
|
+
{ label: '简洁', value: 'concise' },
|
|
163
|
+
{ label: '详细', value: 'detailed' },
|
|
164
|
+
],
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
// 多选组
|
|
168
|
+
{
|
|
169
|
+
type: 'checkboxGroup',
|
|
170
|
+
key: 'features',
|
|
171
|
+
name: '包含功能',
|
|
172
|
+
default: ['comments'],
|
|
173
|
+
props: {
|
|
174
|
+
options: [
|
|
175
|
+
{ label: '注释', value: 'comments' },
|
|
176
|
+
{ label: '错误处理', value: 'error-handling' },
|
|
177
|
+
{ label: '类型定义', value: 'types' },
|
|
178
|
+
],
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
// 开关
|
|
182
|
+
{
|
|
183
|
+
type: 'switcher',
|
|
184
|
+
key: 'async',
|
|
185
|
+
name: '异步函数',
|
|
186
|
+
default: false,
|
|
187
|
+
},
|
|
188
|
+
// 描述文本
|
|
189
|
+
{
|
|
190
|
+
type: 'textarea',
|
|
191
|
+
key: 'description',
|
|
192
|
+
name: '功能描述',
|
|
193
|
+
fillBack: true,
|
|
194
|
+
props: {
|
|
195
|
+
rows: 4,
|
|
196
|
+
placeholder: '请详细描述需要生成的代码功能',
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
{
|
|
203
|
+
id: 'trace-analysis',
|
|
204
|
+
name: 'Trace 分析',
|
|
205
|
+
components: [
|
|
206
|
+
{
|
|
207
|
+
type: 'text',
|
|
208
|
+
key: 'project_name',
|
|
209
|
+
name: '项目名称',
|
|
210
|
+
default: '',
|
|
211
|
+
placeholder: '请输入项目名称',
|
|
212
|
+
required: true,
|
|
213
|
+
fillBack: true,
|
|
214
|
+
fillRegx: /^[a-zA-Z0-9]+$/, // 回填内容验证
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
type: 'number',
|
|
218
|
+
key: 'quantity',
|
|
219
|
+
name: '数量',
|
|
220
|
+
default: '10',
|
|
221
|
+
min: 1,
|
|
222
|
+
max: 100,
|
|
223
|
+
required: true,
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
type: 'select',
|
|
227
|
+
key: 'project_type',
|
|
228
|
+
name: '项目类型',
|
|
229
|
+
required: true,
|
|
230
|
+
options: [
|
|
231
|
+
{ label: '类型A', value: 'A' },
|
|
232
|
+
{ label: '类型B', value: 'B' },
|
|
233
|
+
],
|
|
234
|
+
},
|
|
235
|
+
],
|
|
236
|
+
},
|
|
237
|
+
];
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## 使用快捷指令
|
|
241
|
+
|
|
242
|
+
### 在 ChatInput 中使用
|
|
243
|
+
|
|
244
|
+
```vue
|
|
245
|
+
<template>
|
|
246
|
+
<ChatInput
|
|
247
|
+
v-model="input"
|
|
248
|
+
:shortcuts="shortcuts"
|
|
249
|
+
:shortcut-id="selectedShortcutId"
|
|
250
|
+
@select-shortcut="handleSelectShortcut"
|
|
251
|
+
@delete-shortcut="handleDeleteShortcut"
|
|
252
|
+
/>
|
|
253
|
+
</template>
|
|
254
|
+
|
|
255
|
+
<script setup lang="ts">
|
|
256
|
+
const selectedShortcutId = ref<string | null>(null);
|
|
257
|
+
|
|
258
|
+
const handleSelectShortcut = (shortcut: Shortcut, text?: string) => {
|
|
259
|
+
selectedShortcutId.value = shortcut.id;
|
|
260
|
+
|
|
261
|
+
// 如果有表单组件,显示 ShortcutRender
|
|
262
|
+
if (shortcut.components?.length) {
|
|
263
|
+
showShortcutForm.value = true;
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
const handleDeleteShortcut = () => {
|
|
268
|
+
selectedShortcutId.value = null;
|
|
269
|
+
};
|
|
270
|
+
</script>
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### 配合 ShortcutRender 使用
|
|
274
|
+
|
|
275
|
+
```vue
|
|
276
|
+
<template>
|
|
277
|
+
<!-- 快捷指令表单与输入框互斥 -->
|
|
278
|
+
<ShortcutRender
|
|
279
|
+
v-if="selectedShortcut?.components?.length"
|
|
280
|
+
:name="selectedShortcut.name"
|
|
281
|
+
:components="selectedShortcut.components"
|
|
282
|
+
:form-model="selectedShortcut.formModel"
|
|
283
|
+
@close="handleCloseShortcut"
|
|
284
|
+
@submit="handleSubmitShortcut"
|
|
285
|
+
/>
|
|
286
|
+
<ChatInput
|
|
287
|
+
v-else
|
|
288
|
+
v-model="input"
|
|
289
|
+
:shortcuts="shortcuts"
|
|
290
|
+
:shortcut-id="selectedShortcut?.id"
|
|
291
|
+
@select-shortcut="handleSelectShortcut"
|
|
292
|
+
/>
|
|
293
|
+
</template>
|
|
294
|
+
|
|
295
|
+
<script setup lang="ts">
|
|
296
|
+
const selectedShortcut = ref<Shortcut | null>(null);
|
|
297
|
+
|
|
298
|
+
const handleSelectShortcut = (shortcut: Shortcut, text?: string) => {
|
|
299
|
+
// 如果有 fillBack 的组件,填充选中文本
|
|
300
|
+
if (shortcut.components?.length && text) {
|
|
301
|
+
const fillBackComponent = shortcut.components.find(c => c.fillBack);
|
|
302
|
+
if (fillBackComponent) {
|
|
303
|
+
shortcut.formModel = {
|
|
304
|
+
...shortcut.formModel,
|
|
305
|
+
[fillBackComponent.key]: text,
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
selectedShortcut.value = shortcut;
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
const handleCloseShortcut = () => {
|
|
313
|
+
selectedShortcut.value = null;
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
const handleSubmitShortcut = (formModel: Record<string, unknown>) => {
|
|
317
|
+
console.log('提交快捷指令:', selectedShortcut.value?.id, formModel);
|
|
318
|
+
|
|
319
|
+
// 构造消息发送
|
|
320
|
+
const message = buildMessageFromShortcut(selectedShortcut.value, formModel);
|
|
321
|
+
sendMessage(message);
|
|
322
|
+
|
|
323
|
+
selectedShortcut.value = null;
|
|
324
|
+
};
|
|
325
|
+
</script>
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### 在 AiSelection 中使用
|
|
329
|
+
|
|
330
|
+
```vue
|
|
331
|
+
<template>
|
|
332
|
+
<AiSelection
|
|
333
|
+
v-model:visible="visible"
|
|
334
|
+
:shortcuts="shortcuts"
|
|
335
|
+
:max-shortcut-count="3"
|
|
336
|
+
@select-shortcut="handleSelectShortcut"
|
|
337
|
+
/>
|
|
338
|
+
</template>
|
|
339
|
+
|
|
340
|
+
<script setup lang="ts">
|
|
341
|
+
const handleSelectShortcut = (shortcut: Shortcut, selectedText: string) => {
|
|
342
|
+
// 无表单的快捷指令直接执行
|
|
343
|
+
if (!shortcut.components?.length) {
|
|
344
|
+
executeShortcut(shortcut, selectedText);
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// 有表单的快捷指令,预填充选中文本后显示表单
|
|
349
|
+
const fillBackComponent = shortcut.components.find(c => c.fillBack);
|
|
350
|
+
if (fillBackComponent) {
|
|
351
|
+
shortcut.formModel = {
|
|
352
|
+
...shortcut.formModel,
|
|
353
|
+
[fillBackComponent.key]: selectedText,
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
selectedShortcut.value = shortcut;
|
|
357
|
+
};
|
|
358
|
+
</script>
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
## 表单布局规则
|
|
362
|
+
|
|
363
|
+
ShortcutRender 使用两列网格布局:
|
|
364
|
+
|
|
365
|
+
- `textarea` 类型组件自动占据整行
|
|
366
|
+
- 最后一个组件如果是奇数位置,自动占据整行
|
|
367
|
+
- 提交按钮区域固定在底部
|
|
368
|
+
|
|
369
|
+
## 最佳实践
|
|
370
|
+
|
|
371
|
+
1. **ID 唯一性**:确保每个 shortcut 的 id 唯一
|
|
372
|
+
2. **fillBack 使用**:只给需要回填选中文本的组件设置 `fillBack: true`
|
|
373
|
+
3. **默认值**:为表单组件设置合理的默认值
|
|
374
|
+
4. **验证规则**:使用 `formItemProps.required` 设置必填项
|
|
375
|
+
5. **图标一致性**:使用组件库提供的图标保持风格统一
|