You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docs: Clarify AI tool compatibility and expand context snippet (#3000)
This pull request overhauls the "Building with AI" documentation
section. It includes a comprehensive restructuring of the main
building-with-ai page with new setup guides and troubleshooting
sections, reorganizes the navigation hierarchy to elevate
mcp-agent-rules as a top-level page, and updates multiple documentation
pages to clarify the relationships between three AI tools: Skills, Agent
Rules, and MCP Server. Changes also include formatting improvements,
such as replacing italicized text with inline code formatting, and
consistent additions of explanatory Note blocks and CardGroup components
across related pages.
Give your AI assistant direct access to Trigger.dev tools - search docs, trigger tasks, deploy projects, and monitor runs.
9
+
We provide multiple tools to help AI coding assistants write correct Trigger.dev code. Use one or all of them for the best developer experience.
10
+
11
+
12
+
<Steps>
13
+
14
+
<Steptitle="Install the MCP Server">
15
+
Give your AI assistant direct access to Trigger.dev tools — search docs, trigger tasks, deploy projects, and monitor runs. Works with Claude Code, Cursor, Windsurf, VS Code (Copilot), and Zed.
16
+
17
+
```bash
18
+
npx trigger.dev@latest install-mcp
19
+
```
20
+
21
+
[Learn more →](/mcp-introduction)
22
+
</Step>
23
+
24
+
<Steptitle="Install Skills">
25
+
Portable instruction sets that teach any AI coding assistant Trigger.dev best practices. Works with Claude Code, Cursor, Windsurf, VS Code (Copilot), and any tool that supports the [Agent Skills standard](https://agentskills.io).
26
+
27
+
```bash
28
+
npx skills add triggerdotdev/skills
29
+
```
30
+
31
+
[Learn more →](/skills)
32
+
</Step>
33
+
34
+
<Steptitle="Install Agent Rules">
35
+
Comprehensive rule sets installed directly into your AI client's config files. Works with Cursor, Claude Code, VS Code (Copilot), Windsurf, Gemini CLI, Cline, and more. Claude Code also gets a dedicated subagent for hands-on help.
36
+
37
+
```bash
38
+
npx trigger.dev@latest install-rules
39
+
```
40
+
41
+
[Learn more →](/mcp-agent-rules)
42
+
</Step>
43
+
44
+
</Steps>
45
+
46
+
## Skills vs Agent Rules vs MCP
47
+
48
+
Not sure which tool to use? Here's how they compare:
**Our recommendation:** Install all three. Skills and Agent Rules teach your AI *how* to write code. The MCP Server lets it *do things* in your project.
59
+
60
+
## Project-level context snippet
61
+
62
+
If you prefer a lightweight/passive approach, paste the snippet below into a context file at the root of your project. Different AI tools read different files:
Create the file that matches your AI tool (or multiple files if your team uses different tools) and paste the snippet below. This gives the AI essential Trigger.dev context without installing anything.
73
+
74
+
<Accordiontitle="Copy the snippet">
75
+
76
+
````markdown
77
+
# Trigger.dev rules
78
+
79
+
## Imports
80
+
81
+
Always import from `@trigger.dev/sdk` — never from `@trigger.dev/sdk/v3` or use the deprecated `client.defineJob` pattern.
82
+
83
+
## Task pattern
84
+
85
+
Every task must be exported. Use `task()` from `@trigger.dev/sdk`:
86
+
87
+
```ts
88
+
import { task } from"@trigger.dev/sdk";
89
+
90
+
exportconst myTask =task({
91
+
id: "my-task",
92
+
retry: {
93
+
maxAttempts: 3,
94
+
factor: 1.8,
95
+
minTimeoutInMs: 500,
96
+
maxTimeoutInMs: 30_000,
97
+
},
98
+
run: async (payload: { url:string }) => {
99
+
// No timeouts — runs can take as long as needed
100
+
return { success: true };
101
+
},
102
+
});
103
+
```
104
+
105
+
## Triggering tasks
106
+
107
+
From your backend (Next.js route, Express handler, etc.):
-[trigger.dev/docs/llms-full.txt](https://trigger.dev/docs/llms-full.txt) — full documentation
232
+
233
+
These follow the [llms.txt standard](https://llmstxt.org) and can be fed directly into any LLM context window.
234
+
235
+
236
+
## Troubleshooting
237
+
238
+
<AccordionGroup>
239
+
240
+
<Accordiontitle="AI keeps generating old v2/v3 code">
241
+
Install [Agent Rules](/mcp-agent-rules) or [Skills](/skills) — they override the outdated patterns in the AI's training data. The [context snippet](#project-level-context-snippet) above is a quick alternative.
242
+
</Accordion>
243
+
244
+
<Accordiontitle="MCP server won't connect">
245
+
1. Make sure you've restarted your AI client after adding the config
246
+
2. Run `npx trigger.dev@latest install-mcp` again — it will detect and fix common issues
247
+
3. Check that `npx trigger.dev@latest mcp` runs without errors in your terminal
248
+
4. See the [MCP introduction](/mcp-introduction) for client-specific config details
249
+
</Accordion>
250
+
251
+
<Accordiontitle="Which tool should I install?">
252
+
All three if possible. If you can only pick one:
253
+
-**Agent Rules** if you want the broadest code generation improvement
254
+
-**Skills** if you use multiple AI tools and want a single install
255
+
-**MCP Server** if you need to trigger tasks, deploy, and search docs from your AI
Copy file name to clipboardExpand all lines: docs/mcp-agent-rules.mdx
+19-4Lines changed: 19 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,17 @@
1
1
---
2
2
title: "Agent rules"
3
3
sidebarTitle: "Agent rules"
4
-
description: "Learn how to use the Trigger.dev agent rules with the MCP server"
4
+
description: "Install Trigger.dev agent rules to guide AI assistants toward correct, up-to-date code patterns."
5
5
---
6
6
7
7
## What are Trigger.dev agent rules?
8
8
9
9
Trigger.dev agent rules are comprehensive instruction sets that guide AI assistants to write optimal Trigger.dev code. These rules ensure your AI assistant understands best practices, current APIs, and recommended patterns when working with Trigger.dev projects.
10
10
11
+
<Note>
12
+
Agent Rules are one of three AI tools we provide. You can also install [Skills](/skills) for portable cross-editor instruction sets or the [MCP Server](/mcp-introduction) for live project interaction. See the [comparison table](/building-with-ai#skills-vs-agent-rules-vs-mcp) for details.
13
+
</Note>
14
+
11
15
## Installation
12
16
13
17
Install the agent rules with the following command:
0 commit comments