完善客户端模块与工作区能力
This commit is contained in:
@@ -1,27 +1,8 @@
|
||||
import { existsSync, readdirSync } from 'node:fs';
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { BUNDLED_COURSE_SKILL_IDS } from '@electron/opencode/course-skills';
|
||||
|
||||
const projectRoot = process.cwd();
|
||||
const skillPath = path.join(projectRoot, '.opencode', 'skills', 'youth-plain-language', 'SKILL.md');
|
||||
|
||||
describe('youth plain language Skill', () => {
|
||||
it('contains the required audience, clarity, accuracy, error, and respect rules', async () => {
|
||||
const content = await readFile(skillPath, 'utf8');
|
||||
|
||||
expect(content).toContain('面向 10–16 岁青少年');
|
||||
expect(content).toContain('一句话只讲一件事');
|
||||
expect(content).toContain('先说它能做什么');
|
||||
expect(content).toContain('代码、命令、文件路径、接口名、字段名、错误原文和品牌名必须保持准确');
|
||||
expect(content).toContain('不评价学生本人');
|
||||
expect(content).toContain('不使用幼儿化或居高临下语气');
|
||||
});
|
||||
|
||||
it('remains available as a manually selectable Skill without being injected into new Agents', () => {
|
||||
expect(BUNDLED_COURSE_SKILL_IDS).toContain('youth-plain-language');
|
||||
const generatedAgentsDir = path.join(projectRoot, '.opencode', 'agent');
|
||||
expect(existsSync(generatedAgentsDir) ? readdirSync(generatedAgentsDir) : []).toEqual([]);
|
||||
describe('bundled Skill allowlist', () => {
|
||||
it('keeps only the explicitly retained Agent Browser Skill', () => {
|
||||
expect([...BUNDLED_COURSE_SKILL_IDS]).toEqual(['agent-browser']);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user