Skip to content

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

Merged
ericallam merged 4 commits into
mainfrom
feat/cli-init-ai-tooling
Jun 9, 2026
Merged

feat(cli): set up AI tooling in trigger init and add getting-started skill#3872
ericallam merged 4 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: f4762fb

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b610f497-8e3a-4eb4-9907-1a0d90801ad7

📥 Commits

Reviewing files that changed from the base of the PR and between d3f6f7b and f4762fb.

📒 Files selected for processing (2)
  • packages/cli-v3/src/commands/init.ts
  • packages/cli-v3/src/commands/skills.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/cli-v3/src/commands/skills.ts
📜 Recent 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: internal / 🧪 Unit Tests: Internal (6, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (7, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (5, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (8, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (9, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (11, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (10, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (12, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (4, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (3, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (2, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (1, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 10)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (3, 3)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (2, 3)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (1, 3)
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: typecheck / typecheck
  • GitHub Check: audit
  • GitHub Check: Build and publish previews
  • GitHub Check: Analyze (javascript-typescript)
🧰 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 (6)
packages/cli-v3/src/commands/init.ts (6)

1-64: LGTM!


66-124: LGTM!


132-248: LGTM!


250-366: LGTM!


368-667: LGTM!


669-825: LGTM!


Walkthrough

This PR adds optional AI tooling to trigger init, letting users enable an MCP server and/or bundled agent skills during onboarding. It introduces a new "getting-started" agent skill with detailed bootstrap instructions. The init command now shows a multiselect for AI tooling, records prompt state, installs skills (or marks them seen), optionally runs the MCP installer, and—if tools were installed—offers delegating remaining setup to an AI assistant. New skills APIs resolve the bundled CLI package root, mark the skills prompt as seen, and install skills; tests verify package-root resolution.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete; it lacks the Testing section and Changelog section required by the repository template, and does not reference an issue or include the checklist. Add the Closes # reference, complete the checklist, include a Testing section describing validation steps, and ensure Changelog and Screenshots sections are addressed per the template.
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main changes: adding AI tooling setup to 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@f4762fb

trigger.dev

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

@trigger.dev/core

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

@trigger.dev/plugins

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

@trigger.dev/python

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

@trigger.dev/react-hooks

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

@trigger.dev/redis-worker

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

@trigger.dev/rsc

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

@trigger.dev/schema-to-json

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

@trigger.dev/sdk

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

commit: f4762fb

coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

…dist stub

The skills loader resolved the package.json nearest the bundled code, which is
tshy's `dist/esm` dialect stub ({"type":"module"}), so it looked for skills in
`dist/esm/skills` (which does not exist) and reported "No agent skills found"
from every published build. It only worked when run from source via tsx. Walk
up to the first package.json with a name (the real package root) instead, which
resolves correctly both bundled and from source, and also fixes the version
stamp falling back to 0.0.0.
devin-ai-integration[bot]

This comment was marked as resolved.

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.
@ericallam ericallam merged commit 18b9028 into main Jun 9, 2026
59 checks passed
@ericallam ericallam deleted the feat/cli-init-ai-tooling branch June 9, 2026 10:41
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.

2 participants