Files
makelore/tests/unit/youth-plain-language-skill.test.ts
inman 80e8386fa6
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
feat: update Makelore modules and conversations
2026-07-31 10:08:41 +08:00

27 lines
1.3 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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