feat: add fail-closed Aider development skill

This commit is contained in:
john
2026-07-24 19:48:04 +08:00
parent 1c82b34ad9
commit be9c25f1d0
15 changed files with 320 additions and 7 deletions
+15
View File
@@ -47,6 +47,19 @@ test('filterChatSkills shows service integration smoke when granted', () => {
assert.ok(visible.some((item) => item.id === 'service-integration-smoke'));
});
test('filterChatSkills only shows Aider development when granted', () => {
const hidden = filterChatSkills(CHAT_SKILL_DEFINITIONS, {
canPublish: false,
grantedSkills: [],
});
assert.equal(hidden.some((item) => item.id === 'aider-development'), false);
const visible = filterChatSkills(CHAT_SKILL_DEFINITIONS, {
canPublish: false,
grantedSkills: ['aider-development'],
});
assert.ok(visible.some((item) => item.id === 'aider-development'));
});
test('filterChatSkills shows page-data-collect when granted without static publish', () => {
const visible = filterChatSkills(CHAT_SKILL_DEFINITIONS, {
canPublish: false,
@@ -69,6 +82,8 @@ test('buildChatSkillPrompt includes skill name for platform skills', () => {
assert.match(enhancedPrompt, /tkmind_search/);
assert.match(enhancedPrompt, /web_search/);
assert.match(buildChatSkillPrompt('service-integration-smoke'), /标准联调流程/);
assert.match(buildChatSkillPrompt('aider-development'), /必须由 Aider code run/);
assert.match(buildChatSkillPrompt('aider-development'), /禁止回退/);
assert.match(buildChatSkillPrompt('product-campaign-page'), /商品宣传 \/ 活动页/);
assert.match(buildChatSkillPrompt('image-generation'), /asset\.htmlSrc/);
assert.match(buildChatSkillPrompt('image-generation'), /workspaceRelativePath 只用于文件操作/);