import { 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/superpowers'; 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'); expect(readdirSync(path.join(projectRoot, '.opencode', 'agent'))).toEqual([]); }); });