import { spawnSync } from 'node:child_process'; import { existsSync } from 'node:fs'; import { dirname, join } from 'node:path'; import { fileURLToPath } from 'node:url'; const root = join(dirname(fileURLToPath(import.meta.url)), '../..'); const syncScript = join( root, '.agents', 'rules', 'plate-next', 'scripts', 'sync-resources.mjs' ); if (!existsSync(syncScript)) { process.exit(0); } const run = (command, args) => { const result = spawnSync(command, args, { cwd: root, stdio: 'inherit' }); if (result.status !== 0) process.exit(result.status ?? 1); }; run('bun', ['x', 'skiller@latest', 'apply']); run(process.execPath, [syncScript]);