Skip to content

feat(cli): set up AI tooling in trigger init and add getting-started skill#3872

Open
ericallam wants to merge 2 commits into
mainfrom
feat/cli-init-ai-tooling
Open

feat(cli): set up AI tooling in trigger init and add getting-started skill#3872
ericallam wants to merge 2 commits into
mainfrom
feat/cli-init-ai-tooling

Conversation

@ericallam

Copy link
Copy Markdown
Member

Summary

trigger init now sets up your AI coding assistant as part of project setup. Instead of the old either/or "MCP or CLI" prompt, it offers the MCP server and agent skills together, then asks whether to scaffold with the CLI or let your assistant do it.

A new getting-started agent skill backs that hand-off: it teaches the assistant the bootstrap recipe (install the SDK, write trigger.config.ts, scaffold a first task, wire tsconfig/gitignore, run trigger dev) and is explicit about the two steps that genuinely need a human (trigger login and copying the DEV secret key from the dashboard). It ships in the CLI alongside the existing skills, version-matched to your SDK.

Prompt-once gating is shared, so opting in or out during init means trigger dev won't ask about skills again.

…skill

init now offers the MCP server and agent skills together as one AI-tooling
step, then lets you scaffold with the CLI or hand off to your assistant. The
new getting-started skill is the bootstrap recipe that hand-off path uses:
install the SDK, write trigger.config.ts, create a first task, run dev.
Shared prompt-once gating means trigger dev no longer asks about skills
separately.
@changeset-bot

changeset-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d07913f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 25 packages
Name Type
trigger.dev Patch
@trigger.dev/build Patch
@trigger.dev/core Patch
@trigger.dev/plugins Patch
@trigger.dev/python Patch
@trigger.dev/react-hooks Patch
@trigger.dev/redis-worker Patch
@trigger.dev/rsc Patch
@trigger.dev/schema-to-json Patch
@trigger.dev/sdk Patch
@trigger.dev/database Patch
@trigger.dev/otlp-importer Patch
@trigger.dev/rbac Patch
@internal/cache Patch
@internal/clickhouse Patch
@internal/llm-model-catalog Patch
@internal/redis Patch
@internal/replication Patch
@internal/run-engine Patch
@internal/schedule-engine Patch
@internal/testcontainers Patch
@internal/tracing Patch
@internal/tsql Patch
@internal/zod-worker Patch
@internal/sdk-compat-tests Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ericallam ericallam marked this pull request as ready for review June 8, 2026 18:47
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This PR adds optional AI tooling support to the trigger init command, allowing users to install an MCP server and/or agent skills during project setup. A new "getting-started" skill provides step-by-step guidance for bootstrapping Trigger.dev from scratch, covering SDK installation, configuration file creation, task setup, and common mistakes. The init command now presents a multiselect prompt for AI tooling selection, conditionally installs skills, and offers a choice between CLI scaffolding or delegating setup to an AI assistant. Two new helper functions in the skills module support this workflow by installing skills and marking prompts as seen without additional confirmation.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description clearly explains the changes but is missing required sections (Closes issue, Testing, Changelog, Screenshots) from the template. Add missing template sections: issue reference, detailed testing steps, structured changelog entry, and any relevant screenshots.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: setting up AI tooling in trigger init and introducing the getting-started skill.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cli-init-ai-tooling

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

devin-ai-integration[bot]

This comment was marked as resolved.

The "let my AI set it up" hand-off was gated on what the user selected, not
what installed, so a failed skills install still offered it and claimed the
getting-started skill was ready. Gate it on actual installs and describe only
the tooling that landed. Also fix an inverted profile flag in the next-steps
message that printed `--profile undefined` when no profile was set.
@pkg-pr-new

pkg-pr-new Bot commented Jun 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

@trigger.dev/build

npm i https://pkg.pr.new/@trigger.dev/build@d07913f

trigger.dev

npm i https://pkg.pr.new/trigger.dev@d07913f

@trigger.dev/core

npm i https://pkg.pr.new/@trigger.dev/core@d07913f

@trigger.dev/plugins

npm i https://pkg.pr.new/@trigger.dev/plugins@d07913f

@trigger.dev/python

npm i https://pkg.pr.new/@trigger.dev/python@d07913f

@trigger.dev/react-hooks

npm i https://pkg.pr.new/@trigger.dev/react-hooks@d07913f

@trigger.dev/redis-worker

npm i https://pkg.pr.new/@trigger.dev/redis-worker@d07913f

@trigger.dev/rsc

npm i https://pkg.pr.new/@trigger.dev/rsc@d07913f

@trigger.dev/schema-to-json

npm i https://pkg.pr.new/@trigger.dev/schema-to-json@d07913f

@trigger.dev/sdk

npm i https://pkg.pr.new/@trigger.dev/sdk@d07913f

commit: d07913f

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1563b5df-2a74-4486-b2ad-fc5f71b9b4ac

📥 Commits

Reviewing files that changed from the base of the PR and between 41f81d1 and d07913f.

📒 Files selected for processing (1)
  • packages/cli-v3/src/commands/init.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (34)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (4, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (12, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (8, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (11, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (9, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (7, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (10, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (3, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (5, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (2, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (6, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (1, 12)
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: packages / 🧪 Unit Tests: Packages (2, 3)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (1, 3)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (3, 3)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: audit
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Build and publish previews
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use types over interfaces for TypeScript
Avoid using enums; prefer string unions or const objects instead

Import from @trigger.dev/sdk when writing Trigger.dev tasks. Never use @trigger.dev/sdk/v3 or deprecated client.defineJob

Files:

  • packages/cli-v3/src/commands/init.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use function declarations instead of default exports

**/*.{ts,tsx,js,jsx}: Prefer static imports over dynamic imports. Only use dynamic import() when circular dependencies cannot be resolved, code splitting is needed for performance, or the module must be loaded conditionally at runtime
Import subpaths only from packages/core (@trigger.dev/core), never import from the root

Files:

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

📄 CodeRabbit inference engine (.cursor/rules/otel-metrics.mdc)

**/*.ts: When creating or editing OTEL metrics (counters, histograms, gauges), ensure metric attributes have low cardinality by using only enums, booleans, bounded error codes, or bounded shard IDs
Do not use high-cardinality attributes in OTEL metrics such as UUIDs/IDs (envId, userId, runId, projectId, organizationId), unbounded integers (itemCount, batchSize, retryCount), timestamps (createdAt, startTime), or free-form strings (errorMessage, taskName, queueName)
When exporting OTEL metrics via OTLP to Prometheus, be aware that the exporter automatically adds unit suffixes to metric names (e.g., 'my_duration_ms' becomes 'my_duration_ms_milliseconds', 'my_counter' becomes 'my_counter_total'). Account for these transformations when writing Grafana dashboards or Prometheus queries

Files:

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

📄 CodeRabbit inference engine (packages/cli-v3/CLAUDE.md)

CLI command definitions should be located in src/commands/

Files:

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

📄 CodeRabbit inference engine (packages/cli-v3/CLAUDE.md)

Implement init.ts command in src/commands/ for project initialization

Files:

  • packages/cli-v3/src/commands/init.ts
**/*.{js,ts,tsx,jsx,css,json,md}

📄 CodeRabbit inference engine (AGENTS.md)

Use Prettier for code formatting and run pnpm run format before committing

Files:

  • packages/cli-v3/src/commands/init.ts
🧠 Learnings (5)
📚 Learning: 2026-03-22T13:26:12.060Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3244
File: apps/webapp/app/components/code/TextEditor.tsx:81-86
Timestamp: 2026-03-22T13:26:12.060Z
Learning: In the triggerdotdev/trigger.dev codebase, do not flag `navigator.clipboard.writeText(...)` calls for `missing-await`/`unhandled-promise` issues. These clipboard writes are intentionally invoked without `await` and without `catch` handlers across the project; keep that behavior consistent when reviewing TypeScript/TSX files (e.g., usages like in `apps/webapp/app/components/code/TextEditor.tsx`).

Applied to files:

  • packages/cli-v3/src/commands/init.ts
📚 Learning: 2026-03-22T19:24:14.403Z
Learnt from: matt-aitken
Repo: triggerdotdev/trigger.dev PR: 3187
File: apps/webapp/app/v3/services/alerts/deliverErrorGroupAlert.server.ts:200-204
Timestamp: 2026-03-22T19:24:14.403Z
Learning: In the triggerdotdev/trigger.dev codebase, webhook URLs are not expected to contain embedded credentials/secrets (e.g., fields like `ProjectAlertWebhookProperties` should only hold credential-free webhook endpoints). During code review, if you see logging or inclusion of raw webhook URLs in error messages, do not automatically treat it as a credential-leak/secrets-in-logs issue by default—first verify the URL does not contain embedded credentials (for example, no username/password in the URL, no obvious secret/token query params or fragments). If the URL is credential-free per this project’s conventions, allow the logging.

Applied to files:

  • packages/cli-v3/src/commands/init.ts
📚 Learning: 2026-05-18T08:21:27.694Z
Learnt from: d-cs
Repo: triggerdotdev/trigger.dev PR: 3632
File: apps/webapp/sentry.server.ts:4-21
Timestamp: 2026-05-18T08:21:27.694Z
Learning: When handling Prisma error P1001 ("Can't reach database server") in TypeScript, don’t assume a single error shape. Prisma can surface P1001 via two different error classes/fields: `PrismaClientKnownRequestError` exposes it as `err.code === "P1001"` (common during mid-query connection drops), while `PrismaClientInitializationError` exposes it as `err.errorCode === "P1001"` (common on client startup failure). Therefore, predicates should use `err.code === "P1001" || err.errorCode === "P1001"`. Do not flag `err.code === "P1001"` as “unreachable/never matches,” as it is expected in production.

Applied to files:

  • packages/cli-v3/src/commands/init.ts
📚 Learning: 2026-05-18T08:21:27.694Z
Learnt from: d-cs
Repo: triggerdotdev/trigger.dev PR: 3632
File: apps/webapp/sentry.server.ts:4-21
Timestamp: 2026-05-18T08:21:27.694Z
Learning: When handling Prisma errors for P1001 ("Can't reach database server"), do not assume it only appears under a single property name. Prisma may surface P1001 via either `PrismaClientKnownRequestError` (`err.code === "P1001"`, e.g., mid-query connection drops) or `PrismaClientInitializationError` (`err.errorCode === "P1001"`, e.g., client startup connection failure). To reliably detect the condition, check `err.code === "P1001" || err.errorCode === "P1001"`, and avoid review rules that would incorrectly flag `err.code === "P1001"` as unreachable/never-matching.

Applied to files:

  • packages/cli-v3/src/commands/init.ts
📚 Learning: 2026-06-04T18:16:35.386Z
Learnt from: nicktrn
Repo: triggerdotdev/trigger.dev PR: 3836
File: apps/supervisor/src/backpressure/backpressureMonitor.ts:3-5
Timestamp: 2026-06-04T18:16:35.386Z
Learning: When reviewing TypeScript in this repo, apply the rule “prefer type aliases over interfaces” only to data/object shapes and union/intersection type modeling. If an interface is being used as a behavioral contract for collaborators to implement (e.g., method-shape interfaces that define required behavior, such as `BackpressureLogger` / `BackpressureSignalSource` in `apps/supervisor/src/backpressure/backpressureMonitor.ts`), keep it as an `interface` and do not flag it as a type-alias-vs-interface violation.

Applied to files:

  • packages/cli-v3/src/commands/init.ts
🔇 Additional comments (7)
packages/cli-v3/src/commands/init.ts (7)

176-180: LGTM!


213-213: LGTM!


348-348: LGTM!


136-147: LGTM!


149-172: LGTM!


192-194: LGTM!


186-190: installSkillsFromInit returns Promise<boolean, so the installed === true check is consistent. In packages/cli-v3/src/commands/skills.ts, installSkillsFromInit(...): Promise<boolean> matches the expectation used in packages/cli-v3/src/commands/init.ts (lines 186-190).

Comment on lines +238 to +240
installedSkills
? "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."
: "The MCP server is installed. Ask your assistant to set up Trigger.dev using the MCP server."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Outro message should describe all installed tooling.

When both installedSkills and installedMcp are true, the current ternary only mentions the getting-started skill. The user should be informed about both tools being available.

💬 Suggested improvement
-          installedSkills
-            ? "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."
-            : "The MCP server is installed. Ask your assistant to set up Trigger.dev using the MCP server."
+          installedSkills && installedMcp
+            ? "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."
+            : installedSkills
+            ? "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."
+            : "The MCP server is installed. Ask your assistant to set up Trigger.dev using the MCP server."
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
installedSkills
? "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."
: "The MCP server is installed. Ask your assistant to set up Trigger.dev using the MCP server."
installedSkills && installedMcp
? "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."
: installedSkills
? "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."
: "The MCP server is installed. Ask your assistant to set up Trigger.dev using the MCP server."

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

View 5 additional findings in Devin Review.

Open in Devin Review

Comment on lines +246 to +248
await installSkills(manifest, opts);

return true;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 installSkillsFromInit returns true even when no skills were actually installed on disk

installSkillsFromInit at packages/cli-v3/src/commands/skills.ts:248 unconditionally returns true as long as the skills manifest was loaded, regardless of whether installSkills actually wrote any files. When the user selects "Unsupported target" as their only target during the interactive skills flow, installSkills calls handleUnsupportedTargetOnly() (a log message) and returns without installing anything (packages/cli-v3/src/commands/skills.ts:256-258). Back in init.ts:190, installedSkills is set to true, which causes the "How do you want to set up your project?" prompt to appear (init.ts:219). If the user then picks "ai", the outro message incorrectly tells them the getting-started skill is ready (init.ts:238-239), when in reality no skills were written to disk.

Prompt for agents
The problem is that installSkillsFromInit always returns true when a manifest is found, even if installSkills didn't actually install any skills on disk. This misleads init.ts into thinking skills were installed and offering the AI handoff option.

Two possible fixes:

1. Have installSkills return an indicator of whether any skills were actually installed (e.g., return the number of installations or a boolean), and propagate that through installSkillsFromInit's return value.

2. Alternatively, change installSkillsFromInit to inspect whether installSkills actually installed anything by having installSkills return its results array, then check if any installations occurred before returning true.

The key function chain is: init.ts calls installSkillsFromInit (skills.ts:236) which calls installSkills (skills.ts:251). installSkills already has the results array and checks results.some(r => r.installations.length > 0 || r.pointer) internally. That same check could be used to determine the return value of installSkillsFromInit.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines 210 to 211
return;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 MCP install failure aborts init even after successful skills installation

When the user selects both skills and MCP, and skills install successfully but MCP fails, the outro() + return at lines 209-210 aborts the entire init. Skills are installed on disk but the project isn't scaffolded (no trigger.config.ts, no SDK installed). The user would need to re-run trigger init, at which point hasSeenMCPInstallPrompt is true so it goes straight to CLI scaffolding — so this is recoverable. This pattern is carried over from the old MCP-only flow, but the impact is wider now since skills may have been installed. Consider catching the MCP error and continuing to the setupChoice / CLI scaffolding instead of aborting.

(Refers to lines 208-211)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant