31 lines
1.2 KiB
JavaScript
31 lines
1.2 KiB
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { readFileSync } from 'node:fs';
|
|
import { join } from 'node:path';
|
|
import { repoRoot } from './helpers/run-script.js';
|
|
|
|
const files = [
|
|
...['sdlc-plan', 'sdlc-analyze', 'sdlc-feat', 'sdlc-fix', 'sdlc-sync', 'sdlc-report']
|
|
.map((name) => join(repoRoot, 'prompts', `${name}.md`)),
|
|
join(repoRoot, 'references', 'delegation.md'),
|
|
join(repoRoot, 'AGENTS.md'),
|
|
join(repoRoot, 'README.md'),
|
|
join(repoRoot, 'docs', 'adr', '0001-以集中式雜湊路徑的-worktree-隔離平行工作包.md'),
|
|
join(repoRoot, 'docs', 'adr', '0002-以能力描述而非工具名表達委派.md'),
|
|
];
|
|
|
|
test('流程、規則與文件資產都是合法 UTF-8 且沒有替代字元', () => {
|
|
for (const path of files) {
|
|
const bytes = readFileSync(path);
|
|
const text = new TextDecoder('utf-8', { fatal: true }).decode(bytes);
|
|
assert.equal(text.includes('\uFFFD'), false, `${path} 含替代字元`);
|
|
}
|
|
});
|
|
|
|
test('六份流程正本都以繁體中文 description 開頭', () => {
|
|
for (const path of files.slice(0, 6)) {
|
|
const text = readFileSync(path, 'utf8');
|
|
assert.match(text, /^description: 僅由 \/sdlc-[a-z-]+ 指令叫用。/m, path);
|
|
}
|
|
});
|