prizmkit 1.1.58 → 1.1.61
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 +8 -6
- package/bundled/VERSION.json +3 -3
- package/bundled/adapters/codex/agent-adapter.js +38 -0
- package/bundled/adapters/codex/paths.js +27 -0
- package/bundled/adapters/codex/rules-adapter.js +30 -0
- package/bundled/adapters/codex/settings-adapter.js +27 -0
- package/bundled/adapters/codex/skill-adapter.js +65 -0
- package/bundled/adapters/codex/team-adapter.js +37 -0
- package/bundled/agents/prizm-dev-team-dev.md +6 -5
- package/bundled/dev-pipeline/.env.example +2 -1
- package/bundled/dev-pipeline/README.md +10 -7
- package/bundled/dev-pipeline/lib/common.sh +278 -37
- package/bundled/dev-pipeline/run-bugfix.sh +10 -61
- package/bundled/dev-pipeline/run-feature.sh +10 -78
- package/bundled/dev-pipeline/run-recovery.sh +10 -46
- package/bundled/dev-pipeline/run-refactor.sh +10 -61
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +17 -7
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +9 -3
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +9 -3
- package/bundled/dev-pipeline/scripts/utils.py +6 -4
- package/bundled/dev-pipeline-windows/.env.example +28 -0
- package/bundled/dev-pipeline-windows/README.md +30 -0
- package/bundled/dev-pipeline-windows/SCHEMA_ANALYSIS.md +525 -0
- package/bundled/dev-pipeline-windows/assets/feature-list-example.json +146 -0
- package/bundled/dev-pipeline-windows/assets/prizm-dev-team-integration.md +138 -0
- package/bundled/dev-pipeline-windows/launch-bugfix-daemon.ps1 +9 -0
- package/bundled/dev-pipeline-windows/launch-feature-daemon.ps1 +9 -0
- package/bundled/dev-pipeline-windows/launch-refactor-daemon.ps1 +9 -0
- package/bundled/dev-pipeline-windows/lib/common.ps1 +432 -0
- package/bundled/dev-pipeline-windows/lib/daemon.ps1 +140 -0
- package/bundled/dev-pipeline-windows/lib/pipeline.ps1 +446 -0
- package/bundled/dev-pipeline-windows/lib/reset.ps1 +87 -0
- package/bundled/dev-pipeline-windows/reset-bug.ps1 +9 -0
- package/bundled/dev-pipeline-windows/reset-feature.ps1 +9 -0
- package/bundled/dev-pipeline-windows/reset-refactor.ps1 +9 -0
- package/bundled/dev-pipeline-windows/run-bugfix.ps1 +9 -0
- package/bundled/dev-pipeline-windows/run-feature.ps1 +9 -0
- package/bundled/dev-pipeline-windows/run-recovery.ps1 +76 -0
- package/bundled/dev-pipeline-windows/run-refactor.ps1 +9 -0
- package/bundled/dev-pipeline-windows/scripts/check-session-status.py +228 -0
- package/bundled/dev-pipeline-windows/scripts/cleanup-logs.py +192 -0
- package/bundled/dev-pipeline-windows/scripts/detect-stuck.py +530 -0
- package/bundled/dev-pipeline-windows/scripts/generate-bootstrap-prompt.py +1737 -0
- package/bundled/dev-pipeline-windows/scripts/generate-bugfix-prompt.py +685 -0
- package/bundled/dev-pipeline-windows/scripts/generate-recovery-prompt.py +805 -0
- package/bundled/dev-pipeline-windows/scripts/generate-refactor-prompt.py +763 -0
- package/bundled/dev-pipeline-windows/scripts/init-bugfix-pipeline.py +316 -0
- package/bundled/dev-pipeline-windows/scripts/init-dev-team.py +134 -0
- package/bundled/dev-pipeline-windows/scripts/init-pipeline.py +380 -0
- package/bundled/dev-pipeline-windows/scripts/init-refactor-pipeline.py +399 -0
- package/bundled/dev-pipeline-windows/scripts/parse-stream-progress.py +388 -0
- package/bundled/dev-pipeline-windows/scripts/patch-completion-notes.py +191 -0
- package/bundled/dev-pipeline-windows/scripts/update-bug-status.py +864 -0
- package/bundled/dev-pipeline-windows/scripts/update-checkpoint.py +173 -0
- package/bundled/dev-pipeline-windows/scripts/update-feature-status.py +1501 -0
- package/bundled/dev-pipeline-windows/scripts/update-refactor-status.py +1073 -0
- package/bundled/dev-pipeline-windows/scripts/utils.py +542 -0
- package/bundled/dev-pipeline-windows/templates/agent-prompts/critic-plan-challenge.md +7 -0
- package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-fix.md +7 -0
- package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-implement.md +30 -0
- package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-resume.md +5 -0
- package/bundled/dev-pipeline-windows/templates/agent-prompts/reviewer-review.md +7 -0
- package/bundled/dev-pipeline-windows/templates/bootstrap-prompt.md +46 -0
- package/bundled/dev-pipeline-windows/templates/bootstrap-tier1.md +43 -0
- package/bundled/dev-pipeline-windows/templates/bootstrap-tier2.md +43 -0
- package/bundled/dev-pipeline-windows/templates/bootstrap-tier3.md +43 -0
- package/bundled/dev-pipeline-windows/templates/bug-fix-list-schema.json +263 -0
- package/bundled/dev-pipeline-windows/templates/bugfix-bootstrap-prompt.md +320 -0
- package/bundled/dev-pipeline-windows/templates/feature-list-schema.json +237 -0
- package/bundled/dev-pipeline-windows/templates/refactor-bootstrap-prompt.md +331 -0
- package/bundled/dev-pipeline-windows/templates/refactor-list-schema.json +270 -0
- package/bundled/dev-pipeline-windows/templates/sections/ac-verification-checklist.md +13 -0
- package/bundled/dev-pipeline-windows/templates/sections/checkpoint-system.md +91 -0
- package/bundled/dev-pipeline-windows/templates/sections/context-budget-rules.md +33 -0
- package/bundled/dev-pipeline-windows/templates/sections/critical-paths-agent.md +10 -0
- package/bundled/dev-pipeline-windows/templates/sections/critical-paths-full.md +12 -0
- package/bundled/dev-pipeline-windows/templates/sections/critical-paths-lite.md +7 -0
- package/bundled/dev-pipeline-windows/templates/sections/directory-convention-agent.md +8 -0
- package/bundled/dev-pipeline-windows/templates/sections/directory-convention-full.md +9 -0
- package/bundled/dev-pipeline-windows/templates/sections/directory-convention-lite.md +6 -0
- package/bundled/dev-pipeline-windows/templates/sections/failure-capture.md +21 -0
- package/bundled/dev-pipeline-windows/templates/sections/feature-context.md +31 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification-auto.md +72 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification-opencli.md +63 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification.md +62 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase-commit-full.md +71 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase-commit.md +64 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-agent-suffix.md +23 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-base.md +24 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-lite-suffix.md +12 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase-critic-plan-full.md +53 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase-critic-plan.md +32 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase-implement-agent.md +37 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase-implement-full.md +50 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase-implement-lite.md +52 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase-plan-agent.md +27 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase-plan-lite.md +27 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase-review-agent.md +27 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase-review-full.md +29 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase-specify-plan-full.md +77 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase0-init.md +13 -0
- package/bundled/dev-pipeline-windows/templates/sections/phase0-test-baseline.md +23 -0
- package/bundled/dev-pipeline-windows/templates/sections/session-context.md +5 -0
- package/bundled/dev-pipeline-windows/templates/sections/subagent-timeout-recovery.md +6 -0
- package/bundled/dev-pipeline-windows/templates/sections/test-failure-recovery-agent.md +67 -0
- package/bundled/dev-pipeline-windows/templates/sections/test-failure-recovery-lite.md +58 -0
- package/bundled/dev-pipeline-windows/templates/session-status-schema.json +83 -0
- package/bundled/rules/prizm/prizm-documentation.md +2 -4
- package/bundled/rules/prizm/prizm-progressive-loading.md +2 -1
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/app-planner/SKILL.md +24 -16
- package/bundled/skills/app-planner/references/architecture-decisions.md +9 -5
- package/bundled/skills/app-planner/references/frontend-design-guide.md +1 -1
- package/bundled/skills/feature-planner/SKILL.md +9 -2
- package/bundled/skills/prizmkit-implement/SKILL.md +1 -0
- package/bundled/skills/prizmkit-init/SKILL.md +8 -7
- package/bundled/skills/prizmkit-init/references/config-schema.md +3 -1
- package/bundled/skills/prizmkit-plan/SKILL.md +2 -0
- package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +6 -1
- package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +2 -2
- package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +2 -1
- package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +2 -2
- package/bundled/skills/prizmkit-retrospective/SKILL.md +2 -0
- package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +2 -0
- package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +2 -0
- package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +2 -0
- package/bundled/skills-windows/app-planner/SKILL.md +639 -0
- package/bundled/skills-windows/app-planner/assets/app-design-guide.md +101 -0
- package/bundled/skills-windows/app-planner/references/architecture-decisions.md +52 -0
- package/bundled/skills-windows/app-planner/references/brainstorm-guide.md +101 -0
- package/bundled/skills-windows/app-planner/references/frontend-design-guide.md +71 -0
- package/bundled/skills-windows/app-planner/references/project-brief-guide.md +82 -0
- package/bundled/skills-windows/app-planner/references/red-team-checklist.md +40 -0
- package/bundled/skills-windows/app-planner/references/rules/backend/derivation-rules.md +609 -0
- package/bundled/skills-windows/app-planner/references/rules/backend/fixed-rules.md +285 -0
- package/bundled/skills-windows/app-planner/references/rules/backend/question-bank.md +249 -0
- package/bundled/skills-windows/app-planner/references/rules/backend/template.md +173 -0
- package/bundled/skills-windows/app-planner/references/rules/database/derivation-rules.md +373 -0
- package/bundled/skills-windows/app-planner/references/rules/database/fixed-rules.md +211 -0
- package/bundled/skills-windows/app-planner/references/rules/database/question-bank.md +184 -0
- package/bundled/skills-windows/app-planner/references/rules/database/template.md +158 -0
- package/bundled/skills-windows/app-planner/references/rules/frontend/derivation-rules.md +810 -0
- package/bundled/skills-windows/app-planner/references/rules/frontend/fixed-rules.md +188 -0
- package/bundled/skills-windows/app-planner/references/rules/frontend/question-bank.md +302 -0
- package/bundled/skills-windows/app-planner/references/rules/frontend/template.md +320 -0
- package/bundled/skills-windows/app-planner/references/rules/mobile/derivation-rules.md +639 -0
- package/bundled/skills-windows/app-planner/references/rules/mobile/fixed-rules.md +290 -0
- package/bundled/skills-windows/app-planner/references/rules/mobile/question-bank.md +232 -0
- package/bundled/skills-windows/app-planner/references/rules/mobile/template.md +175 -0
- package/bundled/skills-windows/bug-fix-workflow/SKILL.md +415 -0
- package/bundled/skills-windows/bug-planner/SKILL.md +395 -0
- package/bundled/skills-windows/bug-planner/assets/bug-confirmation-template.md +43 -0
- package/bundled/skills-windows/bug-planner/references/critic-and-verification.md +44 -0
- package/bundled/skills-windows/bug-planner/references/error-recovery.md +73 -0
- package/bundled/skills-windows/bug-planner/references/input-formats.md +53 -0
- package/bundled/skills-windows/bug-planner/references/schema-validation.md +25 -0
- package/bundled/skills-windows/bug-planner/references/severity-rules.md +16 -0
- package/bundled/skills-windows/bug-planner/scripts/validate-bug-list.py +322 -0
- package/bundled/skills-windows/bugfix-pipeline-launcher/SKILL.md +380 -0
- package/bundled/skills-windows/feature-pipeline-launcher/SKILL.md +441 -0
- package/bundled/skills-windows/feature-pipeline-launcher/scripts/preflight-check.py +462 -0
- package/bundled/skills-windows/feature-planner/SKILL.md +401 -0
- package/bundled/skills-windows/feature-planner/assets/evaluation-guide.md +64 -0
- package/bundled/skills-windows/feature-planner/assets/planning-guide.md +214 -0
- package/bundled/skills-windows/feature-planner/references/browser-interaction.md +59 -0
- package/bundled/skills-windows/feature-planner/references/completeness-review.md +57 -0
- package/bundled/skills-windows/feature-planner/references/decomposition-patterns.md +75 -0
- package/bundled/skills-windows/feature-planner/references/error-recovery.md +90 -0
- package/bundled/skills-windows/feature-planner/references/incremental-feature-planning.md +112 -0
- package/bundled/skills-windows/feature-planner/references/new-project-planning.md +85 -0
- package/bundled/skills-windows/feature-planner/scripts/validate-and-generate.py +1029 -0
- package/bundled/skills-windows/feature-workflow/SKILL.md +531 -0
- package/bundled/skills-windows/prizmkit-init/SKILL.md +356 -0
- package/bundled/skills-windows/prizmkit-init/assets/project-brief-template.md +82 -0
- package/bundled/skills-windows/prizmkit-init/references/config-schema.md +70 -0
- package/bundled/skills-windows/prizmkit-init/references/rules/layer-detection.md +41 -0
- package/bundled/skills-windows/prizmkit-init/references/tech-stack-catalog.md +13 -0
- package/bundled/skills-windows/prizmkit-init/references/update-supplement.md +9 -0
- package/bundled/skills-windows/recovery-workflow/SKILL.md +456 -0
- package/bundled/skills-windows/recovery-workflow/evals/evals.json +46 -0
- package/bundled/skills-windows/recovery-workflow/scripts/detect-recovery-state.py +544 -0
- package/bundled/skills-windows/refactor-pipeline-launcher/SKILL.md +406 -0
- package/bundled/skills-windows/refactor-planner/SKILL.md +540 -0
- package/bundled/skills-windows/refactor-planner/assets/planning-guide.md +292 -0
- package/bundled/skills-windows/refactor-planner/references/behavior-preservation.md +301 -0
- package/bundled/skills-windows/refactor-planner/references/refactor-scoping-guide.md +221 -0
- package/bundled/skills-windows/refactor-planner/scripts/validate-and-generate-refactor.py +858 -0
- package/bundled/skills-windows/refactor-workflow/SKILL.md +503 -0
- package/bundled/templates/hooks/diff-prizm-docs.sh +1 -1
- package/bundled/templates/hooks/prizm-pre-commit.sh +53 -4
- package/bundled/templates/hooks/validate-prizm-docs.sh +62 -7
- package/bundled/templates/project-memory-template.md +2 -1
- package/package.json +3 -2
- package/src/clean.js +73 -2
- package/src/config.js +167 -50
- package/src/detect-platform.js +15 -9
- package/src/external-skills.js +26 -19
- package/src/index.js +28 -10
- package/src/manifest.js +6 -2
- package/src/metadata.js +43 -5
- package/src/platforms.js +38 -0
- package/src/prompts.js +50 -9
- package/src/runtimes.js +20 -0
- package/src/scaffold.js +447 -114
- package/src/upgrade.js +87 -44
package/src/index.js
CHANGED
|
@@ -14,6 +14,9 @@ import path from 'path';
|
|
|
14
14
|
import { detectPlatform } from './detect-platform.js';
|
|
15
15
|
import { scaffold } from './scaffold.js';
|
|
16
16
|
import { loadMetadata } from './metadata.js';
|
|
17
|
+
import { platformLabel } from './platforms.js';
|
|
18
|
+
import { normalizeRuntime, runtimeLabel } from './runtimes.js';
|
|
19
|
+
import { selectRuntime } from './prompts.js';
|
|
17
20
|
|
|
18
21
|
export { runUpgrade } from './upgrade.js';
|
|
19
22
|
|
|
@@ -47,6 +50,7 @@ export async function runScaffold(directory, options) {
|
|
|
47
50
|
const cliStatus = [
|
|
48
51
|
detected.cbc ? chalk.green('cbc ✓') : chalk.gray('cbc ✗'),
|
|
49
52
|
detected.claude ? chalk.green('claude ✓') : chalk.gray('claude ✗'),
|
|
53
|
+
detected.codex ? chalk.green('codex ✓') : chalk.gray('codex ✗'),
|
|
50
54
|
].join(' ');
|
|
51
55
|
console.log(` 检测到的 CLI 工具: ${cliStatus}`);
|
|
52
56
|
console.log(` 目标目录: ${projectRoot}`);
|
|
@@ -54,7 +58,6 @@ export async function runScaffold(directory, options) {
|
|
|
54
58
|
|
|
55
59
|
// 加载 Skill 元数据
|
|
56
60
|
const metadata = await loadMetadata();
|
|
57
|
-
const totalSkills = Object.keys(metadata.skills).length;
|
|
58
61
|
|
|
59
62
|
// === 非交互式模式 ===
|
|
60
63
|
if (options.nonInteractive) {
|
|
@@ -64,6 +67,7 @@ export async function runScaffold(directory, options) {
|
|
|
64
67
|
}
|
|
65
68
|
const config = {
|
|
66
69
|
platform: options.platform,
|
|
70
|
+
runtime: normalizeRuntime(options.runtime),
|
|
67
71
|
skills: options.skills || 'core',
|
|
68
72
|
team: options.team !== false,
|
|
69
73
|
pipeline: options.pipeline !== false,
|
|
@@ -81,7 +85,12 @@ export async function runScaffold(directory, options) {
|
|
|
81
85
|
|
|
82
86
|
// === 交互式模式 ===
|
|
83
87
|
try {
|
|
84
|
-
// 1.
|
|
88
|
+
// 1. 选择运行系统(控制安装的流水线和编排技能)
|
|
89
|
+
const runtime = options.runtime !== undefined
|
|
90
|
+
? normalizeRuntime(options.runtime)
|
|
91
|
+
: await selectRuntime();
|
|
92
|
+
|
|
93
|
+
// 2. 选择平台(控制安装的目录结构)
|
|
85
94
|
const platform = await select({
|
|
86
95
|
message: '选择目标平台 (决定安装的目录结构):',
|
|
87
96
|
choices: [
|
|
@@ -94,14 +103,18 @@ export async function runScaffold(directory, options) {
|
|
|
94
103
|
value: 'claude',
|
|
95
104
|
},
|
|
96
105
|
{
|
|
97
|
-
name: '
|
|
98
|
-
value: '
|
|
106
|
+
name: `Codex (AGENTS.md + .agents/skills + .codex/)${detected.codex ? chalk.green(' ← 已检测到 codex') : ''}`,
|
|
107
|
+
value: 'codex',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: '同时安装全部平台',
|
|
111
|
+
value: 'all',
|
|
99
112
|
},
|
|
100
113
|
],
|
|
101
114
|
default: detected.suggested,
|
|
102
115
|
});
|
|
103
116
|
|
|
104
|
-
//
|
|
117
|
+
// 2.5. AI CLI 命令配置(独立于平台,决定实际运行的可执行命令)
|
|
105
118
|
const cliChoices = [
|
|
106
119
|
{
|
|
107
120
|
name: `cbc — CodeBuddy CLI${detected.cbc ? chalk.green(' ✓ 已安装') : chalk.gray(' (未检测到)')}`,
|
|
@@ -111,6 +124,10 @@ export async function runScaffold(directory, options) {
|
|
|
111
124
|
name: `claude — Claude Code${detected.claude ? chalk.green(' ✓ 已安装') : chalk.gray(' (未检测到)')}`,
|
|
112
125
|
value: 'claude',
|
|
113
126
|
},
|
|
127
|
+
{
|
|
128
|
+
name: `codex — Codex CLI${detected.codex ? chalk.green(' ✓ 已安装') : chalk.gray(' (未检测到)')}`,
|
|
129
|
+
value: 'codex',
|
|
130
|
+
},
|
|
114
131
|
{
|
|
115
132
|
name: '自定义 — 输入其他命令',
|
|
116
133
|
value: '__custom__',
|
|
@@ -122,7 +139,7 @@ export async function runScaffold(directory, options) {
|
|
|
122
139
|
];
|
|
123
140
|
|
|
124
141
|
// 如果检测到的推荐命令不在固定列表里,默认选"自定义"
|
|
125
|
-
const knownCliValues = ['cbc', 'claude'];
|
|
142
|
+
const knownCliValues = ['cbc', 'claude', 'codex'];
|
|
126
143
|
const cliDefault = knownCliValues.includes(detected.suggestedCli)
|
|
127
144
|
? detected.suggestedCli
|
|
128
145
|
: (detected.suggestedCli ? '__custom__' : '');
|
|
@@ -219,15 +236,15 @@ export async function runScaffold(directory, options) {
|
|
|
219
236
|
});
|
|
220
237
|
|
|
221
238
|
// 显示安装摘要
|
|
222
|
-
const
|
|
223
|
-
: platform === 'codebuddy' ? 'CodeBuddy' : 'Claude Code';
|
|
239
|
+
const selectedPlatformLabel = platformLabel(platform);
|
|
224
240
|
const suiteLabel = skillSuite === 'core' ? `Core (${metadata.suites.core.skills.length} 个)`
|
|
225
241
|
: skillSuite === 'minimal' ? `Minimal (${metadata.suites.minimal.skills.length} 个)`
|
|
226
242
|
: `Recommended (${skillSuite})`;
|
|
227
243
|
|
|
228
244
|
console.log('');
|
|
229
245
|
console.log(chalk.bold(' 安装摘要:'));
|
|
230
|
-
console.log(`
|
|
246
|
+
console.log(` 运行系统: ${chalk.cyan(runtimeLabel(runtime))}`);
|
|
247
|
+
console.log(` 平台: ${chalk.cyan(selectedPlatformLabel)}`);
|
|
231
248
|
console.log(` 技能: ${chalk.cyan(suiteLabel)}`);
|
|
232
249
|
console.log(` 团队模式: ${team ? chalk.green('启用') : chalk.gray('禁用')}`);
|
|
233
250
|
console.log(` 流水线: ${pipeline ? chalk.green('启用') : chalk.gray('禁用')}`);
|
|
@@ -252,6 +269,7 @@ export async function runScaffold(directory, options) {
|
|
|
252
269
|
|
|
253
270
|
const config = {
|
|
254
271
|
platform,
|
|
272
|
+
runtime,
|
|
255
273
|
skills: skillSuite,
|
|
256
274
|
team,
|
|
257
275
|
pipeline,
|
|
@@ -274,4 +292,4 @@ export async function runScaffold(directory, options) {
|
|
|
274
292
|
}
|
|
275
293
|
throw err;
|
|
276
294
|
}
|
|
277
|
-
}
|
|
295
|
+
}
|
package/src/manifest.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import fs from 'fs-extra';
|
|
11
11
|
import path from 'path';
|
|
12
|
+
import { expandPlatforms, projectMemoryFile } from './platforms.js';
|
|
12
13
|
|
|
13
14
|
const MANIFEST_FILE = 'manifest.json';
|
|
14
15
|
const MANIFEST_DIR = '.prizmkit';
|
|
@@ -46,7 +47,8 @@ export async function writeManifest(projectRoot, data) {
|
|
|
46
47
|
* Build a manifest object from installation config.
|
|
47
48
|
* @param {Object} params
|
|
48
49
|
* @param {string} params.version - PrizmKit version
|
|
49
|
-
* @param {string} params.platform - 'codebuddy' | 'claude' | 'both'
|
|
50
|
+
* @param {string} params.platform - 'codebuddy' | 'claude' | 'codex' | 'all' ('both' supported only for legacy manifests)
|
|
51
|
+
* @param {string} [params.runtime] - 'unix' | 'windows'
|
|
50
52
|
* @param {string} params.suite - skill suite name
|
|
51
53
|
* @param {string[]} params.skills - resolved skill name list
|
|
52
54
|
* @param {string[]} params.agents - agent file names (e.g. ['prizm-dev-team-dev.md'])
|
|
@@ -61,6 +63,7 @@ export async function writeManifest(projectRoot, data) {
|
|
|
61
63
|
export function buildManifest({
|
|
62
64
|
version,
|
|
63
65
|
platform,
|
|
66
|
+
runtime,
|
|
64
67
|
suite,
|
|
65
68
|
skills,
|
|
66
69
|
agents,
|
|
@@ -77,6 +80,7 @@ export function buildManifest({
|
|
|
77
80
|
installedAt: now,
|
|
78
81
|
updatedAt: now,
|
|
79
82
|
platform,
|
|
83
|
+
runtime: runtime || 'unix',
|
|
80
84
|
suite,
|
|
81
85
|
options: {
|
|
82
86
|
team: Boolean(team),
|
|
@@ -90,7 +94,7 @@ export function buildManifest({
|
|
|
90
94
|
rules: [...rules],
|
|
91
95
|
pipeline: pipeline ? [...pipeline] : [],
|
|
92
96
|
extras: extras ? [...extras] : [],
|
|
93
|
-
other: [
|
|
97
|
+
other: [...new Set(expandPlatforms(platform).map(projectMemoryFile).filter(Boolean))],
|
|
94
98
|
},
|
|
95
99
|
};
|
|
96
100
|
}
|
package/src/metadata.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import fs from 'fs-extra';
|
|
10
10
|
import path from 'path';
|
|
11
11
|
import { fileURLToPath } from 'url';
|
|
12
|
+
import { normalizeRuntime, RUNTIME_WINDOWS } from './runtimes.js';
|
|
12
13
|
|
|
13
14
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
14
15
|
|
|
@@ -69,6 +70,41 @@ export function getSkillsDir() {
|
|
|
69
70
|
throw new Error('无法找到 Skills 目录。');
|
|
70
71
|
}
|
|
71
72
|
|
|
73
|
+
/**
|
|
74
|
+
* Return candidate source directories for a skill in priority order.
|
|
75
|
+
* Windows orchestration skills are intentionally sourced from a separate
|
|
76
|
+
* tree so macOS/Linux content remains untouched.
|
|
77
|
+
*/
|
|
78
|
+
export function getSkillCandidatePaths(skillName, skillDef = {}, runtime = 'unix') {
|
|
79
|
+
const normalizedRuntime = normalizeRuntime(runtime);
|
|
80
|
+
const category = skillDef.category;
|
|
81
|
+
const subcategory = skillDef.subcategory;
|
|
82
|
+
const candidates = [];
|
|
83
|
+
|
|
84
|
+
if (normalizedRuntime === RUNTIME_WINDOWS && category) {
|
|
85
|
+
const windowsCategory = `${category}-windows`;
|
|
86
|
+
candidates.push(path.join(getBundledRoot(), 'skills-windows', skillName));
|
|
87
|
+
candidates.push(
|
|
88
|
+
subcategory
|
|
89
|
+
? path.join(getFrameworkRoot(), 'core', 'skills', windowsCategory, subcategory, skillName)
|
|
90
|
+
: path.join(getFrameworkRoot(), 'core', 'skills', windowsCategory, skillName)
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
candidates.push(path.join(getBundledRoot(), 'skills', skillName));
|
|
95
|
+
|
|
96
|
+
if (category) {
|
|
97
|
+
candidates.push(
|
|
98
|
+
subcategory
|
|
99
|
+
? path.join(getFrameworkRoot(), 'core', 'skills', category, subcategory, skillName)
|
|
100
|
+
: path.join(getFrameworkRoot(), 'core', 'skills', category, skillName)
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
candidates.push(path.join(getFrameworkRoot(), 'core', 'skills', skillName));
|
|
105
|
+
return candidates;
|
|
106
|
+
}
|
|
107
|
+
|
|
72
108
|
/**
|
|
73
109
|
* 获取 core agents 目录路径
|
|
74
110
|
*/
|
|
@@ -111,14 +147,16 @@ export function getTemplatesDir() {
|
|
|
111
147
|
/**
|
|
112
148
|
* 获取 dev-pipeline 目录路径
|
|
113
149
|
*/
|
|
114
|
-
export function getPipelineDir() {
|
|
115
|
-
const
|
|
116
|
-
const
|
|
150
|
+
export function getPipelineDir(runtime = 'unix') {
|
|
151
|
+
const normalizedRuntime = normalizeRuntime(runtime);
|
|
152
|
+
const dirName = normalizedRuntime === RUNTIME_WINDOWS ? 'dev-pipeline-windows' : 'dev-pipeline';
|
|
153
|
+
const bundledDir = path.join(getBundledRoot(), dirName);
|
|
154
|
+
const coreDir = path.join(getFrameworkRoot(), dirName);
|
|
117
155
|
|
|
118
156
|
if (fs.pathExistsSync(bundledDir)) return bundledDir;
|
|
119
157
|
if (fs.pathExistsSync(coreDir)) return coreDir;
|
|
120
158
|
|
|
121
|
-
throw new Error(
|
|
159
|
+
throw new Error(`无法找到 ${dirName} 目录。`);
|
|
122
160
|
}
|
|
123
161
|
|
|
124
162
|
/**
|
|
@@ -167,4 +205,4 @@ export async function loadRulesMetadata() {
|
|
|
167
205
|
'无法找到 Rules 元数据文件。\n' +
|
|
168
206
|
`尝试路径:\n 1. ${bundledPath}\n 2. ${corePath}`
|
|
169
207
|
);
|
|
170
|
-
}
|
|
208
|
+
}
|
package/src/platforms.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export const PLATFORM_IDS = ['codebuddy', 'claude', 'codex'];
|
|
2
|
+
export const PLATFORM_GROUPS = {
|
|
3
|
+
all: PLATFORM_IDS,
|
|
4
|
+
};
|
|
5
|
+
const LEGACY_PLATFORM_GROUPS = {
|
|
6
|
+
both: ['codebuddy', 'claude'],
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export function expandPlatforms(platform) {
|
|
10
|
+
return PLATFORM_GROUPS[platform] || LEGACY_PLATFORM_GROUPS[platform] || [platform];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function isKnownPlatform(platform) {
|
|
14
|
+
return PLATFORM_IDS.includes(platform) || Object.hasOwn(PLATFORM_GROUPS, platform);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function platformLabel(platform) {
|
|
18
|
+
if (platform === 'both') return 'legacy codebuddy/claude group';
|
|
19
|
+
if (platform === 'all') return 'All platforms (CodeBuddy, Claude Code, Codex)';
|
|
20
|
+
if (platform === 'codebuddy') return 'CodeBuddy';
|
|
21
|
+
if (platform === 'claude') return 'Claude Code';
|
|
22
|
+
if (platform === 'codex') return 'Codex';
|
|
23
|
+
return platform;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function projectMemoryFile(platform) {
|
|
27
|
+
if (platform === 'claude') return 'CLAUDE.md';
|
|
28
|
+
if (platform === 'codebuddy') return 'CODEBUDDY.md';
|
|
29
|
+
if (platform === 'codex') return 'AGENTS.md';
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function defaultCliForPlatform(platform) {
|
|
34
|
+
if (platform === 'claude') return 'claude';
|
|
35
|
+
if (platform === 'codebuddy') return 'cbc';
|
|
36
|
+
if (platform === 'codex') return 'codex';
|
|
37
|
+
return '';
|
|
38
|
+
}
|
package/src/prompts.js
CHANGED
|
@@ -5,15 +5,48 @@
|
|
|
5
5
|
|
|
6
6
|
import { select, confirm, checkbox, input } from '@inquirer/prompts';
|
|
7
7
|
import chalk from 'chalk';
|
|
8
|
+
import { platformLabel } from './platforms.js';
|
|
9
|
+
import { normalizeRuntime } from './runtimes.js';
|
|
10
|
+
|
|
11
|
+
let selectPlatformPrompt = select;
|
|
12
|
+
|
|
13
|
+
export function __setSelectPlatformPromptForTests(promptFn) {
|
|
14
|
+
selectPlatformPrompt = promptFn;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function __resetSelectPlatformPromptForTests() {
|
|
18
|
+
selectPlatformPrompt = select;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export async function selectRuntime(currentRuntime) {
|
|
22
|
+
return select({
|
|
23
|
+
message: '选择运行系统 (决定安装 macOS/Linux 或 Windows 版本的流水线与编排技能):',
|
|
24
|
+
choices: [
|
|
25
|
+
{ name: 'macOS/Linux — 使用 Bash 流水线', value: 'unix' },
|
|
26
|
+
{ name: 'Windows PowerShell — 使用原生 PowerShell 流水线', value: 'windows' },
|
|
27
|
+
],
|
|
28
|
+
default: normalizeRuntime(currentRuntime),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
8
31
|
|
|
9
32
|
/**
|
|
10
|
-
* Select target platform (codebuddy, claude, or
|
|
33
|
+
* Select target platform (codebuddy, claude, codex, or all).
|
|
11
34
|
* @param {string} currentPlatform - current platform value
|
|
12
35
|
* @param {Object} detected - detected environment info (e.g., { cbc: true, claude: false })
|
|
13
|
-
* @returns {Promise<string>}
|
|
36
|
+
* @returns {Promise<string>}
|
|
14
37
|
*/
|
|
15
38
|
export async function selectPlatform(currentPlatform, detected = {}) {
|
|
16
|
-
const
|
|
39
|
+
const selectablePlatforms = ['codebuddy', 'claude', 'codex', 'all'];
|
|
40
|
+
const detectedDefault = selectablePlatforms.includes(detected.suggested)
|
|
41
|
+
? detected.suggested
|
|
42
|
+
: 'claude';
|
|
43
|
+
let defaultPlatform = detectedDefault;
|
|
44
|
+
if (currentPlatform === 'both') {
|
|
45
|
+
defaultPlatform = 'all';
|
|
46
|
+
} else if (selectablePlatforms.includes(currentPlatform)) {
|
|
47
|
+
defaultPlatform = currentPlatform;
|
|
48
|
+
}
|
|
49
|
+
const platform = await selectPlatformPrompt({
|
|
17
50
|
message: '选择目标平台 (决定安装的目录结构):',
|
|
18
51
|
choices: [
|
|
19
52
|
{
|
|
@@ -25,20 +58,24 @@ export async function selectPlatform(currentPlatform, detected = {}) {
|
|
|
25
58
|
value: 'claude',
|
|
26
59
|
},
|
|
27
60
|
{
|
|
28
|
-
name: '
|
|
29
|
-
value: '
|
|
61
|
+
name: `Codex (AGENTS.md + .agents/skills + .codex/)${detected.codex ? chalk.green(' ← 已检测到 codex') : ''}`,
|
|
62
|
+
value: 'codex',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: `同时安装全部平台 (${platformLabel('all')})`,
|
|
66
|
+
value: 'all',
|
|
30
67
|
},
|
|
31
68
|
],
|
|
32
|
-
default:
|
|
69
|
+
default: defaultPlatform,
|
|
33
70
|
});
|
|
34
71
|
return platform;
|
|
35
72
|
}
|
|
36
73
|
|
|
37
74
|
/**
|
|
38
|
-
* Select AI CLI command (cbc, claude, custom, or skip).
|
|
75
|
+
* Select AI CLI command (cbc, claude, codex, custom, or skip).
|
|
39
76
|
* @param {string} currentCommand - current AI CLI command
|
|
40
77
|
* @param {Object} detected - detected environment info
|
|
41
|
-
* @returns {Promise<string>} -
|
|
78
|
+
* @returns {Promise<string>} - known command, custom string, or ''
|
|
42
79
|
*/
|
|
43
80
|
export async function selectAiCli(currentCommand, detected = {}) {
|
|
44
81
|
const cliChoices = [
|
|
@@ -50,6 +87,10 @@ export async function selectAiCli(currentCommand, detected = {}) {
|
|
|
50
87
|
name: `claude — Claude Code${detected.claude ? chalk.green(' ✓ 已安装') : chalk.gray(' (未检测到)')}`,
|
|
51
88
|
value: 'claude',
|
|
52
89
|
},
|
|
90
|
+
{
|
|
91
|
+
name: `codex — Codex CLI${detected.codex ? chalk.green(' ✓ 已安装') : chalk.gray(' (未检测到)')}`,
|
|
92
|
+
value: 'codex',
|
|
93
|
+
},
|
|
53
94
|
{
|
|
54
95
|
name: '自定义 — 输入其他命令',
|
|
55
96
|
value: '__custom__',
|
|
@@ -60,7 +101,7 @@ export async function selectAiCli(currentCommand, detected = {}) {
|
|
|
60
101
|
},
|
|
61
102
|
];
|
|
62
103
|
|
|
63
|
-
const knownCliValues = ['cbc', 'claude'];
|
|
104
|
+
const knownCliValues = ['cbc', 'claude', 'codex'];
|
|
64
105
|
const cliDefault = knownCliValues.includes(currentCommand)
|
|
65
106
|
? currentCommand
|
|
66
107
|
: (currentCommand ? '__custom__' : (detected.suggestedCli || ''));
|
package/src/runtimes.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const RUNTIME_UNIX = 'unix';
|
|
2
|
+
export const RUNTIME_WINDOWS = 'windows';
|
|
3
|
+
export const RUNTIME_IDS = [RUNTIME_UNIX, RUNTIME_WINDOWS];
|
|
4
|
+
|
|
5
|
+
export function detectDefaultRuntime() {
|
|
6
|
+
return process.platform === 'win32' ? RUNTIME_WINDOWS : RUNTIME_UNIX;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function normalizeRuntime(runtime) {
|
|
10
|
+
if (!runtime || runtime === 'auto') return detectDefaultRuntime();
|
|
11
|
+
if (runtime === 'macos-linux' || runtime === 'macos' || runtime === 'linux') return RUNTIME_UNIX;
|
|
12
|
+
if (runtime === 'win' || runtime === 'powershell') return RUNTIME_WINDOWS;
|
|
13
|
+
if (RUNTIME_IDS.includes(runtime)) return runtime;
|
|
14
|
+
throw new Error(`Unknown runtime "${runtime}". Expected unix or windows.`);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function runtimeLabel(runtime) {
|
|
18
|
+
const normalized = normalizeRuntime(runtime);
|
|
19
|
+
return normalized === RUNTIME_WINDOWS ? 'Windows PowerShell' : 'macOS/Linux';
|
|
20
|
+
}
|