完善客户端模块与工作区能力
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
inman
2026-08-13 19:45:30 +08:00
parent 0148b91a15
commit 22add3f01f
97 changed files with 4756 additions and 3226 deletions

View File

@@ -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('面向 1016 岁青少年');
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']);
});
});