prizmkit 1.1.190 → 1.1.191
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/bin/create-prizmkit.js +4 -4
- package/bundled/VERSION.json +3 -3
- package/bundled/adapters/antigravity/assets/prizmkit-hook.cjs +150 -0
- package/bundled/adapters/antigravity/hooks-adapter.js +195 -0
- package/bundled/adapters/antigravity/paths.js +14 -0
- package/bundled/adapters/antigravity/rules-adapter.js +54 -0
- package/bundled/adapters/antigravity/skill-adapter.js +29 -0
- package/bundled/dev-pipeline/README.md +16 -5
- package/bundled/dev-pipeline/prizmkit_runtime/config.py +13 -2
- package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +12 -12
- package/bundled/dev-pipeline/prizmkit_runtime/platform_detection.py +13 -4
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +8 -2
- package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +186 -24
- package/bundled/dev-pipeline/prizmkit_runtime/status.py +2 -0
- package/bundled/dev-pipeline/scripts/parse-stream-progress.py +305 -17
- package/bundled/dev-pipeline/scripts/utils.py +5 -3
- package/bundled/dev-pipeline/tests/live_ai_cli_log_smoke.py +1 -0
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +135 -0
- package/bundled/dev-pipeline/tests/test_unified_cli.py +363 -0
- package/bundled/rules/USAGE.md +1 -0
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/feature-planner/SKILL.md +2 -2
- package/bundled/skills/prizmkit-init/SKILL.md +1 -1
- package/bundled/skills/prizmkit-init/references/config-schema.md +2 -2
- package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +1 -1
- package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +1 -1
- package/package.json +1 -1
- package/src/ai-cli-launch.js +1 -1
- package/src/clean.js +40 -4
- package/src/config.js +64 -4
- package/src/detect-platform.js +10 -6
- package/src/external-skills.js +2 -2
- package/src/index.js +1 -0
- package/src/manifest.js +1 -1
- package/src/platforms.js +6 -2
- package/src/prompts.js +11 -3
- package/src/scaffold.js +59 -4
- package/src/upgrade.js +9 -3
package/src/config.js
CHANGED
|
@@ -112,6 +112,42 @@ async function removeCursorManagedFiles(projectRoot, dryRun) {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
async function removeAntigravityManagedFiles(projectRoot, dryRun) {
|
|
116
|
+
const adapterPath = path.join(getAdaptersDir(), 'antigravity', 'hooks-adapter.js');
|
|
117
|
+
const { removeHooks } = await import(pathToFileURL(adapterPath).href);
|
|
118
|
+
for (const change of await removeHooks(projectRoot, dryRun)) {
|
|
119
|
+
const verb = change.action === 'updated' ? 'update' : 'remove';
|
|
120
|
+
console.log(dryRun
|
|
121
|
+
? chalk.gray(` [dry-run] ${verb} ${change.path}`)
|
|
122
|
+
: change.action === 'updated'
|
|
123
|
+
? chalk.green(` ✓ updated ${change.path} (removed PrizmKit hooks)`)
|
|
124
|
+
: chalk.red(` ✗ removed ${change.path}`));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const guidancePath = path.join(projectRoot, '.agents', 'plugins', 'prizmkit', 'rules', 'prizmkit-framework.md');
|
|
128
|
+
if (await fs.pathExists(guidancePath)) {
|
|
129
|
+
if (dryRun) console.log(chalk.gray(' [dry-run] remove .agents/plugins/prizmkit/rules/prizmkit-framework.md'));
|
|
130
|
+
else {
|
|
131
|
+
await fs.remove(guidancePath);
|
|
132
|
+
console.log(chalk.red(' ✗ removed .agents/plugins/prizmkit/rules/prizmkit-framework.md'));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (!dryRun) {
|
|
137
|
+
for (const relativeDir of [
|
|
138
|
+
'.agents/plugins/prizmkit/hooks',
|
|
139
|
+
'.agents/plugins/prizmkit/rules',
|
|
140
|
+
'.agents/plugins/prizmkit/skills',
|
|
141
|
+
'.agents/plugins/prizmkit',
|
|
142
|
+
'.agents/plugins',
|
|
143
|
+
'.agents',
|
|
144
|
+
]) {
|
|
145
|
+
const dir = path.join(projectRoot, relativeDir);
|
|
146
|
+
if (await fs.pathExists(dir) && (await fs.readdir(dir)).length === 0) await fs.remove(dir);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
115
151
|
/**
|
|
116
152
|
* Detect which platforms are actually installed on filesystem.
|
|
117
153
|
*/
|
|
@@ -130,7 +166,16 @@ async function detectInstalledPlatforms(projectRoot) {
|
|
|
130
166
|
const hasCodex = await hasPlatformFiles(path.join(projectRoot, '.agents', 'skills'));
|
|
131
167
|
const hasPi = await hasPlatformFiles(path.join(projectRoot, '.pi', 'skills'));
|
|
132
168
|
const hasCursor = await hasPlatformFiles(path.join(projectRoot, '.cursor', 'skills'));
|
|
133
|
-
const
|
|
169
|
+
const hasAntigravity = await fs.pathExists(path.join(projectRoot, '.agents', 'plugins', 'prizmkit', 'plugin.json'))
|
|
170
|
+
|| await hasPlatformFiles(path.join(projectRoot, '.agents', 'plugins', 'prizmkit', 'skills'));
|
|
171
|
+
const detected = [
|
|
172
|
+
hasCodeBuddy && 'codebuddy',
|
|
173
|
+
hasClaude && 'claude',
|
|
174
|
+
hasCodex && 'codex',
|
|
175
|
+
hasPi && 'pi',
|
|
176
|
+
hasCursor && 'cursor',
|
|
177
|
+
hasAntigravity && 'antigravity',
|
|
178
|
+
].filter(Boolean);
|
|
134
179
|
if (detected.length === 0) return null;
|
|
135
180
|
return uniquePlatforms(detected).join(',');
|
|
136
181
|
}
|
|
@@ -246,8 +291,9 @@ async function migrateProjectMemoryOnPlatformDrop(droppedPlatform, newPlatforms,
|
|
|
246
291
|
* Selective removal — only removes known PrizmKit files, leaves user-created files intact.
|
|
247
292
|
*/
|
|
248
293
|
async function removePlatformFiles(platform, projectRoot, manifest, dryRun) {
|
|
249
|
-
// Validate and remove merge-sensitive Cursor hooks before any other platform mutation.
|
|
294
|
+
// Validate and remove merge-sensitive Cursor/Antigravity hooks before any other platform mutation.
|
|
250
295
|
if (platform === 'cursor') await removeCursorManagedFiles(projectRoot, dryRun);
|
|
296
|
+
if (platform === 'antigravity') await removeAntigravityManagedFiles(projectRoot, dryRun);
|
|
251
297
|
|
|
252
298
|
const skillNames = manifest?.files?.skills || [];
|
|
253
299
|
const ruleFileNames = manifest?.files?.rules || [];
|
|
@@ -272,8 +318,8 @@ async function removePlatformFiles(platform, projectRoot, manifest, dryRun) {
|
|
|
272
318
|
}
|
|
273
319
|
|
|
274
320
|
// Settings
|
|
275
|
-
if (platform === 'cursor') {
|
|
276
|
-
// Merge-sensitive
|
|
321
|
+
if (platform === 'cursor' || platform === 'antigravity') {
|
|
322
|
+
// Merge-sensitive hooks and managed framework guidance were handled first.
|
|
277
323
|
} else if (platform === 'codex') {
|
|
278
324
|
await removeGeneratedCodexConfig(projectRoot, dryRun);
|
|
279
325
|
const legacySettingsFile = path.join(projectRoot, '.codex', 'prizmkit-settings.json');
|
|
@@ -414,6 +460,20 @@ async function removePlatformFiles(platform, projectRoot, manifest, dryRun) {
|
|
|
414
460
|
await fs.remove(dir);
|
|
415
461
|
}
|
|
416
462
|
}
|
|
463
|
+
} else if (platform === 'antigravity') {
|
|
464
|
+
for (const relativeDir of [
|
|
465
|
+
'.agents/plugins/prizmkit/skills',
|
|
466
|
+
'.agents/plugins/prizmkit/rules',
|
|
467
|
+
'.agents/plugins/prizmkit/hooks',
|
|
468
|
+
'.agents/plugins/prizmkit',
|
|
469
|
+
'.agents/plugins',
|
|
470
|
+
'.agents',
|
|
471
|
+
]) {
|
|
472
|
+
const dir = path.join(projectRoot, relativeDir);
|
|
473
|
+
if (await fs.pathExists(dir) && !dryRun && (await fs.readdir(dir)).length === 0) {
|
|
474
|
+
await fs.remove(dir);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
417
477
|
}
|
|
418
478
|
}
|
|
419
479
|
|
package/src/detect-platform.js
CHANGED
|
@@ -9,7 +9,7 @@ import os from 'os';
|
|
|
9
9
|
/**
|
|
10
10
|
* 允许检测的命令白名单(仅用于 which 检测)
|
|
11
11
|
*/
|
|
12
|
-
const ALLOWED_COMMANDS = ['cbc', 'claude', 'codex', 'pi', 'agent'];
|
|
12
|
+
const ALLOWED_COMMANDS = ['cbc', 'claude', 'codex', 'pi', 'agent', 'agy'];
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* 检查命令是否存在于 PATH 中
|
|
@@ -51,7 +51,7 @@ function cursorAgentExists() {
|
|
|
51
51
|
* 注意:platform 控制目录结构,suggestedCli 是实际运行的可执行命令。
|
|
52
52
|
* Cursor 的 `agent` 名称通用,只有安全的 version/help 身份探测通过才自动选择。
|
|
53
53
|
*
|
|
54
|
-
* @returns {{ cbc: boolean, claude: boolean, codex: boolean, pi: boolean, cursor: boolean, suggested: string, suggestedCli: string }}
|
|
54
|
+
* @returns {{ cbc: boolean, claude: boolean, codex: boolean, pi: boolean, cursor: boolean, antigravity: boolean, suggested: string, suggestedCli: string }}
|
|
55
55
|
*/
|
|
56
56
|
export function detectPlatform() {
|
|
57
57
|
const cbc = commandExists('cbc');
|
|
@@ -59,10 +59,13 @@ export function detectPlatform() {
|
|
|
59
59
|
const codex = commandExists('codex');
|
|
60
60
|
const pi = commandExists('pi');
|
|
61
61
|
const cursor = cursorAgentExists();
|
|
62
|
+
const antigravity = commandExists('agy');
|
|
62
63
|
|
|
63
|
-
// Preserve historical recommendations when
|
|
64
|
+
// Preserve historical recommendations when newer platforms are absent.
|
|
64
65
|
let suggested = 'codebuddy';
|
|
65
|
-
if (
|
|
66
|
+
if (antigravity) {
|
|
67
|
+
suggested = (cbc || claude || codex || pi || cursor) ? 'all' : 'antigravity';
|
|
68
|
+
} else if (cursor) {
|
|
66
69
|
suggested = (cbc || claude || codex || pi) ? 'all' : 'cursor';
|
|
67
70
|
} else if (pi) {
|
|
68
71
|
suggested = (cbc || claude || codex) ? 'all' : 'pi';
|
|
@@ -76,13 +79,14 @@ export function detectPlatform() {
|
|
|
76
79
|
suggested = 'codebuddy';
|
|
77
80
|
}
|
|
78
81
|
|
|
79
|
-
// Preserve historical precedence and use
|
|
82
|
+
// Preserve historical precedence and use newer CLIs only when earlier ones are absent.
|
|
80
83
|
let suggestedCli = '';
|
|
81
84
|
if (cbc) suggestedCli = 'cbc';
|
|
82
85
|
else if (claude) suggestedCli = 'claude';
|
|
83
86
|
else if (codex) suggestedCli = 'codex';
|
|
84
87
|
else if (pi) suggestedCli = 'pi';
|
|
85
88
|
else if (cursor) suggestedCli = 'agent';
|
|
89
|
+
else if (antigravity) suggestedCli = 'agy';
|
|
86
90
|
|
|
87
|
-
return { cbc, claude, codex, pi, cursor, suggested, suggestedCli };
|
|
91
|
+
return { cbc, claude, codex, pi, cursor, antigravity, suggested, suggestedCli };
|
|
88
92
|
}
|
package/src/external-skills.js
CHANGED
|
@@ -22,7 +22,7 @@ import { payloadSkillRoots } from './platforms.js';
|
|
|
22
22
|
* skill.repo {string} - GitHub short ref (e.g. "pbakaus/impeccable") or full URL
|
|
23
23
|
* skill.name {string} - Skill name (used for display / single-skill mode)
|
|
24
24
|
* skill.installAll {boolean} - If true, install all skills from the repo
|
|
25
|
-
* @param {string} platform - 'claude' | 'codebuddy' | 'codex' | 'pi' | 'cursor' | 'all' ('both' supported only for legacy manifests)
|
|
25
|
+
* @param {string} platform - 'claude' | 'codebuddy' | 'codex' | 'pi' | 'cursor' | 'antigravity' | 'all' ('both' supported only for legacy manifests)
|
|
26
26
|
* @param {string} projectRoot - Target project root
|
|
27
27
|
* @param {string} [aiCli] - optional AI CLI command that may require an additional payload platform
|
|
28
28
|
*/
|
|
@@ -87,7 +87,7 @@ export async function installExternalSkill(skill, platform, projectRoot, dryRun,
|
|
|
87
87
|
* Remove all artifacts created by `npx skills` that are not needed by PrizmKit.
|
|
88
88
|
* Call this once after all external skills have been installed.
|
|
89
89
|
*
|
|
90
|
-
* @param {string} platform - 'claude' | 'codebuddy' | 'codex' | 'pi' | 'cursor' | 'all' ('both' supported only for legacy manifests)
|
|
90
|
+
* @param {string} platform - 'claude' | 'codebuddy' | 'codex' | 'pi' | 'cursor' | 'antigravity' | 'all' ('both' supported only for legacy manifests)
|
|
91
91
|
* @param {string} [aiCli] - optional AI CLI command that may require an additional payload platform
|
|
92
92
|
*/
|
|
93
93
|
export async function cleanExternalSkillArtifacts(projectRoot, platform, aiCli = '') {
|
package/src/index.js
CHANGED
|
@@ -54,6 +54,7 @@ export async function runScaffold(directory, options) {
|
|
|
54
54
|
detected.codex ? chalk.green('codex ✓') : chalk.gray('codex ✗'),
|
|
55
55
|
detected.pi ? chalk.green('pi ✓') : chalk.gray('pi ✗'),
|
|
56
56
|
detected.cursor ? chalk.green('agent(Cursor) ✓') : chalk.gray('agent(Cursor) ✗'),
|
|
57
|
+
detected.antigravity ? chalk.green('agy ✓') : chalk.gray('agy ✗'),
|
|
57
58
|
].join(' ');
|
|
58
59
|
console.log(` 检测到的 CLI 工具: ${cliStatus}`);
|
|
59
60
|
console.log(` 目标目录: ${projectRoot}`);
|
package/src/manifest.js
CHANGED
|
@@ -133,7 +133,7 @@ export async function writeManifest(projectRoot, data) {
|
|
|
133
133
|
* Build a manifest object from installation config.
|
|
134
134
|
* @param {Object} params
|
|
135
135
|
* @param {string} params.version - PrizmKit version
|
|
136
|
-
* @param {string} params.platform - 'codebuddy' | 'claude' | 'codex' | 'pi' | 'cursor' | 'all' ('both' supported only for legacy manifests)
|
|
136
|
+
* @param {string} params.platform - 'codebuddy' | 'claude' | 'codex' | 'pi' | 'cursor' | 'antigravity' | 'all' ('both' supported only for legacy manifests)
|
|
137
137
|
* @param {string} [params.runtime] - canonical Python runtime id or compatibility alias
|
|
138
138
|
* @param {string} params.suite - skill suite name
|
|
139
139
|
* @param {string[]} params.skills - resolved skill name list
|
package/src/platforms.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import { isBuiltInAiCli } from './ai-cli-launch.js';
|
|
3
3
|
|
|
4
|
-
export const PLATFORM_IDS = ['codebuddy', 'claude', 'codex', 'pi', 'cursor'];
|
|
5
|
-
export const PLATFORM_INPUT_HELP = 'codebuddy, claude, codex, pi, cursor, a comma-separated list of those, or all';
|
|
4
|
+
export const PLATFORM_IDS = ['codebuddy', 'claude', 'codex', 'pi', 'cursor', 'antigravity'];
|
|
5
|
+
export const PLATFORM_INPUT_HELP = 'codebuddy, claude, codex, pi, cursor, antigravity, a comma-separated list of those, or all';
|
|
6
6
|
export const CANONICAL_ALL_PLATFORMS = PLATFORM_IDS.join(',');
|
|
7
7
|
|
|
8
8
|
const HOST_LABELS = {
|
|
@@ -11,6 +11,7 @@ const HOST_LABELS = {
|
|
|
11
11
|
codex: 'Codex',
|
|
12
12
|
pi: 'Pi',
|
|
13
13
|
cursor: 'Cursor',
|
|
14
|
+
antigravity: 'Antigravity',
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
export function unknownPlatformMessage(platform) {
|
|
@@ -70,6 +71,7 @@ export function platformFromAiCli(aiCli) {
|
|
|
70
71
|
if (name === 'codex') return 'codex';
|
|
71
72
|
if (name === 'pi') return 'pi';
|
|
72
73
|
if (name === 'agent') return 'cursor';
|
|
74
|
+
if (name === 'agy' || name === 'antigravity') return 'antigravity';
|
|
73
75
|
if (name === 'cbc' || name === 'codebuddy') return 'codebuddy';
|
|
74
76
|
return null;
|
|
75
77
|
}
|
|
@@ -138,6 +140,7 @@ export function defaultCliForPlatform(platform) {
|
|
|
138
140
|
if (platform === 'codex') return 'codex';
|
|
139
141
|
if (platform === 'pi') return 'pi';
|
|
140
142
|
if (platform === 'cursor') return 'agent';
|
|
143
|
+
if (platform === 'antigravity') return 'agy';
|
|
141
144
|
return '';
|
|
142
145
|
}
|
|
143
146
|
|
|
@@ -146,6 +149,7 @@ export function nativeSkillRoot(platform, projectRoot) {
|
|
|
146
149
|
if (platform === 'codex') return path.join(projectRoot, '.agents', 'skills');
|
|
147
150
|
if (platform === 'pi') return path.join(projectRoot, '.pi', 'skills');
|
|
148
151
|
if (platform === 'cursor') return path.join(projectRoot, '.cursor', 'skills');
|
|
152
|
+
if (platform === 'antigravity') return path.join(projectRoot, '.agents', 'plugins', 'prizmkit', 'skills');
|
|
149
153
|
return path.join(projectRoot, '.claude', 'skills');
|
|
150
154
|
}
|
|
151
155
|
|
package/src/prompts.js
CHANGED
|
@@ -37,7 +37,7 @@ export function __resetAiCliPromptsForTests() {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* Select target platforms (codebuddy, claude, codex, pi, cursor).
|
|
40
|
+
* Select target platforms (codebuddy, claude, codex, pi, cursor, antigravity).
|
|
41
41
|
* @param {string} currentPlatform - current platform value
|
|
42
42
|
* @param {Object} detected - detected environment info (e.g., { cbc: true, claude: false })
|
|
43
43
|
* @returns {Promise<string>} canonical comma-separated platform ids
|
|
@@ -67,6 +67,10 @@ export async function selectPlatform(currentPlatform, detected = {}) {
|
|
|
67
67
|
id: 'cursor',
|
|
68
68
|
name: `Cursor (.cursor/skills + .cursor/rules + .cursor/hooks.json)${detected.cursor ? chalk.green(' ← 已检测到 agent') : ''}`,
|
|
69
69
|
},
|
|
70
|
+
{
|
|
71
|
+
id: 'antigravity',
|
|
72
|
+
name: `Antigravity (.agents/plugins/prizmkit/)${detected.antigravity ? chalk.green(' ← 已检测到 agy') : ''}`,
|
|
73
|
+
},
|
|
70
74
|
];
|
|
71
75
|
const selected = await selectPlatformPrompt({
|
|
72
76
|
message: '选择目标平台 (决定安装的目录结构,可多选):',
|
|
@@ -89,7 +93,7 @@ export async function selectPlatform(currentPlatform, detected = {}) {
|
|
|
89
93
|
}
|
|
90
94
|
|
|
91
95
|
/**
|
|
92
|
-
* Select AI CLI command (cbc, claude, codex, pi, agent, custom, or skip).
|
|
96
|
+
* Select AI CLI command (cbc, claude, codex, pi, agent, agy, custom, or skip).
|
|
93
97
|
* @param {string} currentCommand - current AI CLI command
|
|
94
98
|
* @param {Object} detected - detected environment info
|
|
95
99
|
* @returns {Promise<string>} - known command, custom string, or ''
|
|
@@ -116,6 +120,10 @@ export async function selectAiCli(currentCommand, detected = {}) {
|
|
|
116
120
|
name: `agent — Cursor Agent CLI${detected.cursor ? chalk.green(' ✓ 已验证') : chalk.gray(' (未检测到或身份未验证)')}`,
|
|
117
121
|
value: 'agent',
|
|
118
122
|
},
|
|
123
|
+
{
|
|
124
|
+
name: `agy — Antigravity CLI${detected.antigravity ? chalk.green(' ✓ 已安装') : chalk.gray(' (未检测到)')}`,
|
|
125
|
+
value: 'agy',
|
|
126
|
+
},
|
|
119
127
|
{
|
|
120
128
|
name: '自定义 — 输入其他命令',
|
|
121
129
|
value: '__custom__',
|
|
@@ -126,7 +134,7 @@ export async function selectAiCli(currentCommand, detected = {}) {
|
|
|
126
134
|
},
|
|
127
135
|
];
|
|
128
136
|
|
|
129
|
-
const knownCliValues = ['cbc', 'claude', 'codex', 'pi', 'agent'];
|
|
137
|
+
const knownCliValues = ['cbc', 'claude', 'codex', 'pi', 'agent', 'agy'];
|
|
130
138
|
const cliDefault = knownCliValues.includes(currentCommand)
|
|
131
139
|
? currentCommand
|
|
132
140
|
: (currentCommand ? '__custom__' : (detected.suggestedCli || ''));
|
package/src/scaffold.js
CHANGED
|
@@ -98,7 +98,7 @@ async function removeEmptyDirectory(dirPath) {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
export async function removeRetiredAgentTeamArtifacts(platform, projectRoot, dryRun) {
|
|
101
|
-
if (platform === 'pi' || platform === 'cursor') return;
|
|
101
|
+
if (platform === 'pi' || platform === 'cursor' || platform === 'antigravity') return;
|
|
102
102
|
const agentDir = platform === 'claude'
|
|
103
103
|
? path.join(projectRoot, '.claude', 'agents')
|
|
104
104
|
: platform === 'codex'
|
|
@@ -231,11 +231,12 @@ export async function installSkills(platform, skills, projectRoot, dryRun, runti
|
|
|
231
231
|
skillSubcategories[skillName] = skillDef.subcategory;
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
-
// Load
|
|
234
|
+
// Load platform adapters for skill conversion
|
|
235
235
|
let convertSkillToCommand;
|
|
236
236
|
let convertSkillToCodex;
|
|
237
237
|
let convertSkillToPi;
|
|
238
238
|
let convertSkillToCursor;
|
|
239
|
+
let convertSkillToAntigravity;
|
|
239
240
|
if (platform === 'claude') {
|
|
240
241
|
const commandAdapter = await loadAdapter('claude', 'command-adapter.js');
|
|
241
242
|
convertSkillToCommand = commandAdapter.convertSkillToCommand;
|
|
@@ -248,6 +249,9 @@ export async function installSkills(platform, skills, projectRoot, dryRun, runti
|
|
|
248
249
|
} else if (platform === 'cursor') {
|
|
249
250
|
const cursorSkillAdapter = await loadAdapter('cursor', 'skill-adapter.js');
|
|
250
251
|
convertSkillToCursor = cursorSkillAdapter.convertSkill;
|
|
252
|
+
} else if (platform === 'antigravity') {
|
|
253
|
+
const antigravitySkillAdapter = await loadAdapter('antigravity', 'skill-adapter.js');
|
|
254
|
+
convertSkillToAntigravity = antigravitySkillAdapter.convertSkill;
|
|
251
255
|
}
|
|
252
256
|
|
|
253
257
|
for (const skillName of skills) {
|
|
@@ -396,6 +400,25 @@ export async function installSkills(platform, skills, projectRoot, dryRun, runti
|
|
|
396
400
|
}
|
|
397
401
|
}
|
|
398
402
|
console.log(chalk.green(` ✓ .cursor/skills/${skillName}/`));
|
|
403
|
+
} else if (platform === 'antigravity') {
|
|
404
|
+
const content = await fs.readFile(skillMdPath, 'utf8');
|
|
405
|
+
const converted = convertSkillToAntigravity(content, skillName);
|
|
406
|
+
const targetDir = path.join(projectRoot, '.agents', 'plugins', 'prizmkit', 'skills', skillName);
|
|
407
|
+
|
|
408
|
+
if (dryRun) {
|
|
409
|
+
console.log(chalk.gray(` [dry-run] .agents/plugins/prizmkit/skills/${skillName}/`));
|
|
410
|
+
continue;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
await fs.remove(targetDir);
|
|
414
|
+
await fs.ensureDir(targetDir);
|
|
415
|
+
await fs.writeFile(path.join(targetDir, 'SKILL.md'), converted);
|
|
416
|
+
for (const entry of await fs.readdir(corePath, { withFileTypes: true })) {
|
|
417
|
+
if (entry.isDirectory()) {
|
|
418
|
+
await fs.copy(path.join(corePath, entry.name), path.join(targetDir, entry.name));
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
console.log(chalk.green(` ✓ .agents/plugins/prizmkit/skills/${skillName}/`));
|
|
399
422
|
}
|
|
400
423
|
}
|
|
401
424
|
}
|
|
@@ -645,6 +668,22 @@ job_max_runtime_seconds = 3300
|
|
|
645
668
|
console.log(chalk.green(' ✓ .cursor/hooks.json'));
|
|
646
669
|
console.log(chalk.green(' ✓ .cursor/hooks/prizmkit-hook.cjs'));
|
|
647
670
|
console.log(chalk.green(` ✓ .cursor/rules/ (${ruleFiles.length} 条规则)`));
|
|
671
|
+
} else if (platform === 'antigravity') {
|
|
672
|
+
if (dryRun) {
|
|
673
|
+
console.log(chalk.gray(' [dry-run] .agents/plugins/prizmkit/plugin.json'));
|
|
674
|
+
console.log(chalk.gray(' [dry-run] .agents/plugins/prizmkit/hooks.json'));
|
|
675
|
+
console.log(chalk.gray(' [dry-run] .agents/plugins/prizmkit/hooks/prizmkit-hook.cjs'));
|
|
676
|
+
console.log(chalk.gray(` [dry-run] .agents/plugins/prizmkit/rules/ (${ruleFiles.length} 条规则)`));
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
const { installHooks } = await loadAdapter('antigravity', 'hooks-adapter.js');
|
|
680
|
+
const { installRules } = await loadAdapter('antigravity', 'rules-adapter.js');
|
|
681
|
+
await installHooks(projectRoot, { version: scaffoldPkg.version });
|
|
682
|
+
await installRules(projectRoot, ruleFiles);
|
|
683
|
+
console.log(chalk.green(' ✓ .agents/plugins/prizmkit/plugin.json'));
|
|
684
|
+
console.log(chalk.green(' ✓ .agents/plugins/prizmkit/hooks.json'));
|
|
685
|
+
console.log(chalk.green(' ✓ .agents/plugins/prizmkit/hooks/prizmkit-hook.cjs'));
|
|
686
|
+
console.log(chalk.green(` ✓ .agents/plugins/prizmkit/rules/ (${ruleFiles.length} 条规则)`));
|
|
648
687
|
}
|
|
649
688
|
}
|
|
650
689
|
|
|
@@ -1067,6 +1106,22 @@ export async function installProjectMemory(platform, projectRoot, dryRun) {
|
|
|
1067
1106
|
return;
|
|
1068
1107
|
}
|
|
1069
1108
|
|
|
1109
|
+
if (platform === 'antigravity') {
|
|
1110
|
+
const templatePath = path.join(templatesDir, templateName);
|
|
1111
|
+
if (!await fs.pathExists(templatePath)) {
|
|
1112
|
+
console.log(chalk.yellow(` ⚠ 模板文件不存在: ${templateName},跳过`));
|
|
1113
|
+
return;
|
|
1114
|
+
}
|
|
1115
|
+
if (dryRun) {
|
|
1116
|
+
console.log(chalk.gray(' [dry-run] .agents/plugins/prizmkit/rules/prizmkit-framework.md'));
|
|
1117
|
+
return;
|
|
1118
|
+
}
|
|
1119
|
+
const { installFrameworkGuidance } = await loadAdapter('antigravity', 'rules-adapter.js');
|
|
1120
|
+
await installFrameworkGuidance(projectRoot, (await fs.readFile(templatePath, 'utf8')).trimEnd());
|
|
1121
|
+
console.log(chalk.green(' ✓ .agents/plugins/prizmkit/rules/prizmkit-framework.md'));
|
|
1122
|
+
return;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1070
1125
|
if (!privateName) return;
|
|
1071
1126
|
|
|
1072
1127
|
const mainPath = mainName ? path.join(projectRoot, mainName) : null;
|
|
@@ -1876,7 +1931,7 @@ const SCAFFOLD_CONFIG_FIELDS = new Set([
|
|
|
1876
1931
|
/**
|
|
1877
1932
|
* 执行纯净安装
|
|
1878
1933
|
* @param {Object} config
|
|
1879
|
-
* @param {string} config.platform - 'codebuddy' | 'claude' | 'codex' | 'pi' | 'cursor' | 'all' | comma-separated subset
|
|
1934
|
+
* @param {string} config.platform - 'codebuddy' | 'claude' | 'codex' | 'pi' | 'cursor' | 'antigravity' | 'all' | comma-separated subset
|
|
1880
1935
|
* @param {string} [config.runtime] - 'python' (legacy aliases accepted: 'unix' | 'windows')
|
|
1881
1936
|
* @param {string} config.skills - 'core' | 'minimal' | 'recommended:<type>'
|
|
1882
1937
|
* @param {boolean} config.pipeline - 是否安装 dev-pipeline
|
|
@@ -2104,7 +2159,7 @@ export async function scaffold(config) {
|
|
|
2104
2159
|
? '说 "运行 prizmkit-init"'
|
|
2105
2160
|
: mainPlatform === 'pi'
|
|
2106
2161
|
? '输入 "/skill:prizmkit-init"'
|
|
2107
|
-
: mainPlatform === 'cursor'
|
|
2162
|
+
: (mainPlatform === 'cursor' || mainPlatform === 'antigravity')
|
|
2108
2163
|
? '输入 "/prizmkit-init"'
|
|
2109
2164
|
: '说 "/prizmkit-init"';
|
|
2110
2165
|
console.log(` 3. ${chalk.cyan(initInstruction)} ${chalk.gray('# 初始化项目上下文')}`);
|
package/src/upgrade.js
CHANGED
|
@@ -88,12 +88,14 @@ export async function removeSkillFiles(platform, projectRoot, skillNames, dryRun
|
|
|
88
88
|
console.log(chalk.red(` ✗ removed .codebuddy/skills/${skillName}/`));
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
} else if (platform === 'codex' || platform === 'pi' || platform === 'cursor') {
|
|
91
|
+
} else if (platform === 'codex' || platform === 'pi' || platform === 'cursor' || platform === 'antigravity') {
|
|
92
92
|
const skillDir = platform === 'pi'
|
|
93
93
|
? path.join(projectRoot, '.pi', 'skills', skillName)
|
|
94
94
|
: platform === 'cursor'
|
|
95
95
|
? path.join(projectRoot, '.cursor', 'skills', skillName)
|
|
96
|
-
:
|
|
96
|
+
: platform === 'antigravity'
|
|
97
|
+
? path.join(projectRoot, '.agents', 'plugins', 'prizmkit', 'skills', skillName)
|
|
98
|
+
: path.join(projectRoot, '.agents', 'skills', skillName);
|
|
97
99
|
if (await fs.pathExists(skillDir)) {
|
|
98
100
|
if (dryRun) {
|
|
99
101
|
console.log(chalk.gray(` [dry-run] remove ${path.relative(projectRoot, skillDir)}/`));
|
|
@@ -110,7 +112,7 @@ export async function removeSkillFiles(platform, projectRoot, skillNames, dryRun
|
|
|
110
112
|
* Remove agent files for a specific platform.
|
|
111
113
|
*/
|
|
112
114
|
export async function removeAgentFiles(platform, projectRoot, agentFileNames, dryRun) {
|
|
113
|
-
if (platform === 'pi' || platform === 'cursor') return;
|
|
115
|
+
if (platform === 'pi' || platform === 'cursor' || platform === 'antigravity') return;
|
|
114
116
|
for (const fileName of agentFileNames) {
|
|
115
117
|
const dir = platform === 'claude'
|
|
116
118
|
? path.join(projectRoot, '.claude', 'agents')
|
|
@@ -153,6 +155,7 @@ function platformRuleSearchRoots(platform, projectRoot) {
|
|
|
153
155
|
}
|
|
154
156
|
if (platform === 'pi') return [path.join(projectRoot, '.pi', 'rules')];
|
|
155
157
|
if (platform === 'cursor') return [path.join(projectRoot, '.cursor', 'rules')];
|
|
158
|
+
if (platform === 'antigravity') return [path.join(projectRoot, '.agents', 'plugins', 'prizmkit', 'rules')];
|
|
156
159
|
return [path.join(projectRoot, '.codebuddy', 'rules')];
|
|
157
160
|
}
|
|
158
161
|
|
|
@@ -363,6 +366,8 @@ export async function runUpgrade(directory, options = {}) {
|
|
|
363
366
|
const hasCodex = await hasPlatformFiles(path.join(projectRoot, '.agents', 'skills'));
|
|
364
367
|
const hasPi = await hasPlatformFiles(path.join(projectRoot, '.pi', 'skills'));
|
|
365
368
|
const hasCursor = await hasPlatformFiles(path.join(projectRoot, '.cursor', 'skills'));
|
|
369
|
+
const hasAntigravity = await fs.pathExists(path.join(projectRoot, '.agents', 'plugins', 'prizmkit', 'plugin.json'))
|
|
370
|
+
|| await hasPlatformFiles(path.join(projectRoot, '.agents', 'plugins', 'prizmkit', 'skills'));
|
|
366
371
|
|
|
367
372
|
const detectedPlatforms = [
|
|
368
373
|
hasCodeBuddy && 'codebuddy',
|
|
@@ -370,6 +375,7 @@ export async function runUpgrade(directory, options = {}) {
|
|
|
370
375
|
hasCodex && 'codex',
|
|
371
376
|
hasPi && 'pi',
|
|
372
377
|
hasCursor && 'cursor',
|
|
378
|
+
hasAntigravity && 'antigravity',
|
|
373
379
|
].filter(Boolean);
|
|
374
380
|
|
|
375
381
|
platform = detectedPlatforms.length
|