claude-everything-workflow 0.2.10 → 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 +10 -6
- package/README.zh-CN.md +11 -7
- 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 +2 -2
- package/package.json +1 -1
- package/scripts/eval-scenarios.js +46 -14
- package/scripts/install-antigravity.js +501 -0
- package/scripts/install-rules.js +121 -45
- package/scripts/install.ps1 +75 -4
- package/scripts/install.sh +72 -20
- package/scripts/verify/install-rules.test.js +289 -7
- package/scripts/verify/metadata-checks.js +23 -0
- package/scripts/verify/scenario-checks.test.js +39 -10
- package/skills/README.md +1 -1
- package/skills/code-review/SKILL.md +15 -21
- package/skills/implement/SKILL.md +2 -2
package/scripts/install-rules.js
CHANGED
|
@@ -7,8 +7,8 @@ const crypto = require("node:crypto");
|
|
|
7
7
|
const os = require("node:os");
|
|
8
8
|
const { spawnSync } = require("node:child_process");
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const IMPLEMENTATION_RULE_BASE = ".cew-rule-state/02-implementation.base.md";
|
|
11
|
+
const IMPLEMENTATION_RULE_INCOMING = ".cew-rule-state/02-implementation.incoming.md";
|
|
12
12
|
|
|
13
13
|
const BACKUP_ROOT_NAME = ".cew-backups";
|
|
14
14
|
const LEGACY_TOP_LEVEL_BAK = /^(?:CLAUDE\.md|AGENTS\.md|settings\.json)\.bak\..+$/;
|
|
@@ -54,8 +54,20 @@ function replaceFile(file, content, mode = 0o600) {
|
|
|
54
54
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
55
55
|
const temp = file + ".tmp-" + crypto.randomUUID();
|
|
56
56
|
try {
|
|
57
|
-
fs.writeFileSync(temp, content, { flag: "wx", mode });
|
|
58
|
-
|
|
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
|
+
}
|
|
59
71
|
} finally {
|
|
60
72
|
fs.rmSync(temp, { force: true });
|
|
61
73
|
}
|
|
@@ -64,21 +76,19 @@ function replaceFile(file, content, mode = 0o600) {
|
|
|
64
76
|
function copyRule({ source, root, relative, backupId, dryRun, log, merged }) {
|
|
65
77
|
const target = checkedPath(root, relative);
|
|
66
78
|
const content = merged ?? fs.readFileSync(source);
|
|
67
|
-
|
|
79
|
+
const exists = fs.existsSync(target);
|
|
80
|
+
if (exists) {
|
|
68
81
|
const previous = fs.readFileSync(target);
|
|
69
82
|
if (content.equals(previous)) return;
|
|
70
83
|
const backup = checkedPath(root, path.posix.join(BACKUP_ROOT_NAME, backupId, relative));
|
|
71
84
|
log(`${dryRun ? "[dry-run] " : ""}备份规则: ${backup}`);
|
|
72
85
|
if (!dryRun) {
|
|
73
|
-
|
|
74
|
-
fs.copyFileSync(target, backup);
|
|
86
|
+
replaceFile(backup, previous, fs.statSync(target).mode);
|
|
75
87
|
}
|
|
76
88
|
}
|
|
77
89
|
log(`${dryRun ? "[dry-run] " : ""}安装规则: ${target}`);
|
|
78
90
|
if (!dryRun) {
|
|
79
|
-
fs.
|
|
80
|
-
if (merged) replaceFile(target, merged, fs.statSync(target).mode);
|
|
81
|
-
else fs.copyFileSync(source, target);
|
|
91
|
+
replaceFile(target, content, fs.statSync(exists ? target : source).mode);
|
|
82
92
|
}
|
|
83
93
|
}
|
|
84
94
|
|
|
@@ -103,11 +113,11 @@ function mergeRuleText(local, base, incoming) {
|
|
|
103
113
|
}
|
|
104
114
|
}
|
|
105
115
|
|
|
106
|
-
function
|
|
116
|
+
function installMergedImplementationRule(options, knownHashes, hostLabel) {
|
|
107
117
|
const { source, root, relative, dryRun, log } = options;
|
|
108
118
|
const target = checkedPath(root, relative);
|
|
109
|
-
const base = checkedPath(root,
|
|
110
|
-
const incoming = checkedPath(root,
|
|
119
|
+
const base = checkedPath(root, IMPLEMENTATION_RULE_BASE);
|
|
120
|
+
const incoming = checkedPath(root, IMPLEMENTATION_RULE_INCOMING);
|
|
111
121
|
const previous = fs.existsSync(base) ? fs.readFileSync(base) : null;
|
|
112
122
|
const local = fs.existsSync(target) ? fs.readFileSync(target) : null;
|
|
113
123
|
const next = fs.readFileSync(source);
|
|
@@ -126,7 +136,7 @@ function installCodexImplementationRule(options, knownHashes) {
|
|
|
126
136
|
}
|
|
127
137
|
copyRule({ ...options, merged });
|
|
128
138
|
} else {
|
|
129
|
-
log(`保留
|
|
139
|
+
log(`保留 ${hostLabel} 个人实现规则: ${target}`);
|
|
130
140
|
}
|
|
131
141
|
if (!dryRun) {
|
|
132
142
|
if (!previous || !previous.equals(next)) replaceFile(base, next);
|
|
@@ -237,49 +247,111 @@ function finalizeBackups({ installRoot, dryRun = false, log = console.log }) {
|
|
|
237
247
|
}
|
|
238
248
|
}
|
|
239
249
|
|
|
240
|
-
function
|
|
241
|
-
if (
|
|
242
|
-
|
|
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) {
|
|
243
295
|
const rulesRoot = path.join(sourceRoot, "rules");
|
|
244
|
-
const legacy = JSON.parse(fs.readFileSync(path.join(sourceRoot, "scripts/legacy-common-rule-hashes.json"), "utf8"));
|
|
245
296
|
const files = fs.readdirSync(rulesRoot, { withFileTypes: true })
|
|
246
297
|
.filter((entry) => entry.isFile() && entry.name.endsWith(".md"))
|
|
247
298
|
.map((entry) => entry.name);
|
|
248
299
|
const commonFiles = fs.readdirSync(path.join(rulesRoot, "common"), { withFileTypes: true })
|
|
249
300
|
.filter((entry) => entry.isFile() && entry.name.endsWith(".md"))
|
|
250
301
|
.map((entry) => `common/${entry.name}`);
|
|
251
|
-
|
|
252
|
-
|
|
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);
|
|
253
309
|
// Validate all managed destinations before the first write, including upgrade cleanup paths.
|
|
254
310
|
checkedPath(root, BACKUP_ROOT_NAME);
|
|
255
|
-
if (
|
|
256
|
-
checkedPath(root,
|
|
257
|
-
checkedPath(root,
|
|
311
|
+
if (policy.mergedRule) {
|
|
312
|
+
checkedPath(root, IMPLEMENTATION_RULE_BASE);
|
|
313
|
+
checkedPath(root, IMPLEMENTATION_RULE_INCOMING);
|
|
258
314
|
}
|
|
259
|
-
for (const relative of
|
|
260
|
-
|
|
261
|
-
|
|
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}`);
|
|
262
323
|
checkedPath(root, `references/rules/${relative}`);
|
|
263
324
|
}
|
|
264
325
|
}
|
|
265
326
|
for (const retired of retiredTopLevelRules) {
|
|
266
|
-
|
|
267
|
-
|
|
327
|
+
for (const dir of policy.retiredDirs) {
|
|
328
|
+
checkedPath(root, `${dir}/${retired}`);
|
|
329
|
+
}
|
|
268
330
|
}
|
|
269
|
-
|
|
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) {
|
|
270
339
|
const source = path.join(rulesRoot, relative);
|
|
271
|
-
if (
|
|
272
|
-
|
|
273
|
-
|
|
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
|
+
);
|
|
274
346
|
continue;
|
|
275
347
|
}
|
|
276
|
-
if (
|
|
348
|
+
if (policy.promotedRule === relative) {
|
|
277
349
|
installPromotedRule({ source, root, relative, knownHashes: legacy.files[relative] || [], backupId, dryRun, log });
|
|
278
350
|
continue;
|
|
279
351
|
}
|
|
280
|
-
const
|
|
281
|
-
copyRule({ source, root, relative: `${
|
|
282
|
-
if (
|
|
352
|
+
const targetDir = policy.dirFor(relative);
|
|
353
|
+
copyRule({ source, root, relative: `${targetDir}/${relative}`, backupId, dryRun, log });
|
|
354
|
+
if (policy.retireColdFromRules && targetDir === "references/rules") {
|
|
283
355
|
retireRule({
|
|
284
356
|
source, root, relative: `rules/${relative}`,
|
|
285
357
|
knownHashes: legacy.files[relative] || [], dryRun, log,
|
|
@@ -288,14 +360,21 @@ function installRules({ sourceRoot, installRoot, host, backupId = defaultBackupI
|
|
|
288
360
|
}
|
|
289
361
|
for (const retired of retiredTopLevelRules) {
|
|
290
362
|
const knownHashes = legacy.files[retired] || [];
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
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 });
|
|
294
365
|
}
|
|
295
366
|
}
|
|
296
367
|
}
|
|
297
368
|
|
|
298
|
-
module.exports = {
|
|
369
|
+
module.exports = {
|
|
370
|
+
BACKUP_ROOT_NAME,
|
|
371
|
+
checkedPath,
|
|
372
|
+
defaultBackupId,
|
|
373
|
+
validateBackupId,
|
|
374
|
+
validateRuleTargets,
|
|
375
|
+
installRules,
|
|
376
|
+
finalizeBackups,
|
|
377
|
+
};
|
|
299
378
|
|
|
300
379
|
function parseCli(argv) {
|
|
301
380
|
let dryRun = false;
|
|
@@ -309,10 +388,7 @@ function parseCli(argv) {
|
|
|
309
388
|
} else if (arg === "--finalize-backups") {
|
|
310
389
|
finalize = true;
|
|
311
390
|
} else if (arg === "--backup-id") {
|
|
312
|
-
backupId = argv[++i];
|
|
313
|
-
if (!backupId || backupId.includes("/") || backupId.includes("\\") || backupId.includes("..")) {
|
|
314
|
-
throw new Error("Invalid --backup-id");
|
|
315
|
-
}
|
|
391
|
+
backupId = validateBackupId(argv[++i]);
|
|
316
392
|
} else if (arg.startsWith("-")) {
|
|
317
393
|
throw new Error(`Unknown option: ${arg}`);
|
|
318
394
|
} else {
|
|
@@ -334,7 +410,7 @@ if (require.main === module) {
|
|
|
334
410
|
} else {
|
|
335
411
|
const [host, installRoot] = positional;
|
|
336
412
|
if (!host || !installRoot || positional.length !== 2) {
|
|
337
|
-
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]");
|
|
338
414
|
}
|
|
339
415
|
installRules({
|
|
340
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."
|