Skip to content

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

Merged
ericallam merged 3 commits into
mainfrom
feature/tri-10879-ship-docs-skills-in-triggerdevsdk-for-zero-drift-agent
Jun 14, 2026
Merged

feat(sdk,cli): bundle agent skills + docs in the SDK for zero-drift#3937
ericallam merged 3 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: 99e736f

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

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 description provides a good summary of what changed and how it works, but does not follow the repository's required PR template (missing checklist, testing section, and changelog structure). Reformat the description to follow the template: add the checklist, include a Testing section describing what was tested, and structure the Changelog section with a concise summary.
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 summarizes the main change: bundling agent skills and documentation snapshots in the SDK to prevent drift between skill guidance and installed SDK versions.
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 feature/tri-10879-ship-docs-skills-in-triggerdevsdk-for-zero-drift-agent

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


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[bot]

This comment was marked as resolved.

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@99e736f

trigger.dev

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

@trigger.dev/core

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

@trigger.dev/python

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

@trigger.dev/react-hooks

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

@trigger.dev/redis-worker

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

@trigger.dev/rsc

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

@trigger.dev/schema-to-json

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

@trigger.dev/sdk

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

commit: 99e736f

…undle

The realtime skill's TriggerButton example named its token `publicAccessToken`
while passing it to useTaskTrigger, which contradicts the skill's own warning
that a read token cannot trigger a task. Renamed to `triggerToken`.

bundleSdkDocs now throws instead of warning when no doc sources are found, so a
broken skills dir fails the build rather than shipping the SDK with missing docs.

@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.

♻️ Duplicate comments (1)
packages/trigger-sdk/skills/realtime-and-frontend/SKILL.md (1)

258-260: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix the handle subscription example to pass handle.id.

The "correct" code snippet only adds the enabled guard but still passes handle (the object) as the first argument. The hook needs a runId string, so it should be handle.id.

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3ff464b7-99ec-40ac-81cf-de3497fe125c

📥 Commits

Reviewing files that changed from the base of the PR and between 4ed7c1e and 99e736f.

📒 Files selected for processing (2)
  • packages/trigger-sdk/skills/realtime-and-frontend/SKILL.md
  • scripts/bundleSdkDocs.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • 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). (37)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (10, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (8, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (12, 12)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (6, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (2, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (9, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (5, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (11, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (3, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (1, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (7, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (4, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 10)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 10)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: sdk-compat / Node.js 20.20 (ubuntu-latest)
  • GitHub Check: sdk-compat / Node.js 22.12 (ubuntu-latest)
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: sdk-compat / Deno Runtime
  • GitHub Check: sdk-compat / Bun Runtime
  • GitHub Check: sdk-compat / Cloudflare Workers
  • GitHub Check: packages / 🧪 Unit Tests: Packages (1, 3)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (3, 3)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (2, 3)
  • GitHub Check: typecheck / typecheck
  • 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
🪛 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))

@ericallam ericallam marked this pull request as ready for review June 14, 2026 09:42

@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 1 potential issue.

🐛 1 issue in files not directly in the diff

🐛 Turbo cache outputs missing docs/**, causing docs to vanish on cache hits (turbo.json:7-13)

The SDK build now generates a docs/ directory via the bundle-docs step, and docs is listed in files[] for npm publishing. However, the global turbo.json build pipeline only caches "dist/**" (plus a few other unrelated globs) as outputs — docs/** is not included. After a clean (which runs rimraf dist docs … at package.json:67) followed by a Turbo cache-hit build, dist/ is restored from cache but docs/ is not, because Turbo never saved it. The published npm package would then ship without the bundled docs that the slimmed-down CLI skills (packages/cli-v3/skills/*/SKILL.md) now redirect AI agents to read from node_modules/@trigger.dev/sdk/docs/….

Open in Devin Review

@ericallam ericallam merged commit e092919 into main Jun 14, 2026
69 checks passed
@ericallam ericallam deleted the feature/tri-10879-ship-docs-skills-in-triggerdevsdk-for-zero-drift-agent branch June 14, 2026 10:00
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