claude-everything-workflow 0.2.9 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/AGENTS.md +1 -1
- package/README.md +11 -5
- package/README.zh-CN.md +12 -6
- package/bin/claude-everything-workflow.js +16 -4
- package/commands/code-review.md +4 -4
- package/docs/plugins.md +20 -2
- package/evals/routing-scenarios.json +8 -9
- package/package.json +1 -1
- package/scripts/eval-scenarios.js +49 -15
- package/scripts/install-antigravity.js +501 -0
- package/scripts/install-rules.js +186 -32
- package/scripts/install.ps1 +75 -4
- package/scripts/install.sh +72 -20
- package/scripts/legacy-common-rule-hashes.json +2 -1
- package/scripts/verify/install-rules.test.js +367 -7
- package/scripts/verify/metadata-checks.js +23 -0
- package/scripts/verify/scenario-checks.test.js +52 -10
- package/skills/README.md +1 -1
- package/skills/code-review/SKILL.md +15 -21
- package/skills/feature-acceptance/SKILL.md +1 -1
- package/skills/implement/SKILL.md +2 -2
package/scripts/install-rules.js
CHANGED
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
const fs = require("node:fs");
|
|
5
5
|
const path = require("node:path");
|
|
6
6
|
const crypto = require("node:crypto");
|
|
7
|
+
const os = require("node:os");
|
|
8
|
+
const { spawnSync } = require("node:child_process");
|
|
9
|
+
|
|
10
|
+
const IMPLEMENTATION_RULE_BASE = ".cew-rule-state/02-implementation.base.md";
|
|
11
|
+
const IMPLEMENTATION_RULE_INCOMING = ".cew-rule-state/02-implementation.incoming.md";
|
|
7
12
|
|
|
8
13
|
const BACKUP_ROOT_NAME = ".cew-backups";
|
|
9
14
|
const LEGACY_TOP_LEVEL_BAK = /^(?:CLAUDE\.md|AGENTS\.md|settings\.json)\.bak\..+$/;
|
|
@@ -45,23 +50,97 @@ function checkedPath(root, relative) {
|
|
|
45
50
|
return target;
|
|
46
51
|
}
|
|
47
52
|
|
|
48
|
-
function
|
|
53
|
+
function replaceFile(file, content, mode = 0o600) {
|
|
54
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
55
|
+
const temp = file + ".tmp-" + crypto.randomUUID();
|
|
56
|
+
try {
|
|
57
|
+
fs.writeFileSync(temp, content, { flag: "wx", mode: (mode & 0o777) | 0o200 });
|
|
58
|
+
if (process.umask() & 0o200) {
|
|
59
|
+
fs.chmodSync(temp, (fs.statSync(temp).mode & 0o777) | 0o200);
|
|
60
|
+
}
|
|
61
|
+
// Windows refuses to replace a target left read-only by an older installer.
|
|
62
|
+
const priorMode = process.platform === "win32" && fs.existsSync(file) ? fs.statSync(file).mode : null;
|
|
63
|
+
const readOnly = priorMode !== null && !(priorMode & 0o200);
|
|
64
|
+
if (readOnly) fs.chmodSync(file, priorMode | 0o200);
|
|
65
|
+
try {
|
|
66
|
+
fs.renameSync(temp, file);
|
|
67
|
+
} catch (error) {
|
|
68
|
+
if (readOnly) fs.chmodSync(file, priorMode);
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
71
|
+
} finally {
|
|
72
|
+
fs.rmSync(temp, { force: true });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function copyRule({ source, root, relative, backupId, dryRun, log, merged }) {
|
|
49
77
|
const target = checkedPath(root, relative);
|
|
50
|
-
const content = fs.readFileSync(source);
|
|
51
|
-
|
|
78
|
+
const content = merged ?? fs.readFileSync(source);
|
|
79
|
+
const exists = fs.existsSync(target);
|
|
80
|
+
if (exists) {
|
|
52
81
|
const previous = fs.readFileSync(target);
|
|
53
82
|
if (content.equals(previous)) return;
|
|
54
83
|
const backup = checkedPath(root, path.posix.join(BACKUP_ROOT_NAME, backupId, relative));
|
|
55
84
|
log(`${dryRun ? "[dry-run] " : ""}备份规则: ${backup}`);
|
|
56
85
|
if (!dryRun) {
|
|
57
|
-
|
|
58
|
-
fs.copyFileSync(target, backup);
|
|
86
|
+
replaceFile(backup, previous, fs.statSync(target).mode);
|
|
59
87
|
}
|
|
60
88
|
}
|
|
61
89
|
log(`${dryRun ? "[dry-run] " : ""}安装规则: ${target}`);
|
|
62
90
|
if (!dryRun) {
|
|
63
|
-
fs.
|
|
64
|
-
|
|
91
|
+
replaceFile(target, content, fs.statSync(exists ? target : source).mode);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Git only sees disposable copies. A conflict, invalid text or missing Git leaves the live rule untouched.
|
|
96
|
+
function mergeRuleText(local, base, incoming) {
|
|
97
|
+
const scratch = fs.mkdtempSync(path.join(os.tmpdir(), "cew-rule-merge-"));
|
|
98
|
+
try {
|
|
99
|
+
const paths = [];
|
|
100
|
+
for (const [name, bytes] of [["local", local], ["base", base], ["incoming", incoming]]) {
|
|
101
|
+
const text = bytes.toString("utf8");
|
|
102
|
+
if (text.includes("\0") || !Buffer.from(text).equals(bytes)) return null;
|
|
103
|
+
const file = path.join(scratch, name);
|
|
104
|
+
fs.writeFileSync(file, text.replace(/\r\n/g, "\n"));
|
|
105
|
+
paths.push(file);
|
|
106
|
+
}
|
|
107
|
+
const result = spawnSync("git", ["merge-file", "-p", "--", ...paths], { cwd: scratch });
|
|
108
|
+
if (result.status !== 0 || result.error) return null;
|
|
109
|
+
const crlf = local.includes("\r\n") && !local.toString("utf8").replace(/\r\n/g, "").includes("\n");
|
|
110
|
+
return crlf ? Buffer.from(result.stdout.toString("utf8").replace(/\n/g, "\r\n")) : result.stdout;
|
|
111
|
+
} finally {
|
|
112
|
+
fs.rmSync(scratch, { recursive: true, force: true });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function installMergedImplementationRule(options, knownHashes, hostLabel) {
|
|
117
|
+
const { source, root, relative, dryRun, log } = options;
|
|
118
|
+
const target = checkedPath(root, relative);
|
|
119
|
+
const base = checkedPath(root, IMPLEMENTATION_RULE_BASE);
|
|
120
|
+
const incoming = checkedPath(root, IMPLEMENTATION_RULE_INCOMING);
|
|
121
|
+
const previous = fs.existsSync(base) ? fs.readFileSync(base) : null;
|
|
122
|
+
const local = fs.existsSync(target) ? fs.readFileSync(target) : null;
|
|
123
|
+
const next = fs.readFileSync(source);
|
|
124
|
+
const localHash = local && digest(local);
|
|
125
|
+
const pristine = !local || localHash === digest(next) ||
|
|
126
|
+
(previous ? localHash === digest(previous) : knownHashes.includes(localHash));
|
|
127
|
+
|
|
128
|
+
if (pristine) {
|
|
129
|
+
copyRule(options);
|
|
130
|
+
} else if (previous && digest(previous) !== digest(next)) {
|
|
131
|
+
const merged = mergeRuleText(local, previous, next);
|
|
132
|
+
if (!merged) {
|
|
133
|
+
log(`${dryRun ? "[dry-run] " : ""}无法自动合并,保留个人规则 ${target}。请对照 ${incoming} 手动合并,再用它更新基线 ${base}。`);
|
|
134
|
+
if (!dryRun) replaceFile(incoming, next);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
copyRule({ ...options, merged });
|
|
138
|
+
} else {
|
|
139
|
+
log(`保留 ${hostLabel} 个人实现规则: ${target}`);
|
|
140
|
+
}
|
|
141
|
+
if (!dryRun) {
|
|
142
|
+
if (!previous || !previous.equals(next)) replaceFile(base, next);
|
|
143
|
+
fs.rmSync(incoming, { force: true });
|
|
65
144
|
}
|
|
66
145
|
}
|
|
67
146
|
|
|
@@ -168,40 +247,111 @@ function finalizeBackups({ installRoot, dryRun = false, log = console.log }) {
|
|
|
168
247
|
}
|
|
169
248
|
}
|
|
170
249
|
|
|
171
|
-
function
|
|
172
|
-
if (
|
|
173
|
-
|
|
250
|
+
function validateBackupId(backupId) {
|
|
251
|
+
if (
|
|
252
|
+
!backupId ||
|
|
253
|
+
backupId === "." ||
|
|
254
|
+
backupId.includes("/") ||
|
|
255
|
+
backupId.includes("\\") ||
|
|
256
|
+
backupId.includes("..")
|
|
257
|
+
) {
|
|
258
|
+
throw new Error("Invalid --backup-id");
|
|
259
|
+
}
|
|
260
|
+
return backupId;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
function getHostRulePolicy(host) {
|
|
264
|
+
if (host === "claude-code") {
|
|
265
|
+
return {
|
|
266
|
+
dirFor: (relative) => (claudeResidentRules.has(relative) ? "rules" : "references/rules"),
|
|
267
|
+
mergedRule: null,
|
|
268
|
+
promotedRule: "02-implementation.md",
|
|
269
|
+
retireColdFromRules: true,
|
|
270
|
+
retiredDirs: ["rules", "references/rules"],
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
if (host === "codex") {
|
|
274
|
+
return {
|
|
275
|
+
dirFor: () => "rules",
|
|
276
|
+
mergedRule: { relative: "rules/02-implementation.md", hostLabel: "Codex" },
|
|
277
|
+
promotedRule: null,
|
|
278
|
+
retireColdFromRules: false,
|
|
279
|
+
retiredDirs: ["rules"],
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
if (host === "antigravity") {
|
|
283
|
+
return {
|
|
284
|
+
dirFor: () => "references/rules",
|
|
285
|
+
mergedRule: { relative: "references/rules/02-implementation.md", hostLabel: "Antigravity" },
|
|
286
|
+
promotedRule: null,
|
|
287
|
+
retireColdFromRules: false,
|
|
288
|
+
retiredDirs: ["references/rules"],
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
throw new Error(`Invalid host: ${host}`);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function collectRuleSources(sourceRoot) {
|
|
174
295
|
const rulesRoot = path.join(sourceRoot, "rules");
|
|
175
|
-
const legacy = JSON.parse(fs.readFileSync(path.join(sourceRoot, "scripts/legacy-common-rule-hashes.json"), "utf8"));
|
|
176
296
|
const files = fs.readdirSync(rulesRoot, { withFileTypes: true })
|
|
177
297
|
.filter((entry) => entry.isFile() && entry.name.endsWith(".md"))
|
|
178
298
|
.map((entry) => entry.name);
|
|
179
299
|
const commonFiles = fs.readdirSync(path.join(rulesRoot, "common"), { withFileTypes: true })
|
|
180
300
|
.filter((entry) => entry.isFile() && entry.name.endsWith(".md"))
|
|
181
301
|
.map((entry) => `common/${entry.name}`);
|
|
182
|
-
|
|
183
|
-
|
|
302
|
+
return { rulesRoot, relatives: [...files, ...commonFiles] };
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
function validateRuleTargets({ sourceRoot, installRoot, host }) {
|
|
306
|
+
const policy = getHostRulePolicy(host);
|
|
307
|
+
const root = path.resolve(installRoot);
|
|
308
|
+
const { rulesRoot, relatives } = collectRuleSources(sourceRoot);
|
|
184
309
|
// Validate all managed destinations before the first write, including upgrade cleanup paths.
|
|
185
310
|
checkedPath(root, BACKUP_ROOT_NAME);
|
|
186
|
-
|
|
187
|
-
checkedPath(root,
|
|
188
|
-
|
|
311
|
+
if (policy.mergedRule) {
|
|
312
|
+
checkedPath(root, IMPLEMENTATION_RULE_BASE);
|
|
313
|
+
checkedPath(root, IMPLEMENTATION_RULE_INCOMING);
|
|
314
|
+
}
|
|
315
|
+
for (const relative of relatives) {
|
|
316
|
+
const targetDir = policy.dirFor(relative);
|
|
317
|
+
checkedPath(root, `${targetDir}/${relative}`);
|
|
318
|
+
if (policy.retireColdFromRules && targetDir === "references/rules") {
|
|
319
|
+
checkedPath(root, `rules/${relative}`);
|
|
320
|
+
}
|
|
321
|
+
if (policy.promotedRule === relative) {
|
|
322
|
+
checkedPath(root, `rules/${relative}`);
|
|
189
323
|
checkedPath(root, `references/rules/${relative}`);
|
|
190
324
|
}
|
|
191
325
|
}
|
|
192
326
|
for (const retired of retiredTopLevelRules) {
|
|
193
|
-
|
|
194
|
-
|
|
327
|
+
for (const dir of policy.retiredDirs) {
|
|
328
|
+
checkedPath(root, `${dir}/${retired}`);
|
|
329
|
+
}
|
|
195
330
|
}
|
|
196
|
-
|
|
331
|
+
return { policy, root, rulesRoot, relatives };
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function installRules({ sourceRoot, installRoot, host, backupId = defaultBackupId(), dryRun = false, log = console.log }) {
|
|
335
|
+
validateBackupId(backupId);
|
|
336
|
+
const { policy, root, rulesRoot, relatives } = validateRuleTargets({ sourceRoot, installRoot, host });
|
|
337
|
+
const legacy = JSON.parse(fs.readFileSync(path.join(sourceRoot, "scripts/legacy-common-rule-hashes.json"), "utf8"));
|
|
338
|
+
for (const relative of relatives) {
|
|
197
339
|
const source = path.join(rulesRoot, relative);
|
|
198
|
-
if (
|
|
340
|
+
if (policy.mergedRule && relative === "02-implementation.md") {
|
|
341
|
+
installMergedImplementationRule(
|
|
342
|
+
{ source, root, relative: policy.mergedRule.relative, backupId, dryRun, log },
|
|
343
|
+
legacy.files[relative] || [],
|
|
344
|
+
policy.mergedRule.hostLabel,
|
|
345
|
+
);
|
|
346
|
+
continue;
|
|
347
|
+
}
|
|
348
|
+
if (policy.promotedRule === relative) {
|
|
199
349
|
installPromotedRule({ source, root, relative, knownHashes: legacy.files[relative] || [], backupId, dryRun, log });
|
|
200
350
|
continue;
|
|
201
351
|
}
|
|
202
|
-
const
|
|
203
|
-
copyRule({ source, root, relative: `${
|
|
204
|
-
if (
|
|
352
|
+
const targetDir = policy.dirFor(relative);
|
|
353
|
+
copyRule({ source, root, relative: `${targetDir}/${relative}`, backupId, dryRun, log });
|
|
354
|
+
if (policy.retireColdFromRules && targetDir === "references/rules") {
|
|
205
355
|
retireRule({
|
|
206
356
|
source, root, relative: `rules/${relative}`,
|
|
207
357
|
knownHashes: legacy.files[relative] || [], dryRun, log,
|
|
@@ -210,14 +360,21 @@ function installRules({ sourceRoot, installRoot, host, backupId = defaultBackupI
|
|
|
210
360
|
}
|
|
211
361
|
for (const retired of retiredTopLevelRules) {
|
|
212
362
|
const knownHashes = legacy.files[retired] || [];
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
retireRule({ source: null, root, relative: `references/rules/${retired}`, knownHashes, dryRun, log });
|
|
363
|
+
for (const dir of policy.retiredDirs) {
|
|
364
|
+
retireRule({ source: null, root, relative: `${dir}/${retired}`, knownHashes, dryRun, log });
|
|
216
365
|
}
|
|
217
366
|
}
|
|
218
367
|
}
|
|
219
368
|
|
|
220
|
-
module.exports = {
|
|
369
|
+
module.exports = {
|
|
370
|
+
BACKUP_ROOT_NAME,
|
|
371
|
+
checkedPath,
|
|
372
|
+
defaultBackupId,
|
|
373
|
+
validateBackupId,
|
|
374
|
+
validateRuleTargets,
|
|
375
|
+
installRules,
|
|
376
|
+
finalizeBackups,
|
|
377
|
+
};
|
|
221
378
|
|
|
222
379
|
function parseCli(argv) {
|
|
223
380
|
let dryRun = false;
|
|
@@ -231,10 +388,7 @@ function parseCli(argv) {
|
|
|
231
388
|
} else if (arg === "--finalize-backups") {
|
|
232
389
|
finalize = true;
|
|
233
390
|
} else if (arg === "--backup-id") {
|
|
234
|
-
backupId = argv[++i];
|
|
235
|
-
if (!backupId || backupId.includes("/") || backupId.includes("\\") || backupId.includes("..")) {
|
|
236
|
-
throw new Error("Invalid --backup-id");
|
|
237
|
-
}
|
|
391
|
+
backupId = validateBackupId(argv[++i]);
|
|
238
392
|
} else if (arg.startsWith("-")) {
|
|
239
393
|
throw new Error(`Unknown option: ${arg}`);
|
|
240
394
|
} else {
|
|
@@ -256,7 +410,7 @@ if (require.main === module) {
|
|
|
256
410
|
} else {
|
|
257
411
|
const [host, installRoot] = positional;
|
|
258
412
|
if (!host || !installRoot || positional.length !== 2) {
|
|
259
|
-
throw new Error("Usage: install-rules.js <claude-code|codex> <install-root> [--backup-id <id>] [--dry-run]");
|
|
413
|
+
throw new Error("Usage: install-rules.js <claude-code|codex|antigravity> <install-root> [--backup-id <id>] [--dry-run]");
|
|
260
414
|
}
|
|
261
415
|
installRules({
|
|
262
416
|
sourceRoot: path.resolve(__dirname, ".."),
|
package/scripts/install.ps1
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
param(
|
|
2
2
|
[switch]$ClaudeOnly,
|
|
3
3
|
[switch]$CodexOnly,
|
|
4
|
+
[switch]$AntigravityOnly,
|
|
4
5
|
[switch]$DryRun
|
|
5
6
|
)
|
|
6
7
|
|
|
@@ -9,8 +10,12 @@ $ErrorActionPreference = "Stop"
|
|
|
9
10
|
if ($args.Count -gt 0) {
|
|
10
11
|
throw "Unknown option: $($args[0])"
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
$selectedOnly = @()
|
|
14
|
+
if ($ClaudeOnly) { $selectedOnly += "-ClaudeOnly" }
|
|
15
|
+
if ($CodexOnly) { $selectedOnly += "-CodexOnly" }
|
|
16
|
+
if ($AntigravityOnly) { $selectedOnly += "-AntigravityOnly" }
|
|
17
|
+
if ($selectedOnly.Count -gt 1) {
|
|
18
|
+
throw "$($selectedOnly -join ' and ') cannot be used together"
|
|
14
19
|
}
|
|
15
20
|
|
|
16
21
|
$RootDir = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)
|
|
@@ -20,8 +25,10 @@ if (-not $HomeDir) {
|
|
|
20
25
|
throw "USERPROFILE or HOME is required"
|
|
21
26
|
}
|
|
22
27
|
|
|
23
|
-
$InstallClaude = -
|
|
24
|
-
$InstallCodex = -
|
|
28
|
+
$InstallClaude = ($selectedOnly.Count -eq 0) -or [bool]$ClaudeOnly
|
|
29
|
+
$InstallCodex = ($selectedOnly.Count -eq 0) -or [bool]$CodexOnly
|
|
30
|
+
$InstallAntigravity = ($selectedOnly.Count -eq 0) -or [bool]$AntigravityOnly
|
|
31
|
+
$ExplicitAntigravity = [bool]$AntigravityOnly
|
|
25
32
|
$BackupId = Get-Date -Format 'yyyyMMddHHmmss'
|
|
26
33
|
|
|
27
34
|
function Invoke-InstallCommand {
|
|
@@ -159,6 +166,7 @@ function Remove-PackageOnlyPaths {
|
|
|
159
166
|
"scripts\install.sh",
|
|
160
167
|
"scripts\install.ps1",
|
|
161
168
|
"scripts\install-rules.js",
|
|
169
|
+
"scripts\install-antigravity.js",
|
|
162
170
|
"scripts\legacy-common-rule-hashes.json",
|
|
163
171
|
"scripts\eval-scenarios.js",
|
|
164
172
|
"scripts\verify-harness.js",
|
|
@@ -326,6 +334,22 @@ function Install-CodexWorkflow {
|
|
|
326
334
|
Complete-WorkflowBackups -Destination $dest
|
|
327
335
|
}
|
|
328
336
|
|
|
337
|
+
function Test-AntigravityInstallRoot {
|
|
338
|
+
Test-InstallRoot -Destination (Join-Path $HomeDir ".gemini")
|
|
339
|
+
Test-InstallRoot -Destination (Join-Path $HomeDir ".gemini\config")
|
|
340
|
+
Test-InstallRoot -Destination (Join-Path $HomeDir ".gemini\config\plugins")
|
|
341
|
+
Test-InstallRoot -Destination (Join-Path $HomeDir ".gemini\config\plugins\claude-everything-workflow")
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function Install-AntigravityWorkflow {
|
|
345
|
+
$antigravityArgs = @((Join-Path $RootDir "scripts\install-antigravity.js"), $HomeDir, "--backup-id", $BackupId)
|
|
346
|
+
if ($DryRun) { $antigravityArgs += "--dry-run" }
|
|
347
|
+
& node @antigravityArgs
|
|
348
|
+
if ($LASTEXITCODE -ne 0) {
|
|
349
|
+
throw "Antigravity plugin installation failed with exit code $LASTEXITCODE"
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
329
353
|
function Install-WorkflowRules {
|
|
330
354
|
param([string]$Destination, [string]$HostName)
|
|
331
355
|
|
|
@@ -348,15 +372,58 @@ function Complete-WorkflowBackups {
|
|
|
348
372
|
}
|
|
349
373
|
}
|
|
350
374
|
|
|
375
|
+
function Resolve-AntigravityInstall {
|
|
376
|
+
if (-not $script:InstallAntigravity -or $ExplicitAntigravity) {
|
|
377
|
+
return
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
$geminiDir = Join-Path $HomeDir ".gemini"
|
|
381
|
+
$item = Get-Item -LiteralPath $geminiDir -Force -ErrorAction SilentlyContinue
|
|
382
|
+
if ($null -eq $item) {
|
|
383
|
+
Write-Host "Skipping Antigravity plugin sync ($geminiDir not found; use -AntigravityOnly to install)."
|
|
384
|
+
$script:InstallAntigravity = $false
|
|
385
|
+
return
|
|
386
|
+
}
|
|
387
|
+
if (($item.Attributes -band [IO.FileAttributes]::ReparsePoint) -or (-not $item.PSIsContainer)) {
|
|
388
|
+
Write-Host "Skipping Antigravity plugin sync ($geminiDir is not a regular directory; use -AntigravityOnly to inspect)."
|
|
389
|
+
$script:InstallAntigravity = $false
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
Resolve-AntigravityInstall
|
|
394
|
+
|
|
351
395
|
if ($InstallClaude) {
|
|
352
396
|
Test-InstallRoot -Destination (Join-Path $HomeDir ".claude")
|
|
353
397
|
}
|
|
354
398
|
if ($InstallCodex) {
|
|
355
399
|
Test-InstallRoot -Destination (Join-Path $HomeDir ".codex")
|
|
356
400
|
}
|
|
401
|
+
if ($InstallAntigravity) {
|
|
402
|
+
Test-AntigravityInstallRoot
|
|
403
|
+
}
|
|
357
404
|
|
|
358
405
|
Test-RetiredSkillManifest
|
|
359
406
|
|
|
407
|
+
function Resolve-AntigravityInstall {
|
|
408
|
+
if (-not $script:InstallAntigravity -or $ExplicitAntigravity) {
|
|
409
|
+
return
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
$geminiDir = Join-Path $HomeDir ".gemini"
|
|
413
|
+
$item = Get-Item -LiteralPath $geminiDir -Force -ErrorAction SilentlyContinue
|
|
414
|
+
if ($null -eq $item) {
|
|
415
|
+
Write-Host "Skipping Antigravity plugin sync ($geminiDir not found; use -AntigravityOnly to install)."
|
|
416
|
+
$script:InstallAntigravity = $false
|
|
417
|
+
return
|
|
418
|
+
}
|
|
419
|
+
if (($item.Attributes -band [IO.FileAttributes]::ReparsePoint) -or (-not $item.PSIsContainer)) {
|
|
420
|
+
Write-Host "Skipping Antigravity plugin sync ($geminiDir is not a regular directory; use -AntigravityOnly to inspect)."
|
|
421
|
+
$script:InstallAntigravity = $false
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
Resolve-AntigravityInstall
|
|
426
|
+
|
|
360
427
|
if ($InstallClaude) {
|
|
361
428
|
Install-ClaudeWorkflow
|
|
362
429
|
}
|
|
@@ -365,4 +432,8 @@ if ($InstallCodex) {
|
|
|
365
432
|
Install-CodexWorkflow
|
|
366
433
|
}
|
|
367
434
|
|
|
435
|
+
if ($InstallAntigravity) {
|
|
436
|
+
Install-AntigravityWorkflow
|
|
437
|
+
}
|
|
438
|
+
|
|
368
439
|
Write-Host "Install complete."
|
package/scripts/install.sh
CHANGED
|
@@ -6,6 +6,9 @@ HOME_DIR="${HOME:?HOME is required}"
|
|
|
6
6
|
|
|
7
7
|
INSTALL_CLAUDE=1
|
|
8
8
|
INSTALL_CODEX=1
|
|
9
|
+
INSTALL_ANTIGRAVITY=1
|
|
10
|
+
EXPLICIT_ANTIGRAVITY=0
|
|
11
|
+
SELECTED_ONLY=""
|
|
9
12
|
DRY_RUN=0
|
|
10
13
|
SHOW_HELP=0
|
|
11
14
|
BACKUP_ID="$(date +%Y%m%d%H%M%S)"
|
|
@@ -15,30 +18,38 @@ usage() {
|
|
|
15
18
|
Usage: scripts/install.sh [options]
|
|
16
19
|
|
|
17
20
|
Options:
|
|
18
|
-
--claude-only
|
|
19
|
-
--codex-only
|
|
20
|
-
--
|
|
21
|
-
-
|
|
21
|
+
--claude-only Only install to ~/.claude
|
|
22
|
+
--codex-only Only install to ~/.codex
|
|
23
|
+
--antigravity-only Only install Antigravity plugin to ~/.gemini/config/plugins/claude-everything-workflow
|
|
24
|
+
--dry-run Print operations without writing files
|
|
25
|
+
-h, --help Show this help
|
|
22
26
|
EOF
|
|
23
27
|
}
|
|
24
28
|
|
|
29
|
+
set_only_host() {
|
|
30
|
+
local flag="$1"
|
|
31
|
+
if [ -n "$SELECTED_ONLY" ] && [ "$SELECTED_ONLY" != "$flag" ]; then
|
|
32
|
+
echo "$SELECTED_ONLY and $flag cannot be used together" >&2
|
|
33
|
+
exit 1
|
|
34
|
+
fi
|
|
35
|
+
SELECTED_ONLY="$flag"
|
|
36
|
+
INSTALL_CLAUDE=0
|
|
37
|
+
INSTALL_CODEX=0
|
|
38
|
+
INSTALL_ANTIGRAVITY=0
|
|
39
|
+
case "$flag" in
|
|
40
|
+
--claude-only) INSTALL_CLAUDE=1 ;;
|
|
41
|
+
--codex-only) INSTALL_CODEX=1 ;;
|
|
42
|
+
--antigravity-only)
|
|
43
|
+
INSTALL_ANTIGRAVITY=1
|
|
44
|
+
EXPLICIT_ANTIGRAVITY=1
|
|
45
|
+
;;
|
|
46
|
+
esac
|
|
47
|
+
}
|
|
48
|
+
|
|
25
49
|
while [ "$#" -gt 0 ]; do
|
|
26
50
|
case "$1" in
|
|
27
|
-
--claude-only)
|
|
28
|
-
|
|
29
|
-
echo "--claude-only and --codex-only cannot be used together" >&2
|
|
30
|
-
exit 1
|
|
31
|
-
fi
|
|
32
|
-
INSTALL_CLAUDE=1
|
|
33
|
-
INSTALL_CODEX=0
|
|
34
|
-
;;
|
|
35
|
-
--codex-only)
|
|
36
|
-
if [ "$INSTALL_CODEX" -eq 0 ]; then
|
|
37
|
-
echo "--claude-only and --codex-only cannot be used together" >&2
|
|
38
|
-
exit 1
|
|
39
|
-
fi
|
|
40
|
-
INSTALL_CLAUDE=0
|
|
41
|
-
INSTALL_CODEX=1
|
|
51
|
+
--claude-only|--codex-only|--antigravity-only)
|
|
52
|
+
set_only_host "$1"
|
|
42
53
|
;;
|
|
43
54
|
--dry-run)
|
|
44
55
|
DRY_RUN=1
|
|
@@ -166,6 +177,7 @@ remove_package_only_paths() {
|
|
|
166
177
|
"scripts/install.sh" \
|
|
167
178
|
"scripts/install.ps1" \
|
|
168
179
|
"scripts/install-rules.js" \
|
|
180
|
+
"scripts/install-antigravity.js" \
|
|
169
181
|
"scripts/legacy-common-rule-hashes.json" \
|
|
170
182
|
"scripts/eval-scenarios.js" \
|
|
171
183
|
"scripts/verify-harness.js" \
|
|
@@ -293,6 +305,19 @@ install_codex() {
|
|
|
293
305
|
finalize_backups "$dest"
|
|
294
306
|
}
|
|
295
307
|
|
|
308
|
+
install_antigravity() {
|
|
309
|
+
local options=("$ROOT_DIR/scripts/install-antigravity.js" "$HOME_DIR" "--backup-id" "$BACKUP_ID")
|
|
310
|
+
if [ "$DRY_RUN" -eq 1 ]; then options+=(--dry-run); fi
|
|
311
|
+
node "${options[@]}"
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
check_antigravity_root() {
|
|
315
|
+
check_install_root "$HOME_DIR/.gemini"
|
|
316
|
+
check_install_root "$HOME_DIR/.gemini/config"
|
|
317
|
+
check_install_root "$HOME_DIR/.gemini/config/plugins"
|
|
318
|
+
check_install_root "$HOME_DIR/.gemini/config/plugins/claude-everything-workflow"
|
|
319
|
+
}
|
|
320
|
+
|
|
296
321
|
install_workflow_rules() {
|
|
297
322
|
local host_name="$1"
|
|
298
323
|
local dest="$2"
|
|
@@ -309,15 +334,38 @@ finalize_backups() {
|
|
|
309
334
|
node "${options[@]}"
|
|
310
335
|
}
|
|
311
336
|
|
|
337
|
+
resolve_antigravity_install() {
|
|
338
|
+
if [ "$INSTALL_ANTIGRAVITY" -eq 0 ] || [ "$EXPLICIT_ANTIGRAVITY" -eq 1 ]; then
|
|
339
|
+
return
|
|
340
|
+
fi
|
|
341
|
+
|
|
342
|
+
local gemini_dir="$HOME_DIR/.gemini"
|
|
343
|
+
if [ -L "$gemini_dir" ]; then
|
|
344
|
+
echo "Skipping Antigravity plugin sync ($gemini_dir is a symlink; use --antigravity-only to inspect)."
|
|
345
|
+
INSTALL_ANTIGRAVITY=0
|
|
346
|
+
return
|
|
347
|
+
fi
|
|
348
|
+
if [ ! -d "$gemini_dir" ]; then
|
|
349
|
+
echo "Skipping Antigravity plugin sync ($gemini_dir not found; use --antigravity-only to install)."
|
|
350
|
+
INSTALL_ANTIGRAVITY=0
|
|
351
|
+
fi
|
|
352
|
+
}
|
|
353
|
+
|
|
312
354
|
validate_retired_skill_manifest
|
|
355
|
+
resolve_antigravity_install
|
|
313
356
|
if [ "$INSTALL_CLAUDE" -eq 1 ]; then
|
|
314
357
|
check_install_root "$HOME_DIR/.claude"
|
|
315
358
|
fi
|
|
316
359
|
if [ "$INSTALL_CODEX" -eq 1 ]; then
|
|
317
360
|
check_install_root "$HOME_DIR/.codex"
|
|
318
361
|
fi
|
|
362
|
+
if [ "$INSTALL_ANTIGRAVITY" -eq 1 ]; then
|
|
363
|
+
check_antigravity_root
|
|
364
|
+
fi
|
|
319
365
|
|
|
320
|
-
|
|
366
|
+
if [ "$INSTALL_CLAUDE" -eq 1 ] || [ "$INSTALL_CODEX" -eq 1 ]; then
|
|
367
|
+
require_rsync
|
|
368
|
+
fi
|
|
321
369
|
|
|
322
370
|
if [ "$INSTALL_CLAUDE" -eq 1 ]; then
|
|
323
371
|
install_claude
|
|
@@ -327,4 +375,8 @@ if [ "$INSTALL_CODEX" -eq 1 ]; then
|
|
|
327
375
|
install_codex
|
|
328
376
|
fi
|
|
329
377
|
|
|
378
|
+
if [ "$INSTALL_ANTIGRAVITY" -eq 1 ]; then
|
|
379
|
+
install_antigravity
|
|
380
|
+
fi
|
|
381
|
+
|
|
330
382
|
echo "Install complete."
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
3
|
"algorithm": "sha256-lf",
|
|
4
|
-
"source": "common/: origin/main history through a4f938bc70f3f85e4dcfad4d2534f522b823ea20; top-level rules: first-parent main history through 7326e4b",
|
|
4
|
+
"source": "common/: origin/main history through a4f938bc70f3f85e4dcfad4d2534f522b823ea20; top-level rules: first-parent main history through 7326e4b; 02-implementation.md also includes v0.2.9",
|
|
5
5
|
"files": {
|
|
6
6
|
"02-implementation.md": [
|
|
7
|
+
"4412acfbffdc9ac5823de7dd5fdd985297e4184260b4ccebbf7f633dae6090db",
|
|
7
8
|
"1bbe491d9b89e37a6a6d004e1b6e1ccd7478b94341e7b4c51ce8d01fad585c7f",
|
|
8
9
|
"700331676ad40d65acdeb469a67cf802cddff78ebf0861ec5e4427b5a3d23620"
|
|
9
10
|
],
|