- 重构版主提示词(14 parts,面向 ClassHelper 灵动岛重构) - ClassIsland 全量规格提示词(20 parts,含分卷与逐章版本) - 投喂指南、分卷、逐节文件 - 调研记录、一致性基线、生成与质检脚本
53 lines
2.4 KiB
JavaScript
53 lines
2.4 KiB
JavaScript
#!/usr/bin/env node
|
|
/** 术语统一:自动化 Action 统一为「行动」;非自动化语境保留「动作」。 */
|
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
import { join, dirname } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
const root = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
const dir = join(root, 'parts');
|
|
|
|
function edit(file, fn) {
|
|
const p = join(dir, file);
|
|
const before = readFileSync(p, 'utf8');
|
|
const after = fn(before);
|
|
if (after !== before) {
|
|
writeFileSync(p, after, 'utf8');
|
|
console.log(`updated ${file}`);
|
|
}
|
|
}
|
|
|
|
// 纯自动化语境:全文 动作→行动
|
|
for (const f of ['01-overview.md', '02-tech-stack.md', '10-settings.md', '13-data-storage.md', '16-acceptance.md', '17-milestones.md', '18-forbidden.md']) {
|
|
edit(f, (t) => t.split('动作').join('行动'));
|
|
}
|
|
|
|
// 04:进入/退出「动作」指步骤;表格列指操作
|
|
edit('04-main-window.md', (t) =>
|
|
t.replaceAll('进入动作(按序)', '进入步骤(按序)').replaceAll('退出动作:', '退出步骤:').replace('| # | 文本 | 图标 glyph | 可见条件 | 动作 |', '| # | 文本 | 图标 glyph | 可见条件 | 操作 |'),
|
|
);
|
|
|
|
// 12:自动化语境→行动;交互语境改成事件/操作
|
|
edit('12-plugins-ipc.md', (t) =>
|
|
t
|
|
.split('自动化触发器/动作').join('自动化触发器/行动')
|
|
.split('触发器/动作').join('触发器/行动')
|
|
.split('注册触发器/动作').join('注册触发器/行动')
|
|
.split('自动化动作').join('自动化行动')
|
|
.split('触发自动化动作').join('触发自动化行动')
|
|
.split('(岛动作、心跳、交互上报)').join('(岛事件、心跳、交互上报)')
|
|
.split('上报用户动作与命中信息').join('上报用户操作与命中信息')
|
|
.split('所有自愈动作必须写日志').join('所有自愈操作必须写日志'),
|
|
);
|
|
|
|
// 15:教程行动→行动;贴纸「角色_动作」保持
|
|
edit('15-assets.md', (t) =>
|
|
t
|
|
.replace('进入段落时执行的动作', '进入段落时执行的行动')
|
|
.replace('动作列表,元素为', '行动列表,元素为')
|
|
.replace('动作 `Kind` 的具体枚举含义', '行动 `Kind` 的具体枚举含义'),
|
|
);
|
|
|
|
// 11:教程行动统一(如有)
|
|
edit('11-other-windows.md', (t) => (t.includes('动作') ? t.split('动作').join('行动') : t));
|
|
console.log('done');
|