Skip to content

Commit f4762fb

Browse files
committed
fix(cli): harden init AI-tooling hand-off and report real skills install
Warn and continue when MCP install fails instead of aborting init, so an already-installed skill and the project scaffold are not lost. installSkills now reports whether anything was actually written, so the AI hand-off is only offered and described when skills really landed (not when only an unsupported target was chosen). The hand-off message now covers skills, MCP, or both.
1 parent d3f6f7b commit f4762fb

2 files changed

Lines changed: 21 additions & 13 deletions

File tree

packages/cli-v3/src/commands/init.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,12 @@ async function _initCommand(dir: string, options: InitCommandOptions) {
206206
);
207207

208208
if (installError) {
209-
outro(`Failed to install MCP server: ${installError.message}`);
210-
return;
209+
// Don't abort init if MCP fails: skills may already be installed and the user
210+
// still needs the project scaffolded. Warn and carry on.
211+
log.warn(`Skipped MCP server: ${installError.message}`);
212+
} else {
213+
installedMcp = true;
211214
}
212-
213-
installedMcp = true;
214215
}
215216

216217
// Vibe path: once AI tooling is actually installed, the user can hand scaffolding to
@@ -235,9 +236,11 @@ async function _initCommand(dir: string, options: InitCommandOptions) {
235236

236237
if (!isCancel(setupChoice) && setupChoice === "ai") {
237238
outro(
238-
installedSkills
239-
? "Your AI tooling is ready. Ask your assistant to set up Trigger.dev and it will use the getting-started skill to add the SDK, config, and your first task."
240-
: "The MCP server is installed. Ask your assistant to set up Trigger.dev using the MCP server."
239+
installedSkills && installedMcp
240+
? "Your AI tooling is ready. Ask your assistant to set up Trigger.dev; it can use the getting-started skill and the MCP server to add the SDK, config, and your first task."
241+
: installedSkills
242+
? "Your AI tooling is ready. Ask your assistant to set up Trigger.dev and it will use the getting-started skill to add the SDK, config, and your first task."
243+
: "The MCP server is installed. Ask your assistant to set up Trigger.dev using the MCP server."
241244
);
242245
return;
243246
}

packages/cli-v3/src/commands/skills.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,19 +278,20 @@ export async function installSkillsFromInit(opts: SkillsWizardOptions = {}): Pro
278278
writeConfigHasSeenRulesInstallPrompt(true);
279279
writeConfigLastRulesInstallPromptVersion(manifest.currentVersion);
280280

281-
await installSkills(manifest, opts);
282-
283-
return true;
281+
// Returns true only if skills were actually written (false e.g. when the only target
282+
// chosen is "unsupported"), so callers like `trigger init` don't claim skills are ready
283+
// when nothing landed.
284+
return await installSkills(manifest, opts);
284285
}
285286

286-
async function installSkills(manifest: RulesManifest, opts: SkillsWizardOptions) {
287+
async function installSkills(manifest: RulesManifest, opts: SkillsWizardOptions): Promise<boolean> {
287288
const currentVersion = await manifest.getCurrentVersion();
288289

289290
const targetNames = await resolveTargets(opts);
290291

291292
if (targetNames.length === 1 && targetNames.includes("unsupported")) {
292293
handleUnsupportedTargetOnly();
293-
return;
294+
return false;
294295
}
295296

296297
const results = [];
@@ -303,7 +304,9 @@ async function installSkills(manifest: RulesManifest, opts: SkillsWizardOptions)
303304
}
304305
}
305306

306-
if (results.some((r) => r.installations.length > 0 || r.pointer)) {
307+
const installedAny = results.some((r) => r.installations.length > 0 || r.pointer);
308+
309+
if (installedAny) {
307310
log.step("Installed the following skills:");
308311

309312
for (const r of results) {
@@ -319,6 +322,8 @@ async function installSkills(manifest: RulesManifest, opts: SkillsWizardOptions)
319322
`${cliLink("Learn how to use Trigger.dev skills", "https://trigger.dev/docs/agents/rules/overview")}`
320323
);
321324
}
325+
326+
return installedAny;
322327
}
323328

324329
function handleUnsupportedTargetOnly() {

0 commit comments

Comments
 (0)