ai-engineering-init 1.3.4 → 1.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/.claude/hooks/skill-forced-eval.js +2 -0
- package/.claude/settings.json +3 -3
- package/.claude/skills/add-skill/SKILL.md +79 -32
- package/.claude/skills/api-development/SKILL.md +83 -377
- package/.claude/skills/architecture-design/SKILL.md +138 -632
- package/.claude/skills/backend-annotations/SKILL.md +134 -506
- package/.claude/skills/banana-image/SKILL.md +10 -3
- package/.claude/skills/brainstorm/SKILL.md +103 -535
- package/.claude/skills/bug-detective/SKILL.md +147 -1097
- package/.claude/skills/bug-detective/references/error-patterns.md +242 -0
- package/.claude/skills/code-patterns/SKILL.md +116 -426
- package/.claude/skills/code-patterns/references/leniu-code-patterns.md +87 -0
- package/.claude/skills/crud-development/SKILL.md +64 -304
- package/.claude/skills/data-permission/SKILL.md +105 -412
- package/.claude/skills/data-permission/references/custom-data-scope.md +90 -0
- package/.claude/skills/file-oss-management/SKILL.md +106 -714
- package/.claude/skills/file-oss-management/references/entities.md +105 -0
- package/.claude/skills/file-oss-management/references/service-impl.md +104 -0
- package/.claude/skills/leniu-api-development/SKILL.md +142 -626
- package/.claude/skills/leniu-api-development/references/real-examples.md +273 -0
- package/.claude/skills/leniu-architecture-design/SKILL.md +176 -391
- package/.claude/skills/leniu-backend-annotations/SKILL.md +132 -519
- package/.claude/skills/leniu-brainstorm/SKILL.md +132 -541
- package/.claude/skills/leniu-brainstorm/references/business-scenarios.md +162 -0
- package/.claude/skills/leniu-crud-development/SKILL.md +232 -938
- package/.claude/skills/leniu-crud-development/references/templates.md +597 -0
- package/.claude/skills/leniu-customization-location/SKILL.md +410 -0
- package/.claude/skills/leniu-data-permission/SKILL.md +70 -0
- package/.claude/skills/leniu-java-entity/SKILL.md +76 -590
- package/.claude/skills/leniu-java-entity/references/templates.md +237 -0
- package/.claude/skills/leniu-java-export/SKILL.md +94 -379
- package/.claude/skills/leniu-java-logging/SKILL.md +106 -709
- package/.claude/skills/leniu-java-logging/references/data-mask.md +46 -0
- package/.claude/skills/leniu-java-logging/references/logging-scenarios.md +113 -0
- package/.claude/skills/leniu-java-mybatis/SKILL.md +73 -446
- package/.claude/skills/leniu-java-mybatis/references/report-mapper.md +88 -0
- package/.claude/skills/leniu-report-customization/SKILL.md +111 -365
- package/.claude/skills/leniu-report-customization/references/table-fields.md +93 -0
- package/.claude/skills/leniu-report-standard-customization/SKILL.md +111 -334
- package/.claude/skills/leniu-report-standard-customization/references/analysis-module.md +64 -0
- package/.claude/skills/leniu-report-standard-customization/references/table-fields.md +113 -0
- package/.claude/skills/leniu-security-guard/SKILL.md +133 -347
- package/.claude/skills/mysql-debug/SKILL.md +364 -0
- package/.claude/skills/openspec-apply-change/SKILL.md +10 -1
- package/.claude/skills/openspec-archive-change/SKILL.md +9 -1
- package/.claude/skills/openspec-bulk-archive-change/SKILL.md +9 -1
- package/.claude/skills/openspec-continue-change/SKILL.md +9 -1
- package/.claude/skills/openspec-explore/SKILL.md +10 -1
- package/.claude/skills/openspec-ff-change/SKILL.md +9 -1
- package/.claude/skills/openspec-new-change/SKILL.md +9 -1
- package/.claude/skills/openspec-onboard/SKILL.md +15 -130
- package/.claude/skills/openspec-sync-specs/SKILL.md +9 -1
- package/.claude/skills/openspec-verify-change/SKILL.md +9 -1
- package/.claude/skills/performance-doctor/SKILL.md +110 -434
- package/.claude/skills/redis-cache/SKILL.md +89 -595
- package/.claude/skills/redis-cache/references/listeners.md +23 -0
- package/.claude/skills/scheduled-jobs/SKILL.md +88 -407
- package/.claude/skills/security-guard/SKILL.md +137 -532
- package/.claude/skills/security-guard/references/encrypt-config.md +103 -0
- package/.claude/skills/security-guard/references/sensitive-strategies.md +42 -0
- package/.claude/skills/sms-mail/SKILL.md +116 -574
- package/.claude/skills/sms-mail/references/mail-config.md +88 -0
- package/.claude/skills/sms-mail/references/sms-config.md +74 -0
- package/.claude/skills/social-login/SKILL.md +112 -514
- package/.claude/skills/social-login/references/provider-configs.md +118 -0
- package/.claude/skills/tenant-management/SKILL.md +129 -444
- package/.claude/skills/tenant-management/references/tenant-scenarios.md +91 -0
- package/.claude/skills/test-development/SKILL.md +86 -540
- package/.claude/skills/test-development/references/parameterized-examples.md +119 -0
- package/.claude/skills/utils-toolkit/SKILL.md +52 -305
- package/.claude/skills/utils-toolkit/references/redis-utils-api.md +56 -0
- package/.claude/skills/websocket-sse/SKILL.md +105 -550
- package/.claude/skills/workflow-engine/SKILL.md +147 -502
- package/.codex/skills/add-skill/SKILL.md +79 -32
- package/.codex/skills/api-development/SKILL.md +172 -599
- package/.codex/skills/architecture-design/SKILL.md +138 -504
- package/.codex/skills/backend-annotations/SKILL.md +134 -496
- package/.codex/skills/banana-image/SKILL.md +10 -3
- package/.codex/skills/brainstorm/SKILL.md +103 -535
- package/.codex/skills/bug-detective/SKILL.md +147 -1097
- package/.codex/skills/bug-detective/references/error-patterns.md +242 -0
- package/.codex/skills/code-patterns/SKILL.md +120 -282
- package/.codex/skills/code-patterns/references/leniu-code-patterns.md +87 -0
- package/.codex/skills/crud-development/SKILL.md +64 -292
- package/.codex/skills/data-permission/SKILL.md +108 -407
- package/.codex/skills/data-permission/references/custom-data-scope.md +90 -0
- package/.codex/skills/database-ops/SKILL.md +8 -154
- package/.codex/skills/error-handler/SKILL.md +10 -0
- package/.codex/skills/file-oss-management/SKILL.md +106 -714
- package/.codex/skills/file-oss-management/references/entities.md +105 -0
- package/.codex/skills/file-oss-management/references/service-impl.md +104 -0
- package/.codex/skills/git-workflow/SKILL.md +27 -5
- package/.codex/skills/leniu-api-development/SKILL.md +142 -626
- package/.codex/skills/leniu-api-development/references/real-examples.md +273 -0
- package/.codex/skills/leniu-architecture-design/SKILL.md +176 -391
- package/.codex/skills/leniu-backend-annotations/SKILL.md +132 -519
- package/.codex/skills/leniu-brainstorm/SKILL.md +132 -541
- package/.codex/skills/leniu-brainstorm/references/business-scenarios.md +162 -0
- package/.codex/skills/leniu-crud-development/SKILL.md +232 -938
- package/.codex/skills/leniu-crud-development/references/templates.md +597 -0
- package/.codex/skills/leniu-customization-location/SKILL.md +410 -0
- package/.codex/skills/leniu-data-permission/SKILL.md +70 -0
- package/.codex/skills/leniu-java-code-style/SKILL.md +510 -0
- package/.codex/skills/leniu-java-entity/SKILL.md +76 -590
- package/.codex/skills/leniu-java-entity/references/templates.md +237 -0
- package/.codex/skills/leniu-java-export/SKILL.md +94 -379
- package/.codex/skills/leniu-java-logging/SKILL.md +106 -709
- package/.codex/skills/leniu-java-logging/references/data-mask.md +46 -0
- package/.codex/skills/leniu-java-logging/references/logging-scenarios.md +113 -0
- package/.codex/skills/leniu-java-mybatis/SKILL.md +73 -446
- package/.codex/skills/leniu-java-mybatis/references/report-mapper.md +88 -0
- package/.codex/skills/leniu-report-customization/SKILL.md +111 -365
- package/.codex/skills/leniu-report-customization/references/table-fields.md +93 -0
- package/.codex/skills/leniu-report-standard-customization/SKILL.md +111 -334
- package/.codex/skills/leniu-report-standard-customization/references/analysis-module.md +64 -0
- package/.codex/skills/leniu-report-standard-customization/references/table-fields.md +113 -0
- package/.codex/skills/leniu-security-guard/SKILL.md +133 -347
- package/.codex/skills/mysql-debug/SKILL.md +364 -0
- package/.codex/skills/openspec-apply-change/SKILL.md +10 -1
- package/.codex/skills/openspec-archive-change/SKILL.md +9 -1
- package/.codex/skills/openspec-bulk-archive-change/SKILL.md +9 -1
- package/.codex/skills/openspec-continue-change/SKILL.md +9 -1
- package/.codex/skills/openspec-explore/SKILL.md +10 -1
- package/.codex/skills/openspec-ff-change/SKILL.md +9 -1
- package/.codex/skills/openspec-new-change/SKILL.md +9 -1
- package/.codex/skills/openspec-onboard/SKILL.md +15 -130
- package/.codex/skills/openspec-sync-specs/SKILL.md +9 -1
- package/.codex/skills/openspec-verify-change/SKILL.md +9 -1
- package/.codex/skills/performance-doctor/SKILL.md +110 -434
- package/.codex/skills/project-navigator/SKILL.md +20 -1
- package/.codex/skills/redis-cache/SKILL.md +93 -589
- package/.codex/skills/redis-cache/references/listeners.md +23 -0
- package/.codex/skills/scheduled-jobs/SKILL.md +88 -407
- package/.codex/skills/security-guard/SKILL.md +141 -527
- package/.codex/skills/security-guard/references/encrypt-config.md +103 -0
- package/.codex/skills/security-guard/references/sensitive-strategies.md +42 -0
- package/.codex/skills/sms-mail/SKILL.md +116 -574
- package/.codex/skills/sms-mail/references/mail-config.md +88 -0
- package/.codex/skills/sms-mail/references/sms-config.md +74 -0
- package/.codex/skills/social-login/SKILL.md +112 -514
- package/.codex/skills/social-login/references/provider-configs.md +118 -0
- package/.codex/skills/store-pc/SKILL.md +258 -383
- package/.codex/skills/tenant-management/SKILL.md +129 -444
- package/.codex/skills/tenant-management/references/tenant-scenarios.md +91 -0
- package/.codex/skills/test-development/SKILL.md +86 -540
- package/.codex/skills/test-development/references/parameterized-examples.md +119 -0
- package/.codex/skills/ui-pc/SKILL.md +350 -387
- package/.codex/skills/utils-toolkit/SKILL.md +52 -283
- package/.codex/skills/utils-toolkit/references/redis-utils-api.md +56 -0
- package/.codex/skills/websocket-sse/SKILL.md +105 -550
- package/.codex/skills/workflow-engine/SKILL.md +147 -502
- package/.cursor/hooks/cursor-skill-eval.js +53 -1
- package/.cursor/hooks.json +3 -3
- package/.cursor/skills/add-skill/SKILL.md +79 -32
- package/.cursor/skills/api-development/SKILL.md +83 -377
- package/.cursor/skills/architecture-design/SKILL.md +138 -632
- package/.cursor/skills/backend-annotations/SKILL.md +134 -506
- package/.cursor/skills/banana-image/SKILL.md +10 -3
- package/.cursor/skills/brainstorm/SKILL.md +103 -535
- package/.cursor/skills/bug-detective/SKILL.md +147 -1097
- package/.cursor/skills/bug-detective/references/error-patterns.md +242 -0
- package/.cursor/skills/code-patterns/SKILL.md +116 -426
- package/.cursor/skills/code-patterns/references/leniu-code-patterns.md +87 -0
- package/.cursor/skills/crud-development/SKILL.md +64 -304
- package/.cursor/skills/data-permission/SKILL.md +105 -412
- package/.cursor/skills/data-permission/references/custom-data-scope.md +90 -0
- package/.cursor/skills/file-oss-management/SKILL.md +106 -714
- package/.cursor/skills/file-oss-management/references/entities.md +105 -0
- package/.cursor/skills/file-oss-management/references/service-impl.md +104 -0
- package/.cursor/skills/git-workflow/SKILL.md +27 -5
- package/.cursor/skills/leniu-api-development/SKILL.md +142 -626
- package/.cursor/skills/leniu-api-development/references/real-examples.md +273 -0
- package/.cursor/skills/leniu-architecture-design/SKILL.md +176 -391
- package/.cursor/skills/leniu-backend-annotations/SKILL.md +132 -519
- package/.cursor/skills/leniu-brainstorm/SKILL.md +132 -541
- package/.cursor/skills/leniu-brainstorm/references/business-scenarios.md +162 -0
- package/.cursor/skills/leniu-crud-development/SKILL.md +232 -938
- package/.cursor/skills/leniu-crud-development/references/templates.md +597 -0
- package/.cursor/skills/leniu-customization-location/SKILL.md +410 -0
- package/.cursor/skills/leniu-data-permission/SKILL.md +70 -0
- package/.cursor/skills/leniu-java-code-style/SKILL.md +510 -0
- package/.cursor/skills/leniu-java-entity/SKILL.md +76 -590
- package/.cursor/skills/leniu-java-entity/references/templates.md +237 -0
- package/.cursor/skills/leniu-java-export/SKILL.md +94 -379
- package/.cursor/skills/leniu-java-logging/SKILL.md +106 -709
- package/.cursor/skills/leniu-java-logging/references/data-mask.md +46 -0
- package/.cursor/skills/leniu-java-logging/references/logging-scenarios.md +113 -0
- package/.cursor/skills/leniu-java-mybatis/SKILL.md +73 -446
- package/.cursor/skills/leniu-java-mybatis/references/report-mapper.md +88 -0
- package/.cursor/skills/leniu-report-customization/SKILL.md +111 -365
- package/.cursor/skills/leniu-report-customization/references/table-fields.md +93 -0
- package/.cursor/skills/leniu-report-standard-customization/SKILL.md +111 -334
- package/.cursor/skills/leniu-report-standard-customization/references/analysis-module.md +64 -0
- package/.cursor/skills/leniu-report-standard-customization/references/table-fields.md +113 -0
- package/.cursor/skills/leniu-security-guard/SKILL.md +133 -347
- package/.cursor/skills/mysql-debug/SKILL.md +364 -0
- package/.cursor/skills/openspec-apply-change/SKILL.md +10 -1
- package/.cursor/skills/openspec-archive-change/SKILL.md +9 -1
- package/.cursor/skills/openspec-bulk-archive-change/SKILL.md +9 -1
- package/.cursor/skills/openspec-continue-change/SKILL.md +9 -1
- package/.cursor/skills/openspec-explore/SKILL.md +10 -1
- package/.cursor/skills/openspec-ff-change/SKILL.md +9 -1
- package/.cursor/skills/openspec-new-change/SKILL.md +9 -1
- package/.cursor/skills/openspec-onboard/SKILL.md +15 -130
- package/.cursor/skills/openspec-sync-specs/SKILL.md +9 -1
- package/.cursor/skills/openspec-verify-change/SKILL.md +9 -1
- package/.cursor/skills/performance-doctor/SKILL.md +110 -434
- package/.cursor/skills/redis-cache/SKILL.md +89 -595
- package/.cursor/skills/redis-cache/references/listeners.md +23 -0
- package/.cursor/skills/scheduled-jobs/SKILL.md +88 -407
- package/.cursor/skills/security-guard/SKILL.md +137 -532
- package/.cursor/skills/security-guard/references/encrypt-config.md +103 -0
- package/.cursor/skills/security-guard/references/sensitive-strategies.md +42 -0
- package/.cursor/skills/sms-mail/SKILL.md +116 -574
- package/.cursor/skills/sms-mail/references/mail-config.md +88 -0
- package/.cursor/skills/sms-mail/references/sms-config.md +74 -0
- package/.cursor/skills/social-login/SKILL.md +112 -514
- package/.cursor/skills/social-login/references/provider-configs.md +118 -0
- package/.cursor/skills/tenant-management/SKILL.md +129 -444
- package/.cursor/skills/tenant-management/references/tenant-scenarios.md +91 -0
- package/.cursor/skills/test-development/SKILL.md +86 -540
- package/.cursor/skills/test-development/references/parameterized-examples.md +119 -0
- package/.cursor/skills/utils-toolkit/SKILL.md +52 -305
- package/.cursor/skills/utils-toolkit/references/redis-utils-api.md +56 -0
- package/.cursor/skills/websocket-sse/SKILL.md +105 -550
- package/.cursor/skills/workflow-engine/SKILL.md +147 -502
- package/package.json +1 -1
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
|
|
14
|
+
// 项目根目录:__dirname 是 .cursor/hooks/,向上两级
|
|
15
|
+
const PROJECT_ROOT = path.resolve(__dirname, '..', '..');
|
|
12
16
|
|
|
13
17
|
// 从 stdin 读取用户输入
|
|
14
18
|
let inputData = '';
|
|
@@ -158,6 +162,12 @@ const skillMap = [
|
|
|
158
162
|
name: 'leniu-mealtime',
|
|
159
163
|
keywords: ['餐次', '早餐', '午餐', '下午茶', '晚餐', '夜宵', 'mealtimeTypes']
|
|
160
164
|
},
|
|
165
|
+
{
|
|
166
|
+
name: 'leniu-customization-location',
|
|
167
|
+
keywords: ['定制开发', '定制代码位置', 'Dz前缀', 'leniu-yunshitang', 'dz_表名', '定制仓库',
|
|
168
|
+
'覆盖Service', '@Primary', '迁移core文件', '定制开始', '定制结束', 'net.xnzn.yunshitang',
|
|
169
|
+
'wuhanxiehe定制', 'bootstrap-ext']
|
|
170
|
+
},
|
|
161
171
|
|
|
162
172
|
// ========== OpenSpec 工作流 ==========
|
|
163
173
|
{
|
|
@@ -313,6 +323,48 @@ const skillMap = [
|
|
|
313
323
|
{
|
|
314
324
|
name: 'store-pc',
|
|
315
325
|
keywords: ['Vuex', 'store', 'mapState', 'mapActions', '状态管理']
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
name: 'add-skill',
|
|
329
|
+
keywords: ['添加技能', '创建技能', '新技能', '技能开发', '写技能', 'SKILL.md', '新增skill']
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
name: 'banana-image',
|
|
333
|
+
keywords: ['生成图片', 'AI图片', '产品图', '海报', '缩略图', '4K图片', '高清图', '制作图片', '/image']
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
name: 'collaborating-with-codex',
|
|
337
|
+
keywords: ['codex协作', '委托codex', 'openai codex', 'codex分析', '多模型协作', '让codex']
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
name: 'collaborating-with-gemini',
|
|
341
|
+
keywords: ['gemini协作', '委托gemini', 'google gemini', 'gemini分析', '让gemini', 'gemini前端']
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: 'leniu-brainstorm',
|
|
345
|
+
keywords: ['leniu-头脑风暴', '云食堂方案', '云食堂设计', '云食堂功能规划', 'leniu-方案设计',
|
|
346
|
+
'云食堂怎么设计', '云食堂可行性']
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
name: 'leniu-report-customization',
|
|
350
|
+
keywords: ['定制报表', 'report_order_info', 'report_order_detail', 'report_account_flow',
|
|
351
|
+
'退款汇总', '消费金额统计', '订单报表', '流水报表', '汇总报表']
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
name: 'leniu-report-standard-customization',
|
|
355
|
+
keywords: ['标准版报表', 'core-report', 'report_refund', 'report_refund_detail',
|
|
356
|
+
'经营分析', '营业额分析', '用户活跃度', '菜品排行', '操作员统计', '账户日结',
|
|
357
|
+
'ReportOrderConsumeService', 'ReportAccountConsumeService']
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
name: 'mysql-debug',
|
|
361
|
+
keywords: ['mysql查询', '查数据库', '查表', '执行SQL', '数据库排查', '验证数据',
|
|
362
|
+
'数据库调试', 'db查询', 'mysql调试', '直接查库']
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
name: 'openspec-onboard',
|
|
366
|
+
keywords: ['openspec入门', 'opsx:onboard', 'openspec onboard', 'openspec教程',
|
|
367
|
+
'openspec新手', '学习openspec工作流']
|
|
316
368
|
}
|
|
317
369
|
];
|
|
318
370
|
|
|
@@ -335,7 +387,7 @@ if (matchedSkills.length === 0) {
|
|
|
335
387
|
}
|
|
336
388
|
|
|
337
389
|
// 构建技能文档路径列表
|
|
338
|
-
const skillPaths = matchedSkills.map(name =>
|
|
390
|
+
const skillPaths = matchedSkills.map(name => path.join(PROJECT_ROOT, '.cursor', 'skills', name, 'SKILL.md'));
|
|
339
391
|
|
|
340
392
|
const skillList = matchedSkills.map((name, i) => `- **${name}**: \`${skillPaths[i]}\``).join('\n');
|
|
341
393
|
|
package/.cursor/hooks.json
CHANGED
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
"beforeSubmitPrompt": [
|
|
5
5
|
{
|
|
6
6
|
"matcher": "",
|
|
7
|
-
"command": "node .cursor/hooks/cursor-skill-eval.js"
|
|
7
|
+
"command": "node -e \"const p=require('path'),fs=require('fs');let d=process.cwd();while(!fs.existsSync(p.join(d,'.cursor/hooks/cursor-skill-eval.js'))&&d!==p.dirname(d))d=p.dirname(d);const f=p.join(d,'.cursor/hooks/cursor-skill-eval.js');if(fs.existsSync(f))require(f);\""
|
|
8
8
|
}
|
|
9
9
|
],
|
|
10
10
|
"preToolUse": [
|
|
11
11
|
{
|
|
12
12
|
"matcher": "Shell|Write|CreateFile|EditFile",
|
|
13
|
-
"command": "node .cursor/hooks/cursor-pre-tool-use.js"
|
|
13
|
+
"command": "node -e \"const p=require('path'),fs=require('fs');let d=process.cwd();while(!fs.existsSync(p.join(d,'.cursor/hooks/cursor-pre-tool-use.js'))&&d!==p.dirname(d))d=p.dirname(d);const f=p.join(d,'.cursor/hooks/cursor-pre-tool-use.js');if(fs.existsSync(f))require(f);\""
|
|
14
14
|
}
|
|
15
15
|
],
|
|
16
16
|
"stop": [
|
|
17
17
|
{
|
|
18
18
|
"matcher": "",
|
|
19
|
-
"command": "node .cursor/hooks/stop.js"
|
|
19
|
+
"command": "node -e \"const p=require('path'),fs=require('fs');let d=process.cwd();while(!fs.existsSync(p.join(d,'.cursor/hooks/stop.js'))&&d!==p.dirname(d))d=p.dirname(d);const f=p.join(d,'.cursor/hooks/stop.js');if(fs.existsSync(f))require(f);\""
|
|
20
20
|
}
|
|
21
21
|
]
|
|
22
22
|
}
|
|
@@ -18,6 +18,57 @@ description: |
|
|
|
18
18
|
|
|
19
19
|
本指南用于在 leniu-tengyun-core 项目中添加新的技能(Skill)。项目同时支持三个 AI 编码平台,技能需在所有平台保持一致。
|
|
20
20
|
|
|
21
|
+
## 核心设计原则
|
|
22
|
+
|
|
23
|
+
### 精简至上
|
|
24
|
+
|
|
25
|
+
上下文窗口是共享资源。技能与系统提示、对话历史、其他技能元数据共享窗口。
|
|
26
|
+
|
|
27
|
+
**默认假设:AI 已经很聪明。** 只添加 AI 本身不具备的知识。每段内容都应自问:"AI 真的需要这个解释吗?"、"这段内容值得占用 token 吗?"
|
|
28
|
+
|
|
29
|
+
**优先用简洁的代码示例代替冗长的文字说明。**
|
|
30
|
+
|
|
31
|
+
### 自由度控制
|
|
32
|
+
|
|
33
|
+
根据任务的脆弱性和变化性,匹配不同的指定程度:
|
|
34
|
+
|
|
35
|
+
| 自由度 | 适用场景 | 形式 |
|
|
36
|
+
|--------|---------|------|
|
|
37
|
+
| **高** | 多种方案均可,依赖上下文决策 | 文字描述指导 |
|
|
38
|
+
| **中** | 有推荐模式但允许变通 | 伪代码/带参数脚本 |
|
|
39
|
+
| **低** | 操作脆弱易错,必须严格一致 | 精确脚本/步骤 |
|
|
40
|
+
|
|
41
|
+
### 渐进披露
|
|
42
|
+
|
|
43
|
+
技能使用三级加载系统管理上下文:
|
|
44
|
+
|
|
45
|
+
1. **元数据(name + description)** — 始终在上下文中(~100 词)
|
|
46
|
+
2. **SKILL.md 正文** — 技能触发时加载(< 500 行)
|
|
47
|
+
3. **捆绑资源** — 按需加载(无限制)
|
|
48
|
+
|
|
49
|
+
**SKILL.md 正文控制在 500 行以内。** 接近上限时拆分到独立文件。拆分后必须在 SKILL.md 中引用并说明何时读取。
|
|
50
|
+
|
|
51
|
+
**大技能拆分模式**:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
技能名/
|
|
55
|
+
├── SKILL.md # 核心流程 + 导航(< 500 行)
|
|
56
|
+
├── references/ # 按需加载的参考文档
|
|
57
|
+
│ ├── patterns.md # 设计模式详解
|
|
58
|
+
│ └── examples.md # 完整代码示例
|
|
59
|
+
└── assets/ # 输出资源(模板、图片等)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
当技能支持多种变体时,按变体组织 references:
|
|
63
|
+
```
|
|
64
|
+
leniu-report-xxx/
|
|
65
|
+
├── SKILL.md
|
|
66
|
+
└── references/
|
|
67
|
+
├── basic-report.md # 基础报表模式
|
|
68
|
+
├── summary-report.md # 汇总报表模式
|
|
69
|
+
└── analysis-report.md # 分析报表模式
|
|
70
|
+
```
|
|
71
|
+
|
|
21
72
|
### 三平台架构
|
|
22
73
|
|
|
23
74
|
| 平台 | 技能目录 | Hook 文件 | 激活方式 |
|
|
@@ -113,6 +164,18 @@ description: |
|
|
|
113
164
|
|
|
114
165
|
---
|
|
115
166
|
|
|
167
|
+
## 第 0 步:理解需求
|
|
168
|
+
|
|
169
|
+
> 跳过条件:技能的使用模式已经很清楚时可跳过。
|
|
170
|
+
|
|
171
|
+
创建有效技能前,先用具体示例理解技能将如何被使用:
|
|
172
|
+
|
|
173
|
+
1. **收集使用场景**:用户会说什么触发这个技能?
|
|
174
|
+
2. **识别可复用内容**:哪些代码/模板/参考文档在每次使用时都会重复?
|
|
175
|
+
3. **确定资源类型**:重复代码/技术文档 → `references/`;输出模板 → `assets/`;高频规则 → SKILL.md 正文
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
116
179
|
## 第 1 步:规划
|
|
117
180
|
|
|
118
181
|
### 1.1 定义技能属性
|
|
@@ -191,13 +254,11 @@ description: |
|
|
|
191
254
|
|
|
192
255
|
### 2.4 不同类型技能的侧重
|
|
193
256
|
|
|
194
|
-
| 类型 | 侧重 |
|
|
195
|
-
|
|
196
|
-
| 后端开发类 | 代码模板、标准写法、禁止项 |
|
|
197
|
-
|
|
|
198
|
-
|
|
|
199
|
-
| 流程类 | 步骤说明、决策树、检查清单 | leniu-brainstorm |
|
|
200
|
-
| 报表类 | SQL 模板、fix 模式、退款处理 | leniu-report-customization |
|
|
257
|
+
| 类型 | 侧重 |
|
|
258
|
+
|------|------|
|
|
259
|
+
| 后端开发类 | 代码模板、标准写法、禁止项 |
|
|
260
|
+
| 工具/中间件类 | API 列表、配置方法、使用示例 |
|
|
261
|
+
| 流程/报表类 | 步骤说明、SQL 模板、决策树 |
|
|
201
262
|
|
|
202
263
|
---
|
|
203
264
|
|
|
@@ -409,33 +470,19 @@ cp .claude/skills/$SKILL_NAME/SKILL.md .cursor/skills/$SKILL_NAME/SKILL.md
|
|
|
409
470
|
cp .claude/skills/$SKILL_NAME/SKILL.md .codex/skills/$SKILL_NAME/SKILL.md
|
|
410
471
|
```
|
|
411
472
|
|
|
412
|
-
### 4.
|
|
413
|
-
|
|
414
|
-
**症状**:技能在不相关场景被频繁误触发
|
|
415
|
-
|
|
416
|
-
**原因**:触发词太通用(如"开发"、"功能")
|
|
417
|
-
|
|
418
|
-
**解决**:使用具体术语(如"CRUD开发"、"支付接入")
|
|
473
|
+
### 4-7. 其他常见问题
|
|
419
474
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
### 6. 技能范围重叠
|
|
427
|
-
|
|
428
|
-
**症状**:同一个问题触发多个技能,指导矛盾
|
|
429
|
-
|
|
430
|
-
**解决**:在 SKILL.md 末尾添加"注意"段落说明边界:
|
|
431
|
-
```
|
|
432
|
-
注意:如果是行级数据权限(@DataPermission),请使用 leniu-data-permission。
|
|
433
|
-
```
|
|
475
|
+
| # | 症状 | 原因 | 解决 |
|
|
476
|
+
|---|------|------|------|
|
|
477
|
+
| 4 | 技能频繁误触发 | 触发词太通用(如"开发") | 用具体术语(如"CRUD开发") |
|
|
478
|
+
| 5 | 生成代码引用不存在的类 | 代码示例虚构 | 编写前用 Grep/Glob 确认类和方法存在 |
|
|
479
|
+
| 6 | 多技能触发、指导矛盾 | 技能范围重叠 | SKILL.md 末尾添加"注意"段落说明边界 |
|
|
480
|
+
| 7 | 生成代码编译失败 | 写了 `org.dromara.*` | 统一使用 `net.xnzn.core.*` |
|
|
434
481
|
|
|
435
|
-
|
|
482
|
+
---
|
|
436
483
|
|
|
437
|
-
|
|
484
|
+
## 迭代优化
|
|
438
485
|
|
|
439
|
-
|
|
486
|
+
技能创建后持续改进:使用技能完成真实任务 → 发现不足 → 更新 SKILL.md → 同步三平台 → 重新测试。
|
|
440
487
|
|
|
441
|
-
|
|
488
|
+
> **提示**:不要创建多余的文档文件(README.md 等)。技能只包含 AI 执行任务所需的信息。
|