Skip to content

feat(sdk,cli): bundle agent skills + docs in the SDK for zero-drift#3937

Draft
ericallam wants to merge 2 commits into
mainfrom
feature/tri-10879-ship-docs-skills-in-triggerdevsdk-for-zero-drift-agent
Draft

feat(sdk,cli): bundle agent skills + docs in the SDK for zero-drift#3937
ericallam wants to merge 2 commits into
mainfrom
feature/tri-10879-ship-docs-skills-in-triggerdevsdk-for-zero-drift-agent

Conversation

@ericallam

Copy link
Copy Markdown
Member

Summary

@trigger.dev/sdk now ships the Trigger.dev agent skills and a curated snapshot of the docs those skills cite. The skills that trigger skills installs into your coding agent are thin pointers that read this bundled content from node_modules, so the guidance always matches the SDK version installed in your project. Previously the full skill text was copied into your repo at install time and went stale until you reinstalled after an upgrade.

How it works

The SDK's files[] now includes skills/ (the full skill text) and docs/ (a curated snapshot generated at build time). The docs manifest is derived from each skill's own sources: frontmatter, so a skill only ships the docs it references, and a skill that cites a missing doc fails the build.

The CLI installs thin skills whose body points the agent at node_modules/@trigger.dev/sdk/skills/<name>/SKILL.md and node_modules/@trigger.dev/sdk/docs/. They keep the high-value "Common mistakes" anti-patterns inline so the trigger and the guardrails survive even if the agent does not follow the pointer. getting-started stays self-contained in the CLI because it runs before the SDK is installed.

@trigger.dev/sdk now ships the agent skills and a curated snapshot of the docs
the skills cite. The skills the CLI installs into your coding agent (.claude/skills
and friends) are thin pointers that read this content directly from node_modules, so
the guidance always matches the SDK version in your project instead of going stale
until the next reinstall.
@changeset-bot

changeset-bot Bot commented Jun 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4ed7c1e

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/sdk Patch
trigger.dev Patch
@trigger.dev/python Patch
@internal/sdk-compat-tests Patch
@trigger.dev/build Patch
@trigger.dev/core Patch
@trigger.dev/plugins Patch
@trigger.dev/react-hooks Patch
@trigger.dev/redis-worker Patch
@trigger.dev/rsc Patch
@trigger.dev/schema-to-json 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

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

@coderabbitai

coderabbitai Bot commented Jun 13, 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: 77724c26-0c36-4fa5-94cd-6ab4881c2b7e

📥 Commits

Reviewing files that changed from the base of the PR and between 87f8df6 and 4ed7c1e.

📒 Files selected for processing (8)
  • packages/cli-v3/skills/authoring-chat-agent/SKILL.md
  • packages/cli-v3/skills/authoring-tasks/SKILL.md
  • packages/cli-v3/skills/chat-agent-advanced/SKILL.md
  • packages/cli-v3/skills/realtime-and-frontend/SKILL.md
  • packages/trigger-sdk/skills/authoring-chat-agent/SKILL.md
  • packages/trigger-sdk/skills/authoring-tasks/SKILL.md
  • packages/trigger-sdk/skills/chat-agent-advanced/SKILL.md
  • packages/trigger-sdk/skills/realtime-and-frontend/SKILL.md
✅ Files skipped from review due to trivial changes (6)
  • packages/cli-v3/skills/chat-agent-advanced/SKILL.md
  • packages/cli-v3/skills/authoring-chat-agent/SKILL.md
  • packages/trigger-sdk/skills/authoring-chat-agent/SKILL.md
  • packages/trigger-sdk/skills/authoring-tasks/SKILL.md
  • packages/trigger-sdk/skills/chat-agent-advanced/SKILL.md
  • packages/cli-v3/skills/authoring-tasks/SKILL.md
📜 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). (38)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (4, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (11, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (6, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (8, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (9, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (3, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (1, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (2, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (7, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (10, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (5, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (12, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 10)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (2, 3)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (1, 3)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (3, 3)
  • GitHub Check: sdk-compat / Node.js 22.12 (ubuntu-latest)
  • GitHub Check: sdk-compat / Bun Runtime
  • GitHub Check: sdk-compat / Cloudflare Workers
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: sdk-compat / Node.js 20.20 (ubuntu-latest)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: sdk-compat / Deno Runtime
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Build and publish previews
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{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/trigger-sdk/skills/realtime-and-frontend/SKILL.md
  • packages/cli-v3/skills/realtime-and-frontend/SKILL.md
🪛 SkillSpector (2.1.1)
packages/trigger-sdk/skills/realtime-and-frontend/SKILL.md

[error] 235: [PE3] Credential Access: Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Remediation: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.

(Privilege Escalation (PE3))

packages/cli-v3/skills/realtime-and-frontend/SKILL.md

[error] 29: [PE3] Credential Access: Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Remediation: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.

(Privilege Escalation (PE3))

🔇 Additional comments (2)
packages/cli-v3/skills/realtime-and-frontend/SKILL.md (1)

23-23: LGTM!

packages/trigger-sdk/skills/realtime-and-frontend/SKILL.md (1)

268-273: LGTM!


Walkthrough

This PR adds a bundling pipeline (scripts/bundleSdkDocs.ts) that extracts docs referenced by SKILL.md frontmatter and copies them into packages/trigger-sdk/docs. package.json and build scripts are updated to run and publish the bundled docs and skills; .gitignore and a changeset are updated accordingly. CLI skill SKILL.md files are replaced with pointers to the installed @trigger.dev/sdk node_modules for version-pinned guidance. New SDK skill docs are added under packages/trigger-sdk/skills covering chat agent authoring, advanced chat-agent patterns, task authoring, and realtime frontend consumption.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is missing critical sections from the template: issue reference, testing details, and the required checklist with contributor verification. Add the missing template sections: 'Closes #' reference, 'Testing' section with test steps, and the complete '✅ Checklist' with all items marked.
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% 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 describes the main change: bundling agent skills and docs in the SDK to eliminate version drift. It is specific, actionable, and accurately reflects the core objective.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/tri-10879-ship-docs-skills-in-triggerdevsdk-for-zero-drift-agent

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.

@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: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a9f1d871-1cd0-46ca-b388-c5315b1c684b

📥 Commits

Reviewing files that changed from the base of the PR and between 034058b and 87f8df6.

📒 Files selected for processing (12)
  • .changeset/agent-skills-bundled-in-sdk.md
  • packages/cli-v3/skills/authoring-chat-agent/SKILL.md
  • packages/cli-v3/skills/authoring-tasks/SKILL.md
  • packages/cli-v3/skills/chat-agent-advanced/SKILL.md
  • packages/cli-v3/skills/realtime-and-frontend/SKILL.md
  • packages/trigger-sdk/.gitignore
  • packages/trigger-sdk/package.json
  • packages/trigger-sdk/skills/authoring-chat-agent/SKILL.md
  • packages/trigger-sdk/skills/authoring-tasks/SKILL.md
  • packages/trigger-sdk/skills/chat-agent-advanced/SKILL.md
  • packages/trigger-sdk/skills/realtime-and-frontend/SKILL.md
  • scripts/bundleSdkDocs.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). (38)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (7, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (10, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (5, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (2, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (4, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (9, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (8, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (3, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (12, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (6, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (11, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (1, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 10)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: sdk-compat / Node.js 20.20 (ubuntu-latest)
  • GitHub Check: sdk-compat / Node.js 22.12 (ubuntu-latest)
  • GitHub Check: sdk-compat / Deno Runtime
  • GitHub Check: sdk-compat / Bun Runtime
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: sdk-compat / Cloudflare Workers
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: typecheck / typecheck
  • GitHub Check: packages / 🧪 Unit Tests: Packages (3, 3)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (2, 3)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (1, 3)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Build and publish previews
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{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/trigger-sdk/skills/chat-agent-advanced/SKILL.md
  • packages/cli-v3/skills/authoring-tasks/SKILL.md
  • packages/trigger-sdk/skills/realtime-and-frontend/SKILL.md
  • packages/trigger-sdk/package.json
  • packages/trigger-sdk/skills/authoring-chat-agent/SKILL.md
  • packages/cli-v3/skills/authoring-chat-agent/SKILL.md
  • packages/trigger-sdk/skills/authoring-tasks/SKILL.md
  • scripts/bundleSdkDocs.ts
  • packages/cli-v3/skills/chat-agent-advanced/SKILL.md
  • packages/cli-v3/skills/realtime-and-frontend/SKILL.md
**/*.{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:

  • scripts/bundleSdkDocs.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:

  • scripts/bundleSdkDocs.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:

  • scripts/bundleSdkDocs.ts
🧠 Learnings (6)
📚 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:

  • scripts/bundleSdkDocs.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:

  • scripts/bundleSdkDocs.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:

  • scripts/bundleSdkDocs.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:

  • scripts/bundleSdkDocs.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:

  • scripts/bundleSdkDocs.ts
📚 Learning: 2026-06-09T17:58:04.699Z
Learnt from: 0ski
Repo: triggerdotdev/trigger.dev PR: 3879
File: apps/webapp/app/models/vercelIntegration.server.ts:619-630
Timestamp: 2026-06-09T17:58:04.699Z
Learning: In this codebase, outbound raw `fetch` calls should typically rely on Node/undici’s default request timeout (about ~300s) rather than adding a per-call `AbortController` + `setTimeout` wrapper inside individual functions (e.g. in files like `apps/webapp/app/models/vercelIntegration.server.ts`). During code review, do not flag the absence of a per-call timeout on a single `fetch` as an issue; if per-call timeouts are needed, they should be implemented via a codebase-wide convention (e.g., a shared fetch wrapper or documented pattern) rather than ad-hoc per-function changes.

Applied to files:

  • scripts/bundleSdkDocs.ts
🪛 LanguageTool
packages/trigger-sdk/skills/realtime-and-frontend/SKILL.md

[grammar] ~71-~71: Use a hyphen to join words.
Context: ...iggerPublicToken`). Both default to a 15 minute expiry. ## Core patterns ### 1....

(QB_NEW_EN_HYPHEN)

🪛 SkillSpector (2.1.1)
packages/trigger-sdk/skills/realtime-and-frontend/SKILL.md

[error] 235: [PE3] Credential Access: Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Remediation: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.

(Privilege Escalation (PE3))

packages/cli-v3/skills/realtime-and-frontend/SKILL.md

[error] 29: [PE3] Credential Access: Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Remediation: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.

(Privilege Escalation (PE3))


[error] 29: [PE3] Credential Access: Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Remediation: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.

(Privilege Escalation (PE3))

🔇 Additional comments (10)
packages/trigger-sdk/package.json (1)

16-20: LGTM!

Also applies to: 66-75

packages/trigger-sdk/.gitignore (1)

1-3: LGTM!

.changeset/agent-skills-bundled-in-sdk.md (1)

1-7: LGTM!

packages/trigger-sdk/skills/authoring-chat-agent/SKILL.md (1)

1-293: LGTM!

packages/trigger-sdk/skills/chat-agent-advanced/SKILL.md (1)

1-366: LGTM!

packages/trigger-sdk/skills/authoring-tasks/SKILL.md (1)

1-255: LGTM!

packages/cli-v3/skills/authoring-chat-agent/SKILL.md (1)

15-22: LGTM!

Also applies to: 60-60

packages/cli-v3/skills/authoring-tasks/SKILL.md (1)

16-23: LGTM!

Also applies to: 57-57

packages/cli-v3/skills/chat-agent-advanced/SKILL.md (1)

16-23: LGTM!

Also applies to: 70-70

packages/cli-v3/skills/realtime-and-frontend/SKILL.md (1)

20-25: LGTM!

Also applies to: 58-58

Comment on lines +122 to +125
export function TriggerButton({ publicAccessToken }: { publicAccessToken: string }) {
const { submit, handle, isLoading } = useTaskTrigger<typeof myTask>("my-task", {
accessToken: publicAccessToken,
});

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

Rename the token prop to match the auth type.

useTaskTrigger needs a Trigger Token here, but the example names it publicAccessToken, which nudges readers toward the read-only token from createPublicToken. A triggerToken name keeps the example aligned with the actual flow.

Suggested fix
-export function TriggerButton({ publicAccessToken }: { publicAccessToken: string }) {
+export function TriggerButton({ triggerToken }: { triggerToken: string }) {
   const { submit, handle, isLoading } = useTaskTrigger<typeof myTask>("my-task", {
-    accessToken: publicAccessToken,
+    accessToken: triggerToken,
   });
📝 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
export function TriggerButton({ publicAccessToken }: { publicAccessToken: string }) {
const { submit, handle, isLoading } = useTaskTrigger<typeof myTask>("my-task", {
accessToken: publicAccessToken,
});
export function TriggerButton({ triggerToken }: { triggerToken: string }) {
const { submit, handle, isLoading } = useTaskTrigger<typeof myTask>("my-task", {
accessToken: triggerToken,
});
🧰 Tools
🪛 SkillSpector (2.1.1)

[error] 235: [PE3] Credential Access: Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Remediation: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.

(Privilege Escalation (PE3))

Comment on lines +258 to +260
6. **Subscribing before the handle exists.**
- Wrong: `useRealtimeRun(handle, { accessToken: handle?.publicAccessToken })` with no guard
- Correct: add `enabled: !!handle` so it subscribes only once the trigger returns a handle.

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

Pass the handle’s id in the guarded subscription example.

enabled: !!handle only fixes the timing race; the hook still needs the run id once the handle exists. As written, the “correct” snippet is still invalid because it never switches the first argument to handle.id.

Suggested fix
-const { run } = useRealtimeRun(handle, { accessToken: handle?.publicAccessToken, enabled: !!handle });
+const { run } = useRealtimeRun(handle.id, { accessToken: handle.publicAccessToken, enabled: !!handle });
🧰 Tools
🪛 SkillSpector (2.1.1)

[error] 235: [PE3] Credential Access: Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Remediation: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.

(Privilege Escalation (PE3))

Comment thread scripts/bundleSdkDocs.ts
Comment on lines +51 to +73
const entries = await fs.readdir(skillsDir, { withFileTypes: true }).catch(() => []);
const all = new Set<string>();

for (const entry of entries) {
if (!entry.isDirectory()) continue;
const skillMd = path.join(skillsDir, entry.name, "SKILL.md");
const sources = await readSkillSources(skillMd).catch(() => []);
for (const s of sources) {
// Only bundle docs paths; ignore anything that isn't a docs/*.mdx source.
if (s.startsWith("docs/") && s.endsWith(".mdx")) all.add(s);
}
}

return [...all].sort();
}

async function bundleSdkDocs() {
const manifest = await collectManifest();

if (manifest.length === 0) {
console.warn("[bundleSdkDocs] no doc sources found in skills/*/SKILL.md; skipping");
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Don't let manifest discovery silently no-op.

Swallowing readSkillSources() errors and returning when the manifest is empty can leave docs/ stale or missing while the build still succeeds. Fail fast instead so the published SDK stays in sync with the bundled skills.

Suggested fix
-    const sources = await readSkillSources(skillMd).catch(() => []);
+    const sources = await readSkillSources(skillMd);
@@
-  if (manifest.length === 0) {
-    console.warn("[bundleSdkDocs] no doc sources found in skills/*/SKILL.md; skipping");
-    return;
-  }
+  if (manifest.length === 0) {
+    throw new Error("[bundleSdkDocs] no doc sources found in skills/*/SKILL.md");
+  }
📝 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
const entries = await fs.readdir(skillsDir, { withFileTypes: true }).catch(() => []);
const all = new Set<string>();
for (const entry of entries) {
if (!entry.isDirectory()) continue;
const skillMd = path.join(skillsDir, entry.name, "SKILL.md");
const sources = await readSkillSources(skillMd).catch(() => []);
for (const s of sources) {
// Only bundle docs paths; ignore anything that isn't a docs/*.mdx source.
if (s.startsWith("docs/") && s.endsWith(".mdx")) all.add(s);
}
}
return [...all].sort();
}
async function bundleSdkDocs() {
const manifest = await collectManifest();
if (manifest.length === 0) {
console.warn("[bundleSdkDocs] no doc sources found in skills/*/SKILL.md; skipping");
return;
}
const entries = await fs.readdir(skillsDir, { withFileTypes: true }).catch(() => []);
const all = new Set<string>();
for (const entry of entries) {
if (!entry.isDirectory()) continue;
const skillMd = path.join(skillsDir, entry.name, "SKILL.md");
const sources = await readSkillSources(skillMd);
for (const s of sources) {
// Only bundle docs paths; ignore anything that isn't a docs/*.mdx source.
if (s.startsWith("docs/") && s.endsWith(".mdx")) all.add(s);
}
}
return [...all].sort();
}
async function bundleSdkDocs() {
const manifest = await collectManifest();
if (manifest.length === 0) {
throw new Error("[bundleSdkDocs] no doc sources found in skills/*/SKILL.md");
}

The bundled skills now reference the docs shipped alongside them in @trigger.dev/sdk (read from node_modules, pinned to your installed version) instead of the docs website, and the CLI pointer skills name the bundled doc set and its sources explicitly. An assistant reading a skill is sent to the local pinned copy.
@pkg-pr-new

pkg-pr-new Bot commented Jun 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

@trigger.dev/build

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

trigger.dev

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

@trigger.dev/core

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

@trigger.dev/python

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

@trigger.dev/react-hooks

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

@trigger.dev/redis-worker

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

@trigger.dev/rsc

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

@trigger.dev/schema-to-json

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

@trigger.dev/sdk

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

commit: 4ed7c1e

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