From 7f71675deb8d60c64cb2a01a1e9775d7c43138c6 Mon Sep 17 00:00:00 2001 From: jtl959 Date: Thu, 20 Aug 2026 11:19:46 +0800 Subject: [PATCH] add syncAgents.mjs --- agents/syncAgents.mjs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 agents/syncAgents.mjs diff --git a/agents/syncAgents.mjs b/agents/syncAgents.mjs new file mode 100644 index 0000000..cfa6ef9 --- /dev/null +++ b/agents/syncAgents.mjs @@ -0,0 +1,18 @@ +// 从 https://git.tic.cc/opx/sysconfig/ 同步 agents/AGENTS.md 和 agents/CLAUDE.md +// 到本项目根目录(覆盖现有文件)。 +// 使用 Node 内置 fetch,跨 Windows / Linux / macOS 平台,无需额外工具。 +import { writeFile } from 'node:fs/promises'; + +const BASE_URL = 'https://git.tic.cc/opx/sysconfig/raw/branch/main/agents/'; +const FILES = ['AGENTS.md', 'CLAUDE.md']; + +for (const name of FILES) { + const response = await fetch(BASE_URL + name); + if (!response.ok) { + throw new Error(`下载 ${name} 失败: HTTP ${response.status}`); + } + await writeFile(name, await response.text()); + console.log(`已同步 ${name}`); +} + +console.log('agents 文件同步完成');