Skip to content

Commit 8b775f4

Browse files
committed
Docs: adds agent rules page
1 parent 160cc90 commit 8b775f4

File tree

2 files changed

+137
-69
lines changed

2 files changed

+137
-69
lines changed

docs/docs.json

Lines changed: 21 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@
1010
},
1111
"favicon": "/images/favicon.png",
1212
"contextual": {
13-
"options": [
14-
"copy",
15-
"view",
16-
"claude"
17-
]
13+
"options": ["copy", "view", "claude"]
1814
},
1915
"navigation": {
2016
"dropdowns": [
@@ -40,11 +36,7 @@
4036
"pages": [
4137
{
4238
"group": "Tasks",
43-
"pages": [
44-
"tasks/overview",
45-
"tasks/schemaTask",
46-
"tasks/scheduled"
47-
]
39+
"pages": ["tasks/overview", "tasks/schemaTask", "tasks/scheduled"]
4840
},
4941
"triggering",
5042
"runs",
@@ -59,12 +51,7 @@
5951
"errors-retrying",
6052
{
6153
"group": "Wait",
62-
"pages": [
63-
"wait",
64-
"wait-for",
65-
"wait-until",
66-
"wait-for-token"
67-
]
54+
"pages": ["wait", "wait-for", "wait-until", "wait-for-token"]
6855
},
6956
"queue-concurrency",
7057
"versioning",
@@ -110,9 +97,7 @@
11097
},
11198
{
11299
"group": "Development",
113-
"pages": [
114-
"cli-dev"
115-
]
100+
"pages": ["cli-dev"]
116101
},
117102
{
118103
"group": "Deployment",
@@ -124,9 +109,7 @@
124109
"deployment/atomic-deployment",
125110
{
126111
"group": "Deployment integrations",
127-
"pages": [
128-
"vercel-integration"
129-
]
112+
"pages": ["vercel-integration"]
130113
}
131114
]
132115
},
@@ -181,19 +164,11 @@
181164
},
182165
{
183166
"group": "MCP Server",
184-
"pages": [
185-
"mcp-introduction",
186-
"mcp-tools"
187-
]
167+
"pages": ["mcp-introduction", "mcp-tools", "mcp-agent-rules"]
188168
},
189169
{
190170
"group": "Using the Dashboard",
191-
"pages": [
192-
"run-tests",
193-
"troubleshooting-alerts",
194-
"replaying",
195-
"bulk-actions"
196-
]
171+
"pages": ["run-tests", "troubleshooting-alerts", "replaying", "bulk-actions"]
197172
},
198173
{
199174
"group": "Troubleshooting",
@@ -215,39 +190,23 @@
215190
"self-hosting/kubernetes",
216191
{
217192
"group": "Environment variables",
218-
"pages": [
219-
"self-hosting/env/webapp",
220-
"self-hosting/env/supervisor"
221-
]
193+
"pages": ["self-hosting/env/webapp", "self-hosting/env/supervisor"]
222194
}
223195
],
224-
"tags": [
225-
"v4"
226-
],
196+
"tags": ["v4"],
227197
"tag": "v4"
228198
},
229199
{
230200
"group": "Self-hosting",
231-
"pages": [
232-
"open-source-self-hosting"
233-
]
201+
"pages": ["open-source-self-hosting"]
234202
},
235203
{
236204
"group": "Open source",
237-
"pages": [
238-
"open-source-contributing",
239-
"github-repo",
240-
"changelog",
241-
"roadmap"
242-
]
205+
"pages": ["open-source-contributing", "github-repo", "changelog", "roadmap"]
243206
},
244207
{
245208
"group": "Help",
246-
"pages": [
247-
"community",
248-
"help-slack",
249-
"help-email"
250-
]
209+
"pages": ["community", "help-slack", "help-email"]
251210
}
252211
]
253212
},
@@ -268,10 +227,7 @@
268227
},
269228
{
270229
"group": "Tasks API",
271-
"pages": [
272-
"management/tasks/trigger",
273-
"management/tasks/batch-trigger"
274-
]
230+
"pages": ["management/tasks/trigger", "management/tasks/batch-trigger"]
275231
},
276232
{
277233
"group": "Runs API",
@@ -317,9 +273,7 @@
317273
"groups": [
318274
{
319275
"group": "Introduction",
320-
"pages": [
321-
"guides/introduction"
322-
]
276+
"pages": ["guides/introduction"]
323277
},
324278
{
325279
"group": "Frameworks",
@@ -349,7 +303,6 @@
349303
"guides/ai-agents/verify-news-article"
350304
]
351305
},
352-
"guides/cursor-rules",
353306
"guides/frameworks/drizzle",
354307
"guides/frameworks/prisma",
355308
"guides/frameworks/sequin",
@@ -436,9 +389,7 @@
436389
},
437390
{
438391
"group": "Migration guides",
439-
"pages": [
440-
"migration-mergent"
441-
]
392+
"pages": ["migration-mergent"]
442393
},
443394
{
444395
"group": "Community packages",
@@ -459,10 +410,7 @@
459410
"href": "https://trigger.dev"
460411
},
461412
"api": {
462-
"openapi": [
463-
"openapi.yml",
464-
"v3-openapi.yaml"
465-
],
413+
"openapi": ["openapi.yml", "v3-openapi.yaml"],
466414
"playground": {
467415
"display": "simple"
468416
}
@@ -675,6 +623,10 @@
675623
{
676624
"source": "/management/projects/runs",
677625
"destination": "/management/overview"
626+
},
627+
{
628+
"source": "/guides/cursor-rules",
629+
"destination": "/mcp-agent-rules"
678630
}
679631
]
680-
}
632+
}

docs/mcp-agent-rules.mdx

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
title: "Agent rules"
3+
sidebarTitle: "Agent rules"
4+
description: "Learn how to use the Trigger.dev agent rules with the MCP server"
5+
tag: "new"
6+
---
7+
8+
## What are Trigger.dev agent rules?
9+
10+
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.
11+
12+
## Installation
13+
14+
Install the agent rules with the following command:
15+
16+
```bash
17+
npx trigger.dev@latest install-rules
18+
```
19+
20+
## Available rule sets
21+
22+
We provide five specialized rule sets, each optimized for different aspects of Trigger.dev development:
23+
24+
| Rule set | Tokens | Description | GitHub |
25+
|:---------|:-------|:------------|:------------|
26+
| **Basic tasks** | 1,200 | Essential rules for writing basic Trigger.dev tasks and fundamental patterns | [View](https://github.com/triggerdotdev/trigger.dev/blob/main/rules/4.0.0/basic-tasks.md) |
27+
| **Advanced tasks** | 3,000 | Comprehensive rules for complex workflows, error handling, and advanced task patterns | [View](https://github.com/triggerdotdev/trigger.dev/blob/main/rules/4.0.0/advanced-tasks.md) |
28+
| **Scheduled tasks** | 780 | Specialized guidance for cron jobs, scheduled workflows, and time-based triggers | [View](https://github.com/triggerdotdev/trigger.dev/blob/main/rules/4.0.0/scheduled-tasks.md) |
29+
| **Configuration** | 1,900 | Complete guide for trigger.config.ts setup, environment configuration, and project structure | [View](https://github.com/triggerdotdev/trigger.dev/blob/main/rules/4.0.0/config.md) |
30+
| **Realtime** | 1,700 | Using Trigger.dev Realtime features and frontend integration patterns | [View](https://github.com/triggerdotdev/trigger.dev/blob/main/rules/4.0.0/realtime.md) |
31+
32+
## Claude Code subagent
33+
34+
For Claude Code users, we provide a subagent called `trigger-dev-expert` that's an expert at writing well-structured Trigger.dev code.
35+
36+
### Installation
37+
38+
The subagent is available as an option when running the rules installation command. Select "Claude Code" as your client and choose to include the subagent when prompted.
39+
40+
### Usage
41+
42+
Activate the subagent in your prompts by requesting it explicitly:
43+
44+
```markdown
45+
use the trigger-dev-expert subagent to create a trigger.dev job that accepts a video url, processes it with ffmpeg to extract the audio, runs the audio through a text-to-speech API like openai, and then uploads both the transcription and the audio to s3
46+
```
47+
48+
The subagent works best when combined with the appropriate rule sets installed alongside it, providing both high-level architectural guidance and detailed implementation knowledge.
49+
50+
## Supported AI clients
51+
52+
The Trigger.dev rules work across a wide range of AI coding assistants and editors:
53+
54+
| Client | Rule activation | Docs |
55+
|:--------|:----------------|:--------------|
56+
| **Cursor** | Automatic when working in trigger directories | [Link](https://docs.cursor.com/en/context/rules#rules/) |
57+
| **Claude Code** | Context-aware activation + custom subagent | [Link](https://docs.anthropic.com/en/docs/claude-code) |
58+
| **VSCode Copilot** | Integration with GitHub Copilot chat | [Link](https://code.visualstudio.com/docs/copilot/overview) |
59+
| **Windsurf** | Automatic activation in Trigger.dev projects | [Link](https://docs.windsurf.com/windsurf/cascade/memories#rules) |
60+
| **Gemini CLI** | Command-line integration | [Link](https://ai.google.dev/gemini-api/docs) |
61+
| **Cline** | Automatic context detection | [Link](https://github.com/cline/cline) |
62+
| **Sourcegraph AMP** | Code intelligence integration | [Link](https://sourcegraph.com/docs) |
63+
| **Kilo** | Custom rule integration | [Link](https://kilocode.ai/docs/advanced-usage/custom-rules) |
64+
| **Ruler** | Rule management | [Link](https://github.com/intellectronica/ruler) |
65+
| **AGENTS.md** | Universal format for OpenAI Codex, Jules, OpenCode, etc. | |
66+
67+
### Rule activation behavior
68+
69+
Different AI tools handle rules differently:
70+
71+
- **Automatic Activation**: Cursor, Windsurf, VSCode Copilot, and Cline automatically apply relevant rules when working in Trigger.dev projects or when `trigger.config.ts` is detected
72+
- **Context-Aware**: Claude Code intelligently applies rules based on the current context and file types
73+
- **Manual Integration**: AGENTS.md clients and others append rules to configuration files for manual activation
74+
75+
## Keeping rules updated
76+
77+
Trigger.dev rules are regularly updated to reflect new features, API changes, and best practices. The CLI includes automatic update detection.
78+
79+
### Automatic update notifications
80+
81+
When running `npx trigger.dev@latest dev`, you'll receive notifications when newer rule versions are available with a simple update command.
82+
83+
### Manual updates
84+
85+
Update rules anytime with:
86+
87+
```bash
88+
npx trigger.dev@latest install-rules
89+
```
90+
91+
The update process replaces existing rules without creating duplicates, keeping your configuration files clean and organized.
92+
93+
### Why updates matter
94+
95+
- **Current API patterns**: Access the latest Trigger.dev APIs and features
96+
- **Performance optimizations**: Benefit from improved patterns and practices
97+
- **Deprecated pattern avoidance**: Prevent AI assistants from generating outdated code
98+
- **New feature support**: Immediate access to newly released capabilities
99+
100+
## Getting started
101+
102+
1. Install the rules:
103+
104+
```bash
105+
npx trigger.dev@latest install-rules
106+
```
107+
108+
2. Follow the prompts to install the rules for your AI client.
109+
110+
3. Consider installing the `trigger-dev-expert` subagent if using Claude Code.
111+
112+
## Next steps
113+
114+
- [Install the MCP server](/mcp-introduction) for complete Trigger.dev integration
115+
- [Explore MCP tools](/mcp-tools) for project management and task execution
116+

0 commit comments

Comments
 (0)